[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 8/9] target/i386: set the CPUID level to 0x14 on old machine-type
From: |
Eduardo Habkost |
Subject: |
[PULL 8/9] target/i386: set the CPUID level to 0x14 on old machine-type |
Date: |
Thu, 2 Apr 2020 19:20:50 -0300 |
From: Luwei Kang <address@hidden>
The CPUID level need to be set to 0x14 manually on old
machine-type if Intel PT is enabled in guest. E.g. the
CPUID[0].EAX(level)=7 and CPUID[7].EBX[25](intel-pt)=1 when the
Qemu with "-machine pc-i440fx-3.1 -cpu qemu64,+intel-pt" parameter.
Some Intel PT capabilities are exposed by leaf 0x14 and the
missing capabilities will cause some MSRs access failed.
This patch add a warning message to inform the user to extend
the CPUID level.
Suggested-by: Eduardo Habkost <address@hidden>
Signed-off-by: Luwei Kang <address@hidden>
Message-Id: <address@hidden>
Signed-off-by: Eduardo Habkost <address@hidden>
---
target/i386/cpu.c | 11 ++++++++---
1 file changed, 8 insertions(+), 3 deletions(-)
diff --git a/target/i386/cpu.c b/target/i386/cpu.c
index 6ad24774c5..f3b25c7301 100644
--- a/target/i386/cpu.c
+++ b/target/i386/cpu.c
@@ -6356,9 +6356,14 @@ static void x86_cpu_expand_features(X86CPU *cpu, Error
**errp)
x86_cpu_adjust_feat_level(cpu, FEAT_XSAVE);
/* Intel Processor Trace requires CPUID[0x14] */
- if ((env->features[FEAT_7_0_EBX] & CPUID_7_0_EBX_INTEL_PT) &&
- kvm_enabled() && cpu->intel_pt_auto_level) {
- x86_cpu_adjust_level(cpu, &cpu->env.cpuid_min_level, 0x14);
+ if ((env->features[FEAT_7_0_EBX] & CPUID_7_0_EBX_INTEL_PT)) {
+ if (cpu->intel_pt_auto_level) {
+ x86_cpu_adjust_level(cpu, &cpu->env.cpuid_min_level, 0x14);
+ } else if (cpu->env.cpuid_min_level < 0x14) {
+ mark_unavailable_features(cpu, FEAT_7_0_EBX,
+ CPUID_7_0_EBX_INTEL_PT,
+ "Intel PT need CPUID leaf 0x14, please set by \"-cpu
...,+intel-pt,level=0x14\"");
+ }
}
/* CPU topology with multi-dies support requires CPUID[0x1F] */
--
2.24.1
- [PULL 0/9] x86 queue for -rc2, Eduardo Habkost, 2020/04/02
- [PULL 2/9] target/i386: Cleanup and use the EPYC mode topology functions, Eduardo Habkost, 2020/04/02
- [PULL 1/9] hw/386: Add EPYC mode topology decoding functions, Eduardo Habkost, 2020/04/02
- [PULL 3/9] hw/i386: Introduce apicid functions inside X86MachineState, Eduardo Habkost, 2020/04/02
- [PULL 4/9] i386: Introduce use_epyc_apic_id_encoding in X86CPUDefinition, Eduardo Habkost, 2020/04/02
- [PULL 5/9] hw/i386: Move arch_id decode inside x86_cpus_init, Eduardo Habkost, 2020/04/02
- [PULL 7/9] i386: Fix pkg_id offset for EPYC cpu models, Eduardo Habkost, 2020/04/02
- [PULL 8/9] target/i386: set the CPUID level to 0x14 on old machine-type,
Eduardo Habkost <=
- [PULL 6/9] target/i386: Enable new apic id encoding for EPYC based cpus models, Eduardo Habkost, 2020/04/02
- [PULL 9/9] target/i386: Add ARCH_CAPABILITIES related bits into Icelake-Server CPU model, Eduardo Habkost, 2020/04/02
- Re: [PULL 0/9] x86 queue for -rc2, Peter Maydell, 2020/04/03