qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [QEMU 1.1 PATCH] Expose CPUID leaf 7 only for -cpu host


From: Eduardo Habkost
Subject: Re: [Qemu-devel] [QEMU 1.1 PATCH] Expose CPUID leaf 7 only for -cpu host
Date: Thu, 17 May 2012 09:57:00 -0300
User-agent: Mutt/1.5.21 (2010-09-15)

On Wed, May 16, 2012 at 05:58:05PM -0300, Eduardo Habkost wrote:
[...]
> @@ -521,6 +523,13 @@ static int cpu_x86_fill_host(x86_def_t *x86_cpu_def)
>      x86_cpu_def->ext_features = ecx;
>      x86_cpu_def->features = edx;
>  
> +    if (x86_cpu_def->level >= 7) {
> +        host_cpuid(0x7, 0, &eax, &ebx, &ecx, &edx);
> +        x86_cpu_def->cpuid_7_0_ebx_features = ebx;
> +    } else {
> +        x86_cpu_def->cpuid_7_0_ebx_features = 0;
> +    }
> +

Ouch: it looks like -cpu host isn't using GET_SUPPORTED_CPUID at all,
host_cpuid() is a raw cpuid instruction. I am surprised -cpu host works
at all (probably it breaks in interesting ways if running on a new CPU
and a not-very-new kernel).

I will send v2 of this patch, to use GET_SUPPORTED_CPUID at least for
cpuid_7_0_ebx_features.

It is still a bug to not filter the remaining CPUID leaves using
GET_SUPPORTED_CPUID, but I am not sure we would have enough time for
testing if we try to fix all that in 1.1.

-- 
Eduardo



reply via email to

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