qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH] i386: extended the cpuid level when Intel PT is


From: Eduardo Habkost
Subject: Re: [Qemu-devel] [PATCH] i386: extended the cpuid level when Intel PT is enabled
Date: Thu, 24 Jan 2019 16:39:09 -0200
User-agent: Mutt/1.10.1 (2018-07-13)

Hi,

Thanks for the patch.  Comment below:

On Thu, Jan 24, 2019 at 08:54:43PM -0500, Luwei Kang wrote:
> 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 <address@hidden>
> ---
>  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);
> +        }

This will require a new machine-type compatibility flag to enable
the new behavior, so we don't change CPUID data under the guest
feet during live migration.

> +
>          /* 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
> 

-- 
Eduardo



reply via email to

[Prev in Thread] Current Thread [Next in Thread]