]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
KVM: x86: Snapshot the host's DEBUGCTL after disabling IRQs
authorSean Christopherson <seanjc@google.com>
Fri, 15 Aug 2025 00:11:51 +0000 (17:11 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 28 Aug 2025 14:25:49 +0000 (16:25 +0200)
commit0e82f79598630664ecaf630c7ac67cdc6250c56e
tree4424003183e26731e763e5e2183e1f93e11f49e5
parentd9d4e0933a27d481c5fe58376051aa1b25d81d0f
KVM: x86: Snapshot the host's DEBUGCTL after disabling IRQs

[ Upstream commit 189ecdb3e112da703ac0699f4ec76aa78122f911 ]

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: Sasha Levin <sashal@kernel.org>
arch/x86/kvm/x86.c