]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
KVM: SVM: Treat exit_code as an unsigned 64-bit value through all of KVM
authorSean Christopherson <seanjc@google.com>
Tue, 30 Dec 2025 21:13:44 +0000 (13:13 -0800)
committerSean Christopherson <seanjc@google.com>
Wed, 14 Jan 2026 01:37:03 +0000 (17:37 -0800)
commitd7507a94a07202234236d7f94bed6015ca645ae6
tree316e0eb84500ad961ef747f6c590ef9725f5af65
parent405fce694bd1589082a7ffd500b5a4b841c22f0d
KVM: SVM: Treat exit_code as an unsigned 64-bit value through all of KVM

Fix KVM's long-standing buggy handling of SVM's exit_code as a 32-bit
value.  Per the APM and Xen commit d1bd157fbc ("Big merge the HVM
full-virtualisation abstractions.") (which is arguably more trustworthy
than KVM), offset 0x70 is a single 64-bit value:

  070h 63:0 EXITCODE

Track exit_code as a single u64 to prevent reintroducing bugs where KVM
neglects to correctly set bits 63:32.

Fixes: 6aa8b732ca01 ("[PATCH] kvm: userspace interface")
Cc: Jim Mattson <jmattson@google.com>
Cc: Yosry Ahmed <yosry.ahmed@linux.dev>
Reviewed-by: Yosry Ahmed <yosry.ahmed@linux.dev>
Link: https://patch.msgid.link/20251230211347.4099600-6-seanjc@google.com
Signed-off-by: Sean Christopherson <seanjc@google.com>
arch/x86/include/asm/svm.h
arch/x86/include/uapi/asm/svm.h
arch/x86/kvm/svm/hyperv.c
arch/x86/kvm/svm/nested.c
arch/x86/kvm/svm/sev.c
arch/x86/kvm/svm/svm.c
arch/x86/kvm/svm/svm.h
arch/x86/kvm/trace.h
include/hyperv/hvgdk.h
tools/testing/selftests/kvm/include/x86/svm.h
tools/testing/selftests/kvm/x86/svm_nested_soft_inject_test.c