From: Lei Wang <lei4.wang@intel.com>
To: pbonzini@redhat.com
Cc: qemu-devel@nongnu.org, imammedo@redhat.com, dgilbert@redhat.com,
berrange@redhat.com, xiaoyao.li@intel.com,
yang.zhong@linux.intel.com, lei4.wang@intel.com
Subject: [PATCH v3 1/6] i386: Introduce FeatureWordInfo for AMX CPUID leaf 0x1D and 0x1E
Date: Fri, 6 Jan 2023 00:38:21 -0800 [thread overview]
Message-ID: <20230106083826.5384-2-lei4.wang@intel.com> (raw)
In-Reply-To: <20230106083826.5384-1-lei4.wang@intel.com>
CPUID leaf 0x1D and 0x1E enumerate tile and TMUL information for AMX.
Introduce FeatureWord FEAT_1D_1_EAX, FEAT_1D_1_EBX, FEAT_1D_1_ECX and
FEAT_1E_0_EBX. Thus these features of AMX can be expanded when
"-cpu host/max" and can be configured in named CPU model.
Signed-off-by: Lei Wang <lei4.wang@intel.com>
---
target/i386/cpu.c | 55 +++++++++++++++++++++++++++++++++++++++++++++++
target/i386/cpu.h | 12 +++++++++++
2 files changed, 67 insertions(+)
diff --git a/target/i386/cpu.c b/target/i386/cpu.c
index 3410e5e470..b6d1247e5e 100644
--- a/target/i386/cpu.c
+++ b/target/i386/cpu.c
@@ -1002,6 +1002,45 @@ FeatureWordInfo feature_word_info[FEATURE_WORDS] = {
},
.tcg_features = ~0U,
},
+ [FEAT_1D_1_EAX] = {
+ .type = CPUID_FEATURE_WORD,
+ .cpuid = {
+ .eax = 0x1D,
+ .needs_ecx = true, .ecx = 1,
+ .reg = R_EAX,
+ },
+ .migratable_flags = CPUID_AMX_PALETTE_1_TOTAL_TILE_BYTES_MASK |
+ CPUID_AMX_PALETTE_1_BYTES_PER_TILE_MASK,
+ },
+ [FEAT_1D_1_EBX] = {
+ .type = CPUID_FEATURE_WORD,
+ .cpuid = {
+ .eax = 0x1D,
+ .needs_ecx = true, .ecx = 1,
+ .reg = R_EBX,
+ },
+ .migratable_flags = CPUID_AMX_PALETTE_1_BYTES_PER_ROW_MASK |
+ CPUID_AMX_PALETTE_1_MAX_NAMES_MASK,
+ },
+ [FEAT_1D_1_ECX] = {
+ .type = CPUID_FEATURE_WORD,
+ .cpuid = {
+ .eax = 0x1D,
+ .needs_ecx = true, .ecx = 1,
+ .reg = R_ECX,
+ },
+ .migratable_flags = CPUID_AMX_PALETTE_1_MAX_ROWS_MASK,
+ },
+ [FEAT_1E_0_EBX] = {
+ .type = CPUID_FEATURE_WORD,
+ .cpuid = {
+ .eax = 0x1E,
+ .needs_ecx = true, .ecx = 0,
+ .reg = R_EBX,
+ },
+ .migratable_flags = CPUID_AMX_TMUL_MAX_K_MASK |
+ CPUID_AMX_TMUL_MAX_N_MASK,
+ },
/*Below are MSR exposed features*/
[FEAT_ARCH_CAPABILITIES] = {
.type = MSR_FEATURE_WORD,
@@ -1371,6 +1410,22 @@ static FeatureDep feature_dependencies[] = {
.from = { FEAT_7_0_EBX, CPUID_7_0_EBX_INTEL_PT },
.to = { FEAT_14_0_ECX, ~0ull },
},
+ {
+ .from = { FEAT_7_0_EDX, CPUID_7_0_EDX_AMX_TILE },
+ .to = { FEAT_1D_1_EAX, ~0ull },
+ },
+ {
+ .from = { FEAT_7_0_EDX, CPUID_7_0_EDX_AMX_TILE },
+ .to = { FEAT_1D_1_EBX, ~0ull },
+ },
+ {
+ .from = { FEAT_7_0_EDX, CPUID_7_0_EDX_AMX_TILE },
+ .to = { FEAT_1D_1_ECX, ~0ull },
+ },
+ {
+ .from = { FEAT_7_0_EDX, CPUID_7_0_EDX_AMX_TILE },
+ .to = { FEAT_1E_0_EBX, ~0ull },
+ },
{
.from = { FEAT_8000_0001_EDX, CPUID_EXT2_RDTSCP },
.to = { FEAT_VMX_SECONDARY_CTLS, VMX_SECONDARY_EXEC_RDTSCP },
diff --git a/target/i386/cpu.h b/target/i386/cpu.h
index d4bc19577a..3e3e0cfe59 100644
--- a/target/i386/cpu.h
+++ b/target/i386/cpu.h
@@ -585,6 +585,14 @@ typedef enum X86Seg {
XSTATE_Hi16_ZMM_MASK | XSTATE_PKRU_MASK | \
XSTATE_XTILE_CFG_MASK | XSTATE_XTILE_DATA_MASK)
+#define CPUID_AMX_PALETTE_1_TOTAL_TILE_BYTES_MASK 0xffffU
+#define CPUID_AMX_PALETTE_1_BYTES_PER_TILE_MASK (0xffffU << 16)
+#define CPUID_AMX_PALETTE_1_BYTES_PER_ROW_MASK 0xffffU
+#define CPUID_AMX_PALETTE_1_MAX_NAMES_MASK (0xffffU << 16)
+#define CPUID_AMX_PALETTE_1_MAX_ROWS_MASK 0xffffU
+#define CPUID_AMX_TMUL_MAX_K_MASK 0xffU
+#define CPUID_AMX_TMUL_MAX_N_MASK (0xffffU << 8)
+
/* CPUID feature words */
typedef enum FeatureWord {
FEAT_1_EDX, /* CPUID[1].EDX */
@@ -605,6 +613,10 @@ typedef enum FeatureWord {
FEAT_6_EAX, /* CPUID[6].EAX */
FEAT_XSAVE_XCR0_LO, /* CPUID[EAX=0xd,ECX=0].EAX */
FEAT_XSAVE_XCR0_HI, /* CPUID[EAX=0xd,ECX=0].EDX */
+ FEAT_1D_1_EAX, /* CPUID[EAX=0x1d,ECX=1].EAX */
+ FEAT_1D_1_EBX, /* CPUID[EAX=0x1d,ECX=1].EBX */
+ FEAT_1D_1_ECX, /* CPUID[EAX=0x1d,ECX=1].ECX */
+ FEAT_1E_0_EBX, /* CPUID[EAX=0x1e,ECX=0].EBX */
FEAT_ARCH_CAPABILITIES,
FEAT_CORE_CAPABILITY,
FEAT_PERF_CAPABILITIES,
--
2.34.1
next prev parent reply other threads:[~2023-01-06 8:40 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-01-06 8:38 [PATCH v3 0/6] Support for new CPU model SapphireRapids Lei Wang
2023-01-06 8:38 ` Lei Wang [this message]
2023-02-06 7:45 ` [PATCH v3 1/6] i386: Introduce FeatureWordInfo for AMX CPUID leaf 0x1D and 0x1E Yuan Yao
2023-01-06 8:38 ` [PATCH v3 2/6] i386: Remove unused parameter "uint32_t bit" in feature_word_description() Lei Wang
2023-01-27 13:29 ` Igor Mammedov
2023-02-08 14:33 ` Xiaoyao Li
2023-01-06 8:38 ` [PATCH v3 3/6] i386: Introduce new struct "MultiBitFeatureInfo" for multi-bit features Lei Wang
2023-02-08 14:39 ` Xiaoyao Li
2023-01-06 8:38 ` [PATCH v3 4/6] i386: Mask and report unavailable multi-bit feature values Lei Wang
2023-02-06 7:43 ` Yuan Yao
2023-02-09 1:04 ` Wang, Lei
2023-02-09 3:29 ` Xiaoyao Li
2023-02-09 4:21 ` Wang, Lei
2023-02-09 5:59 ` Xiaoyao Li
2023-02-09 6:15 ` Wang, Lei
2023-02-09 9:26 ` Xiaoyao Li
2023-01-06 8:38 ` [PATCH v3 5/6] i386: Initialize AMX CPUID leaves with corresponding env->features[] leaves Lei Wang
2023-01-06 8:38 ` [PATCH v3 6/6] i386: Add new CPU model SapphireRapids Lei Wang
2023-02-02 10:40 ` Igor Mammedov
2023-02-03 6:02 ` Wang, Lei
2023-02-02 11:05 ` [PATCH v3 0/6] Support for " Igor Mammedov
2023-02-07 2:50 ` Wang, Lei
2023-03-06 12:49 ` Igor Mammedov
2023-02-08 14:53 ` Xiaoyao Li
2023-03-02 14:49 ` Robert Hoo
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20230106083826.5384-2-lei4.wang@intel.com \
--to=lei4.wang@intel.com \
--cc=berrange@redhat.com \
--cc=dgilbert@redhat.com \
--cc=imammedo@redhat.com \
--cc=pbonzini@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=xiaoyao.li@intel.com \
--cc=yang.zhong@linux.intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).