From: "Jan Beulich" Subject: Re: [PATCH] xc_cpuid_x86.c: No need to mask NX twice Date: Mon, 08 Sep 2014 16:07:02 +0100 Message-ID: <540DE23602000078000321D6@mail.emea.novell.com> References: <1409911893-18037-1-git-send-email-alfred.z.song@gmail.com> <5409AD6E0200007800031618@mail.emea.novell.com> <5409E07D020000780003182B@mail.emea.novell.com> <5409FC650200007800031931@mail.emea.novell.com> <540D70070200007800031D44@mail.emea.novell.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: z Cc: Ian Campbell , Stefano Stabellini , jinsong.liu@alibaba-inc.com, ian.jackson@eu.citrix.com, Zhuo Song , boyu.mt@alibaba-inc.com, xen-devel@lists.xen.org List-Id: xen-devel@lists.xenproject.org >>> On 08.09.14 at 16:43, wrote: > On Mon, Sep 8, 2014 at 4:48 PM, z wrote: >> On Mon, Sep 8, 2014 at 2:59 PM, Jan Beulich wrote: >>> Looking at the context above I also wonder whether tying RDTSCP >>> to 64-bit guests is really correct in (at least) the Intel case. >>> >> >> I am not so sure for now, but I will check it later as well:) > > I just checked Intel SDM. It seems you are right. RDTSCP could be used for > both 64-bit and 32-bit architectures. Maybe the limit for 64-bit should be > removed too. > > diff --git a/tools/libxc/xc_cpuid_x86.c b/tools/libxc/xc_cpuid_x86.c > index 710fd61..e7b50b1 100644 > --- a/tools/libxc/xc_cpuid_x86.c > +++ b/tools/libxc/xc_cpuid_x86.c > @@ -193,7 +193,7 @@ static void intel_xc_cpuid_policy( > regs[3] &= (bitmaskof(X86_FEATURE_NX) | > bitmaskof(X86_FEATURE_LM) | > (is_pae ? bitmaskof(X86_FEATURE_SYSCALL) : 0) | > - (is_pae ? bitmaskof(X86_FEATURE_RDTSCP) : 0)); > + (bitmaskof(X86_FEATURE_RDTSCP)); > break; > } That's what I though it should look like; the tying of various features to "is_pae" with your most recent patch is a little strange anyway, i.e. I'd hope that many of those could get cleaned up just like the RDTSCP one. In any even, please submit a format patch for the change above and feel free to extend the cleanup. Thanks again, Jan