From nobody Tue Feb 10 12:21:46 2026 Delivered-To: importer2@patchew.org Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer2=patchew.org@nongnu.org ARC-Seal: i=1; a=rsa-sha256; t=1622480927; cv=none; d=zohomail.com; s=zohoarc; b=MOzkgzDUDnTAtGZprqbNpivD9VWPSa34IQovuD8D9xVu1Mjfj3yNBcLsug6jscty6LqDCC3f9GnijTBpq36ioKx2TfRmfRGOOMXpw2evY5p3YQrC6YR7ecLP75mW8/a+BpBCDcih+QLYv4EVMxVg9gYUKswXESl85rOQ0aOigWU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1622480927; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=Jkf/U/7ltfxc/1GJ0Ppr+vEGnI81QrtyiQs5e7Amj3M=; b=CIRE0s5DkS2TSic+dHU5HOwE7RF3t+ATGpltOP6FbyvVj4q7SD/L+VEFpIlkvHXLmYTt3wQ7qM6SqeCmDCbJ8SLF0bYnVt2qvrodZVXc3xmA4gdtjv8juvu50OW8m7OVWNX5aMJoqCqpmovEnoDKyzbn/fXBsUOSV1JBn8JmYEM= ARC-Authentication-Results: i=1; mx.zohomail.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer2=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1622480927205991.4280090122652; Mon, 31 May 2021 10:08:47 -0700 (PDT) Received: from localhost ([::1]:37552 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lnlPC-0002oA-1Q for importer2@patchew.org; Mon, 31 May 2021 13:08:46 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:55284) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lnlKQ-00068U-CC for qemu-devel@nongnu.org; Mon, 31 May 2021 13:03:50 -0400 Received: from prt-mail.chinatelecom.cn ([42.123.76.228]:33168 helo=chinatelecom.cn) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lnlKK-0004aa-PN for qemu-devel@nongnu.org; Mon, 31 May 2021 13:03:50 -0400 Received: from clientip-202.80.192.39?logid-48afce8d3b6b4436b73d11f8304b4286 (unknown [172.18.0.48]) by chinatelecom.cn (HERMES) with SMTP id A730F2800E8; Tue, 1 Jun 2021 01:03:23 +0800 (CST) Received: from ([172.18.0.48]) by app0024 with ESMTP id 48afce8d3b6b4436b73d11f8304b4286 for qemu-devel@nongnu.org; Tue Jun 1 01:03:30 2021 HMM_SOURCE_IP: 172.18.0.48:58222.1682084387 HMM_ATTACHE_NUM: 0000 HMM_SOURCE_TYPE: SMTP X-189-SAVE-TO-SEND: +huangy81@chinatelecom.cn X-Transaction-ID: 48afce8d3b6b4436b73d11f8304b4286 X-filter-score: filter<0> X-Real-From: huangy81@chinatelecom.cn X-Receive-IP: 172.18.0.48 X-MEDUSA-Status: 0 From: huangy81@chinatelecom.cn To: Subject: [PATCH v1 1/6] KVM: add kvm_dirty_ring_enabled function Date: Tue, 1 Jun 2021 01:03:18 +0800 Message-Id: X-Mailer: git-send-email 1.8.3.1 In-Reply-To: References: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer2=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=42.123.76.228; envelope-from=huangy81@chinatelecom.cn; helo=chinatelecom.cn X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: kvm@vger.kernel.org, Juan Quintela , Hyman , "Dr. David Alan Gilbert" , Peter Xu , Paolo Bonzini Errors-To: qemu-devel-bounces+importer2=patchew.org@nongnu.org Sender: "Qemu-devel" From: Hyman Huang(=E9=BB=84=E5=8B=87) introduce kvm_dirty_ring_enabled to show if kvm-reaper is working. dirtyrate thread could use it to check if calculation can base on dirty ring feature. Signed-off-by: Hyman Huang(=E9=BB=84=E5=8B=87) --- accel/kvm/kvm-all.c | 5 +++++ include/sysemu/kvm.h | 1 + 2 files changed, 6 insertions(+) diff --git a/accel/kvm/kvm-all.c b/accel/kvm/kvm-all.c index c7ec538850..2e96b77b31 100644 --- a/accel/kvm/kvm-all.c +++ b/accel/kvm/kvm-all.c @@ -2293,6 +2293,11 @@ bool kvm_vcpu_id_is_valid(int vcpu_id) return vcpu_id >=3D 0 && vcpu_id < kvm_max_vcpu_id(s); } =20 +bool kvm_dirty_ring_enabled(void) +{ + return kvm_state->kvm_dirty_ring_size ? true : false; +} + static int kvm_init(MachineState *ms) { MachineClass *mc =3D MACHINE_GET_CLASS(ms); diff --git a/include/sysemu/kvm.h b/include/sysemu/kvm.h index a1ab1ee12d..7b22aeb6ae 100644 --- a/include/sysemu/kvm.h +++ b/include/sysemu/kvm.h @@ -547,4 +547,5 @@ bool kvm_cpu_check_are_resettable(void); =20 bool kvm_arch_cpu_check_are_resettable(void); =20 +bool kvm_dirty_ring_enabled(void); #endif --=20 2.24.3