qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v6 0/3] modify CPU model info
@ 2020-07-14  8:41 Chenyi Qiang
  2020-07-14  8:41 ` [PATCH v6 1/3] target/i386: add fast short REP MOV support Chenyi Qiang
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Chenyi Qiang @ 2020-07-14  8:41 UTC (permalink / raw)
  To: Paolo Bonzini, Richard Henderson, Eduardo Habkost
  Cc: Xiaoyao Li, qemu-devel, Robert Hoo

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(-)

-- 
2.17.1



^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH v6 1/3] target/i386: add fast short REP MOV support
  2020-07-14  8:41 [PATCH v6 0/3] modify CPU model info Chenyi Qiang
@ 2020-07-14  8:41 ` Chenyi Qiang
  2020-07-14  8:41 ` [PATCH v6 2/3] target/i386: fix model number and add missing features for Icelake-Server CPU model Chenyi Qiang
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: Chenyi Qiang @ 2020-07-14  8:41 UTC (permalink / raw)
  To: Paolo Bonzini, Richard Henderson, Eduardo Habkost
  Cc: Xiaoyao Li, qemu-devel, Robert Hoo

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.

Reviewed-by: Eduardo Habkost <ehabkost@redhat.com>
Signed-off-by: Chenyi Qiang <chenyi.qiang@intel.com>
---
 target/i386/cpu.c | 2 +-
 target/i386/cpu.h | 2 ++
 2 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/target/i386/cpu.c b/target/i386/cpu.c
index 1e5123251d..55e063babe 100644
--- a/target/i386/cpu.c
+++ b/target/i386/cpu.c
@@ -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,
diff --git a/target/i386/cpu.h b/target/i386/cpu.h
index 37fffa5cac..e1a5c174dc 100644
--- a/target/i386/cpu.h
+++ b/target/i386/cpu.h
@@ -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 */
-- 
2.17.1



^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH v6 2/3] target/i386: fix model number and add missing features for Icelake-Server CPU model
  2020-07-14  8:41 [PATCH v6 0/3] modify CPU model info Chenyi Qiang
  2020-07-14  8:41 ` [PATCH v6 1/3] target/i386: add fast short REP MOV support Chenyi Qiang
@ 2020-07-14  8:41 ` Chenyi Qiang
  2020-07-14  8:41 ` [PATCH v6 3/3] target/i386: add the missing vmx features for Skylake-Server and Cascadelake-Server CPU models Chenyi Qiang
  2020-07-16 15:06 ` [PATCH v6 0/3] modify CPU model info Eduardo Habkost
  3 siblings, 0 replies; 5+ messages in thread
From: Chenyi Qiang @ 2020-07-14  8:41 UTC (permalink / raw)
  To: Paolo Bonzini, Richard Henderson, Eduardo Habkost
  Cc: Xiaoyao Li, qemu-devel, Robert Hoo

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.

Signed-off-by: Chenyi Qiang <chenyi.qiang@intel.com>
---
 target/i386/cpu.c | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/target/i386/cpu.c b/target/i386/cpu.c
index 55e063babe..6afc59d8ff 100644
--- a/target/i386/cpu.c
+++ b/target/i386/cpu.c
@@ -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 */ }
         }
     },
-- 
2.17.1



^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH v6 3/3] target/i386: add the missing vmx features for Skylake-Server and Cascadelake-Server CPU models
  2020-07-14  8:41 [PATCH v6 0/3] modify CPU model info Chenyi Qiang
  2020-07-14  8:41 ` [PATCH v6 1/3] target/i386: add fast short REP MOV support Chenyi Qiang
  2020-07-14  8:41 ` [PATCH v6 2/3] target/i386: fix model number and add missing features for Icelake-Server CPU model Chenyi Qiang
@ 2020-07-14  8:41 ` Chenyi Qiang
  2020-07-16 15:06 ` [PATCH v6 0/3] modify CPU model info Eduardo Habkost
  3 siblings, 0 replies; 5+ messages in thread
From: Chenyi Qiang @ 2020-07-14  8:41 UTC (permalink / raw)
  To: Paolo Bonzini, Richard Henderson, Eduardo Habkost
  Cc: Xiaoyao Li, qemu-devel, Robert Hoo

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

Signed-off-by: Chenyi Qiang <chenyi.qiang@intel.com>
---
 target/i386/cpu.c | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/target/i386/cpu.c b/target/i386/cpu.c
index 6afc59d8ff..1dca1713bd 100644
--- a/target/i386/cpu.c
+++ b/target/i386/cpu.c
@@ -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 */ }
         }
     },
-- 
2.17.1



^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH v6 0/3] modify CPU model info
  2020-07-14  8:41 [PATCH v6 0/3] modify CPU model info Chenyi Qiang
                   ` (2 preceding siblings ...)
  2020-07-14  8:41 ` [PATCH v6 3/3] target/i386: add the missing vmx features for Skylake-Server and Cascadelake-Server CPU models Chenyi Qiang
@ 2020-07-16 15:06 ` Eduardo Habkost
  3 siblings, 0 replies; 5+ messages in thread
From: Eduardo Habkost @ 2020-07-16 15:06 UTC (permalink / raw)
  To: Chenyi Qiang
  Cc: Paolo Bonzini, Robert Hoo, Xiaoyao Li, qemu-devel, Richard Henderson

On Tue, Jul 14, 2020 at 04:41:45PM +0800, Chenyi Qiang wrote:
> 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!

-- 
Eduardo



^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2020-07-16 15:08 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-07-14  8:41 [PATCH v6 0/3] modify CPU model info Chenyi Qiang
2020-07-14  8:41 ` [PATCH v6 1/3] target/i386: add fast short REP MOV support Chenyi Qiang
2020-07-14  8:41 ` [PATCH v6 2/3] target/i386: fix model number and add missing features for Icelake-Server CPU model Chenyi Qiang
2020-07-14  8:41 ` [PATCH v6 3/3] target/i386: add the missing vmx features for Skylake-Server and Cascadelake-Server CPU models Chenyi Qiang
2020-07-16 15:06 ` [PATCH v6 0/3] modify CPU model info Eduardo Habkost

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).