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

Re: [PATCH for-4.16] x86/cpuid: prevent shrinking migrated policies max leaves


  • To: Andrew Cooper <amc96@xxxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Thu, 11 Nov 2021 10:26:29 +0100
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=BlCOUlTbakbaK2RQv7+0DXqzQLLvjdR5sNIPLuL6DLY=; b=HouJXqUyc23yajTNp5iavLYKtn9M8nZqCIwDE9dDnIdqW71z+a4+qv1GVN3tJlyM2oYv76qJuNBVeO93SXbshn3/7W1mJWbsx6j0DexGISjXXucKpBayUKGK/ghy2STUhHpX/vX9rmWgs1VnKgWW7VJJZN4zF/Aq5O1uPYZ/bqas7FgLL3PY5PmP+tCP/Y7bucnTHn3NlmBUH2Jp/SNbgBa2boZDl31bgQxLUFZmV6Sva3ampqhuxr4khev4bPfIYj+ymNhusoy5ayxTUkOBzuGtsIM7n1600Tl782GIxNtgIJDb0HX25iWVae91aSzt7Ff6HxdLYf3WjR7AVtadNQ==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=g/UnezSWjpilH57MAcUvzQqpm8EPVI/DMNgOshKEnHKLjauIbNbyh6bzIFmnO/OzMqXVn6EjSHVL02eQCWWwQUTWy9eLoGVZuAySrCOfJ7Pr1KeQAqoPjwTBOiLALMeipQ/uvZXjBMXrwhdTv2PN8XJcKHbtvEklY2hfv8POUjI0BdDLurpbpAxLNXBOjARxqta+l7UhsPuE9TVOy2Z6e36bVXq3l6idfWhizA7xdegHLdmy2wuPpFNrL5ReM7hVT4XAFyKEntH99OBptA/ETRaJ1x45+XUiCtocPtECW0kBTrWh4eyRep8OG9YkWN3LWjEZbk/9lG/PUayTuDTjJQ==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com;
  • Cc: Wei Liu <wl@xxxxxxx>, Juergen Gross <jgross@xxxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Ian Jackson <iwj@xxxxxxxxxxxxxx>, Roger Pau Monne <roger.pau@xxxxxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxxx
  • Delivery-date: Thu, 11 Nov 2021 09:27:15 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

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
> 




 


Rackspace

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