qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/5] target/i386: introduce ITS_NO to several models
@ 2025-11-06 17:46 Jon Kohler
  2025-11-06 17:46 ` [PATCH 1/5] target/i386: Add MSR_IA32_ARCH_CAPABILITIES ITS_NO Jon Kohler
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: Jon Kohler @ 2025-11-06 17:46 UTC (permalink / raw)
  To: pbonzini, zhao1.liu, qemu-devel, pawan.kumar.gupta; +Cc: Jon Kohler

ITS_NO is a synthetic bit that indicates to a guest VM that it is
running on hardware that A) is not vulnerable to ITS vulnerability and
B) will not be migrated to a host that is vulnerable to ITS.

Guests will use ITS_NO to opt out of mitigating against ITS.

Intel Sapphire Rapids and higher are all invulnerable to ITS.

Note: for posterity, add MSR_ARCH_CAP_ITS_NO bit definition, such that
future CPU models can add ITS_NO without needing a sub version for
its-no.

Jon Kohler (5):
  target/i386: Add MSR_IA32_ARCH_CAPABILITIES ITS_NO
  target/i386: introduce SapphireRapids-v5 to expose ITS_NO
  target/i386: introduce GraniteRapids-v4 to expose ITS_NO
  target/i386: introduce SierraForest-v4 to expose ITS_NO
  target/i386: introduce ClearwaterForest-v2 to expose ITS_NO

 target/i386/cpu.c | 35 +++++++++++++++++++++++++++++++++++
 target/i386/cpu.h |  1 +
 2 files changed, 36 insertions(+)

-- 
2.43.0



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

* [PATCH 1/5] target/i386: Add MSR_IA32_ARCH_CAPABILITIES ITS_NO
  2025-11-06 17:46 [PATCH 0/5] target/i386: introduce ITS_NO to several models Jon Kohler
@ 2025-11-06 17:46 ` Jon Kohler
  2025-11-06 17:46 ` [PATCH 2/5] target/i386: introduce SapphireRapids-v5 to expose ITS_NO Jon Kohler
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: Jon Kohler @ 2025-11-06 17:46 UTC (permalink / raw)
  To: pbonzini, zhao1.liu, qemu-devel, pawan.kumar.gupta; +Cc: Jon Kohler

Add bit definition for Indirect Target Selection (ITS_NO) bit 62, to
allow ITS_NO to be added directly to a CPU model in the future.

Cc: Pawan Gupta <pawan.kumar.gupta@linux.intel.com>
Signed-off-by: Jon Kohler <jon@nutanix.com>
---
 target/i386/cpu.h | 1 +
 1 file changed, 1 insertion(+)

diff --git a/target/i386/cpu.h b/target/i386/cpu.h
index cee1f692a1..93f466fb2b 100644
--- a/target/i386/cpu.h
+++ b/target/i386/cpu.h
@@ -1245,6 +1245,7 @@ uint64_t x86_cpu_get_supported_feature_word(X86CPU *cpu, FeatureWord w);
 #define MSR_ARCH_CAP_PBRSB_NO           (1U << 24)
 #define MSR_ARCH_CAP_GDS_NO             (1U << 26)
 #define MSR_ARCH_CAP_RFDS_NO            (1U << 27)
+#define MSR_ARCH_CAP_ITS_NO             (1U << 62)
 
 #define MSR_CORE_CAP_SPLIT_LOCK_DETECT  (1U << 5)
 
-- 
2.43.0



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

* [PATCH 2/5] target/i386: introduce SapphireRapids-v5 to expose ITS_NO
  2025-11-06 17:46 [PATCH 0/5] target/i386: introduce ITS_NO to several models Jon Kohler
  2025-11-06 17:46 ` [PATCH 1/5] target/i386: Add MSR_IA32_ARCH_CAPABILITIES ITS_NO Jon Kohler
@ 2025-11-06 17:46 ` Jon Kohler
  2025-11-06 17:46 ` [PATCH 3/5] target/i386: introduce GraniteRapids-v4 " Jon Kohler
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: Jon Kohler @ 2025-11-06 17:46 UTC (permalink / raw)
  To: pbonzini, zhao1.liu, qemu-devel, pawan.kumar.gupta; +Cc: Jon Kohler

Expose ITS_NO by default, as users using Sapphire Rapids and higher
CPU models would not be able to live migrate to lower CPU hosts due to
missing features. In that case, they would not be vulnerable to ITS.

