[PATCH] cpu_map: Add cpu feature amx

Lin Yang posted 1 patch 1 year, 7 months ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/libvirt tags/patchew/20220913193031.13543-1-lin.a.yang@intel.com
src/cpu_map/sync_qemu_i386.py | 3 +++
src/cpu_map/x86_features.xml  | 9 +++++++++
2 files changed, 12 insertions(+)
[PATCH] cpu_map: Add cpu feature amx
Posted by Lin Yang 1 year, 7 months ago
AMX was introduced in QEMU commit 1f16764f7d4515bfd5e4ae0aae814fa280a7d0c8
and following commits.
---
 src/cpu_map/sync_qemu_i386.py | 3 +++
 src/cpu_map/x86_features.xml  | 9 +++++++++
 2 files changed, 12 insertions(+)

diff --git a/src/cpu_map/sync_qemu_i386.py b/src/cpu_map/sync_qemu_i386.py
index 4dd9f3b84d..6a46f87cff 100755
--- a/src/cpu_map/sync_qemu_i386.py
+++ b/src/cpu_map/sync_qemu_i386.py
@@ -72,6 +72,9 @@ def translate_feature(name):
         "CPUID_7_0_EDX_SPEC_CTRL": "spec-ctrl",
         "CPUID_7_0_EDX_SPEC_CTRL_SSBD": "ssbd",
         "CPUID_7_0_EDX_STIBP": "stibp",
+        "CPUID_7_0_EDX_AMX_BF16": "amx-bf16",
+        "CPUID_7_0_EDX_AMX_TILE": "amx-tile",
+        "CPUID_7_0_EDX_AMX_INT8": "amx-int8",
         "CPUID_7_1_EAX_AVX512_BF16": "avx512-bf16",
         "CPUID_7_1_EAX_AVX_VNNI": "avx-vnni",
         "CPUID_8000_0008_EBX_AMD_SSBD": "amd-ssbd",
diff --git a/src/cpu_map/x86_features.xml b/src/cpu_map/x86_features.xml
index 4cf3ff0804..102d39f626 100644
--- a/src/cpu_map/x86_features.xml
+++ b/src/cpu_map/x86_features.xml
@@ -347,6 +347,15 @@
   <feature name='pconfig'>
     <cpuid eax_in='0x07' ecx_in='0x00' edx='0x00040000'/>
   </feature>
+  <feature name='amx-bf16'>
+    <cpuid eax_in='0x07' ecx_in='0x00' edx='0x00400000'/>
+  </feature>
+  <feature name='amx-tile'>
+    <cpuid eax_in='0x07' ecx_in='0x00' edx='0x01000000'/>
+  </feature>
+  <feature name='amx-int8'>
+    <cpuid eax_in='0x07' ecx_in='0x00' edx='0x02000000'/>
+  </feature>
   <feature name='spec-ctrl'>
     <cpuid eax_in='0x07' ecx_in='0x00' edx='0x04000000'/>
   </feature>
-- 
2.34.1
Re: [PATCH] cpu_map: Add cpu feature amx
Posted by Martin Kletzander 1 year, 7 months ago
On Tue, Sep 13, 2022 at 12:30:31PM -0700, Lin Yang wrote:
>AMX was introduced in QEMU commit 1f16764f7d4515bfd5e4ae0aae814fa280a7d0c8
>and following commits.

Some of them not pushed yet I believe:

https://lists.gnu.org/archive/html/qemu-devel/2022-08/msg01936.html

