qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/2]  Add new features for intel processor
@ 2020-07-05 23:17 Cathy Zhang
  2020-07-05 23:17 ` [PATCH 1/2] target/i386: Add SERIALIZE cpu feature Cathy Zhang
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Cathy Zhang @ 2020-07-05 23:17 UTC (permalink / raw)
  To: qemu-devel; +Cc: Cathy Zhang, pbonzini, ehabkost, rth

This patchset is to add two new features for intel processors
which support them, like Sapphire Rapids. SERIALIZE is a faster
serializing instruction which does not modify registers,
arithmetic flags or memory, will not cause VM exit. TSX suspend
load tracking instruction aims to give a way to choose which
memory accesses do not need to be tracked in the TSX read set.

Cathy Zhang (2):
  target/i386: Add SERIALIZE cpu feature
  target/i386: Enable TSX Suspend Load Address Tracking feature

 target/i386/cpu.c | 4 ++--
 target/i386/cpu.h | 4 ++++
 2 files changed, 6 insertions(+), 2 deletions(-)

--
1.8.3.1



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

* [PATCH 1/2] target/i386: Add SERIALIZE cpu feature
  2020-07-05 23:17 [PATCH 0/2] Add new features for intel processor Cathy Zhang
@ 2020-07-05 23:17 ` Cathy Zhang
  2020-07-05 23:17 ` [PATCH 2/2] target/i386: Enable TSX Suspend Load Address Tracking feature Cathy Zhang
  2020-07-06  9:25 ` [PATCH 0/2] Add new features for intel processor Paolo Bonzini
  2 siblings, 0 replies; 4+ messages in thread
From: Cathy Zhang @ 2020-07-05 23:17 UTC (permalink / raw)
  To: qemu-devel; +Cc: Cathy Zhang, pbonzini, ehabkost, rth

The availability of the SERIALIZATION instruction is indicated
by the presence of the CPUID feature flag SERIALIZE, which is
defined as CPUID.(EAX=7,ECX=0):ECX[bit 14].

The release spec link is as follows:
https://software.intel.com/content/dam/develop/public/us/en/documents/\
architecture-instruction-set-extensions-programming-reference.pdf

The associated kvm patch link is as follows:
https://lore.kernel.org/patchwork/patch/1268025/

