]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
KVM: VMX: Wrap all accesses to IA32_DEBUGCTL with getter/setter APIs
authorMaxim Levitsky <mlevitsk@redhat.com>
Tue, 10 Jun 2025 23:20:09 +0000 (16:20 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 20 Aug 2025 16:36:34 +0000 (18:36 +0200)
commita967bf63d3aa26b3eb973500764644eacaa78e2c
treef23b1daf72319dd8563f28d34c420697f80955f2
parent9251c57c4f2397b06152d0a1915218ba7a18b6a7
KVM: VMX: Wrap all accesses to IA32_DEBUGCTL with getter/setter APIs

commit 7d0cce6cbe71af6e9c1831bff101a2b9c249c4a2 upstream.

Introduce vmx_guest_debugctl_{read,write}() to handle all accesses to
vmcs.GUEST_IA32_DEBUGCTL. This will allow stuffing FREEZE_IN_SMM into
GUEST_IA32_DEBUGCTL based on the host setting without bleeding the state
into the guest, and without needing to copy+paste the FREEZE_IN_SMM
logic into every patch that accesses GUEST_IA32_DEBUGCTL.

No functional change intended.

Cc: stable@vger.kernel.org
Signed-off-by: Maxim Levitsky <mlevitsk@redhat.com>
[sean: massage changelog, make inline, use in all prepare_vmcs02() cases]
Reviewed-by: Dapeng Mi <dapeng1.mi@linux.intel.com>
Link: https://lore.kernel.org/r/20250610232010.162191-8-seanjc@google.com
Signed-off-by: Sean Christopherson <seanjc@google.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
arch/x86/kvm/vmx/nested.c
arch/x86/kvm/vmx/pmu_intel.c
arch/x86/kvm/vmx/vmx.c
arch/x86/kvm/vmx/vmx.h