From: Tim Deegan Subject: Re: [PATCH 1/2] x86/hvm: Always do SMAP check when updating runstate_guest(v) Date: Wed, 23 Jul 2014 14:15:14 +0200 Message-ID: <20140723121514.GA19344@deinos.phlegethon.org> 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> <53CFC2940200007800025120@mail.emea.novell.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Content-Disposition: inline In-Reply-To: <53CFC2940200007800025120@mail.emea.novell.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: Jan Beulich Cc: linux@eikelenboom.it, keir@xen.org, Feng Wu , xen-devel@lists.xen.org List-Id: xen-devel@lists.xenproject.org At 13:11 +0100 on 23 Jul (1406117492), Jan Beulich wrote: > >>> 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). OK, that makes sense. Tim.