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

Re: [PATCH 3/6] x86/cpu-policy: Infrastructure for MSR_ARCH_CAPS


  • To: Jan Beulich <jbeulich@xxxxxxxx>
  • From: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
  • Date: Fri, 19 May 2023 16:36:39 +0100
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=citrix.com; dmarc=pass action=none header.from=citrix.com; dkim=pass header.d=citrix.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=TtMiiOK4EZSQ52xTb4CP2P8D+baoolUYBsdhmsSZFbk=; b=cyF5qzzK5lwQXhkgbyYSCSSRWm6T0d6YOzZ6XxQvLf44+2W5A7EavHfaibIbMnpGT2oaZhRpxLPhg1xefqWR5OoZp5vfcp6kwuo8XDtl4ZLR1YskpszwRSNyvr2BEh2u4vThx4TJJs/MTGDlE3w0epZEXyW8Z1Bqbt6iYL9bfVkH5WHYTt8Jr5oVbFreR/YZIdZPzCWFFYFIl406XoCBybEZvaXKd/B4Sq7YrMmFsK8hMbOxYNUMmMY2OnInL35eyJuMjIFxpdg8AdmkTX0ZL0eIulDKA1xRwh8C9XYZJYA9CYdxTEfdua/NqOhjsgjtDU/lVu7wTNFV0B+QdC1vBA==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=LmmDhRAefJtRKCKfZxkPZeXOsi57s7lHCV5udf2DoMAePp3iX3FoHVICLKdH2HxBpCQtaDgqK2KsT/PaUwXugL371kqeilZ6fAQRfCuufshCAwgnc7ijuDd1/b/bq0cO+brmtrsy1bJaFADoLRmXXosPZuRGxcZ70F8vueE+rLqv9OARoCqOjDBysupW9XrOX6RN0sXKOaANWXjslO2tCY3aeKxs16N5SNUDyIbOvWXri0qEroNbzDTco+zf0+d4ADOvMj38k7iArBGC7PbAZcP6gbEZdPaj1wApgAjTCergU9chGuw99XScks+vmjLS82husGXFV/5+4caflNAdoA==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=citrix.com;
  • Cc: Roger Pau Monné <roger.pau@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, Xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • Delivery-date: Fri, 19 May 2023 15:37:13 +0000
  • Ironport-data: A9a23:CiY0nKvpefk0FJVgvgQGqOWo1OfnVHRfMUV32f8akzHdYApBsoF/q tZmKW2CP/+JajfxLYtwPYjg/U0BvsXSzIQxQAVqr3s0RHsR+JbJXdiXEBz9bniYRiHhoOCLz O1FM4Wdc5pkJpP4jk3wWlQ0hSAkjclkfpKlVKiffHg3HVQ+IMsYoUoLs/YjhYJ1isSODQqIu Nfjy+XSI1bg0DNvWo4uw/vrRChH4rKq4Fv0gnRkPaoQ5AKHxiFPZH4iDfrZw0XQE9E88tGSH 44v/JnhlkvF8hEkDM+Sk7qTWiXmlZaLYGBiIlIPM0STqkAqSh4ai87XB9JFAatjsB2bnsgZ9 Tl4ncfYpTHFnEH7sL91vxFwS0mSNEDdkVPNCSDXXce7lyUqf5ZwqhnH4Y5f0YAwo45K7W9yG fMwGg0DNh+Kv/OPm6u+Wu9w3dUCFvj5I9ZK0p1g5Wmx4fcOZ7nmGv+PwOACmTA6i4ZJAOrUY NcfZXx3dhPcbhZTO1ARTpUjgOOvgXq5eDpdwL6XjfNvvy6Pk0ovjv6xYbI5efTTLSlRtm+eq njL4CLSBRYCOcbE4TGE7mitlqnEmiaTtIc6TeXpqK460QDNroAVIBJRSQuHmf/gtl6Baf0HE XMmqyEJj5FnoSRHSfG4BXVUukWsvBQRRt5RGO0S8xyWx+zf5APxLncAZi5MbpohrsBebSwn0 BqFks3kARRrsaaJUjSN+7GMtzSwNCMJa2gYakc5oRAt5tDipMQ2kUjJR9M6Sqqt1IWpSHf33 iyAqzU4i/MLl8kX2q6n/FfBxTWxupzOSQ1z7QLSNo640j5EiEeeT9TAwTDmATxode51knHpU KA4pvWj
  • Ironport-hdrordr: A9a23:wYNAN6GLbELaW5GYpLqE28eALOsnbusQ8zAXPhZKOGVom62j5q WTdJZy73XJYVMqNU3I9urtBEDtexzhHP1OkOss1NWZPDUO41HYSr2KhLGKq1bd8kvFmNK1vp 0QEJSWZueQMbDU5/yKmDVRv7wbsb26GAHDv5a480tQ
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 16/05/2023 1:02 pm, Jan Beulich wrote:
> On 15.05.2023 16:42, Andrew Cooper wrote:
>> Bits through 24 are already defined, meaning that we're not far off needing
>> the second word.  Put both in right away.
>>
>> The bool bitfield names in the arch_caps union are unused, and somewhat out 
>> of
>> date.  They'll shortly be automatically generated.
>>
>> Signed-off-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
> I'm largely okay, but I'd like to raise a couple of naming / presentation
> questions:
>
>> --- a/tools/misc/xen-cpuid.c
>> +++ b/tools/misc/xen-cpuid.c
>> @@ -226,6 +226,14 @@ static const char *const str_7d2[32] =
>>      [ 4] = "bhi-ctrl",      [ 5] = "mcdt-no",
>>  };
>>  
>> +static const char *const str_10Al[32] =
>> +{
>> +};
>> +
>> +static const char *const str_10Ah[32] =
>> +{
>> +};
>> +
>>  static const struct {
>>      const char *name;
>>      const char *abbr;
>> @@ -248,6 +256,8 @@ static const struct {
>>      { "0x00000007:2.edx", "7d2", str_7d2 },
>>      { "0x00000007:1.ecx", "7c1", str_7c1 },
>>      { "0x00000007:1.edx", "7d1", str_7d1 },
>> +    { "0x0000010a.lo",   "10Al", str_10Al },
>> +    { "0x0000010a.hi",   "10Ah", str_10Ah },
> The MSR-ness can certainly be inferred from the .lo / .hi and l/h
> suffixes of the strings, but I wonder whether having it e.g. like
>
>     { "MSR0000010a.lo",   "m10Al", str_10Al },
>     { "MSR0000010a.hi",   "m10Ah", str_10Ah },
>
> or
>
>     { "MSR[010a].lo",   "m10Al", str_10Al },
>     { "MSR[010a].hi",   "m10Ah", str_10Ah },
>
> or even
>
>     { "ARCH_CAPS.lo",   "m10Al", str_10Al },
>     { "ARCH_CAPS.hi",   "m10Ah", str_10Ah },
>
> wouldn't make it more obvious.

Well, it's takes something which is consistent, and introduces
inconsistencies.

The e is logically part of the leaf number, so using m for MSRs is not
equivalent.  If you do want to prefix MSRs, you need to prefix the
non-extended leaves, and c isn't obviously CPUID when there's the
Centaur range at 0xC000xxxx

Nor can you reasonably have MSR[...] in the long names without
CPUID[...] too, and that's taking some pretty long lines and making them
even longer.

>  For the two str_*, see below.
>
>> --- a/xen/include/public/arch-x86/cpufeatureset.h
>> +++ b/xen/include/public/arch-x86/cpufeatureset.h
>> @@ -307,6 +307,10 @@ XEN_CPUFEATURE(AVX_VNNI_INT8,      15*32+ 4) /*A  
>> AVX-VNNI-INT8 Instructions */
>>  XEN_CPUFEATURE(AVX_NE_CONVERT,     15*32+ 5) /*A  AVX-NE-CONVERT 
>> Instructions */
>>  XEN_CPUFEATURE(CET_SSS,            15*32+18) /*   CET Supervisor Shadow 
>> Stacks safe to use */
>>  
>> +/* Intel-defined CPU features, MSR_ARCH_CAPS 0x10a.eax, word 16 */
>> +
>> +/* Intel-defined CPU features, MSR_ARCH_CAPS 0x10a.edx, word 17 */
> Right here I'd be inclined to omit the MSR index; the name ought to
> be sufficient.

It doesn't hurt to have it, and it it might be helpful for people who
don't know the indices off by heart.

~Andrew



 


Rackspace

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