KVM: TDX: Use kvm_arch_vcpu.host_debugctl to restore the host's DEBUGCTL
authorSean Christopherson <seanjc@google.com>
Tue, 10 Jun 2025 23:20:03 +0000 (16:20 -0700)
committerSean Christopherson <seanjc@google.com>
Fri, 20 Jun 2025 20:04:23 +0000 (13:04 -0700)
commit7d390a9da8233fd32ccdf132726712a72a990b26
tree38dd5db50f627149820685853c6b42e970b385fa
parent28224ef02b56fceee2c161fe2a49a0bb197e44f5
KVM: TDX: Use kvm_arch_vcpu.host_debugctl to restore the host's DEBUGCTL

Use the kvm_arch_vcpu.host_debugctl snapshot to restore DEBUGCTL after
running a TD vCPU.  The final TDX series rebase was mishandled, likely due
to commit fb71c7959356 ("KVM: x86: Snapshot the host's DEBUGCTL in common
x86") deleting the same line of code from vmx.h, i.e. creating a semantic
conflict of sorts, but no syntactic conflict.

Using the version in kvm_vcpu_arch picks up the ulong => u64 fix (which
isn't relevant to TDX) as well as the IRQ fix from commit 189ecdb3e112
("KVM: x86: Snapshot the host's DEBUGCTL after disabling IRQs").

Link: https://lore.kernel.org/all/20250307212053.2948340-10-pbonzini@redhat.com
Cc: Adrian Hunter <adrian.hunter@intel.com>
Fixes: 8af099037527 ("KVM: TDX: Save and restore IA32_DEBUGCTL")
Reviewed-by: Adrian Hunter <adrian.hunter@intel.com>
Link: https://lore.kernel.org/r/20250610232010.162191-2-seanjc@google.com
Signed-off-by: Sean Christopherson <seanjc@google.com>
arch/x86/kvm/vmx/common.h
arch/x86/kvm/vmx/tdx.c