From mboxrd@z Thu Jan 1 00:00:00 1970 From: Keir Fraser Subject: Re: [PATCH] VMX: disable SMEP feature when guest is in non-paging mode Date: Wed, 30 Jan 2013 17:11:51 -0800 Message-ID: References: <40776A41FC278F40B59438AD47D147A90FF0A622@SHSMSX102.ccr.corp.intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <40776A41FC278F40B59438AD47D147A90FF0A622@SHSMSX102.ccr.corp.intel.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: "Xu, Dongxiao" , Tim Deegan Cc: "xen-devel@lists.xen.org" List-Id: xen-devel@lists.xenproject.org On 30/01/2013 16:56, "Xu, Dongxiao" wrote: >>> Shouldn't this be handled on CR0 writes as well as CR4? The SMEP bit of >>> hw_cr[4] ought to be cleared and set whenever CR0_PG is changed. >> >> That's what I would expect too. > > In the case 0 (CR0 update) in vmx_update_guest_cr(), it will call > vmx_update_guest_cr(v, 4) to adjust CR4 related bits if certain bits (PG, PE) > in CR0 changed. Good point! In fact we can make that cr4 update unconditional and simplify the cr0 handling a bit more. -- Keir