its-no was originally added on [1], but needs to be exposed on the
individual CPU models for the guests to see by default.

[1] 74978391b2da ("target/i386: Make ITS_NO available to guests")

Cc: Pawan Gupta <pawan.kumar.gupta@linux.intel.com>
Signed-off-by: Jon Kohler <jon@nutanix.com>
---
 target/i386/cpu.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/target/i386/cpu.c b/target/i386/cpu.c
index 6417775786..e579b790e0 100644
--- a/target/i386/cpu.c
+++ b/target/i386/cpu.c
@@ -5111,6 +5111,15 @@ static const X86CPUDefinition builtin_x86_defs[] = {
                     { /* end of list */ },
                 }
             },
+            {
+                .version = 5,
+                .note = "with ITS_NO",
+                .cache_info = &xeon_spr_cache_info,
+                .props = (PropValue[]) {
+                    { "its-no", "on" },
+                    { /* end of list */ },
+                }
+            },
             { /* end of list */ }
         }
     },
-- 
2.43.0



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

* [PATCH 3/5] target/i386: introduce GraniteRapids-v4 to expose ITS_NO
  2025-11-06 17:46 [PATCH 0/5] target/i386: introduce ITS_NO to several models Jon Kohler
  2025-11-06 17:46 ` [PATCH 1/5] target/i386: Add MSR_IA32_ARCH_CAPABILITIES ITS_NO Jon Kohler
  2025-11-06 17:46 ` [PATCH 2/5] target/i386: introduce SapphireRapids-v5 to expose ITS_NO Jon Kohler
@ 2025-11-06 17:46 ` Jon Kohler
  2025-11-06 17:46 ` [PATCH 4/5] target/i386: introduce SierraForest-v4 " Jon Kohler
  2025-11-06 17:46 ` [PATCH 5/5] target/i386: introduce ClearwaterForest-v2 " Jon Kohler
  4 siblings, 0 replies; 6+ messages in thread
From: Jon Kohler @ 2025-11-06 17:46 UTC (permalink / raw)
  To: pbonzini, zhao1.liu, qemu-devel, pawan.kumar.gupta; +Cc: Jon Kohler

Expose ITS_NO by default, as users using Granite Rapids and higher
CPU models would not be able to live migrate to lower CPU hosts due to
missing features. In that case, they would not be vulnerable to ITS.

its-no was originally added on [1], but needs to be exposed on the
individual CPU models for the guests to see by default.

[1] 74978391b2da ("target/i386: Make ITS_NO available to guests")

Cc: Pawan Gupta <pawan.kumar.gupta@linux.intel.com>
Signed-off-by: Jon Kohler <jon@nutanix.com>
---
 target/i386/cpu.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/target/i386/cpu.c b/target/i386/cpu.c
index e579b790e0..afbfe11733 100644
--- a/target/i386/cpu.c
+++ b/target/i386/cpu.c
@@ -5282,6 +5282,15 @@ static const X86CPUDefinition builtin_x86_defs[] = {
                     { /* end of list */ },
                 }
             },
+            {
+                .version = 4,
+                .note = "with ITS_NO",
+                .cache_info = &xeon_gnr_cache_info,
+                .props = (PropValue[]) {
+                    { "its-no", "on" },
+                    { /* end of list */ },
+                }
+            },
             { /* end of list */ },
         },
     },
-- 
2.43.0



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

* [PATCH 4/5] target/i386: introduce SierraForest-v4 to expose ITS_NO
  2025-11-06 17:46 [PATCH 0/5] target/i386: introduce ITS_NO to several models Jon Kohler
                   ` (2 preceding siblings ...)
  2025-11-06 17:46 ` [PATCH 3/5] target/i386: introduce GraniteRapids-v4 " Jon Kohler
@ 2025-11-06 17:46 ` Jon Kohler
  2025-11-06 17:46 ` [PATCH 5/5] target/i386: introduce ClearwaterForest-v2 " Jon Kohler
  4 siblings, 0 replies; 6+ messages in thread
From: Jon Kohler @ 2025-11-06 17:46 UTC (permalink / raw)
  To: pbonzini, zhao1.liu, qemu-devel, pawan.kumar.gupta; +Cc: Jon Kohler

Expose ITS_NO by default, as users using Sierra Forest and higher
CPU models would not be able to live migrate to lower CPU hosts due to
missing features. In that case, they would not be vulnerable to ITS.

its-no was originally added on [1], but needs to be exposed on the
individual CPU models for the guests to see by default.

Note: For SRF, version 2 already exposed BHI_CTRL, which would already
mark the CPU as invulnerable to ITS (at least in Linux); however,
expose ITS_NO for completeness.

[1] 74978391b2da ("target/i386: Make ITS_NO available to guests")

Cc: Pawan Gupta <pawan.kumar.gupta@linux.intel.com>
Signed-off-by: Jon Kohler <jon@nutanix.com>
---
 target/i386/cpu.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/target/i386/cpu.c b/target/i386/cpu.c
index afbfe11733..a522805233 100644
--- a/target/i386/cpu.c
+++ b/target/i386/cpu.c
@@ -5445,6 +5445,15 @@ static const X86CPUDefinition builtin_x86_defs[] = {
                     { /* end of list */ },
                 }
             },
+            {
+                .version = 4,
+                .note = "with ITS_NO",
+                .cache_info = &xeon_srf_cache_info,
+                .props = (PropValue[]) {
+                    { "its-no", "on" },
+                    { /* end of list */ },
+                }
+            },
             { /* end of list */ },
         },
     },
-- 
2.43.0



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

* [PATCH 5/5] target/i386: introduce ClearwaterForest-v2 to expose ITS_NO
  2025-11-06 17:46 [PATCH 0/5] target/i386: introduce ITS_NO to several models Jon Kohler
                   ` (3 preceding siblings ...)
  2025-11-06 17:46 ` [PATCH 4/5] target/i386: introduce SierraForest-v4 " Jon Kohler
@ 2025-11-06 17:46 ` Jon Kohler
  4 siblings, 0 replies; 6+ messages in thread
