From: "Jan Beulich" Subject: Re: [PATCH] xc_cpuid_x86.c: No need to mask NX twice Date: Mon, 08 Sep 2014 11:54:32 +0100 Message-ID: <540DA7080200007800031E60@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> <540D8E6A0200007800031DDD@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 11:56, wrote: > On Mon, Sep 8, 2014 at 5:09 PM, Jan Beulich wrote: > >> >>> On 08.09.14 at 10:48, wrote: >> >> Things look fine from a general pov, but >> >> > @@ -278,12 +274,14 @@ static void xc_cpuid_hvm_policy( >> > DECLARE_DOMCTL; >> > char brand[13]; >> > uint64_t val; >> > - int is_pae, is_nestedhvm; >> > + int is_64bit, is_pae, is_nestedhvm; >> > uint64_t xfeature_mask; >> > >> > xc_hvm_param_get(xch, domid, HVM_PARAM_PAE_ENABLED, &val); >> > is_pae = !!val; >> > - >> > + >> > + is_64bit = hypervisor_is_64bit(xch) && is_pae; >> >> ... with this using hypervisor_is_64bit() and there not being a 32-bit >> hypervisor anymore, there's clearly room for more cleanup (and in >> particular no need to pass around an "is_64bit" variable that's always >> going to be set to true). >> > > Do your mean hypervisor_is_64bit() will always return true? Then it means > that is_64bit will only depend on is_pae here, so we could simply use > is_pae instead of is_64bit in both vendor specific functions. If so, I > think xen_64bit in xc_cpuid_pv_policy could also be dropped and > function hypervisor_is_64bit() > is also redundant now. Right? Right. > Maybe something like this? Yes. Thanks, Jan