lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  PHC 
Open Source and information security mailing list archives
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Date:   Mon, 17 Feb 2020 18:36:41 +0800
From:   Wanpeng Li <>
To:     LKML <>, kvm <>
Cc:     Paolo Bonzini <>,
        Sean Christopherson <>,
        Wanpeng Li <>,
        Vitaly Kuznetsov <>,
        Jim Mattson <>,
        Joerg Roedel <>
Subject: [PATCH v3 1/2] KVM: X86: Less kvmclock sync induced vmexits after VM boots

From: Wanpeng Li <>

In the progress of vCPUs creation, it queues a kvmclock sync worker to
the global
workqueue before each vCPU creation completes. Each worker will be scheduled
after 300 * HZ delay and request a kvmclock update for all vCPUs and kick them
out. This is especially worse when scaling to large VMs due to a lot of vmexits.
Just one worker as a leader to trigger the kvmclock sync request for
all vCPUs is

Signed-off-by: Wanpeng Li <>
 arch/x86/kvm/x86.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
index fb5d64e..d0ba2d4 100644
--- a/arch/x86/kvm/x86.c
+++ b/arch/x86/kvm/x86.c
@@ -9390,8 +9390,9 @@ void kvm_arch_vcpu_postcreate(struct kvm_vcpu *vcpu)
     if (!kvmclock_periodic_sync)

-    schedule_delayed_work(&kvm->arch.kvmclock_sync_work,
-                    KVMCLOCK_SYNC_PERIOD);
+    if (kvm->created_vcpus == 1)
+        schedule_delayed_work(&kvm->arch.kvmclock_sync_work,
+                        KVMCLOCK_SYNC_PERIOD);

 void kvm_arch_vcpu_destroy(struct kvm_vcpu *vcpu)

Powered by blists - more mailing lists