From nobody Mon Feb 9 20:36:51 2026 Delivered-To: importer@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+importer=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 1626109276397359.461122382654; Mon, 12 Jul 2021 10:01:16 -0700 (PDT) Received: from localhost ([::1]:50474 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m2zIx-0002Xs-Ep for importer@patchew.org; Mon, 12 Jul 2021 13:01:15 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:46744) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m2zF4-0005hj-Go for qemu-devel@nongnu.org; Mon, 12 Jul 2021 12:57:14 -0400 Received: from prt-mail.chinatelecom.cn ([42.123.76.227]:60827 helo=chinatelecom.cn) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m2zEz-0007Ex-Tl for qemu-devel@nongnu.org; Mon, 12 Jul 2021 12:57:13 -0400 Received: from clientip-182.138.181.19?logid-d6ee1067a9e34bf398e4104729ee285e (unknown [172.18.0.48]) by chinatelecom.cn (HERMES) with SMTP id D5CAF28008B; Tue, 13 Jul 2021 00:57:04 +0800 (CST) Received: from ([172.18.0.48]) by app0024 with ESMTP id 5f487c777cb1474681e0b37319fd179a for qemu-devel@nongnu.org; Tue Jul 13 00:57:04 2021 HMM_SOURCE_IP: 172.18.0.48:50580.4574419 HMM_ATTACHE_NUM: 0000 HMM_SOURCE_TYPE: SMTP X-189-SAVE-TO-SEND: +huangy81@chinatelecom.cn X-Transaction-ID: 5f487c777cb1474681e0b37319fd179a X-filter-score: X-Real-From: huangy81@chinatelecom.cn X-Receive-IP: 172.18.0.48 X-MEDUSA-Status: 0 From: huangy81@chinatelecom.cn To: qemu-devel@nongnu.org Subject: [PATCH v2 1/3] KVM: introduce kvm_get_manual_dirty_log_protect Date: Tue, 13 Jul 2021 00:56:50 +0800 Message-Id: <3a027c3e0d431c331cfe83be1996e269f5a19f0e.1626108969.git.huangy81@chinatelecom.cn> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: References: 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+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=42.123.76.227; 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: Eduardo Habkost , Juan Quintela , Hyman , "Dr. David Alan Gilbert" , Peter Xu , Chuan Zheng , Paolo Bonzini Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZM-MESSAGEID: 1626109279337100001 From: Hyman Huang(=E9=BB=84=E5=8B=87) introduce kvm_get_manual_dirty_log_protect for measureing dirtyrate via dirty bitmap. calculation of dirtyrate need to sync dirty log and depends on the features of dirty log. Signed-off-by: Hyman Huang(=E9=BB=84=E5=8B=87) --- accel/kvm/kvm-all.c | 6 ++++++ include/sysemu/kvm.h | 1 + 2 files changed, 7 insertions(+) diff --git a/accel/kvm/kvm-all.c b/accel/kvm/kvm-all.c index e0e88a2..f7d9ae0 100644 --- a/accel/kvm/kvm-all.c +++ b/accel/kvm/kvm-all.c @@ -245,6 +245,12 @@ int kvm_get_max_memslots(void) return s->nr_slots; } =20 +uint64_t kvm_get_manual_dirty_log_protect(void) +{ + KVMState *s =3D KVM_STATE(current_accel()); + return s->manual_dirty_log_protect; +} + /* Called with KVMMemoryListener.slots_lock held */ static KVMSlot *kvm_get_free_slot(KVMMemoryListener *kml) { diff --git a/include/sysemu/kvm.h b/include/sysemu/kvm.h index 7b22aeb..b668d49 100644 --- a/include/sysemu/kvm.h +++ b/include/sysemu/kvm.h @@ -533,6 +533,7 @@ int kvm_set_one_reg(CPUState *cs, uint64_t id, void *so= urce); int kvm_get_one_reg(CPUState *cs, uint64_t id, void *target); struct ppc_radix_page_info *kvm_get_radix_page_info(void); int kvm_get_max_memslots(void); +uint64_t kvm_get_manual_dirty_log_protect(void); =20 /* Notify resamplefd for EOI of specific interrupts. */ void kvm_resample_fd_notify(int gsi); --=20 1.8.3.1