]> www.infradead.org Git - users/dwmw2/linux.git/commit
KVM: x86: Do not use kvm_rip_read() unconditionally in KVM tracepoints
authorAdrian Hunter <adrian.hunter@intel.com>
Tue, 15 Apr 2025 10:48:20 +0000 (13:48 +0300)
committerPaolo Bonzini <pbonzini@redhat.com>
Thu, 24 Apr 2025 13:52:31 +0000 (09:52 -0400)
commitca4f113b0b4c2de6ffb438d5d0ebb7337877c911
tree380918b10e730e7e6884afb57f3c7db46b27d4da
parent268cbfe65bb9096f78f98d1e092b1939d3caa382
KVM: x86: Do not use kvm_rip_read() unconditionally in KVM tracepoints

Not all VMs allow access to RIP.  Check guest_state_protected before
calling kvm_rip_read().

This avoids, for example, hitting WARN_ON_ONCE in vt_cache_reg() for
TDX VMs.

Fixes: 81bf912b2c15 ("KVM: TDX: Implement TDX vcpu enter/exit path")
Signed-off-by: Adrian Hunter <adrian.hunter@intel.com>
Message-ID: <20250415104821.247234-2-adrian.hunter@intel.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
arch/x86/kvm/trace.h