[PATCH] x86/decode: Decode remaining TigerLake features

Andrew Cooper posted 1 patch 2 years, 2 months ago
Test gitlab-ci failed
Patches applied successfully (tree, apply log)
git fetch https://gitlab.com/xen-project/patchew/xen tags/patchew/20220126184758.15902-1-andrew.cooper3@citrix.com
tools/libs/light/libxl_cpuid.c | 2 ++
tools/misc/xen-cpuid.c         | 4 ++--
2 files changed, 4 insertions(+), 2 deletions(-)
[PATCH] x86/decode: Decode remaining TigerLake features
Posted by Andrew Cooper 2 years, 2 months ago
These are the two remaining TGL features which xen-cpuid doesn't know yet.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
CC: Jan Beulich <JBeulich@suse.com>
CC: Roger Pau Monné <roger.pau@citrix.com>
CC: Wei Liu <wl@xen.org>
---
 tools/libs/light/libxl_cpuid.c | 2 ++
 tools/misc/xen-cpuid.c         | 4 ++--
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/tools/libs/light/libxl_cpuid.c b/tools/libs/light/libxl_cpuid.c
index e1acf6648db4..28c2fa6a0350 100644
--- a/tools/libs/light/libxl_cpuid.c
+++ b/tools/libs/light/libxl_cpuid.c
@@ -208,8 +208,10 @@ int libxl_cpuid_parse_config(libxl_cpuid_policy_list *cpuid, const char* str)
         {"vpclmulqdq",   0x00000007,  0, CPUID_REG_ECX, 10,  1},
         {"avx512-vnni",  0x00000007,  0, CPUID_REG_ECX, 11,  1},
         {"avx512-bitalg",0x00000007,  0, CPUID_REG_ECX, 12,  1},
+        {"tme",          0x00000007,  0, CPUID_REG_ECX, 13,  1},
         {"avx512-vpopcntdq",0x00000007,0,CPUID_REG_ECX, 14,  1},
         {"rdpid",        0x00000007,  0, CPUID_REG_ECX, 22,  1},
+        {"keylocker",    0x00000007,  0, CPUID_REG_ECX, 23,  1},
         {"cldemote",     0x00000007,  0, CPUID_REG_ECX, 25,  1},
 
         {"avx512-4vnniw",0x00000007,  0, CPUID_REG_EDX,  2,  1},
diff --git a/tools/misc/xen-cpuid.c b/tools/misc/xen-cpuid.c
index a3003245f12a..28842f56fcb2 100644
--- a/tools/misc/xen-cpuid.c
+++ b/tools/misc/xen-cpuid.c
@@ -127,10 +127,10 @@ static const char *const str_7c0[32] =
     [ 6] = "avx512-vbmi2",     [ 7] = "cet-ss",
     [ 8] = "gfni",             [ 9] = "vaes",
     [10] = "vpclmulqdq",       [11] = "avx512-vnni",
-    [12] = "avx512-bitalg",
+    [12] = "avx512-bitalg",    [13] = "tme",
     [14] = "avx512-vpopcntdq",
 
-    [22] = "rdpid",
+    [22] = "rdpid",            [23] = "keylocker",
     /* 24 */                   [25] = "cldemote",
     /* 26 */                   [27] = "movdiri",
     [28] = "movdir64b",        [29] = "enqcmd",
-- 
2.11.0


Re: [PATCH] x86/decode: Decode remaining TigerLake features
Posted by Jan Beulich 2 years, 2 months ago
On 26.01.2022 19:47, Andrew Cooper wrote:
> These are the two remaining TGL features which xen-cpuid doesn't know yet.

Well, for KeyLocker that's only part of the truth. The KeyLocker
leaf has further (sub-)features.

> --- a/tools/libs/light/libxl_cpuid.c
> +++ b/tools/libs/light/libxl_cpuid.c
> @@ -208,8 +208,10 @@ int libxl_cpuid_parse_config(libxl_cpuid_policy_list *cpuid, const char* str)
>          {"vpclmulqdq",   0x00000007,  0, CPUID_REG_ECX, 10,  1},
>          {"avx512-vnni",  0x00000007,  0, CPUID_REG_ECX, 11,  1},
>          {"avx512-bitalg",0x00000007,  0, CPUID_REG_ECX, 12,  1},
> +        {"tme",          0x00000007,  0, CPUID_REG_ECX, 13,  1},
>          {"avx512-vpopcntdq",0x00000007,0,CPUID_REG_ECX, 14,  1},
>          {"rdpid",        0x00000007,  0, CPUID_REG_ECX, 22,  1},
> +        {"keylocker",    0x00000007,  0, CPUID_REG_ECX, 23,  1},
>          {"cldemote",     0x00000007,  0, CPUID_REG_ECX, 25,  1},

In my KeyLocker series I name this just "kl", matching how the spec
refers to it. But first of all - this is unrelated to xen-cpuid and
not very useful to have without the settings actually being possible
to use sensibly.

> --- a/tools/misc/xen-cpuid.c
> +++ b/tools/misc/xen-cpuid.c
> @@ -127,10 +127,10 @@ static const char *const str_7c0[32] =
>      [ 6] = "avx512-vbmi2",     [ 7] = "cet-ss",
>      [ 8] = "gfni",             [ 9] = "vaes",
>      [10] = "vpclmulqdq",       [11] = "avx512-vnni",
> -    [12] = "avx512-bitalg",
> +    [12] = "avx512-bitalg",    [13] = "tme",
>      [14] = "avx512-vpopcntdq",
>  
> -    [22] = "rdpid",
> +    [22] = "rdpid",            [23] = "keylocker",

Like above, matching the spec I call this just "kl" in my patch.

I can certainly post what I have, maybe at least the first of those
patches would actually make sense to take. Whether the actual
emulator changes are very useful to have right away (i.e. without
other infrastructure in place to really make use of KL) is less
clear. I didn't post them yet for this reason as well as them
sitting on top of the stalled AMX series.

Jan