From: "Jan Beulich" Subject: Re: [PATCH 1/2] x86/hvm: Always do SMAP check when updating runstate_guest(v) Date: Wed, 23 Jul 2014 13:10:03 +0100 Message-ID: <53CFC23B020000780002511D@mail.emea.novell.com> References: <1404775098-6083-1-git-send-email-feng.wu@intel.com> <1404775098-6083-2-git-send-email-feng.wu@intel.com> <53BBC230.7080705@citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: 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: Feng Wu Cc: Andrew Cooper , "tim@xen.org" , "xen-devel@lists.xen.org" , "keir@xen.org" , "linux@eikelenboom.it" List-Id: xen-devel@lists.xenproject.org >>> On 09.07.14 at 03:33, wrote: >> From: Andrew Cooper [mailto:andrew.cooper3@citrix.com] >> On 08/07/14 00:18, Feng Wu wrote: >> > In the current implementation, we honor the guest's CPL and AC >> > to determain whether do the SMAP check or not for runstate_guest(v). >> > However, this doesn't work. The VMCS feild is invalid when we try >> > to get geust's SS by hvm_get_segment_register(), since the >> > right VMCS has not beed loaded for the current VCPU. >> > >> > In this patch, we always do the SMAP check when updating >> > runstate_guest(v) for the guest when SMAP is enabled by it. >> > >> > Reported-by: Sander Eikelenboom >> > Signed-off-by: Feng Wu >> >> Why can't the VMCS be reloaded in vmx_ctxt_switch_to() rather than >> vmx_do_resume() ? The problem is not with updating the runstate area >> persay, but due to using guest_walk_tables() during a context switch >> before the VMCS has been loaded. > > This is another option in the discussion with Jan. However, seems > the current option is preferred by Jan. I don't think I ever said so. What I probably did say is that doing it the alternative way, while presumably better, will need quite a bit more care (i.e. is overall more risky than the change here). Jan