Re: [Xen-devel] [Patch] Enable SMEP CPU feature support for XEN itself
On 01/06/2011 23:52, "Li, Xin" <xin.li@xxxxxxxxx> wrote:
>>>>> and kills a pv guest triggering SMEP fault.
>>>> Should only occur when the guest kernel triggers the SMEP.
>>> According to code base size, it's much easier for malicious applications to
>>> security holes in kernel. But unluckily SMEP doesn't apply to the ring 3
>>> x86_64 pv kernel runs on. It's wiser to use HVM :)
>> Yep, but 32-bit guests can still benefit.
> Can we know a guest will be 32bit or 64bit before it boots?
> Code will be like
> case 7, 0:
> if ( 64 bit pv guest )
> disallow smep;
> I don't know if we can distinguish that when creating guest.
Of course you can. See the guest_64bit flag already used in
However, given that the guest cannot influence whether SMEP is
enabled/disabled, perhaps it makes sense to always hide the feature? Also we
should unconditionally be hiding the CPUID feature in any case when Xen does
not support SMEP (because disabled on command line, or in the stable
branches without the feature patch applied) as otherwise guest can detect
the feature and will crash when it tries to enable the feature in CR4. This
is why it's a bad idea that we blacklist CPUID features for PV guests rather
than whitelist them. I will apply such a patch to all trees now.
Xen-devel mailing list