kvm: support to get/set dirty log initial-all-set capability
PATCH 1/1 kvm: support to get/set dirty log initial-all-set capability
Since the new capability KVM_DIRTY_LOG_INITIALLY_SET of KVM_CAP_MANUAL_DIRTY_LOG_PROTECT2 has been introduced in the kernel, tweak the userspace side to detect and enable this capability.
--- accel/kvm/kvm-all.c | 21 ++++++++++++++------- linux-headers/linux/kvm.h | 3 +++ 2 files changed, 17 insertions(+), 7 deletions(-)
accel/kvm/kvm-all.c +14 -7
@@ -100,7 +100,7 @@ struct KVMStatebool kernel_irqchip_required;OnOffAuto kernel_irqchip_split;bool sync_mmu; -bool manual_dirty_log_protect; +uint64_t manual_dirty_log_protect;/* The man page (and posix) say ioctl numbers are signed int, but * they're not. Linux, glibc and *BSD all treat ioctl numbers as * unsigned, and treating them as signed here can break things */
@@ -1882,6 +1882,7 @@ static int kvm_init(MachineState *ms)int ret;int type =0 ;const char *kvm_type; +uint64_t dirty_log_manual_caps; s =KVM_STATE (ms->accelerator);
@@ -2007,14 +2008,20 @@ static int kvm_init(MachineState *ms) s->coalesced_pio = s->coalesced_mmio &&kvm_check_extension (s,KVM_CAP_COALESCED_PIO ); - s->manual_dirty_log_protect = + dirty_log_manual_caps =kvm_check_extension (s,KVM_CAP_MANUAL_DIRTY_LOG_PROTECT2 ); -if (s->manual_dirty_log_protect) { - ret =kvm_vm_enable_cap (s,KVM_CAP_MANUAL_DIRTY_LOG_PROTECT2 ,0 ,1 ); + dirty_log_manual_caps &= (KVM_DIRTY_LOG_MANUAL_PROTECT_ENABLE | +KVM_DIRTY_LOG_INITIALLY_SET ); + s->manual_dirty_log_protect = dirty_log_manual_caps; +if (dirty_log_manual_caps) { + ret =kvm_vm_enable_cap (s,KVM_CAP_MANUAL_DIRTY_LOG_PROTECT2 ,0 , + dirty_log_manual_caps);if (ret) { -warn_report ("Trying to enable KVM_CAP_MANUAL_DIRTY_LOG_PROTECT2 " -"but failed. Falling back to the legacy mode. " ); - s->manual_dirty_log_protect = false; +warn_report ("Trying to enable capability %" PRIu64" of " +"KVM_CAP_MANUAL_DIRTY_LOG_PROTECT2 but failed. " +"Falling back to the legacy mode. " , + dirty_log_manual_caps); + s->manual_dirty_log_protect =0 ; } }
linux-headers/linux/kvm.h +3 -0
@@ -1628,4 +1628,7 @@ struct kvm_hyperv_eventfd {#define KVM_HYPERV_CONN_ID_MASK 0x00ffffff#define KVM_HYPERV_EVENTFD_DEASSIGN (1 << 0) +#define KVM_DIRTY_LOG_MANUAL_PROTECT_ENABLE (1 << 0) +#define KVM_DIRTY_LOG_INITIALLY_SET (1 << 1) +#endif /* __LINUX_KVM_H */
Signature · 1 line
2.14.1.windows.1
Quoted 64 lines · Jay Zhou
Since the new capability
KVM_DIRTY_LOG_INITIALLY_SETofKVM_CAP_MANUAL_DIRTY_LOG_PROTECT2has been introduced in the kernel, tweak the userspace side to detect and enable this capability.Signed-off-by Jay Zhou <[email protected]>--- accel/kvm/kvm-all.c | 21 ++++++++++++++------- linux-headers/linux/kvm.h | 3 +++ 2 files changed, 17 insertions(+), 7 deletions(-)accel/kvm/kvm-all.c +14
-7@@ -100,7 +100,7 @@ struct KVMStatebool kernel_irqchip_required;OnOffAuto kernel_irqchip_split;bool sync_mmu; -bool manual_dirty_log_protect; +uint64_t manual_dirty_log_protect;/* The man page (and posix) say ioctl numbers are signed int, but * they're not. Linux, glibc and *BSD all treat ioctl numbers as * unsigned, and treating them as signed here can break things */ @@ -1882,6 +1882,7 @@ static int kvm_init(MachineState *ms)int ret;int type =0 ;const char *kvm_type; +uint64_t dirty_log_manual_caps; s =KVM_STATE (ms->accelerator);@@ -2007,14 +2008,20 @@ static int kvm_init(MachineState *ms) s->coalesced_pio = s->coalesced_mmio &&kvm_check_extension (s,KVM_CAP_COALESCED_PIO ); - s->manual_dirty_log_protect = + dirty_log_manual_caps =kvm_check_extension (s,KVM_CAP_MANUAL_DIRTY_LOG_PROTECT2 ); -if (s->manual_dirty_log_protect) { - ret =kvm_vm_enable_cap (s,KVM_CAP_MANUAL_DIRTY_LOG_PROTECT2 ,0 ,1 ); + dirty_log_manual_caps &= (KVM_DIRTY_LOG_MANUAL_PROTECT_ENABLE | +KVM_DIRTY_LOG_INITIALLY_SET ); + s->manual_dirty_log_protect = dirty_log_manual_caps; +if (dirty_log_manual_caps) { + ret =kvm_vm_enable_cap (s,KVM_CAP_MANUAL_DIRTY_LOG_PROTECT2 ,0 , + dirty_log_manual_caps);if (ret) { -warn_report ("Trying to enable KVM_CAP_MANUAL_DIRTY_LOG_PROTECT2 " -"but failed. Falling back to the legacy mode. " ); - s->manual_dirty_log_protect = false; +warn_report ("Trying to enable capability %" PRIu64" of " +"KVM_CAP_MANUAL_DIRTY_LOG_PROTECT2 but failed. " +"Falling back to the legacy mode. " , + dirty_log_manual_caps); + s->manual_dirty_log_protect =0 ; } }linux-headers/linux/kvm.h +0
-0
linux-headers/linux/kvm.h struct kvm_hyperv_eventfd { · line 1633
Quoted 6 lines
linux-headers/linux/kvm.h +3
-0@@ -1628,4 +1628,7 @@ struct kvm_hyperv_eventfd {#define KVM_HYPERV_CONN_ID_MASK 0x00ffffff#define KVM_HYPERV_EVENTFD_DEASSIGN (1 << 0) +#define KVM_DIRTY_LOG_MANUAL_PROTECT_ENABLE (1 << 0) +#define KVM_DIRTY_LOG_INITIALLY_SET (1 << 1) +
The patch looks ok, though ideally I think we need to wait until the kernel patch got pushed then we'll be sure these macros won't be overwrite by other ./scripts/update-linux-headers.sh updates (or another patch to call the update script to fetch the macros...).
Thanks,
Signature · 1 line
Peter Xu
Quoted 10 lines · On Wed, 4 Mar 2020 10:55:54 +0800 Jay Zhou <[email protected]> wrote:
Since the new capability
KVM_DIRTY_LOG_INITIALLY_SETofKVM_CAP_MANUAL_DIRTY_LOG_PROTECT2has been introduced in the kernel, tweak the userspace side to detect and enable this capability.Signed-off-by Jay Zhou <[email protected]>--- accel/kvm/kvm-all.c | 21 ++++++++++++++------- linux-headers/linux/kvm.h | 3 +++ 2 files changed, 17 insertions(+), 7 deletions(-)
<standard message>
Please do any linux-headers updates in a separate patch; that makes it easy to replace the manual update with a complete headers update. </standard message>
:)
Quoted 65 lines · Jay Zhou
Since the new capability
KVM_DIRTY_LOG_INITIALLY_SETofKVM_CAP_MANUAL_DIRTY_LOG_PROTECT2has been introduced in the kernel, tweak the userspace side to detect and enable this capability.Signed-off-by Jay Zhou <[email protected]>--- accel/kvm/kvm-all.c | 21 ++++++++++++++------- linux-headers/linux/kvm.h | 3 +++ 2 files changed, 17 insertions(+), 7 deletions(-)accel/kvm/kvm-all.c +14
-7@@ -100,7 +100,7 @@ struct KVMStatebool kernel_irqchip_required;OnOffAuto kernel_irqchip_split;bool sync_mmu; -bool manual_dirty_log_protect; +uint64_t manual_dirty_log_protect;/* The man page (and posix) say ioctl numbers are signed int, but * they're not. Linux, glibc and *BSD all treat ioctl numbers as * unsigned, and treating them as signed here can break things */ @@ -1882,6 +1882,7 @@ static int kvm_init(MachineState *ms)int ret;int type =0 ;const char *kvm_type; +uint64_t dirty_log_manual_caps; s =KVM_STATE (ms->accelerator);@@ -2007,14 +2008,20 @@ static int kvm_init(MachineState *ms) s->coalesced_pio = s->coalesced_mmio &&kvm_check_extension (s,KVM_CAP_COALESCED_PIO ); - s->manual_dirty_log_protect = + dirty_log_manual_caps =kvm_check_extension (s,KVM_CAP_MANUAL_DIRTY_LOG_PROTECT2 ); -if (s->manual_dirty_log_protect) { - ret =kvm_vm_enable_cap (s,KVM_CAP_MANUAL_DIRTY_LOG_PROTECT2 ,0 ,1 ); + dirty_log_manual_caps &= (KVM_DIRTY_LOG_MANUAL_PROTECT_ENABLE | +KVM_DIRTY_LOG_INITIALLY_SET ); + s->manual_dirty_log_protect = dirty_log_manual_caps; +if (dirty_log_manual_caps) { + ret =kvm_vm_enable_cap (s,KVM_CAP_MANUAL_DIRTY_LOG_PROTECT2 ,0 , + dirty_log_manual_caps);if (ret) { -warn_report ("Trying to enable KVM_CAP_MANUAL_DIRTY_LOG_PROTECT2 " -"but failed. Falling back to the legacy mode. " ); - s->manual_dirty_log_protect = false; +warn_report ("Trying to enable capability %" PRIu64" of " +"KVM_CAP_MANUAL_DIRTY_LOG_PROTECT2 but failed. " +"Falling back to the legacy mode. " , + dirty_log_manual_caps); + s->manual_dirty_log_protect =0 ; } }linux-headers/linux/kvm.h +0
-0
linux-headers/linux/kvm.h struct kvm_hyperv_eventfd { · line 1634
Quoted 7 lines
linux-headers/linux/kvm.h +3
-0@@ -1628,4 +1628,7 @@ struct kvm_hyperv_eventfd {#define KVM_HYPERV_CONN_ID_MASK 0x00ffffff#define KVM_HYPERV_EVENTFD_DEASSIGN (1 << 0) +#define KVM_DIRTY_LOG_MANUAL_PROTECT_ENABLE (1 << 0) +#define KVM_DIRTY_LOG_INITIALLY_SET (1 << 1) +#endif /* __LINUX_KVM_H */
Queued, thanks.
Paolo
Quoted 86 lines
-----Original Message-----
From: Paolo Bonzini [mailto:[email protected]]
Sent: Wednesday, March 18, 2020 6:48 PM
To: Zhoujian (jay) <[email protected]>; [email protected]; [email protected]
Cc: [email protected]; [email protected]; [email protected]; wangxin (U) <[email protected]>; Huangweidong (C) <[email protected]>; Liujinsong (Paul) <[email protected]>
Subject: Re: [PATCH] kvm: support to get/set dirty log initial-all-set capabilityQuoted 32 lines · Jay Zhou
Since the new capability
KVM_DIRTY_LOG_INITIALLY_SETofKVM_CAP_MANUAL_DIRTY_LOG_PROTECT2has been introduced in the kernel, tweak the userspace side to detect and enable this capability.Signed-off-by Jay Zhou <[email protected]>--- accel/kvm/kvm-all.c | 21 ++++++++++++++------- linux-headers/linux/kvm.h | 3 +++ 2 files changed, 17 insertions(+), 7 deletions(-)accel/kvm/kvm-all.c index renamed from accel/kvm/kvm-all.c +0
-0
439a4efe52..45ab25be63100644accel/kvm/kvm-all.c +2
-1@@ -100,7 +100,7 @@ struct KVMStatebool kernel_irqchip_required;OnOffAuto kernel_irqchip_split;bool sync_mmu; -bool manual_dirty_log_protect; +uint64_t manual_dirty_log_protect;/* The man page (and posix) say ioctl numbers are signed int, but * they're not. Linux, glibc and *BSD all treat ioctl numbers as * unsigned, and treating them as signed here can break things */ @@ -1882,6 +1882,7 @@ static int kvm_init(MachineState *ms)int ret;int type =0 ;const char *kvm_type; +uint64_t dirty_log_manual_caps; s =KVM_STATE (ms->accelerator);accel/kvm/kvm-all.c static int kvm_init(MachineState *ms) · line 2009
Quoted 2 lines
accel/kvm/kvm-all.c +0
-0@@ -2007,14 +2008,20 @@ static int kvm_init(MachineState *ms) s->coalesced_pio = s->coalesced_mmio && kvm_check_extension(s,
KVM_CAP_COALESCED_PIO);accel/kvm/kvm-all.c static int kvm_init(MachineState *ms)
Quoted 4 lines
accel/kvm/kvm-all.c +1
-1- s->manual_dirty_log_protect = + dirty_log_manual_caps = kvm_check_extension(s,
KVM_CAP_MANUAL_DIRTY_LOG_PROTECT2);accel/kvm/kvm-all.c static int kvm_init(MachineState *ms) · line 2012
Quoted 2 lines
accel/kvm/kvm-all.c +0
-2-if (s->manual_dirty_log_protect) { - ret = kvm_vm_enable_cap(s,
KVM_CAP_MANUAL_DIRTY_LOG_PROTECT2, 0, 1);accel/kvm/kvm-all.c static int kvm_init(MachineState *ms) · line 2012
Quoted 1 line
accel/kvm/kvm-all.c +1
-0+ dirty_log_manual_caps &=(
KVM_DIRTY_LOG_MANUAL_PROTECT_ENABLE|accel/kvm/kvm-all.c static int kvm_init(MachineState *ms)
Quoted 4 lines
accel/kvm/kvm-all.c +4
-0+ KVM_DIRTY_LOG_INITIALLY_SET); + s->manual_dirty_log_protect = dirty_log_manual_caps; +if (dirty_log_manual_caps) { + ret = kvm_vm_enable_cap(s,
KVM_CAP_MANUAL_DIRTY_LOG_PROTECT2, 0,accel/kvm/kvm-all.c static int kvm_init(MachineState *ms)
Quoted 3 lines
accel/kvm/kvm-all.c +1
-1+ dirty_log_manual_caps);if (ret) { - warn_report("Trying to enable
KVM_CAP_MANUAL_DIRTY_LOG_PROTECT2"accel/kvm/kvm-all.c static int kvm_init(MachineState *ms)
Quoted 4 lines
accel/kvm/kvm-all.c +2
-2- "but failed. Falling back to the legacy mode. "); - s->manual_dirty_log_protect = false; +warn_report ("Trying to enable capability %" PRIu64" of " + "KVM_CAP_MANUAL_DIRTY_LOG_PROTECT2but failed. "
Quoted 14 lines
accel/kvm/kvm-all.c +3
-0+"Falling back to the legacy mode. " , + dirty_log_manual_caps); + s->manual_dirty_log_protect =0 ; } }linux-headers/linux/kvm.h +0
-0@@ -1628,4 +1628,7 @@ struct kvm_hyperv_eventfd {#define KVM_HYPERV_CONN_ID_MASK 0x00ffffff#define KVM_HYPERV_EVENTFD_DEASSIGN (1 << 0)
Quoted 8 lines
linux-headers/linux/kvm.h struct kvm_hyperv_eventfd { · line 1634
Quoted 5 lines
linux-headers/linux/kvm.h +3
-0+#define KVM_DIRTY_LOG_MANUAL_PROTECT_ENABLE (1 << 0) +#define KVM_DIRTY_LOG_INITIALLY_SET (1 << 1) +#endif /* __LINUX_KVM_H */ Queued, thanks.
Hi Paolo,
It seems that this patch isn't included in your last pull request... If there's something else to be done, please let me know.
Regards,
Jay Zhou
Paolo Bonzini
maintainerQuoted 95 lines · Zhoujian (jay)
Quoted 86 lines
-----Original Message-----
From: Paolo Bonzini [mailto:[email protected]]
Sent: Wednesday, March 18, 2020 6:48 PM
To: Zhoujian (jay) <[email protected]>; [email protected]; [email protected]
Cc: [email protected]; [email protected]; [email protected]; wangxin (U) <[email protected]>; Huangweidong (C) <[email protected]>; Liujinsong (Paul) <[email protected]>
Subject: Re: [PATCH] kvm: support to get/set dirty log initial-all-set capabilityQuoted 32 lines · Jay Zhou
Since the new capability
KVM_DIRTY_LOG_INITIALLY_SETofKVM_CAP_MANUAL_DIRTY_LOG_PROTECT2has been introduced in the kernel, tweak the userspace side to detect and enable this capability.Signed-off-by Jay Zhou <[email protected]>--- accel/kvm/kvm-all.c | 21 ++++++++++++++------- linux-headers/linux/kvm.h | 3 +++ 2 files changed, 17 insertions(+), 7 deletions(-)accel/kvm/kvm-all.c index renamed from accel/kvm/kvm-all.c +0
-0
439a4efe52..45ab25be63100644accel/kvm/kvm-all.c +2
-1@@ -100,7 +100,7 @@ struct KVMStatebool kernel_irqchip_required;OnOffAuto kernel_irqchip_split;bool sync_mmu; -bool manual_dirty_log_protect; +uint64_t manual_dirty_log_protect;/* The man page (and posix) say ioctl numbers are signed int, but * they're not. Linux, glibc and *BSD all treat ioctl numbers as * unsigned, and treating them as signed here can break things */ @@ -1882,6 +1882,7 @@ static int kvm_init(MachineState *ms)int ret;int type =0 ;const char *kvm_type; +uint64_t dirty_log_manual_caps; s =KVM_STATE (ms->accelerator);accel/kvm/kvm-all.c static int kvm_init(MachineState *ms) · line 2009
Quoted 2 lines
accel/kvm/kvm-all.c +0
-0@@ -2007,14 +2008,20 @@ static int kvm_init(MachineState *ms) s->coalesced_pio = s->coalesced_mmio && kvm_check_extension(s,
KVM_CAP_COALESCED_PIO);accel/kvm/kvm-all.c static int kvm_init(MachineState *ms)
Quoted 4 lines
accel/kvm/kvm-all.c +1
-1- s->manual_dirty_log_protect = + dirty_log_manual_caps = kvm_check_extension(s,
KVM_CAP_MANUAL_DIRTY_LOG_PROTECT2);accel/kvm/kvm-all.c static int kvm_init(MachineState *ms) · line 2012
Quoted 2 lines
accel/kvm/kvm-all.c +0
-2-if (s->manual_dirty_log_protect) { - ret = kvm_vm_enable_cap(s,
KVM_CAP_MANUAL_DIRTY_LOG_PROTECT2, 0, 1);accel/kvm/kvm-all.c static int kvm_init(MachineState *ms) · line 2012
Quoted 1 line
accel/kvm/kvm-all.c +1
-0+ dirty_log_manual_caps &=(
KVM_DIRTY_LOG_MANUAL_PROTECT_ENABLE|accel/kvm/kvm-all.c static int kvm_init(MachineState *ms)
Quoted 4 lines
accel/kvm/kvm-all.c +4
-0+ KVM_DIRTY_LOG_INITIALLY_SET); + s->manual_dirty_log_protect = dirty_log_manual_caps; +if (dirty_log_manual_caps) { + ret = kvm_vm_enable_cap(s,
KVM_CAP_MANUAL_DIRTY_LOG_PROTECT2, 0,accel/kvm/kvm-all.c static int kvm_init(MachineState *ms)
Quoted 3 lines
accel/kvm/kvm-all.c +1
-1+ dirty_log_manual_caps);if (ret) { - warn_report("Trying to enable
KVM_CAP_MANUAL_DIRTY_LOG_PROTECT2"accel/kvm/kvm-all.c static int kvm_init(MachineState *ms)
Quoted 4 lines
accel/kvm/kvm-all.c +2
-2- "but failed. Falling back to the legacy mode. "); - s->manual_dirty_log_protect = false; +warn_report ("Trying to enable capability %" PRIu64" of " + "KVM_CAP_MANUAL_DIRTY_LOG_PROTECT2but failed. "
Quoted 14 lines
accel/kvm/kvm-all.c +3
-0+"Falling back to the legacy mode. " , + dirty_log_manual_caps); + s->manual_dirty_log_protect =0 ; } }linux-headers/linux/kvm.h +0
-0@@ -1628,4 +1628,7 @@ struct kvm_hyperv_eventfd {#define KVM_HYPERV_CONN_ID_MASK 0x00ffffff#define KVM_HYPERV_EVENTFD_DEASSIGN (1 << 0)Quoted 8 lines
linux-headers/linux/kvm.h struct kvm_hyperv_eventfd { · line 1634
Quoted 5 lines
linux-headers/linux/kvm.h +3
-0+#define KVM_DIRTY_LOG_MANUAL_PROTECT_ENABLE (1 << 0) +#define KVM_DIRTY_LOG_INITIALLY_SET (1 << 1) +#endif /* __LINUX_KVM_H */ Queued, thanks.
Quoted 4 lines
Hi Paolo,
It seems that this patch isn't included in your last pull request... If there's something else to be done, please let me know.
Sorry, I thought mistakenly that it was a 5.8 feature (so it would have to wait for the 5.8-rc1 release and header update). It's still queued though.
Paolo
Quoted 113 lines
-----Original Message-----
From: Paolo Bonzini [mailto:[email protected]]
Sent: Friday, June 12, 2020 5:28 PM
To: Zhoujian (jay) <[email protected]>; [email protected]; [email protected]
Cc: [email protected]; [email protected]; [email protected]; Wangxin (Alexander, Cloud Infrastructure Service Product Dept.) <[email protected]>; Huangweidong (C) <[email protected]>; Liujinsong (Paul) <[email protected]>
Subject: Re: [PATCH] kvm: support to get/set dirty log initial-all-set capabilityQuoted 14 lines · Zhoujian (jay)
Quoted 14 lines
-----Original Message-----
From: Paolo Bonzini [mailto:[email protected]]
Sent: Wednesday, March 18, 2020 6:48 PM
To: Zhoujian (jay) <[email protected]>; [email protected]; [email protected]
Cc: [email protected]; [email protected]; [email protected]; wangxin (U) <[email protected]>; Huangweidong (C) <[email protected]>; Liujinsong (Paul) <[email protected]>
Subject: Re: [PATCH] kvm: support to get/set dirty log initial-all-set capabilityQuoted 3 lines
Quoted 3 lines · Jay Zhou
Quoted 2 lines
Since the new capability
KVM_DIRTY_LOG_INITIALLY_SETofKVM_CAP_MANUAL_DIRTY_LOG_PROTECT2has been introduced in thekernel,
Quoted 47 lines
Quoted 47 lines
Quoted 30 lines
tweak the userspace side to detect and enable this capability.
Signed-off-by Jay Zhou <[email protected]>--- accel/kvm/kvm-all.c | 21 ++++++++++++++------- linux-headers/linux/kvm.h | 3 +++ 2 files changed, 17 insertions(+), 7 deletions(-)accel/kvm/kvm-all.c index renamed from accel/kvm/kvm-all.c +0
-0
439a4efe52..45ab25be63100644accel/kvm/kvm-all.c +1
-1@@ -100,7 +100,7 @@ struct KVMStatebool kernel_irqchip_required;OnOffAuto kernel_irqchip_split;bool sync_mmu; -bool manual_dirty_log_protect; +uint64_t manual_dirty_log_protect;/* The man page (and posix) say ioctl numbers are signed int, but * they're not. Linux, glibc and *BSD all treat ioctl numbers as * unsigned, and treating them as signed here can break things */ @@ -1882,6 +1882,7 @@ static int
kvm_init(MachineState *ms)int ret; int type = 0; const char *kvm_type;accel/kvm/kvm-all.c +1
-0+uint64_t dirty_log_manual_caps; s =KVM_STATE (ms->accelerator);accel/kvm/kvm-all.c static int kvm_init(MachineState *ms) · line 2009
Quoted 2 lines
accel/kvm/kvm-all.c +0
-0@@ -2007,14 +2008,20 @@ static int kvm_init(MachineState *ms) s->coalesced_pio = s->coalesced_mmio && kvm_check_extension(s,
KVM_CAP_COALESCED_PIO);accel/kvm/kvm-all.c static int kvm_init(MachineState *ms)
Quoted 4 lines
accel/kvm/kvm-all.c +1
-1- s->manual_dirty_log_protect = + dirty_log_manual_caps = kvm_check_extension(s,
KVM_CAP_MANUAL_DIRTY_LOG_PROTECT2);accel/kvm/kvm-all.c static int kvm_init(MachineState *ms) · line 2012
Quoted 2 lines
accel/kvm/kvm-all.c +0
-2-if (s->manual_dirty_log_protect) { - ret = kvm_vm_enable_cap(s,
KVM_CAP_MANUAL_DIRTY_LOG_PROTECT2, 0, 1);accel/kvm/kvm-all.c static int kvm_init(MachineState *ms) · line 2012
Quoted 1 line
accel/kvm/kvm-all.c +1
-0+ dirty_log_manual_caps &=(
KVM_DIRTY_LOG_MANUAL_PROTECT_ENABLE|Quoted 4 lines
accel/kvm/kvm-all.c +4
-0+ KVM_DIRTY_LOG_INITIALLY_SET); + s->manual_dirty_log_protect = dirty_log_manual_caps; +if (dirty_log_manual_caps) { + ret = kvm_vm_enable_cap(s,Quoted 6 lines
Quoted 6 lines
KVM_CAP_MANUAL_DIRTY_LOG_PROTECT2, 0,accel/kvm/kvm-all.c static int kvm_init(MachineState *ms)
Quoted 3 lines
accel/kvm/kvm-all.c +1
-1+ dirty_log_manual_caps);if (ret) { - warn_report("Trying to enable
KVM_CAP_MANUAL_DIRTY_LOG_PROTECT2"Quoted 1 line
accel/kvm/kvm-all.c +0
-1- "but failed. Falling back to the legacy mode.");
Quoted 27 lines
Quoted 26 lines
accel/kvm/kvm-all.c static int kvm_init(MachineState *ms)
Quoted 3 lines
accel/kvm/kvm-all.c +2
-1- s->manual_dirty_log_protect = false; +warn_report ("Trying to enable capability %" PRIu64" of " + "KVM_CAP_MANUAL_DIRTY_LOG_PROTECT2but failed. "
Quoted 12 lines
accel/kvm/kvm-all.c +3
-0+"Falling back to the legacy mode. " , + dirty_log_manual_caps); + s->manual_dirty_log_protect =0 ; } }linux-headers/linux/kvm.h +0
-0linux-headers/linux/kvm.h struct kvm_hyperv_eventfd { · line 1634
Quoted 7 lines
linux-headers/linux/kvm.h +3
-0@@ -1628,4 +1628,7 @@ struct kvm_hyperv_eventfd {#define KVM_HYPERV_CONN_ID_MASK 0x00ffffff#define KVM_HYPERV_EVENTFD_DEASSIGN (1 << 0) +#define KVM_DIRTY_LOG_MANUAL_PROTECT_ENABLE (1 << 0) +#define KVM_DIRTY_LOG_INITIALLY_SET (1 << 1) +#endif /* __LINUX_KVM_H */ Queued, thanks.
Quoted 7 lines
Quoted 4 lines
Hi Paolo,
It seems that this patch isn't included in your last pull request... If there's something else to be done, please let me know.
Sorry, I thought mistakenly that it was a 5.8 feature (so it would have to wait for the 5.8-rc1 release and header update). It's still queued though.
Okay, never mind, :)
Regards,
Jay Zhou