]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
KVM: x86: Snapshot the host's DEBUGCTL after disabling IRQs
authorSean Christopherson <seanjc@google.com>
Thu, 27 Feb 2025 22:24:10 +0000 (14:24 -0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 13 Mar 2025 12:02:14 +0000 (13:02 +0100)
commit9eb6f272a6382c18b78983e0f50b5ae2a02646d6
tree7296f6c4204fa4d6812047ad825dde0410d67f2f
parentc94120322553ff8bc7bc69894bb7a370b9d098a9
KVM: x86: Snapshot the host's DEBUGCTL after disabling IRQs

commit 189ecdb3e112da703ac0699f4ec76aa78122f911 upstream.

Snapshot the host's DEBUGCTL after disabling IRQs, as perf can toggle
debugctl bits from IRQ context, e.g. when enabling/disabling events via
smp_call_function_single().  Taking the snapshot (long) before IRQs are
disabled could result in KVM effectively clobbering DEBUGCTL due to using
a stale snapshot.

Cc: stable@vger.kernel.org
Reviewed-and-tested-by: Ravi Bangoria <ravi.bangoria@amd.com>
Link: https://lore.kernel.org/r/20250227222411.3490595-6-seanjc@google.com
Signed-off-by: Sean Christopherson <seanjc@google.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
arch/x86/kvm/x86.c