> > +   best = kvm_find_cpuid_entry(vcpu, 7, 0);
> > +   if (best&&  (best->ebx&  bit(X86_FEATURE_SMEP))) {
> > +           if (boot_cpu_has(X86_FEATURE_SMEP))
> > +                   vcpu->arch.cr4_reserved_bits&=
> > +                           ~((unsigned long)X86_CR4_SMEP);
> 
> Fails if cpuid is updated again to include SMEP.  But I suggest to drop
> cr4_reserved_bits completely and just check cpuid directly in
> kvm_set_cr4(), if cr4.smep is changed, which should be very rare.  See
> how XSAVE is supported, for example.
> 
> > +           else
> > +                   best->ebx&= ~(bit(X86_FEATURE_SMEP));
> 
> Not needed - x86.c already masks unsupported features.

Should KVM still support guest SMEP when host disables it thru nosmep?
Thanks!
-Xin
--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to