Signed-off-by: Cathy Zhang <cathy.zhang@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 36cbd3d..92716f4 100644
--- a/target/i386/cpu.c
+++ b/target/i386/cpu.c
@@ -986,7 +986,7 @@ static FeatureWordInfo feature_word_info[FEATURE_WORDS] = {
             NULL, NULL, "avx512-4vnniw", "avx512-4fmaps",
             NULL, NULL, NULL, NULL,
             "avx512-vp2intersect", NULL, "md-clear", NULL,
-            NULL, NULL, NULL, NULL,
+            NULL, NULL, "serialize", NULL,
             NULL, NULL, NULL /* pconfig */, NULL,
             NULL, NULL, NULL, NULL,
             NULL, NULL, "spec-ctrl", "stibp",
diff --git a/target/i386/cpu.h b/target/i386/cpu.h
index 7d77efd..3ef1123 100644
--- a/target/i386/cpu.h
+++ b/target/i386/cpu.h
@@ -777,6 +777,8 @@ typedef uint64_t FeatureWordArray[FEATURE_WORDS];
 #define CPUID_7_0_EDX_AVX512_4FMAPS     (1U << 3)
 /* AVX512 Vector Pair Intersection to a Pair of Mask Registers */
 #define CPUID_7_0_EDX_AVX512_VP2INTERSECT (1U << 8)
+/* SERIALIZE instruction */
+#define CPUID_7_0_EDX_SERIALIZE         (1U << 14)
 /* Speculation Control */
 #define CPUID_7_0_EDX_SPEC_CTRL         (1U << 26)
 /* Single Thread Indirect Branch Predictors */
-- 
1.8.3.1



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

* [PATCH 2/2] target/i386: Enable TSX Suspend Load Address Tracking feature
  2020-07-05 23:17 [PATCH 0/2] Add new features for intel processor Cathy Zhang
  2020-07-05 23:17 ` [PATCH 1/2] target/i386: Add SERIALIZE cpu feature Cathy Zhang
@ 2020-07-05 23:17 ` Cathy Zhang
  2020-07-06  9:25 ` [PATCH 0/2] Add new features for intel processor Paolo Bonzini
  2 siblings, 0 replies; 4+ messages in thread
From: Cathy Zhang @ 2020-07-05 23:17 UTC (permalink / raw)
  To: qemu-devel; +Cc: Cathy Zhang, pbonzini, ehabkost, rth

This instruction aims to give a way to choose which memory accesses
do not need to be tracked in the TSX read set, which is defined as
CPUID.(EAX=7,ECX=0):EDX[bit 16].

The release spec link is as follows:
https://software.intel.com/content/dam/develop/public/us/en/documents/\
architecture-instruction-set-extensions-programming-reference.pdf

The associated kvm patch link is as follows:
https://lore.kernel.org/patchwork/patch/1268026/

Signed-off-by: Cathy Zhang <cathy.zhang@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 92716f4..256a9a1 100644
--- a/target/i386/cpu.c
+++ b/target/i386/cpu.c
@@ -987,7 +987,7 @@ static FeatureWordInfo feature_word_info[FEATURE_WORDS] = {
             NULL, NULL, NULL, NULL,
             "avx512-vp2intersect", NULL, "md-clear", NULL,
             NULL, NULL, "serialize", NULL,
-            NULL, NULL, NULL /* pconfig */, NULL,
+            "tsx-ldtrk", NULL, NULL /* pconfig */, NULL,
             NULL, NULL, NULL, NULL,
             NULL, NULL, "spec-ctrl", "stibp",
             NULL, "arch-capabilities", "core-capability", "ssbd",
diff --git a/target/i386/cpu.h b/target/i386/cpu.h
index 3ef1123..155972b 100644
--- a/target/i386/cpu.h
+++ b/target/i386/cpu.h
@@ -779,6 +779,8 @@ typedef uint64_t FeatureWordArray[FEATURE_WORDS];
 #define CPUID_7_0_EDX_AVX512_VP2INTERSECT (1U << 8)
 /* SERIALIZE instruction */
 #define CPUID_7_0_EDX_SERIALIZE         (1U << 14)
+/* TSX Suspend Load Address Tracking instruction */
+#define CPUID_7_0_EDX_TSX_LDTRK         (1U << 16)
 /* Speculation Control */
 #define CPUID_7_0_EDX_SPEC_CTRL         (1U << 26)
 /* Single Thread Indirect Branch Predictors */
-- 
1.8.3.1



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

* Re: [PATCH 0/2] Add new features for intel processor
  2020-07-05 23:17 [PATCH 0/2] Add new features for intel processor Cathy Zhang
  2020-07-05 23:17 ` [PATCH 1/2] target/i386: Add SERIALIZE cpu feature Cathy Zhang
  2020-07-05 23:17 ` [PATCH 2/2] target/i386: Enable TSX Suspend Load Address Tracking feature Cathy Zhang
@ 2020-07-06  9:25 ` Paolo Bonzini
  2 siblings, 0 replies; 4+ messages in thread
From: Paolo Bonzini @ 2020-07-06  9:25 UTC (permalink / raw)
  To: Cathy Zhang, qemu-devel; +Cc: ehabkost, rth

On 06/07/20 01:17, Cathy Zhang wrote:
> This patchset is to add two new features for intel processors
> which support them, like Sapphire Rapids. SERIALIZE is a faster
> serializing instruction which does not modify registers,
> arithmetic flags or memory, will not cause VM exit. TSX suspend
> load tracking instruction aims to give a way to choose which
> memory accesses do not need to be tracked in the TSX read set.
> 
> Cathy Zhang (2):
>   target/i386: Add SERIALIZE cpu feature
>   target/i386: Enable TSX Suspend Load Address Tracking feature
> 
>  target/i386/cpu.c | 4 ++--
>  target/i386/cpu.h | 4 ++++
>  2 files changed, 6 insertions(+), 2 deletions(-)
> 
> --
> 1.8.3.1
> 

Queued, thanks.

Paolo



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

end of thread, other threads:[~2020-07-06  9:26 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-07-05 23:17 [PATCH 0/2] Add new features for intel processor Cathy Zhang
2020-07-05 23:17 ` [PATCH 1/2] target/i386: Add SERIALIZE cpu feature Cathy Zhang
2020-07-05 23:17 ` [PATCH 2/2] target/i386: Enable TSX Suspend Load Address Tracking feature Cathy Zhang
2020-07-06  9:25 ` [PATCH 0/2] Add new features for intel processor Paolo Bonzini

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