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

Ping²: [PATCH] x86/CPUID: don't shrink hypervisor leaves


  • To: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Mon, 18 Oct 2021 10:05:51 +0200
  • 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=XwUo7Lw7IfGtRWkL4PKNPB39NB8A/txOu8Lk2EVup0U=; b=PCsE99MoeYTZ67yMB6KfHuL9wuHB9Prn19kFMcdQhJreEH9g6T1dt5JF4eKV9dkYskWzjs3CBCumtr2lEucU+vA7X0Bkn5LBwkRCn8DygLQvigVSDqvznhhSHKYTB6W5EuygP+9AhC8HyK4sYKLuzmIX/bynacMavq+MYbY0mrYFWmXdz2qCe2lBGivV1121tG5n3J8DSjG6qGoHG5anZMSgxBQrFlgnCVIo2NdrIIo/m4s9oY8/jLPVxKdm7RyC2eG0oacdO5UOXMOTr/lNk6CnT/96QfIM+RbmYXratkOIG3FserhwwmWDY13sQxDhGHJK6JYN7GGo2smnDukm1w==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=MIe0vD0Qz2hlYPLXZY2ioFzAlJqSBZ6vDQr3Jhr8D3pZHChgtbpCmRjfoCrTf3apct9k2TqDt/vPTCY+khOkShMlPRtPn9uLV5wE/yvL54cUXp9EWYleu6cX3t3QZnisS52sjIUbULUvz6whgeeGah317ktFDnJk+n1kmgH4Ux5jNjO8BMOuCd4mJNmGVFBxomwiQnohVvm2Rvqu2PiQWN35dRVnURdjS6XY0vMRT3RdDAfVETZQnDgSAkng1B5WrSJxePYoR0oPM13M4PwsxOHnbW8s1cYsxDexvZUIlMGD0+0laO6BBQNHCce66DigpmquLyPy/+VXZNGjt/lcuw==
  • Authentication-results: xenproject.org; dkim=none (message not signed) header.d=none;xenproject.org; dmarc=none action=none header.from=suse.com;
  • Cc: Wei Liu <wl@xxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>, Ian Jackson <iwj@xxxxxxxxxxxxxx>
  • Delivery-date: Mon, 18 Oct 2021 08:06:00 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 06.07.2021 09:48, Jan Beulich wrote:
> Andrew,
> 
> On 07.05.2021 10:40, Jan Beulich wrote:
>> This is a partial revert of 540d911c2813 ("x86/CPUID: shrink
>> max_{,sub}leaf fields according to actual leaf contents"). Andrew points
>> out that XXX.
> 
> if you still think the original change was wrong, would you please take
> the time to fill in the XXX above. It was you who asked for the revert,
> so I hope you can explain the reasons (I'm sorry for not being able to
> deduce these from your [informal iirc] revert request), and I expect
> you can find this much of time when I've already taken care of
> everything else. If I don't hear back within a couple of days, I'll
> assume you've changed your mind, and I'd then drop this patch.
> 
> Thanks, Jan

I notice this still is pending, despite what I've said above, since it
seems unlikely to me that you've changed your mind and didn't care about
saying so. Could you please clarify things one way or another?

Jan

>> Reported-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
>> Signed-off-by: Jan Beulich <jbeulich@xxxxxxxx>
>> ---
>> Obviously the XXX wants filling in. So far I did not really understand
>> what bad consequences there might be, but I can agree with the undoing
>> of this part of the original change along the lines of why the Viridian
>> side adjustment was also requested to be dropped (before the patch went
>> in).
>>
>> --- a/xen/arch/x86/traps.c
>> +++ b/xen/arch/x86/traps.c
>> @@ -964,15 +964,13 @@ void cpuid_hypervisor_leaves(const struc
>>      uint32_t base = is_viridian_domain(d) ? 0x40000100 : 0x40000000;
>>      uint32_t idx  = leaf - base;
>>      unsigned int limit = is_viridian_domain(d) ? p->hv2_limit : p->hv_limit;
>> -    unsigned int dflt = is_pv_domain(d) ? XEN_CPUID_MAX_PV_NUM_LEAVES
>> -                                        : XEN_CPUID_MAX_HVM_NUM_LEAVES;
>>  
>>      if ( limit == 0 )
>>          /* Default number of leaves */
>> -        limit = dflt;
>> +        limit = XEN_CPUID_MAX_NUM_LEAVES;
>>      else
>>          /* Clamp toolstack value between 2 and MAX_NUM_LEAVES. */
>> -        limit = min(max(limit, 2u), dflt);
>> +        limit = min(max(limit, 2u), XEN_CPUID_MAX_NUM_LEAVES + 0u);
>>  
>>      if ( idx > limit )
>>          return;
>> --- a/xen/include/public/arch-x86/cpuid.h
>> +++ b/xen/include/public/arch-x86/cpuid.h
>> @@ -113,10 +113,6 @@
>>  /* Max. address width in bits taking memory hotplug into account. */
>>  #define XEN_CPUID_MACHINE_ADDRESS_WIDTH_MASK (0xffu << 0)
>>  
>> -#define XEN_CPUID_MAX_PV_NUM_LEAVES 5
>> -#define XEN_CPUID_MAX_HVM_NUM_LEAVES 4
>> -#define XEN_CPUID_MAX_NUM_LEAVES \
>> -    (XEN_CPUID_MAX_PV_NUM_LEAVES > XEN_CPUID_MAX_HVM_NUM_LEAVES ? \
>> -     XEN_CPUID_MAX_PV_NUM_LEAVES : XEN_CPUID_MAX_HVM_NUM_LEAVES)
>> +#define XEN_CPUID_MAX_NUM_LEAVES 5
>>  
>>  #endif /* __XEN_PUBLIC_ARCH_X86_CPUID_H__ */
>>
> 




 


Rackspace

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