From: "Jan Beulich" Subject: Re: [PATCH RFC v13 07/20] pvh: Do not allow PVH guests to change paging modes Date: Thu, 26 Sep 2013 16:30:42 +0100 Message-ID: <52446F4202000078000F70B0@nat28.tlf.novell.com> References: <1379955000-11050-1-git-send-email-george.dunlap@eu.citrix.com> <1379955000-11050-8-git-send-email-george.dunlap@eu.citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta5.messagelabs.com ([195.245.231.135]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1VPDWG-0001ya-QO for xen-devel@lists.xenproject.org; Thu, 26 Sep 2013 15:30:20 +0000 In-Reply-To: <1379955000-11050-8-git-send-email-george.dunlap@eu.citrix.com> Content-Disposition: inline List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: George Dunlap Cc: xen-devel , Keir Fraser , Tim Deegan List-Id: xen-devel@lists.xenproject.org >>> On 23.09.13 at 18:49, George Dunlap wrote: > --- a/xen/arch/x86/hvm/hvm.c > +++ b/xen/arch/x86/hvm/hvm.c > @@ -1765,6 +1765,16 @@ int hvm_set_cr0(unsigned long value) > (value & (X86_CR0_PE | X86_CR0_PG)) == X86_CR0_PG ) > goto gpf; > > + > + Please drop these bogus blank lines ... > + /* A pvh is not expected to change to real mode. */ > + if ( is_pvh_vcpu(v) > + && (value & (X86_CR0_PE | X86_CR0_PG)) != (X86_CR0_PG | X86_CR0_PE) ) > + { > + printk(XENLOG_G_WARNING > + "PVH attempting to turn off PE/PG. CR0:%lx\n", value); > + goto gpf; > + } ... and perhaps insert one here instead. > if ( (value & X86_CR0_PG) && !(old_value & X86_CR0_PG) ) > { > if ( v->arch.hvm_vcpu.guest_efer & EFER_LME ) Jan