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

Re: [PATCH] x86/Intel: use CPUID bit to determine PPIN availability


  • To: Andrew Cooper <amc96@xxxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Tue, 18 Jan 2022 14:27:52 +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=rKa7NzZ3aDrnL+HnhEGCJXWcP3oVhCrE/ec2hBfHROM=; b=RbrQHyu9D//J6+xnthjjCbYgYwNN0uZXwZ2PZUBOZajy/8QKY2xmUgFOKjWLRhVHBaOu0O59V7aZDF5xyzeB+nJSS2jnPhjp/cUyz/sHI/55skOvso+2NYnMxoTG0oG2qylPZ9fq0oj/uXjhT1OnIHkcEUENcIA2LJGSkYlbbLaIhIO5f/H3RB3BtQ0/wwmQ1VA9tSdxnTOIRa6Wb6yHc4X2dpA7PyO4dKMTxLwiApO/JMcdxyQi2INgFlU77ACXlf/VM+1hHdFWlWY6qFuJCHTO2gkXzrKMd+6T/05QuMKkWj0abb0J3/TqJ+sZSGVmnRqllGCFbHX/fmvn/S9MVA==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=hUDJOgwAO3VBQ7SPLYG/BWV6FAHXQwPGj2DUqzJs7XfatUkcnPY7ufzTjDNhY0jzYAZTHrnttWiP/2AV+X2G808vfRpf1l19FZ99cdgmFoRHIfHopyMWmUZdDVu/Ykv6NPM1qhw8TfvUMRA62A4qJMqYUMKmP6PXprolGiYgIFMEGrex7cXZGYisuJJm2rB+3uUnLdwpH/4n8UVYpRShhXaNu4Xjm3D4Nm47P64bqMqf8uXSE3HaHvbkTsxr7sDztEO6bRKwVIHvNYW/Oq2vOqiZJidgeIAr+SAigGuZEau4VVkU3NNMeqahDYKv3LekphMKhgC+IL/5mcaczpB32g==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com;
  • Cc: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • Delivery-date: Tue, 18 Jan 2022 13:28:09 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 18.01.2022 13:18, Andrew Cooper wrote:
> On 17/01/2022 15:30, Jan Beulich wrote:
>> As of SDM revision 076 there is a CPUID bit for this functionality. Use
>> it to amend the existing model-based logic.
>>
>> Signed-off-by: Jan Beulich <jbeulich@xxxxxxxx>
>> ---
>> In xen-cpuid.c I wasn't sure whether it's better to put the 7b1 table
>> next to the 7a1 one, or whether tables should continue to be placed by
>> feature set ABI identifier.
> 
> They're in FEATURESET_* order, which is also chronological order. 
> str_7b1 wants to be after str_e21a.

I can see the ordering being necessary for decodes[], but I have a
hard time seeing why there would be any strict need for a particular
ordering model for the str_...[] objects; there it would seem
slightly more natural to me to have adjacent registers / leaves
next to each other. But since I don't care that much, I'll switch.

>> --- a/tools/misc/xen-cpuid.c
>> +++ b/tools/misc/xen-cpuid.c
>> @@ -156,7 +156,7 @@ static const char *const str_e8b[32] =
>>      [18] = "ibrs-fast",        [19] = "ibrs-same-mode",
>>  
>>      [20] = "no-lmsl",
>> -    /* [22] */                 [23] = "ppin",
>> +    /* [22] */                 [23] = "amd-ppin",
> 
> We don't retrofit names like this.  If we did, loads of the speculation
> bits would need to change.
> 
> The Intel vs AMD split is clear from the leaf index, and the only reason
> we have the distinction is to fit the two bits into the same namespace.

In which case are you also asking to make the new leave simply say
"ppin"?

> Please leave this as was, to match its name in the source code.

By match you mean what? Hardly

XEN_CPUFEATURE(AMD_PPIN,      8*32+23) /*   Protected Processor Inventory 
Number */

?

>> --- a/xen/arch/x86/cpu/mcheck/mce_intel.c
>> +++ b/xen/arch/x86/cpu/mcheck/mce_intel.c
>> @@ -865,6 +865,13 @@ static void intel_init_ppin(const struct
>>      {
>>          uint64_t val;
>>  
>> +    default:
> 
> Considering the comment above this switch statement, which you haven't
> edited at all, this wants a note saying that a CPUID bit was added in
> Sapphire Rapids, but older CPUs still require model-specific enumeration.

Oh, yes, I should have paid attention to that comment. Will edit.

Jan




 


Rackspace

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