target/i386: introduce ITS_NO to several models
cover target/i386: introduce ITS_NO to several models
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(+)
Signature · 1 line
2.43.0
PATCH 2/5 target/i386: introduce SapphireRapids-v5 to expose ITS_NO
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")
--- target/i386/cpu.c | 9 +++++++++ 1 file changed, 9 insertions(+)
target/i386/cpu.c +9 -0
@@ -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 */ } } },
Signature · 1 line
2.43.0
PATCH 1/5 target/i386: Add MSR_IA32_ARCH_CAPABILITIES ITS_NO
In reply to Jon KohlerAdd 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.
--- target/i386/cpu.h | 1 + 1 file changed, 1 insertion(+)
target/i386/cpu.h +1 -0
@@ -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)
Signature · 1 line
2.43.0
PATCH 3/5 target/i386: introduce GraniteRapids-v4 to expose ITS_NO
In reply to Jon KohlerExpose 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")
--- target/i386/cpu.c | 9 +++++++++ 1 file changed, 9 insertions(+)
target/i386/cpu.c +9 -0
@@ -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 */ }, }, },
Signature · 1 line
2.43.0
PATCH 4/5 target/i386: introduce SierraForest-v4 to expose ITS_NO
In reply to Jon KohlerExpose 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")
--- target/i386/cpu.c | 9 +++++++++ 1 file changed, 9 insertions(+)
target/i386/cpu.c +9 -0
@@ -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 */ }, }, },
Signature · 1 line
2.43.0
PATCH 5/5 target/i386: introduce ClearwaterForest-v2 to expose ITS_NO
In reply to Jon KohlerExpose 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")
--- target/i386/cpu.c | 8 ++++++++ 1 file changed, 8 insertions(+)
target/i386/cpu.c +8 -0
@@ -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 */ }, }, },
Signature · 1 line
2.43.0
Quoted 23 lines · Jon Kohler
ITS_NOis 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_NOto opt out of mitigating against ITS.Intel Sapphire Rapids and higher are all invulnerable to ITS.
Note: for posterity, add
MSR_ARCH_CAP_ITS_NObit definition, such that future CPU models can addITS_NOwithout needing a sub version for its-no.Jon Kohler (5):
target/i386: AddMSR_IA32_ARCH_CAPABILITIESITS_NOtarget/i386: introduce SapphireRapids-v5 to exposeITS_NOtarget/i386: introduce GraniteRapids-v4 to exposeITS_NOtarget/i386: introduce SierraForest-v4 to exposeITS_NOtarget/i386: introduce ClearwaterForest-v2 to exposeITS_NO
Quoted 6 lines
target/i386/cpu.c| 35 +++++++++++++++++++++++++++++++++++target/i386/cpu.h| 1 +2 files changed, 36 insertions(+)Signature · 1 line
2.43.0
Gentle ping on this series, any feedback?
Paolo Bonzini
AppliedQueued, thanks. In the meanwhile the last patch had to be changed to introduce ClearwaterForest-v3, so I have adjusted that.
Paolo