From: Jon Kohler @ 2025-11-06 17:46 UTC (permalink / raw)
  To: pbonzini, zhao1.liu, qemu-devel, pawan.kumar.gupta; +Cc: Jon Kohler

Expose ITS_NO by default, as users using Clearwater Forest and higher
CPU models would not be able to live migrate to lower CPU hosts due to
missing features. In that case, they would not be vulnerable to ITS.

its-no was originally added on [1], but needs to be exposed on the
individual CPU models for the guests to see by default.

Note: Version 1 already exposes ARCH_CAP_BHI_NO, which would already
mark the CPU as invulnerable to ITS (at least in Linux); however,
expose ITS_NO for completeness.

[1] 74978391b2da ("target/i386: Make ITS_NO available to guests")

Cc: Pawan Gupta <pawan.kumar.gupta@linux.intel.com>
Signed-off-by: Jon Kohler <jon@nutanix.com>
---
 target/i386/cpu.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/target/i386/cpu.c b/target/i386/cpu.c
index a522805233..9b66a19b7b 100644
--- a/target/i386/cpu.c
+++ b/target/i386/cpu.c
@@ -5589,6 +5589,14 @@ static const X86CPUDefinition builtin_x86_defs[] = {
         .model_id = "Intel Xeon Processor (ClearwaterForest)",
         .versions = (X86CPUVersionDefinition[]) {
             { .version = 1 },
+            {
+                .version = 2,
+                .note = "with ITS_NO",
+                .props = (PropValue[]) {
+                    { "its-no", "on" },
+                    { /* end of list */ },
+                }
+            },
             { /* end of list */ },
         },
     },
-- 
2.43.0



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

end of thread, other threads:[~2025-11-06 17:06 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-11-06 17:46 [PATCH 0/5] target/i386: introduce ITS_NO to several models Jon Kohler
2025-11-06 17:46 ` [PATCH 1/5] target/i386: Add MSR_IA32_ARCH_CAPABILITIES ITS_NO Jon Kohler
2025-11-06 17:46 ` [PATCH 2/5] target/i386: introduce SapphireRapids-v5 to expose ITS_NO Jon Kohler
2025-11-06 17:46 ` [PATCH 3/5] target/i386: introduce GraniteRapids-v4 " Jon Kohler
2025-11-06 17:46 ` [PATCH 4/5] target/i386: introduce SierraForest-v4 " Jon Kohler
2025-11-06 17:46 ` [PATCH 5/5] target/i386: introduce ClearwaterForest-v2 " Jon Kohler

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