[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v1 8/9] Adjust CPUID level for RDT features
From: |
Hendrik Wuethrich |
Subject: |
[PATCH v1 8/9] Adjust CPUID level for RDT features |
Date: |
Fri, 19 Jul 2024 16:29:28 +0000 |
From: Hendrik Wüthrich <whendrik@google.com>
Adjust minimum CPUID level if RDT monitoring or allocation features are
enabled to ensure that CPUID will return them.
Signed-off-by: Hendrik Wüthrich <whendrik@google.com>
---
target/i386/cpu.c | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/target/i386/cpu.c b/target/i386/cpu.c
index 1cf5e5d5ff..482f980a1f 100644
--- a/target/i386/cpu.c
+++ b/target/i386/cpu.c
@@ -7590,6 +7590,16 @@ void x86_cpu_expand_features(X86CPU *cpu, Error **errp)
if (env->features[FEAT_7_0_EBX] & CPUID_7_0_EBX_SGX) {
x86_cpu_adjust_level(cpu, &env->cpuid_min_level, 0x12);
}
+
+ /* RDT monitoring requires CPUID[0xF] */
+ if (env->features[FEAT_7_0_EBX] & CPUID_7_0_EBX_PQM) {
+ x86_cpu_adjust_level(cpu, &env->cpuid_min_level, 0xF);
+ }
+
+ /* RDT allocation requires CPUID[0x10] */
+ if (env->features[FEAT_7_0_EBX] & CPUID_7_0_EBX_PQE) {
+ x86_cpu_adjust_level(cpu, &env->cpuid_min_level, 0x10);
+ }
}
/* Set cpuid_*level* based on cpuid_min_*level, if not explicitly set */
--
2.45.2.1089.g2a221341d9-goog
- [PATCH v1 0/9] target:386/ Emulate Intel RDT features needed to mount ResCtrl in Linux, Hendrik Wuethrich, 2024/07/19
- [PATCH v1 5/9] Add RDT device interface through MSRs, Hendrik Wuethrich, 2024/07/19
- [PATCH v1 2/9] Add state for RDT device., Hendrik Wuethrich, 2024/07/19
- [PATCH v1 9/9] Adjust level for RDT on full_cpuid_auto_level, Hendrik Wuethrich, 2024/07/19
- [PATCH v1 4/9] Add RDT functionality, Hendrik Wuethrich, 2024/07/19
- [PATCH v1 8/9] Adjust CPUID level for RDT features,
Hendrik Wuethrich <=
- [PATCH v1 1/9] Add Intel RDT device to config., Hendrik Wuethrich, 2024/07/19
- [PATCH v1 6/9] Add CPUID enumeration for RDT, Hendrik Wuethrich, 2024/07/19
- [PATCH v1 3/9] Add init and realize funciontality for RDT device., Hendrik Wuethrich, 2024/07/19
- [PATCH v1 7/9] Add RDT feature flags., Hendrik Wuethrich, 2024/07/19