FAILED: patch "[PATCH] KVM: TDX: Stuff exit_reason with UNDEFINED on" failed to apply to 6.18-stable tree
Subsystems (4)
[email protected]
maintainerThe patch below does not apply to the 6.18-stable tree.
If someone wants it applied there, or to any other stable or longterm tree, then please email the backport, including the original git commit id to <[email protected]>.
To reproduce the conflict and resubmit, you may use the following commands:
git fetch https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/ linux-6.18.y
git checkout FETCH_HEAD
git cherry-pick -x e5f1d62c59aea4f270773de1bf6e8867f5b1124c
# <resolve conflicts, build, test, etc.>
git commit -s
git send-email --to '<[email protected]>' --in-reply-to '2026110443-stage-reproach-62d3@gregkh' --subject-prefix 'PATCH 6.18.y' 'HEAD^..'
Possible dependencies:
thanks,
greg k-h
------------------ original commit in Linus's tree ------------------
From e5f1d62c59aea4f270773de1bf6e8867f5b1124c Mon Sep 17 00:00:00 2001
From: Xiaoyao Li <[email protected]>
Date: Wed, 19 Aug 2026 17:48:59 +0800
Subject: [PATCH] KVM: TDX: Stuff exit_reason with UNDEFINED on
wait_for_sept_zap return
Forcefully update the exit_reason to KVM's "standard" EXIT_REASON_UNDEFINED if tdx_vcpu_run() bails without trying to run the vCPU because KVM needs to wait for an in-progress S-EPT zap to complete. This avoids handling the previous exit multiple times due to a stale exit_reason.
arch/x86/kvm/vmx/tdx.c +9 -1
@@ -1085,8 +1085,16 @@ fastpath_t tdx_vcpu_run(struct kvm_vcpu *vcpu, u64 run_flags)* allowing vCPU entry to avoid contention with tdh_vp_enter() and * TDCALLs. */ -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))) { +/* +* The vCPU never entered the guest, but this looks like a +* handled exit to the caller. Synthesize an invalid exit +* reason so the previous exit's stale value isn't consumed +* a second time. +*/ + vt->exit_reason.full =EXIT_REASON_UNDEFINED ;return EXIT_FASTPATH_EXIT_HANDLED ; + }trace_kvm_entry (vcpu, run_flags &KVM_RUN_FORCE_IMMEDIATE_EXIT );
Sasha Levin
maintainerPATCH 1/1 KVM: TDX: Stuff exit_reason with UNDEFINED on wait_for_sept_zap return
From: Xiaoyao Li <[email protected]>
[ Upstream commit e5f1d62c59aea4f270773de1bf6e8867f5b1124c ]
Forcefully update the exit_reason to KVM's "standard" EXIT_REASON_UNDEFINED if tdx_vcpu_run() bails without trying to run the vCPU because KVM needs to wait for an in-progress S-EPT zap to complete. This avoids handling the previous exit multiple times due to a stale exit_reason.
--- arch/x86/kvm/vmx/tdx.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-)
arch/x86/kvm/vmx/tdx.c +9 -1
@@ -1041,8 +1041,16 @@ fastpath_t tdx_vcpu_run(struct kvm_vcpu *vcpu, u64 run_flags)* allowing vCPU entry to avoid contention with tdh_vp_enter() and * TDCALLs. */ -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))) { +/* +* The vCPU never entered the guest, but this looks like a +* handled exit to the caller. Synthesize an invalid exit +* reason so the previous exit's stale value isn't consumed +* a second time. +*/ + vt->exit_reason.full =EXIT_REASON_UNDEFINED ;return EXIT_FASTPATH_EXIT_HANDLED ; + }trace_kvm_entry (vcpu, run_flags &KVM_RUN_FORCE_IMMEDIATE_EXIT );
Signature · 1 line
2.53.0