Re: [PATCH] KVM: VMX: Do not trap VMFUNC instructions for L1 guests.

From: Yu Zhang
Date: Tue Nov 08 2022 - 05:24:05 EST


On Mon, Nov 07, 2022 at 05:36:21PM +0000, Sean Christopherson wrote:
> On Mon, Nov 07, 2022, Paolo Bonzini wrote:
> > On 11/7/22 09:27, Yu Zhang wrote:
> > > VMFUNC is not supported for L1 guests, and executing VMFUNC in
> > > L1 shall generate a #UD directly. Just disable it in secondary
> > > proc-based execution control for L1, instead of intercepting it
> > > and inject the #UD again.
> > >
> > > Signed-off-by: Yu Zhang<yu.c.zhang@xxxxxxxxxxxxxxx>
> >
> > Is this for TDX or similar? The reason for a patch should be mentioned in
> > the commit message.
>
> It's just a cleanup, but (a) it should be split over two patches as disabling
> VMFUNC for L1 is technically a functional change, where as the changes to
> nested_vmx_setup_ctls_msrs() are pure cleanups, and (b) the !guest_mode path in
> handle_vmfunc() should either be removed or turned into a KVM_BUG_ON().
>

Got it. Will do in V2. And thanks!

B.R.
Yu