On 10.11.2021 19:17, Andrew Cooper wrote:
> On 10/11/2021 17:40, Roger Pau Monne wrote:
>> diff --git a/tools/libs/guest/xg_cpuid_x86.c 
>> b/tools/libs/guest/xg_cpuid_x86.c
>> index 198892ebdf..3ffd5f683b 100644
>> --- a/tools/libs/guest/xg_cpuid_x86.c
>> +++ b/tools/libs/guest/xg_cpuid_x86.c
>> @@ -638,6 +638,13 @@ int xc_cpuid_apply_policy(xc_interface *xch, uint32_t 
>> domid, bool restore,
>>          }
>>      }
>>  
>> +    /*
>> +     * Do not try to shrink the policy if restoring, as that could cause
>> +     * guest visible changes in the maximum leaf fields.
>> +     */
>> +    if ( !restore )
>> +        x86_cpuid_policy_shrink_max_leaves(p);
> 
> Nothing in xc_cpuid_apply_policy() changes any of the max leaves, so
> this is dead logic.

I guess you mean nothing there does anything which would result in
shrinking of the max leaves by calling this function? Yet even if
so, isn't the call here to take care of any earlier changes which
might have resulted in fully blank tail leaves?

Jan

> xc_cpuid_xend_policy() can in principle change max leaves, but that
> logic is all horribly broken and I don't recommend touching it.
> 
> I'd just drop this hunk entirely, and retain the deletion in the hypervisor.
> 
> ~Andrew
> 


Reply via email to