lkml.org 
[lkml]   [2020]   [Apr]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v11 2/9] KVM: VMX: Set guest CET MSRs per KVM and host configuration
On Fri, Apr 24, 2020 at 07:55:29AM -0700, Sean Christopherson wrote:
> On Fri, Apr 24, 2020 at 10:07:51PM +0800, Yang Weijiang wrote:
> > On Thu, Apr 23, 2020 at 09:27:49AM -0700, Sean Christopherson wrote:
> > > On Thu, Mar 26, 2020 at 04:18:39PM +0800, Yang Weijiang wrote:
> > > > @@ -7102,6 +7138,10 @@ static void vmx_cpuid_update(struct kvm_vcpu *vcpu)
> > > > vmx_set_guest_msr(vmx, msr, enabled ? 0 : TSX_CTRL_RTM_DISABLE);
> > > > }
> > > > }
> > > > +
> > > > + if (guest_cpuid_has(vcpu, X86_FEATURE_SHSTK) ||
> > > > + guest_cpuid_has(vcpu, X86_FEATURE_IBT))
> > > > + vmx_update_intercept_for_cet_msr(vcpu);
> > >
> > > This is wrong, it will miss the case where userspace double configures CPUID
> > > and goes from CET=1 to CET=0. This should instead be:
> > >
> > > if (supported_xss & (XFEATURE_MASK_CET_KERNEL | XFEATURE_MASK_CET_USER))
> > > vmx_update_intercept_for_cet_msr(vcpu);
> > >
> > > > }
> > Here CET=1/0, did you mean the CET bit in XSS or CR4.CET? If it's the
> > former, then it's OK for me.
>
> The former, i.e. update the CET MSRs if KVM supports CET virtualization and
> the guest's CPUID configuration is changing.
Yep, this case should be taken into account, thank you for pointing it out!

\
 
 \ /
  Last update: 2020-04-25 11:12    [W:0.056 / U:0.200 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site