]> Gentwo Git Trees - linux/.git/commit
KVM: nVMX: Virtualize NO_HW_ERROR_CODE_CC for L1 event injection to L2
authorYang Weijiang <weijiang.yang@intel.com>
Fri, 19 Sep 2025 22:32:37 +0000 (15:32 -0700)
committerSean Christopherson <seanjc@google.com>
Tue, 23 Sep 2025 16:24:11 +0000 (09:24 -0700)
commit033cc166f02920b193f7ec989083bce1a20e9abf
tree08d445445a7894e919987ec41d25f3c602f702a4
parentf7336d47be53d0da1e74143b8befea8c0176f3cc
KVM: nVMX: Virtualize NO_HW_ERROR_CODE_CC for L1 event injection to L2

Per SDM description(Vol.3D, Appendix A.1):
"If bit 56 is read as 1, software can use VM entry to deliver a hardware
exception with or without an error code, regardless of vector"

Modify has_error_code check before inject events to nested guest. Only
enforce the check when guest is in real mode, the exception is not hard
exception and the platform doesn't enumerate bit56 in VMX_BASIC, in all
other case ignore the check to make the logic consistent with SDM.

Signed-off-by: Yang Weijiang <weijiang.yang@intel.com>
Reviewed-by: Maxim Levitsky <mlevitsk@redhat.com>
Reviewed-by: Chao Gao <chao.gao@intel.com>
Tested-by: Mathias Krause <minipli@grsecurity.net>
Tested-by: John Allen <john.allen@amd.com>
Tested-by: Rick Edgecombe <rick.p.edgecombe@intel.com>
Signed-off-by: Chao Gao <chao.gao@intel.com>
Reviewed-by: Binbin Wu <binbin.wu@linux.intel.com>
Link: https://lore.kernel.org/r/20250919223258.1604852-31-seanjc@google.com
Signed-off-by: Sean Christopherson <seanjc@google.com>
arch/x86/kvm/vmx/nested.c
arch/x86/kvm/vmx/nested.h