Skip to contentSkip to conversation

modify CPU model info

PATCH Applied Chenyi Qiang 2 participants 5 messages Jul 14, 2020 – Jul 16, 2020

lore
Share & tools
lore
#0 lore raw

v6 cover modify CPU model info

Add the missing VMX features in Skylake-Server, Cascadelake-Server and Icelake-Server CPU models. In Icelake-Server CPU model, it lacks sha_ni, avx512ifma, rdpid and fsrm. The model number of Icelake-Server also needs to be fixed.

To apply this patchset, a bug related to env->user_features need to be fixed first. The patch is available at
https://lists.gnu.org/archive/html/qemu-devel/2020-07/msg04399.html

Changes in v6:
-integrate all the missing features(patch 1/4, 3/4, 4/4 in
previous version) into the same version of CPU model

Changes in v5:
- exclude Icelake-Client CPU model deprecation API from this series. Robert is working on it available at https://patchwork.kernel.org/patch/11599155/

Changes in v4:
- remove the Icelake-Client CPU model

Changes in v3:
- change the missing features of Icelake-Server from v3 to v4

Changes in v2:
- add missing features as a new version of CPU model
- add the support of FSRM
- add New CPUID of FSRM and RDPID in Icelake-Server CPU model

Chenyi Qiang (3):
target/i386: add fast short REP MOV support target/i386: fix model number and add missing features for
Icelake-Server CPU model
target/i386: add the missing vmx features for Skylake-Server and
Cascadelake-Server CPU models

 target/i386/cpu.c | 30 +++++++++++++++++++++++++++++-
 target/i386/cpu.h |  2 ++
 2 files changed, 31 insertions(+), 1 deletion(-)
Signature · 1 line
2.17.1
#1 lore raw

PATCH v6 1/3 target/i386: add fast short REP MOV support

For CPUs support fast short REP MOV[CPUID.(EAX=7,ECX=0):EDX(bit4)], e.g Icelake and Tigerlake, expose it to the guest VM.

---
 target/i386/cpu.c | 2 +-
 target/i386/cpu.h | 2 ++
 2 files changed, 3 insertions(+), 1 deletion(-)
target/i386/cpu.c +1 -1
index 1e5123251d..55e063babe 100644
@@ -984,7 +984,7 @@ static FeatureWordInfo feature_word_info[FEATURE_WORDS] = {
         .type = CPUID_FEATURE_WORD,
         .feat_names = {
             NULL, NULL, "avx512-4vnniw", "avx512-4fmaps",
-            NULL, NULL, NULL, NULL,
+            "fsrm", NULL, NULL, NULL,
             "avx512-vp2intersect", NULL, "md-clear", NULL,
             NULL, NULL, "serialize", NULL,
             "tsx-ldtrk", NULL, NULL /* pconfig */, NULL,
target/i386/cpu.h +2 -0
index 37fffa5cac..e1a5c174dc 100644
@@ -775,6 +775,8 @@ typedef uint64_t FeatureWordArray[FEATURE_WORDS];
 #define CPUID_7_0_EDX_AVX512_4VNNIW     (1U << 2)
 /* AVX512 Multiply Accumulation Single Precision */
 #define CPUID_7_0_EDX_AVX512_4FMAPS     (1U << 3)
+/* Fast Short Rep Mov */
+#define CPUID_7_0_EDX_FSRM              (1U << 4)
 /* AVX512 Vector Pair Intersection to a Pair of Mask Registers */
 #define CPUID_7_0_EDX_AVX512_VP2INTERSECT (1U << 8)
 /* SERIALIZE instruction */
Signature · 1 line
2.17.1
#2 lore raw

PATCH v6 2/3 target/i386: fix model number and add missing features for Icelake-Server CPU model

In reply to Chenyi Qiang

Add the missing features(sha_ni, avx512ifma, rdpid, fsrm, vmx-rdseed-exit, vmx-pml, vmx-eptp-switching) and change the model number to 106 in the Icelake-Server-v4 CPU model.

---
 target/i386/cpu.c | 14 ++++++++++++++
 1 file changed, 14 insertions(+)
target/i386/cpu.c +14 -0
index 55e063babe..6afc59d8ff 100644
@@ -3512,6 +3512,20 @@ static X86CPUDefinition builtin_x86_defs[] = {
                     { /* end of list */ }
                 },
             },
+            {
+                .version = 4,
+                .props = (PropValue[]) {
+                    { "sha-ni", "on" },
+                    { "avx512ifma", "on" },
+                    { "rdpid", "on" },
+                    { "fsrm", "on" },
+                    { "vmx-rdseed-exit", "on" },
+                    { "vmx-pml", "on" },
+                    { "vmx-eptp-switching", "on" },
+                    { "model", "106" },
+                    { /* end of list */ }
+                },
+            },
             { /* end of list */ }
         }
     },
Signature · 1 line
2.17.1
#3 lore raw

PATCH v6 3/3 target/i386: add the missing vmx features for Skylake-Server and Cascadelake-Server CPU models

In reply to Chenyi Qiang

Add the missing vmx features in Skylake-Server and Cascadelake-Server CPU models based on the output of Paolo's script.

---
 target/i386/cpu.c | 14 ++++++++++++++
 1 file changed, 14 insertions(+)
target/i386/cpu.c +14 -0
index 6afc59d8ff..1dca1713bd 100644
@@ -3034,6 +3034,13 @@ static X86CPUDefinition builtin_x86_defs[] = {
                     { /* end of list */ }
                 }
             },
+            {
+                .version = 4,
+                .props = (PropValue[]) {
+                    { "vmx-eptp-switching", "on" },
+                    { /* end of list */ }
+                }
+            },
             { /* end of list */ }
         }
     },
@@ -3158,6 +3165,13 @@ static X86CPUDefinition builtin_x86_defs[] = {
                   { /* end of list */ }
               },
             },
+            { .version = 4,
+              .note = "ARCH_CAPABILITIES, no TSX",
+              .props = (PropValue[]) {
+                  { "vmx-eptp-switching", "on" },
+                  { /* end of list */ }
+              },
+            },
             { /* end of list */ }
         }
     },
Signature · 1 line
2.17.1
#4 lore raw
In reply to Chenyi Qiang
Quoted 9 lines · Chenyi Qiang

Add the missing VMX features in Skylake-Server, Cascadelake-Server and Icelake-Server CPU models. In Icelake-Server CPU model, it lacks sha_ni, avx512ifma, rdpid and fsrm. The model number of Icelake-Server also needs to be fixed.

To apply this patchset, a bug related to env->user_features need to be fixed first. The patch is available at
https://lists.gnu.org/archive/html/qemu-devel/2020-07/msg04399.html

Queued for 5.1, thanks!

Signature · 1 line
Eduardo