Skip to content

Commit 3d30bfc

Browse files
dmatlacksean-jc
authored andcommitted
KVM: x86/mmu: Stop kicking vCPUs to sync the dirty log when PML is disabled
Stop kicking vCPUs in kvm_arch_sync_dirty_log() when PML is disabled. Kicking vCPUs when PML is disabled serves no purpose and could negatively impact guest performance. This restores KVM's behavior to prior to 5.12 commit a018eba ("KVM: x86: Move MMU's PML logic to common code"), which replaced a static_call_cond(kvm_x86_flush_log_dirty) with unconditional calls to kvm_vcpu_kick(). Fixes: a018eba ("KVM: x86: Move MMU's PML logic to common code") Signed-off-by: David Matlack <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Sean Christopherson <[email protected]>
1 parent 26951ec commit 3d30bfc

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

arch/x86/kvm/x86.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6355,6 +6355,9 @@ void kvm_arch_sync_dirty_log(struct kvm *kvm, struct kvm_memory_slot *memslot)
63556355
struct kvm_vcpu *vcpu;
63566356
unsigned long i;
63576357

6358+
if (!kvm_x86_ops.cpu_dirty_log_size)
6359+
return;
6360+
63586361
kvm_for_each_vcpu(i, vcpu, kvm)
63596362
kvm_vcpu_kick(vcpu);
63606363
}

0 commit comments

Comments
 (0)