From mboxrd@z Thu Jan 1 00:00:00 1970 From: Marcelo Tosatti Subject: Re: [Patch v4 2/4] Add SMEP handling when setting CR4 Date: Tue, 31 May 2011 15:48:27 -0300 Message-ID: <20110531184827.GA4376@amt.cnet> References: <5D8008F58939784290FAB48F5497519844E9278011@shsmsx502.ccr.corp.intel.com> <20110531175232.GA2721@amt.cnet> <4DE52DEF.2000009@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: "Yang, Wei Y" , "kvm@vger.kernel.org" To: Avi Kivity Return-path: Received: from mx1.redhat.com ([209.132.183.28]:32487 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1758115Ab1EaSvo (ORCPT ); Tue, 31 May 2011 14:51:44 -0400 Content-Disposition: inline In-Reply-To: <4DE52DEF.2000009@redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: On Tue, May 31, 2011 at 09:05:35PM +0300, Avi Kivity wrote: > >> if (is_long_mode(vcpu)) { > >> if (!(cr4& X86_CR4_PAE)) > >> return 1; > > > >A new field in vcpu->arch.mmu.base_role for smep is required > >for shadow MMU (similar to nxe). > > I plan to add that with my cr0.wp=0 fixup (it's only needed there, right?) Sptes instantiated when cr4.smep = 0 should not be used when cr4.smep = 1, so no (unlikely that guest kernel executes user=1 code anyway, but for consistency with other base_role flags). OK then, you'll fix that.