Otherwise the patch looks good (I'm not sure what's the planned usage of
the python script, but this patch just adds features that'd be missing
in the future, so I think it's fine).

Reviewed-by: Martin Kletzander <mkletzan@redhat.com>

>---
> src/cpu_map/sync_qemu_i386.py | 3 +++
> src/cpu_map/x86_features.xml  | 9 +++++++++
> 2 files changed, 12 insertions(+)
>
>diff --git a/src/cpu_map/sync_qemu_i386.py b/src/cpu_map/sync_qemu_i386.py
>index 4dd9f3b84d..6a46f87cff 100755
>--- a/src/cpu_map/sync_qemu_i386.py
>+++ b/src/cpu_map/sync_qemu_i386.py
>@@ -72,6 +72,9 @@ def translate_feature(name):
>         "CPUID_7_0_EDX_SPEC_CTRL": "spec-ctrl",
>         "CPUID_7_0_EDX_SPEC_CTRL_SSBD": "ssbd",
>         "CPUID_7_0_EDX_STIBP": "stibp",
>+        "CPUID_7_0_EDX_AMX_BF16": "amx-bf16",
>+        "CPUID_7_0_EDX_AMX_TILE": "amx-tile",
>+        "CPUID_7_0_EDX_AMX_INT8": "amx-int8",
>         "CPUID_7_1_EAX_AVX512_BF16": "avx512-bf16",
>         "CPUID_7_1_EAX_AVX_VNNI": "avx-vnni",
>         "CPUID_8000_0008_EBX_AMD_SSBD": "amd-ssbd",
>diff --git a/src/cpu_map/x86_features.xml b/src/cpu_map/x86_features.xml
>index 4cf3ff0804..102d39f626 100644
>--- a/src/cpu_map/x86_features.xml
>+++ b/src/cpu_map/x86_features.xml
>@@ -347,6 +347,15 @@
>   <feature name='pconfig'>
>     <cpuid eax_in='0x07' ecx_in='0x00' edx='0x00040000'/>
>   </feature>
>+  <feature name='amx-bf16'>
>+    <cpuid eax_in='0x07' ecx_in='0x00' edx='0x00400000'/>
>+  </feature>
>+  <feature name='amx-tile'>
>+    <cpuid eax_in='0x07' ecx_in='0x00' edx='0x01000000'/>
>+  </feature>
>+  <feature name='amx-int8'>
>+    <cpuid eax_in='0x07' ecx_in='0x00' edx='0x02000000'/>
>+  </feature>
>   <feature name='spec-ctrl'>
>     <cpuid eax_in='0x07' ecx_in='0x00' edx='0x04000000'/>
>   </feature>
>-- 
>2.34.1
>
Re: [PATCH] cpu_map: Add cpu feature amx
Posted by Martin Kletzander 1 year, 6 months ago
On Thu, Sep 22, 2022 at 04:35:51PM +0200, Martin Kletzander wrote:
>On Tue, Sep 13, 2022 at 12:30:31PM -0700, Lin Yang wrote:
>>AMX was introduced in QEMU commit 1f16764f7d4515bfd5e4ae0aae814fa280a7d0c8
>>and following commits.
>
>Some of them not pushed yet I believe:
>
>https://lists.gnu.org/archive/html/qemu-devel/2022-08/msg01936.html
>
>Otherwise the patch looks good (I'm not sure what's the planned usage of
>the python script, but this patch just adds features that'd be missing
>in the future, so I think it's fine).
>
>Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
>

I still can't see the other commits in QEMU mentioning the other
features, but I can't see how those missing could cause an issue, so in
the end I removed the "and following commits".

We also require a Signed-off-by for contributions as written in our
contribution guidelines:

https://libvirt.org/hacking.html

If you say I can add one for you with the current e-mail address there's
no need to resend this patch and I can add it before pushing.

Thanks for the patch.
Re: [PATCH] cpu_map: Add cpu feature amx
Posted by Yang, Lin A 1 year, 6 months ago
On Thu, Sep 22, 2022 at 04:35:51PM +0200, Martin Kletzander wrote:
> >On Tue, Sep 13, 2022 at 12:30:31PM -0700, Lin Yang wrote:
> >>AMX was introduced in QEMU commit 1f16764f7d4515bfd5e4ae0aae814fa280a7d0c8
> >>and following commits.
> >
> >Some of them not pushed yet I believe:
> >
> >https://lists.gnu.org/archive/html/qemu-devel/2022-08/msg01936.html
> >
> >Otherwise the patch looks good (I'm not sure what's the planned usage of
> >the python script, but this patch just adds features that'd be missing
> >in the future, so I think it's fine).
> >
> >Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
> >
>
> I still can't see the other commits in QEMU mentioning the other
> features, but I can't see how those missing could cause an issue, so in
> the end I removed the "and following commits".
>
> We also require a Signed-off-by for contributions as written in our
> contribution guidelines:
>
> https://libvirt.org/hacking.html
>
> If you say I can add one for you with the current e-mail address there's
> no need to resend this patch and I can add it before pushing.
>
> Thanks for the patch.

Totally okay to me. Please sign with “Lin Yang <lin.a.yang@intel.com>".
Thank you so much for reviewing this patch.

Thanks,
Lin.
Re: [PATCH] cpu_map: Add cpu feature amx
Posted by Martin Kletzander 1 year, 6 months ago
On Fri, Nov 04, 2022 at 05:11:10AM +0000, Yang, Lin A wrote:
>On Thu, Sep 22, 2022 at 04:35:51PM +0200, Martin Kletzander wrote:
>> >On Tue, Sep 13, 2022 at 12:30:31PM -0700, Lin Yang wrote:
>> >>AMX was introduced in QEMU commit 1f16764f7d4515bfd5e4ae0aae814fa280a7d0c8
>> >>and following commits.
>> >
>> >Some of them not pushed yet I believe:
>> >
>> >https://lists.gnu.org/archive/html/qemu-devel/2022-08/msg01936.html
>> >
>> >Otherwise the patch looks good (I'm not sure what's the planned usage of
>> >the python script, but this patch just adds features that'd be missing
>> >in the future, so I think it's fine).
>> >
>> >Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
>> >
>>
>> I still can't see the other commits in QEMU mentioning the other
>> features, but I can't see how those missing could cause an issue, so in
>> the end I removed the "and following commits".
>>
>> We also require a Signed-off-by for contributions as written in our
>> contribution guidelines:
>>
>> https://libvirt.org/hacking.html
>>
>> If you say I can add one for you with the current e-mail address there's
>> no need to resend this patch and I can add it before pushing.
>>
>> Thanks for the patch.
>
>Totally okay to me. Please sign with “Lin Yang <lin.a.yang@intel.com>".
>Thank you so much for reviewing this patch.
>

Thanks, pushed.

>Thanks,
>Lin.