* [PATCH v1] target/i386: set the CPUID level to 0x14 on old machine-type
@ 2019-10-30 5:27 Luwei Kang
2019-10-30 7:09 ` no-reply
0 siblings, 1 reply; 2+ messages in thread
From: Luwei Kang @ 2019-10-30 5:27 UTC (permalink / raw)
To: pbonzini, rth, ehabkost; +Cc: Luwei Kang, qemu-devel
The CPUID level need to be set to 0x14 manually on old
machine-type if Intel PT is enabled in guest. e.g. in Qemu 3.1
-machine pc-i440fx-3.1 -cpu qemu64,+intel-pt
will be CPUID[0].EAX(level)=7 and CPUID[7].EBX[25](intel-pt)=1.
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 <ehabkost@redhat.com>
Signed-off-by: Luwei Kang <luwei.kang@intel.com>
---
target/i386/cpu.c | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/target/i386/cpu.c b/target/i386/cpu.c
index 47200b4..9abbd30 100644
--- a/target/i386/cpu.c
+++ b/target/i386/cpu.c
@@ -5393,8 +5393,12 @@ static void x86_cpu_expand_features(X86CPU *cpu, Error **errp)
/* 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);
+ kvm_enabled()) {
+ if (cpu->intel_pt_auto_level)
+ x86_cpu_adjust_level(cpu, &cpu->env.cpuid_min_level, 0x14);
+ else
+ warn_report("Intel PT need CPUID leaf 0x14, please set "
+ "by \"-cpu ...,+intel-pt,level=0x14\"\n");
}
/* CPU topology with multi-dies support requires CPUID[0x1F] */
--
1.8.3.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH v1] target/i386: set the CPUID level to 0x14 on old machine-type
2019-10-30 5:27 [PATCH v1] target/i386: set the CPUID level to 0x14 on old machine-type Luwei Kang
@ 2019-10-30 7:09 ` no-reply
0 siblings, 0 replies; 2+ messages in thread
From: no-reply @ 2019-10-30 7:09 UTC (permalink / raw)
To: luwei.kang; +Cc: qemu-devel, pbonzini, luwei.kang, ehabkost, rth
Patchew URL: https://patchew.org/QEMU/1572413233-27015-1-git-send-email-luwei.kang@intel.com/
Hi,
This series seems to have some coding style problems. See output below for
more information:
Subject: [PATCH v1] target/i386: set the CPUID level to 0x14 on old machine-type
Type: series
Message-id: 1572413233-27015-1-git-send-email-luwei.kang@intel.com
=== TEST SCRIPT BEGIN ===
#!/bin/bash
git rev-parse base > /dev/null || exit 0
git config --local diff.renamelimit 0
git config --local diff.renames True
git config --local diff.algorithm histogram
./scripts/checkpatch.pl --mailback base..
=== TEST SCRIPT END ===
Switched to a new branch 'test'
c5736fe target/i386: set the CPUID level to 0x14 on old machine-type
=== OUTPUT BEGIN ===
ERROR: Error messages should not contain newlines
#36: FILE: target/i386/cpu.c:5448:
+ "by \"-cpu ...,+intel-pt,level=0x14\"\n");
total: 1 errors, 0 warnings, 14 lines checked
Commit c5736fe95d3f (target/i386: set the CPUID level to 0x14 on old machine-type) has style problems, please review. If any of these errors
are false positives report them to the maintainer, see
CHECKPATCH in MAINTAINERS.
=== OUTPUT END ===
Test command exited with code: 1
The full log is available at
http://patchew.org/logs/1572413233-27015-1-git-send-email-luwei.kang@intel.com/testing.checkpatch/?type=message.
---
Email generated automatically by Patchew [https://patchew.org/].
Please send your feedback to patchew-devel@redhat.com
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2019-10-30 7:10 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-10-30 5:27 [PATCH v1] target/i386: set the CPUID level to 0x14 on old machine-type Luwei Kang
2019-10-30 7:09 ` no-reply
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.