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:11:32 +0100 Message-ID: <53CFC2940200007800025120@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> <20140710105607.GA65674@deinos.phlegethon.org> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <20140710105607.GA65674@deinos.phlegethon.org> 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: Tim Deegan Cc: linux@eikelenboom.it, keir@xen.org, Feng Wu , xen-devel@lists.xen.org List-Id: xen-devel@lists.xenproject.org >>> On 10.07.14 at 12:56, wrote: > At 07:18 +0800 on 08 Jul (1404800297), 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. > > Surely the correct behaviour is _not_ to do the check -- this is the > context switch path in the _hypervisor_, not a guest-kernel operation. But it is being "asked for" by the kernel, and hence should be treated as implicit supervisor mode access just like e.g. descriptor table accesses (see also the earlier discussion in the thread where the problem got reported). Jan