From patchwork Mon May 27 20:23:55 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eduardo Habkost X-Patchwork-Id: 246655 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 54CF02C02C8 for ; Tue, 28 May 2013 06:24:52 +1000 (EST) Received: from localhost ([::1]:53071 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Uh3yM-0003RJ-Gn for incoming@patchwork.ozlabs.org; Mon, 27 May 2013 16:24:50 -0400 Received: from eggs.gnu.org ([208.118.235.92]:41199) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Uh3xq-0003Oz-FD for qemu-devel@nongnu.org; Mon, 27 May 2013 16:24:23 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Uh3xi-00034X-9Z for qemu-devel@nongnu.org; Mon, 27 May 2013 16:24:18 -0400 Received: from mx1.redhat.com ([209.132.183.28]:55546) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Uh3xi-00033C-13 for qemu-devel@nongnu.org; Mon, 27 May 2013 16:24:10 -0400 Received: from int-mx02.intmail.prod.int.phx2.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id r4RKO9Kd026348 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Mon, 27 May 2013 16:24:09 -0400 Received: from localhost (vpn1-5-26.gru2.redhat.com [10.97.5.26]) by int-mx02.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id r4RKO8jm032404; Mon, 27 May 2013 16:24:09 -0400 From: Eduardo Habkost To: qemu-devel@nongnu.org, =?UTF-8?q?Andreas=20F=C3=A4rber?= Date: Mon, 27 May 2013 17:23:55 -0300 Message-Id: <1369686235-11090-4-git-send-email-ehabkost@redhat.com> In-Reply-To: <1369686235-11090-1-git-send-email-ehabkost@redhat.com> References: <1369686235-11090-1-git-send-email-ehabkost@redhat.com> X-Scanned-By: MIMEDefang 2.67 on 10.5.11.12 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 209.132.183.28 Cc: Igor Mammedov , Gleb Natapov Subject: [Qemu-devel] [PATCH qom-cpu 3/3] target-i386: set level=4 on Conroe/Penryn/Nehalem X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org The CPUID level value on Conroe, Penryn, and Nehalem are too low. This causes at least one known problem: the -smp "threads" option doesn't work as expect if level is < 4, because thread count information is provided to the guest on CPUID[EAX=4,ECX=2].EAX Signed-off-by: Eduardo Habkost --- Testing: those level values have been in use on Red Hat Enterprise Linux since version 6.0 (released in 2010). The fix wasn't submitted to QEMU earlier because we didn't have a good mechanism and clear procedure to update CPUID values of existing CPU models in QEMU. --- include/hw/i386/pc.h | 12 ++++++++++++ target-i386/cpu.c | 6 +++--- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/include/hw/i386/pc.h b/include/hw/i386/pc.h index 8883b37..4351f39 100644 --- a/include/hw/i386/pc.h +++ b/include/hw/i386/pc.h @@ -188,13 +188,25 @@ int e820_add_entry(uint64_t, uint64_t, uint32_t); .property = "model",\ .value = stringify(2),\ },{\ + .driver = "Conroe-" TYPE_X86_CPU,\ + .property = "level",\ + .value = stringify(2),\ + },{\ .driver = "Penryn-" TYPE_X86_CPU,\ .property = "model",\ .value = stringify(2),\ },{\ + .driver = "Penryn-" TYPE_X86_CPU,\ + .property = "level",\ + .value = stringify(2),\ + },{\ .driver = "Nehalem-" TYPE_X86_CPU,\ .property = "model",\ .value = stringify(2),\ + },{\ + .driver = "Nehalem-" TYPE_X86_CPU,\ + .property = "level",\ + .value = stringify(2),\ } #define PC_COMPAT_1_4 \ diff --git a/target-i386/cpu.c b/target-i386/cpu.c index 6b48562..762baad 100644 --- a/target-i386/cpu.c +++ b/target-i386/cpu.c @@ -669,7 +669,7 @@ static x86_def_t builtin_x86_defs[] = { }, { .name = "Conroe", - .level = 2, + .level = 4, .vendor = CPUID_VENDOR_INTEL, .family = 6, .model = 15, @@ -691,7 +691,7 @@ static x86_def_t builtin_x86_defs[] = { }, { .name = "Penryn", - .level = 2, + .level = 4, .vendor = CPUID_VENDOR_INTEL, .family = 6, .model = 23, @@ -714,7 +714,7 @@ static x86_def_t builtin_x86_defs[] = { }, { .name = "Nehalem", - .level = 2, + .level = 4, .vendor = CPUID_VENDOR_INTEL, .family = 6, .model = 26,