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

Re: [Xen-devel] [PATCH 20/27] x86/cpuid: Drop the temporary linear feature bitmap from struct cpuid_policy



On 05/01/17 13:07, Jan Beulich wrote:
>>>> On 04.01.17 at 13:39, <andrew.cooper3@xxxxxxxxxx> wrote:
>>  static void __init calculate_pv_max_policy(void)
>>  {
>>      struct cpuid_policy *p = &pv_max_policy;
>> +    uint32_t pv_featureset[FSCAPINTS], host_featureset[FSCAPINTS];
>>      unsigned int i;
>>  
>> +    cpuid_policy_to_featureset(&host_policy, host_featureset);
>> +
>>      for ( i = 0; i < FSCAPINTS; ++i )
>>          pv_featureset[i] = host_featureset[i] & pv_featuremask[i];
> While at init time we shouldn't be tight on stack space, it would still
> feel better if you didn't put two such (growing in the future) arrays
> on the stack. Would you consider it unreasonable to do
>
>     cpuid_policy_to_featureset(&host_policy, pv_featureset);
>     for ( i = 0; i < FSCAPINTS; ++i )
>         pv_featureset[i] &= pv_featuremask[i];
>
> (and then similarly for HVM)?

The following patch does (basically) this, and drops one of the arrays.

~Andrew

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

 


Rackspace

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