From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:52040) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VJfhR-00064s-Qv for qemu-devel@nongnu.org; Wed, 11 Sep 2013 04:23:03 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VJfhL-0004DH-QJ for qemu-devel@nongnu.org; Wed, 11 Sep 2013 04:22:57 -0400 Received: from mx1.redhat.com ([209.132.183.28]:41517) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VJfhL-0004C2-HO for qemu-devel@nongnu.org; Wed, 11 Sep 2013 04:22:51 -0400 Date: Wed, 11 Sep 2013 10:22:23 +0200 From: Igor Mammedov Message-ID: <20130911102223.0a51a7bb@nial.usersys.redhat.com> In-Reply-To: <1378846139-22187-1-git-send-email-ehabkost@redhat.com> References: <1378846139-22187-1-git-send-email-ehabkost@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH] target-i386: set model=6 on qemu64 & qemu32 CPU models List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Eduardo Habkost Cc: Andrea Arcangeli , qemu-devel@nongnu.org, Andreas =?ISO-8859-1?B?RuRyYmVy?= On Tue, 10 Sep 2013 17:48:59 -0300 Eduardo Habkost wrote: > There's no Intel CPU with family=6,model=2, and Linux and Windows guests > disable SEP when seeing that combination due to Pentium Pro erratum #82. > > In addition to just having SEP ignored by guests, Skype (and maybe other > applications) runs sysenter directly without passing through ntdll on > Windows, and crashes because Windows ignored the SEP CPUID bit. > > So, having model > 2 is a better default on qemu64 and qemu32 for two > reasons: making SEP really available for guests, and avoiding crashing > applications that work on bare metal. > > model=3 would fix the problem, but it causes CPU enumeration problems > for Windows guests[1]. So this patch sets model=6, that matches "Athlon > (PM core)" on AMD and "P2 with on-die L2 cache" on Intel and it allows > Windows to use all CPUs as well as fixing sysenter. > > [1] https://bugzilla.redhat.com/show_bug.cgi?id=508623 > > Cc: Andrea Arcangeli > Signed-off-by: Eduardo Habkost > --- > include/hw/i386/pc.h | 8 ++++++++ > target-i386/cpu.c | 4 ++-- > 2 files changed, 10 insertions(+), 2 deletions(-) > > diff --git a/include/hw/i386/pc.h b/include/hw/i386/pc.h > index 7fb04d8..195e962 100644 > --- a/include/hw/i386/pc.h > +++ b/include/hw/i386/pc.h > @@ -258,6 +258,14 @@ int e820_add_entry(uint64_t, uint64_t, uint32_t); > .driver = TYPE_X86_CPU,\ > .property = "pmu",\ > .value = "on",\ > + },{\ > + .driver = "qemu64-" TYPE_X86_CPU,\ > + .property = "model",\ > + .value = stringify(2),\ > + },{\ > + .driver = "qemu32-" TYPE_X86_CPU,\ > + .property = "model",\ > + .value = stringify(3),\ > } > > #define PC_COMPAT_1_4 \ > diff --git a/target-i386/cpu.c b/target-i386/cpu.c > index c36345e..36cfbce 100644 > --- a/target-i386/cpu.c > +++ b/target-i386/cpu.c > @@ -544,7 +544,7 @@ static x86_def_t builtin_x86_defs[] = { > .level = 4, > .vendor = CPUID_VENDOR_AMD, > .family = 6, > - .model = 2, > + .model = 6, > .stepping = 3, > .features[FEAT_1_EDX] = > PPRO_FEATURES | > @@ -647,7 +647,7 @@ static x86_def_t builtin_x86_defs[] = { > .level = 4, > .vendor = CPUID_VENDOR_INTEL, > .family = 6, > - .model = 3, > + .model = 6, > .stepping = 3, > .features[FEAT_1_EDX] = > PPRO_FEATURES, Reviewed-By: Igor Mammedov