From: yong.huang@smartx.com
To: qemu-devel@nongnu.org
Cc: Peter Xu <peterx@redhat.com>, Fabiano Rosas <farosas@suse.de>,
Paolo Bonzini <pbonzini@redhat.com>,
yong.huang@smartx.com
Subject: [PATCH RFC 1/2] accel/kvm: Introduce kvm_dirty_log_manual_enabled
Date: Wed, 23 Oct 2024 10:09:50 +0800 [thread overview]
Message-ID: <6df7d9ca9c90cf021857ef4f06b7f59c3664441b.1729648695.git.yong.huang@smartx.com> (raw)
In-Reply-To: <cover.1729648695.git.yong.huang@smartx.com>
From: Hyman Huang <yong.huang@smartx.com>
Introudce kvm_dirty_log_manual_enabled to indicate if dirty
logging manually was enabled in KVM.
The kvm_dirty_log_manual_enabled will be used in the next commit.
Signed-off-by: Hyman Huang <yong.huang@smartx.com>
---
accel/kvm/kvm-all.c | 2 ++
include/sysemu/kvm.h | 8 ++++++++
2 files changed, 10 insertions(+)
diff --git a/accel/kvm/kvm-all.c b/accel/kvm/kvm-all.c
index 801cff16a5..a0f3e6e493 100644
--- a/accel/kvm/kvm-all.c
+++ b/accel/kvm/kvm-all.c
@@ -93,6 +93,7 @@ bool kvm_allowed;
bool kvm_readonly_mem_allowed;
bool kvm_vm_attributes_allowed;
bool kvm_msi_use_devid;
+bool kvm_dirty_log_manual;
static bool kvm_has_guest_debug;
static int kvm_sstep_flags;
static bool kvm_immediate_exit;
@@ -2537,6 +2538,7 @@ static int kvm_setup_dirty_ring(KVMState *s)
dirty_log_manual_caps);
s->manual_dirty_log_protect = 0;
}
+ kvm_dirty_log_manual = true;
}
}
diff --git a/include/sysemu/kvm.h b/include/sysemu/kvm.h
index c3a60b2890..f38f2818e1 100644
--- a/include/sysemu/kvm.h
+++ b/include/sysemu/kvm.h
@@ -42,6 +42,7 @@ extern bool kvm_gsi_routing_allowed;
extern bool kvm_gsi_direct_mapping;
extern bool kvm_readonly_mem_allowed;
extern bool kvm_msi_use_devid;
+extern bool kvm_dirty_log_manual;
#define kvm_enabled() (kvm_allowed)
/**
@@ -143,6 +144,12 @@ extern bool kvm_msi_use_devid;
*/
#define kvm_msi_devid_required() (kvm_msi_use_devid)
+/**
+ * kvm_dirty_log_manual_enabled:
+ * Returns: true if dirty logging manually was enabled.
+ */
+#define kvm_dirty_log_manual_enabled() (kvm_dirty_log_manual)
+
#else
#define kvm_enabled() (0)
@@ -157,6 +164,7 @@ extern bool kvm_msi_use_devid;
#define kvm_gsi_direct_mapping() (false)
#define kvm_readonly_mem_enabled() (false)
#define kvm_msi_devid_required() (false)
+#define kvm_dirty_log_manual_enabled() (false)
#endif /* CONFIG_KVM_IS_POSSIBLE */
--
2.27.0
next prev parent reply other threads:[~2024-10-23 2:11 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-10-23 2:09 [PATCH RFC 0/2] migration: Skip sync in ram_init_bitmaps() yong.huang
2024-10-23 2:09 ` yong.huang [this message]
2024-10-23 2:09 ` [PATCH RFC 2/2] migration: Avoid doing RAMBlock dirty sync in the initial iteration yong.huang
2024-10-29 16:21 ` Peter Xu
2024-10-30 2:09 ` Yong Huang
2024-10-30 19:43 ` Peter Xu
2024-10-31 2:08 ` Yong Huang
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=6df7d9ca9c90cf021857ef4f06b7f59c3664441b.1729648695.git.yong.huang@smartx.com \
--to=yong.huang@smartx.com \
--cc=farosas@suse.de \
--cc=pbonzini@redhat.com \
--cc=peterx@redhat.com \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).