Received: from eggs.gnu.org ([2001:4830:134:3::10]:34548) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VTrL8-0007W9-Uu for qemu-devel@nongnu.org; Wed, 09 Oct 2013 06:50:09 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VTrL0-0005rZ-Ms for qemu-devel@nongnu.org; Wed, 09 Oct 2013 06:50:02 -0400 Received: from cantor2.suse.de ([195.135.220.15]:44685 helo=mx2.suse.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VTrL0-0005rT-DW for qemu-devel@nongnu.org; Wed, 09 Oct 2013 06:49:54 -0400 From: =?UTF-8?q?Andreas=20F=C3=A4rber?= Date: Wed, 9 Oct 2013 12:49:20 +0200 Message-Id: <1381315764-2814-2-git-send-email-afaerber@suse.de> In-Reply-To: <1381315764-2814-1-git-send-email-afaerber@suse.de> References: <1381315764-2814-1-git-send-email-afaerber@suse.de> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: [Qemu-devel] [PULL 1/5] target-i386: Set model=6 on qemu64 & qemu32 CPU models List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Andrea Arcangeli , Eduardo Habkost , =?UTF-8?q?Andreas=20F=C3=A4rber?= From: Eduardo Habkost There's no Intel CPU with family=3D6,model=3D2, and Linux and Windows gue= sts 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=3D3 would fix the problem, but it causes CPU enumeration problems for Windows guests[1]. So let's set model=3D6, 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=3D508623 Cc: Andrea Arcangeli Signed-off-by: Eduardo Habkost Reviewed-by: Igor Mammedov Signed-off-by: Andreas F=C3=A4rber --- 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 9b2ddc4..6083839 100644 --- a/include/hw/i386/pc.h +++ b/include/hw/i386/pc.h @@ -230,6 +230,14 @@ int e820_add_entry(uint64_t, uint64_t, uint32_t); .driver =3D "e1000",\ .property =3D "mitigation",\ .value =3D "off",\ + },{\ + .driver =3D "qemu64-" TYPE_X86_CPU,\ + .property =3D "model",\ + .value =3D stringify(2),\ + },{\ + .driver =3D "qemu32-" TYPE_X86_CPU,\ + .property =3D "model",\ + .value =3D stringify(3),\ } =20 #define PC_COMPAT_1_5 \ diff --git a/target-i386/cpu.c b/target-i386/cpu.c index b682802..c1c994f 100644 --- a/target-i386/cpu.c +++ b/target-i386/cpu.c @@ -545,7 +545,7 @@ static x86_def_t builtin_x86_defs[] =3D { .level =3D 4, .vendor =3D CPUID_VENDOR_AMD, .family =3D 6, - .model =3D 2, + .model =3D 6, .stepping =3D 3, .features[FEAT_1_EDX] =3D PPRO_FEATURES | @@ -648,7 +648,7 @@ static x86_def_t builtin_x86_defs[] =3D { .level =3D 4, .vendor =3D CPUID_VENDOR_INTEL, .family =3D 6, - .model =3D 3, + .model =3D 6, .stepping =3D 3, .features[FEAT_1_EDX] =3D PPRO_FEATURES, --=20 1.8.1.4