[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <04F972F38B3C4E4E91C4697DA8BF9F525B208891C9@shsmsx502.ccr.corp.intel.com>
Date: Thu, 19 May 2011 14:41:43 +0800
From: "Shan, Haitao" <haitao.shan@...el.com>
To: "Tian, Kevin" <kevin.tian@...el.com>, Avi Kivity <avi@...hat.com>,
Ingo Molnar <mingo@...e.hu>
CC: "H. Peter Anvin" <hpa@...or.com>,
"Yu, Fenghua" <fenghua.yu@...el.com>,
Thomas Gleixner <tglx@...utronix.de>,
"Mallick, Asit K" <asit.k.mallick@...el.com>,
Linus Torvalds <torvalds@...ux-foundation.org>,
Arjan van de Ven <arjan@...radead.org>,
Andrew Morton <akpm@...ux-foundation.org>,
Andi Kleen <andi@...stfloor.org>,
linux-kernel <linux-kernel@...r.kernel.org>,
Pekka Enberg <penberg@...helsinki.fi>
Subject: RE: [PATCH v2 0/4] Enable SMEP CPU Feature
After this basic enabling work, we could work out a patch to address Ingo's idea, which will mandatorily turn on SMEP for guests.
Shan Haitao
-----Original Message-----
From: Tian, Kevin
Sent: Thursday, May 19, 2011 2:11 PM
To: Avi Kivity; Ingo Molnar
Cc: H. Peter Anvin; Yu, Fenghua; Thomas Gleixner; Mallick, Asit K; Linus Torvalds; Arjan van de Ven; Andrew Morton; Andi Kleen; linux-kernel; Pekka Enberg; Shan, Haitao
Subject: RE: [PATCH v2 0/4] Enable SMEP CPU Feature
> From: Avi Kivity
> Sent: Tuesday, May 17, 2011 7:34 PM
>
> On 05/17/2011 01:46 PM, Ingo Molnar wrote:
> > >
> > > We could support it as a non-default feature, but that reduces its utility.
> >
> > It would be a nice touch for tools/kvm/: we would use KVM_GET_SREGS
> > and KVM_GET_SREGS to twiddle CR4.SMEP, even without the guest
> > explicitly
> doing it.
> >
> > A quick glance suggests that it could be done straight away in
> > tools/kvm/kvm-cpu.c::kvm_cpu__setup_sregs() during vcpu setup, and
> > hopefully that cr4 value survives boot and ends up in the guest
> > kernel's mmu_cr4_features mask shadow register.
>
> Depends if the guest uses a read-modify-write pattern or not. We
> could do it transparently in kvm.ko, since the real cr4 need not
> corresponds to the guest notion (for example, we often set cr0.wp or
> cr0.ts even though the guest wants them clear).
>
We have a patch in hand now to enable SMEP for kvm guest, which is under test and cleanup and will be sent out soon. Basically it contains the basic idea by exposing CR4.smep and cpuid leaf. Above idea is nice and we'll try that in a following work.
Thanks
Kevin
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists