summaryrefslogtreecommitdiffstats
path: root/arch/x86
diff options
context:
space:
mode:
authorDavid Matlack <dmatlack@google.com>2023-10-16 15:12:28 -0700
committerSean Christopherson <seanjc@google.com>2023-10-17 13:54:52 -0700
commit3d30bfcbdc268b41a7d9253a9cb3082281223b19 (patch)
tree9c7ebba6e391b83505dacfbaf0036a6d1f4f9850 /arch/x86
parent26951ec8623e915823985e86d2c428213f110659 (diff)
downloadlinux-stable-3d30bfcbdc268b41a7d9253a9cb3082281223b19.tar.gz
linux-stable-3d30bfcbdc268b41a7d9253a9cb3082281223b19.tar.bz2
linux-stable-3d30bfcbdc268b41a7d9253a9cb3082281223b19.zip
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 a018eba53870 ("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: a018eba53870 ("KVM: x86: Move MMU's PML logic to common code") Signed-off-by: David Matlack <dmatlack@google.com> Link: https://lore.kernel.org/r/20231016221228.1348318-1-dmatlack@google.com Signed-off-by: Sean Christopherson <seanjc@google.com>
Diffstat (limited to 'arch/x86')
-rw-r--r--arch/x86/kvm/x86.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
index 94ccad95f7e0..051ca1978442 100644
--- a/arch/x86/kvm/x86.c
+++ b/arch/x86/kvm/x86.c
@@ -6355,6 +6355,9 @@ void kvm_arch_sync_dirty_log(struct kvm *kvm, struct kvm_memory_slot *memslot)
struct kvm_vcpu *vcpu;
unsigned long i;
+ if (!kvm_x86_ops.cpu_dirty_log_size)
+ return;
+
kvm_for_each_vcpu(i, vcpu, kvm)
kvm_vcpu_kick(vcpu);
}