Re: [PATCH v3 10/21] KVM:x86: Add #CP support in guest exception classification

Sean Christopherson
2023-06-30T15:16:30Z

On Fri, Jun 30, 2023, Gil Neiger wrote:
> Intel will not produce any CPU with CET that does not enumerate IA32_VMX_BASIC[56] as 1.
>
> One can check that bit before injecting a #CP with error code, but it should
> not be necessary if CET is enumerated.
>
> Of course, if the KVM may run as a guest of another VMM/hypervisor, it may be
> that the virtual CPU in which KVM operates may enumerate CET but clear the
> bit in IA32_VMX_BASIC.

Yeah, I think KVM should be paranoid and expose CET to the guest if and only if
IA32_VMX_BASIC[56] is 1. That'll also help validate nested support, e.g. will
make it more obvious if userspace+KVM provides a "bad" model to L1.