Re: [PATCH] KVM: x86: Emulate SYSENTER in 64-bit mode for Intel-compatible vCPUs
From: Sean Christopherson
Date: Wed Nov 04 2026 - 21:26:30 EST
On Wed, Oct 21, 2026, Hao Zhang wrote:
> From: Hao Zhang <zhanghao1@xxxxxxxxxx>
>
> Intel allows SYSENTER in both IA-32e submodes, whereas AMD raises #UD
> in either submode. On AMD hosts, KVM intercepts #UD and emulates
> SYSENTER to support Intel-compatible vCPUs.
>
> However, em_sysenter() unconditionally rejects execution from 64-bit
> mode. As a result, a valid SYSENTER in an Intel-compatible guest can
> fail emulation instead of entering the guest's kernel. For a
> non-nested guest at CPL0, this results in a
> KVM_INTERNAL_ERROR_EMULATION exit to userspace even when
> KVM_CAP_EXIT_ON_EMULATION_FAILURE is not enabled.
>
> Remove the unconditional rejection.
Why? I'm not inclined to expand the emulator's capabilities for something like
this without a *really* good reason to do so.