Re: [PATCH v3 4/4] KVM: TDX: Enable Bus Lock VM exit
From: Xiaoyao Li
Date: Thu Aug 13 2026 - 07:18:28 EST
On 8/13/2026 6:58 AM, Edgecombe, Rick P wrote:
On Wed, 2026-08-12 at 16:02 +0800, Xiaoyao Li wrote:
- if (unlikely(READ_ONCE(to_kvm_tdx(vcpu->kvm)->wait_for_sept_zap)))
+ if (unlikely(READ_ONCE(to_kvm_tdx(vcpu->kvm)->wait_for_sept_zap))) {
+ vt->exit_reason.bus_lock_detected = 0;
return EXIT_FASTPATH_EXIT_HANDLED;
+ }
This still feels hacky to me. It at least deserves a comment I think. If you
spin another version.
I spent more time on this today and I find there is an existing issue. When the previous Exit Reason is EXIT_REASON_EXTERNAL_INTERRUPT, the early return here can go to the path due to the stale exit_reason.
kvm_x86_call(handle_exit_irqoff)(vcpu)
vmx_handle_exit_irqoff()
handle_external_interrupt_irqoff()
This makes the host process the external interrupt twice, and maybe more times if the wait_for_sept_zap remains longer.
I think we need an separate fix to set
vt->exit_reasons.full = TDX_INVALID_EXIT_REASON;
so that if some patch is going to consume the stale Exit Reason, it can be caught by TDX_INVALID_EXIT_REASON.