qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH v3] target-i386: emulate CPUID level of real har


From: Eduardo Habkost
Subject: Re: [Qemu-devel] [PATCH v3] target-i386: emulate CPUID level of real hardware
Date: Mon, 29 Jun 2015 17:20:47 -0300
User-agent: Mutt/1.5.23 (2014-03-12)

On Mon, Jun 22, 2015 at 01:08:02PM +0200, Radim Krčmář wrote:
> W10 insider has a bug where it ignores CPUID level and interprets
> CPUID.(EAX=07H, ECX=0H) incorrectly, because CPUID in fact returned
> CPUID.(EAX=04H, ECX=0H);  this resulted in execution of unsupported
> instructions.
> 
> While it's a Windows bug, there is no reason to emulate incorrect level.
> 
> I used http://instlatx64.atw.hu/ as a source of CPUID and checked that
> it matches Penryn Xeon X5472, Westmere Xeon W3520, SandyBridge i5-2540M,
> and Haswell i5-4670T.
> 
> kvm64 and qemu64 were bumped to 0xD to allow all available features for
> them (and to avoid the same Windows bug).
> 
> Signed-off-by: Radim Krčmář <address@hidden>
> ---
>  v3: use PC_COMPAT_2_3 array to set old (x)level values [Eduardo]
>  v2:
>  * maintained compatibility for old (< 2.4) machine types [Paolo]
>  * dropped automatic increase to 0xd, for compatibility [Eduardo]
> 
>  include/hw/compat.h | 66 
> ++++++++++++++++++++++++++++++++++++++++++++++++++++-
>  target-i386/cpu.c   | 37 +++++++++++++++---------------
>  2 files changed, 83 insertions(+), 20 deletions(-)
> 
> diff --git a/include/hw/compat.h b/include/hw/compat.h
> index 4a43466f0369..ef996be22263 100644
> --- a/include/hw/compat.h
> +++ b/include/hw/compat.h
> @@ -2,7 +2,71 @@
>  #define HW_COMPAT_H
>  
>  #define HW_COMPAT_2_3 \
> -        /* empty */
[...]
> +        },{\
> +            .driver   = "Penryn" "-" TYPE_X86_CPU,\
> +            .property = "xlevel",\
> +            .value    = stringify(0x8000000a),\
> +        },{\

You changed Conroe xlevel, too. This was missing:

        {\
            .driver   = "Conroe" "-" TYPE_X86_CPU,\
            .property = "xlevel",\
            .value    = stringify(0x8000000a),\
        },

I have added it to the patch on the x86 tree.

-- 
Eduardo



reply via email to

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