qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] i386: extended the cpuid level when Intel PT is enabled
@ 2019-01-25  1:54 Luwei Kang
  2019-01-24 18:39 ` Eduardo Habkost
  0 siblings, 1 reply; 7+ messages in thread
From: Luwei Kang @ 2019-01-25  1:54 UTC (permalink / raw)
  To: qemu-devel; +Cc: pbonzini, rth, ehabkost, Luwei Kang

Intel Processor Trace required CPUID[0x14] but the cpuid level
is 0xd when create a kvm guest with e.g. "-cpu qemu64,+intel-pt".

Signed-off-by: Luwei Kang <luwei.kang@intel.com>
---
 target/i386/cpu.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/target/i386/cpu.c b/target/i386/cpu.c
index 2f54125..da477b3 100644
--- a/target/i386/cpu.c
+++ b/target/i386/cpu.c
@@ -5023,6 +5023,13 @@ static void x86_cpu_expand_features(X86CPU *cpu, Error **errp)
         x86_cpu_adjust_feat_level(cpu, FEAT_C000_0001_EDX);
         x86_cpu_adjust_feat_level(cpu, FEAT_SVM);
         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()) {
+            x86_cpu_adjust_level(cpu, &cpu->env.cpuid_min_level, 0x14);
+        }
+
         /* SVM requires CPUID[0x8000000A] */
         if (env->features[FEAT_8000_0001_ECX] & CPUID_EXT3_SVM) {
             x86_cpu_adjust_level(cpu, &env->cpuid_min_xlevel, 0x8000000A);
-- 
1.8.3.1

^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2019-01-29  0:30 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-01-25  1:54 [Qemu-devel] [PATCH] i386: extended the cpuid level when Intel PT is enabled Luwei Kang
2019-01-24 18:39 ` Eduardo Habkost
2019-01-25  2:21   ` Kang, Luwei
2019-01-26  2:51     ` Eduardo Habkost
2019-01-28  6:06       ` Kang, Luwei
2019-01-28 18:03         ` Eduardo Habkost
2019-01-29  0:29           ` Kang, Luwei

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).