FAILED: patch "[PATCH] KVM: VMX: Preserve negative return value in vmx_handle_exit()" failed to apply to 6.6-stable tree
Subsystems (3)
[email protected]
maintainerThe patch below does not apply to the 6.6-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.6.y
git checkout FETCH_HEAD
git cherry-pick -x cef48693da1e964e9f192bfc16cd0ed287c48337
# <resolve conflicts, build, test, etc.>
git commit -s
git send-email --to '<[email protected]>' --in-reply-to '2026110459-cone-playlist-3832@gregkh' --subject-prefix 'PATCH 6.6.y' 'HEAD^..'
Possible dependencies:
thanks,
greg k-h
------------------ original commit in Linus's tree ------------------
From cef48693da1e964e9f192bfc16cd0ed287c48337 Mon Sep 17 00:00:00 2001
From: Xiaoyao Li <[email protected]>
Date: Wed, 19 Aug 2026 17:49:00 +0800
Subject: [PATCH] KVM: VMX: Preserve negative return value in vmx_handle_exit()
with bus lock detected
Preserve the negative return value from __vmx_handle_exit() when a bus lock is detected, instead of always overwriting it with 0.
The purpose of bus_lock_detected handling is to force a userspace exit to inform userspace that a bus lock happened. The negative return value can achieve this purpose, and changing the negative value to 0 fails to return an error to userspace. So, preserve the negative return value.
arch/x86/kvm/vmx/vmx.c +3 -2
@@ -6864,11 +6864,12 @@ int vmx_handle_exit(struct kvm_vcpu *vcpu, fastpath_t exit_fastpath)* a bus lock in guest. */ if (vmx_get_exit_reason (vcpu).bus_lock_detected) { -if (ret >0 ) +if (ret >0 ) { vcpu->run->exit_reason =KVM_EXIT_X86_BUS_LOCK ; + ret =0 ; + } vcpu->run->flags |=KVM_RUN_X86_BUS_LOCK ; -return 0 ; }return ret; }
PATCH 1/1 KVM: VMX: Preserve negative return value in vmx_handle_exit() with bus lock detected
[ Upstream commit cef48693da1e964e9f192bfc16cd0ed287c48337 ]
Preserve the negative return value from __vmx_handle_exit() when a bus lock is detected, instead of always overwriting it with 0.
The purpose of bus_lock_detected handling is to force a userspace exit to inform userspace that a bus lock happened. The negative return value can achieve this purpose, and changing the negative value to 0 fails to return an error to userspace. So, preserve the negative return value.
--- arch/x86/kvm/vmx/vmx.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
arch/x86/kvm/vmx/vmx.c +3 -2
@@ -6620,11 +6620,12 @@ static int vmx_handle_exit(struct kvm_vcpu *vcpu, fastpath_t exit_fastpath)* a bus lock in guest. */ if (to_vmx (vcpu)->exit_reason.bus_lock_detected) { -if (ret >0 ) +if (ret >0 ) { vcpu->run->exit_reason =KVM_EXIT_X86_BUS_LOCK ; + ret =0 ; + } vcpu->run->flags |=KVM_RUN_X86_BUS_LOCK ; -return 0 ; }return ret; }
Signature · 1 line
2.53.0
Re: [PATCH 6.6.y] KVM: VMX: Preserve negative return value in vmx_handle_exit() with bus lock detected
Quoted 18 lines · Xiaoyao Li
[ Upstream commit
cef48693da1e964e9f192bfc16cd0ed287c48337]Preserve the negative return value from
__vmx_handle_exit()when a bus lock is detected, instead of always overwriting it with 0.The purpose of
bus_lock_detectedhandling is to force a userspace exit to inform userspace that a bus lock happened. The negative return value can achieve this purpose, and changing the negative value to 0 fails to return an error to userspace. So, preserve the negative return value.Fixes fe6b6bc802b4 ("KVM: VMX: Enable bus lock VM exit")Reported-by [email protected]Signed-off-by Xiaoyao Li <[email protected]>Signed-off-by Sean Christopherson <[email protected]>Signed-off-by Xiaoyao Li <[email protected]>
Quoted 1 line
---
Conflict on the exit_reason field due to lack of 7172c753c26a5 ("KVM: VMX: Move common fields of struct vcpu_{vmx,tdx} to a struct").