[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 10/16] target/i386: Add the immediate form MSR access instruction
From: |
Paolo Bonzini |
Subject: |
[PULL 10/16] target/i386: Add the immediate form MSR access instruction support |
Date: |
Tue, 3 Jun 2025 23:45:17 +0200 |
From: "Xin Li (Intel)" <xin@zytor.com>
The immediate form of MSR access instructions are primarily motivated by
performance, not code size: by having the MSR number in an immediate, it
is available *much* earlier in the pipeline, which allows the hardware
much more leeway about how a particular MSR is handled.
Signed-off-by: Xin Li (Intel) <xin@zytor.com>
Link: https://lore.kernel.org/r/20250103084827.1820007-4-xin@zytor.com
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
target/i386/cpu.h | 4 ++++
target/i386/cpu.c | 2 +-
2 files changed, 5 insertions(+), 1 deletion(-)
diff --git a/target/i386/cpu.h b/target/i386/cpu.h
index 0ec1cbd9f43..545851cbde1 100644
--- a/target/i386/cpu.h
+++ b/target/i386/cpu.h
@@ -1001,6 +1001,9 @@ uint64_t x86_cpu_get_supported_feature_word(X86CPU *cpu,
FeatureWord w);
/* Linear Address Masking */
#define CPUID_7_1_EAX_LAM (1U << 26)
+/* The immediate form of MSR access instructions */
+#define CPUID_7_1_ECX_MSR_IMM (1U << 5)
+
/* Support for VPDPB[SU,UU,SS]D[,S] */
#define CPUID_7_1_EDX_AVX_VNNI_INT8 (1U << 4)
/* AVX NE CONVERT Instructions */
@@ -1024,6 +1027,7 @@ uint64_t x86_cpu_get_supported_feature_word(X86CPU *cpu,
FeatureWord w);
#define CPUID_7_2_EDX_DDPD_U (1U << 3)
/* Indicate bit 10 of the IA32_SPEC_CTRL MSR is supported */
#define CPUID_7_2_EDX_BHI_CTRL (1U << 4)
+
/* Do not exhibit MXCSR Configuration Dependent Timing (MCDT) behavior */
#define CPUID_7_2_EDX_MCDT_NO (1U << 5)
diff --git a/target/i386/cpu.c b/target/i386/cpu.c
index b05f465e2ef..40aefb38f6d 100644
--- a/target/i386/cpu.c
+++ b/target/i386/cpu.c
@@ -1155,7 +1155,7 @@ FeatureWordInfo feature_word_info[FEATURE_WORDS] = {
.type = CPUID_FEATURE_WORD,
.feat_names = {
NULL, NULL, NULL, NULL,
- NULL, NULL, NULL, NULL,
+ NULL, "msr-imm", NULL, NULL,
NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL,
--
2.49.0
- [PULL 00/16] rust, i386 changes for 2025-06-03, Paolo Bonzini, 2025/06/03
- [PULL 01/16] rust: bindings: allow ptr_offset_with_cast, Paolo Bonzini, 2025/06/03
- [PULL 03/16] rust: use "objects" for Rust executables as well, Paolo Bonzini, 2025/06/03
- [PULL 04/16] build, dockerfiles: add support for detecting rustdoc, Paolo Bonzini, 2025/06/03
- [PULL 06/16] rust: cell: remove support for running doctests with "cargo test --doc", Paolo Bonzini, 2025/06/03
- [PULL 07/16] rust: use native Meson support for clippy and rustdoc, Paolo Bonzini, 2025/06/03
- [PULL 05/16] rust: add qemu-api doctests to "meson test", Paolo Bonzini, 2025/06/03
- [PULL 09/16] target/i386: Add a new CPU feature word for CPUID.7.1.ECX, Paolo Bonzini, 2025/06/03
- [PULL 08/16] target/i386: Remove FRED dependency on WRMSRNS, Paolo Bonzini, 2025/06/03
- [PULL 10/16] target/i386: Add the immediate form MSR access instruction support,
Paolo Bonzini <=
- [PULL 11/16] meson: use config_base_arch for target libraries, Paolo Bonzini, 2025/06/03
- [PULL 13/16] i386/tdvf: Fix build on 32-bit host, Paolo Bonzini, 2025/06/03
- [PULL 12/16] i386/tdx: Fix build on 32-bit host, Paolo Bonzini, 2025/06/03
- [PULL 14/16] rust: add "bits", a custom bitflags implementation, Paolo Bonzini, 2025/06/03
- [PULL 02/16] meson: update to version 1.8.1, Paolo Bonzini, 2025/06/03
- [PULL 15/16] rust: pl011: use the bits macro, Paolo Bonzini, 2025/06/03
- [PULL 16/16] rust: qemu-api-macros: add from_bits and into_bits to #[derive(TryInto)], Paolo Bonzini, 2025/06/03
- Re: [PULL 00/16] rust, i386 changes for 2025-06-03, Stefan Hajnoczi, 2025/06/05