Re: [PATCH v5 2/2] KVM: SVM: Recalc instructions intercepts when EFER.SVME is toggled

From: Yosry Ahmed

Date: Tue Mar 03 2026 - 20:20:39 EST


On Tue, Mar 03, 2026 at 04:30:10PM -0800, Sean Christopherson wrote:
> From: Kevin Cheng <chengkev@xxxxxxxxxx>
>
> 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@xxxxxxxxxx>
> [sean: isolate Intel CPU "compatibility" in EFER.SVME=1 path]
> Signed-off-by: Sean Christopherson <seanjc@xxxxxxxxxx>

Reviewed-by: Yosry Ahmed <yosry@xxxxxxxxxx>