]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
KVM: SVM: Recalc instructions intercepts when EFER.SVME is toggled
authorKevin Cheng <chengkev@google.com>
Wed, 4 Mar 2026 00:30:10 +0000 (16:30 -0800)
committerSean Christopherson <seanjc@google.com>
Thu, 5 Mar 2026 00:08:57 +0000 (16:08 -0800)
commit460c7eb2e7594319abcb2066c737cb8b5eb78213
tree07af6d82460020ea5b5cb78a5f597383dc1a9212
parent69f779f79e0d1ff321a89ab56cdcab34613104c0
KVM: SVM: Recalc instructions intercepts when EFER.SVME is toggled

The AMD APM states that VMRUN, VMLOAD, VMSAVE, CLGI, VMMCALL, and
INVLPGA instructions should generate a #UD when EFER.SVME is cleared.
Currently, when VMLOAD, VMSAVE, or CLGI are executed in L1 with
EFER.SVME cleared, no #UD is generated in certain cases. This is because
the intercepts for these instructions are cleared based on whether or
not vls or vgif is enabled. The #UD fails to be generated when the
intercepts are absent.

Fix the missing #UD generation by ensuring that all relevant
instructions have intercepts set when SVME.EFER is disabled.

VMMCALL is special because KVM's ABI is that VMCALL/VMMCALL are always
supported for L1 and never fault.

Signed-off-by: Kevin Cheng <chengkev@google.com>
[sean: isolate Intel CPU "compatibility" in EFER.SVME=1 path]
Reviewed-by: Yosry Ahmed <yosry@kernel.org>
Link: https://patch.msgid.link/20260304003010.1108257-3-seanjc@google.com
Signed-off-by: Sean Christopherson <seanjc@google.com>
arch/x86/kvm/svm/svm.c