67 lines
1.9 KiB
Diff
67 lines
1.9 KiB
Diff
From 85583352f3bc28badd4cb336517f6a4eb440d5b0 Mon Sep 17 00:00:00 2001
|
|
From: =?UTF-8?q?Hyman=20Huang=28=E9=BB=84=E5=8B=87=29?=
|
|
<huangy81@chinatelecom.cn>
|
|
Date: Sun, 26 Jun 2022 01:38:34 +0800
|
|
Subject: [PATCH 2/3] accel/kvm/kvm-all: Introduce kvm_dirty_ring_size function
|
|
MIME-Version: 1.0
|
|
Content-Type: text/plain; charset=UTF-8
|
|
Content-Transfer-Encoding: 8bit
|
|
|
|
Introduce kvm_dirty_ring_size util function to help calculate
|
|
dirty ring ful time.
|
|
|
|
Signed-off-by: Hyman Huang(黄勇) <huangy81@chinatelecom.cn>
|
|
Acked-by: Peter Xu <peterx@redhat.com>
|
|
Message-Id: <f9ce1f550bfc0e3a1f711e17b1dbc8f701700e56.1656177590.git.huangy81@chinatelecom.cn>
|
|
Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
|
|
---
|
|
accel/kvm/kvm-all.c | 5 +++++
|
|
accel/stubs/kvm-stub.c | 5 +++++
|
|
include/sysemu/kvm.h | 2 ++
|
|
3 files changed, 12 insertions(+)
|
|
|
|
diff --git a/accel/kvm/kvm-all.c b/accel/kvm/kvm-all.c
|
|
index 3bc6eb6294..d0c4310507 100644
|
|
--- a/accel/kvm/kvm-all.c
|
|
+++ b/accel/kvm/kvm-all.c
|
|
@@ -2332,6 +2332,11 @@ bool kvm_dirty_ring_enabled(void)
|
|
return kvm_state->kvm_dirty_ring_size ? true : false;
|
|
}
|
|
|
|
+uint32_t kvm_dirty_ring_size(void)
|
|
+{
|
|
+ return kvm_state->kvm_dirty_ring_size;
|
|
+}
|
|
+
|
|
static int kvm_init(MachineState *ms)
|
|
{
|
|
MachineClass *mc = MACHINE_GET_CLASS(ms);
|
|
diff --git a/accel/stubs/kvm-stub.c b/accel/stubs/kvm-stub.c
|
|
index 5319573e00..1128cb2928 100644
|
|
--- a/accel/stubs/kvm-stub.c
|
|
+++ b/accel/stubs/kvm-stub.c
|
|
@@ -152,4 +152,9 @@ bool kvm_dirty_ring_enabled(void)
|
|
{
|
|
return false;
|
|
}
|
|
+
|
|
+uint32_t kvm_dirty_ring_size(void)
|
|
+{
|
|
+ return 0;
|
|
+}
|
|
#endif
|
|
diff --git a/include/sysemu/kvm.h b/include/sysemu/kvm.h
|
|
index 2623775c27..19c5c8402a 100644
|
|
--- a/include/sysemu/kvm.h
|
|
+++ b/include/sysemu/kvm.h
|
|
@@ -549,4 +549,6 @@ bool kvm_cpu_check_are_resettable(void);
|
|
bool kvm_arch_cpu_check_are_resettable(void);
|
|
|
|
bool kvm_dirty_ring_enabled(void);
|
|
+
|
|
+uint32_t kvm_dirty_ring_size(void);
|
|
#endif
|
|
--
|
|
2.27.0
|
|
|