[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [PATCH] xc_cpuid_x86.c: No need to mask NX twice



>>> On 08.09.14 at 11:56, <alfred.z.song@xxxxxxxxx> wrote:
> On Mon, Sep 8, 2014 at 5:09 PM, Jan Beulich <JBeulich@xxxxxxxx> wrote:
> 
>> >>> On 08.09.14 at 10:48, <alfred.z.song@xxxxxxxxx> 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


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.