From patchwork Thu Sep 10 22:20:57 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andre Przywara X-Patchwork-Id: 33398 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by bilbo.ozlabs.org (Postfix) with ESMTPS id 39A18B707B for ; Fri, 11 Sep 2009 08:43:34 +1000 (EST) Received: from localhost ([127.0.0.1]:46848 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MlsMV-00030U-DV for incoming@patchwork.ozlabs.org; Thu, 10 Sep 2009 18:43:31 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Mls44-0004gg-4A for qemu-devel@nongnu.org; Thu, 10 Sep 2009 18:24:28 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Mls3u-0004ZG-Dx for qemu-devel@nongnu.org; Thu, 10 Sep 2009 18:24:22 -0400 Received: from [199.232.76.173] (port=40036 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Mls3t-0004Yj-MT for qemu-devel@nongnu.org; Thu, 10 Sep 2009 18:24:17 -0400 Received: from tx2ehsobe005.messaging.microsoft.com ([65.55.88.15]:15690 helo=TX2EHSOBE010.bigfish.com) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_ARCFOUR_MD5:16) (Exim 4.60) (envelope-from ) id 1Mls3t-0001KO-2P for qemu-devel@nongnu.org; Thu, 10 Sep 2009 18:24:17 -0400 Received: from mail193-tx2-R.bigfish.com (10.9.14.240) by TX2EHSOBE010.bigfish.com (10.9.40.30) with Microsoft SMTP Server id 8.1.340.0; Thu, 10 Sep 2009 22:24:15 +0000 Received: from mail193-tx2 (localhost.localdomain [127.0.0.1]) by mail193-tx2-R.bigfish.com (Postfix) with ESMTP id DF447840477 for ; Thu, 10 Sep 2009 22:24:15 +0000 (UTC) X-SpamScore: 6 X-BigFish: VPS6(zz19c2kzz1202hzzz32i203h43j62h) X-Spam-TCS-SCL: 1:0 X-FB-SS: 5, Received: by mail193-tx2 (MessageSwitch) id 1252621454516662_6939; Thu, 10 Sep 2009 22:24:14 +0000 (UCT) Received: from ausb3extmailp01.amd.com (unknown [163.181.251.8]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail193-tx2.bigfish.com (Postfix) with ESMTP id 4F4D5E4806A for ; Thu, 10 Sep 2009 22:24:14 +0000 (UTC) Received: from ausb3twp02.amd.com ([163.181.250.38]) by ausb3extmailp01.amd.com (Switch-3.2.7/Switch-3.2.7) with ESMTP id n8AMO6Vn020690 for ; Thu, 10 Sep 2009 17:24:11 -0500 X-WSS-ID: 0KPS0WA-02-O8J-02 X-M-MSG: Received: from sausexbh2.amd.com (SAUSEXBH2.amd.com [163.181.22.102]) by ausb3twp02.amd.com (Tumbleweed MailGate 3.7.0) with ESMTP id 2034CC8513 for ; Thu, 10 Sep 2009 17:24:09 -0500 (CDT) Received: from sausexmb5.amd.com ([163.181.49.129]) by sausexbh2.amd.com with Microsoft SMTPSVC(6.0.3790.3959); Thu, 10 Sep 2009 17:24:10 -0500 Received: from SDRSEXMB1.amd.com ([172.20.3.116]) by sausexmb5.amd.com with Microsoft SMTPSVC(6.0.3790.3959); Thu, 10 Sep 2009 17:24:10 -0500 Received: from localhost.localdomain ([165.204.15.42]) by SDRSEXMB1.amd.com with Microsoft SMTPSVC(6.0.3790.3959); Fri, 11 Sep 2009 00:23:57 +0200 From: Andre Przywara To: qemu-devel@nongnu.org Date: Fri, 11 Sep 2009 00:20:57 +0200 Message-ID: <1252621257-26364-13-git-send-email-andre.przywara@amd.com> X-Mailer: git-send-email 1.6.1.3 In-Reply-To: <1252621257-26364-1-git-send-email-andre.przywara@amd.com> References: <1252621257-26364-1-git-send-email-andre.przywara@amd.com> X-OriginalArrivalTime: 10 Sep 2009 22:23:57.0199 (UTC) FILETIME=[634459F0:01CA3265] MIME-Version: 1.0 X-detected-operating-system: by monty-python.gnu.org: Windows 2000 SP4, XP SP1+ Cc: Andre Przywara Subject: [Qemu-devel] [PATCH 12/12] cpuid: decrease L2 cache for Intel and add comments X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org The Intel cache info leafs describe a Core2Duo with 4MB L2 Cache. This is a pretty high value not reached by many host CPUs. So lower this value to one MB to avoid guests assuming too large caches. Signed-off-by: Andre Przywara --- target-i386/cpuid.c | 12 ++++++------ 1 files changed, 6 insertions(+), 6 deletions(-) diff --git a/target-i386/cpuid.c b/target-i386/cpuid.c index b35523c..7b3f31b 100644 --- a/target-i386/cpuid.c +++ b/target-i386/cpuid.c @@ -700,25 +700,25 @@ void cpu_x86_cpuid(CPUX86State *env, uint32_t index, uint32_t count, *eax = 0; } switch (count) { - case 0: /* L1 dcache info */ + case 0: /* L1 dcache info: 32KB */ *eax |= 0x0000121; *ebx = 0x1c0003f; *ecx = 0x000003f; *edx = 0x0000001; break; - case 1: /* L1 icache info */ + case 1: /* L1 icache info: 32KB */ *eax |= 0x0000122; *ebx = 0x1c0003f; *ecx = 0x000003f; *edx = 0x0000001; break; - case 2: /* L2 cache info */ + case 2: /* L2 cache info: 1024KB */ *eax |= 0x0000143; if (env->nr_threads > 1) { *eax |= (env->nr_threads - 1) << 14; } *ebx = 0x3c0003f; - *ecx = 0x0000fff; + *ecx = 0x00003ff; *edx = 0x0000001; break; default: /* end of info */ @@ -790,14 +790,14 @@ void cpu_x86_cpuid(CPUX86State *env, uint32_t index, uint32_t count, *edx = env->cpuid_model[(index - 0x80000002) * 4 + 3]; break; case 0x80000005: - /* cache info (L1 cache) */ + /* cache info (L1 cache): 64KB L1D & L1I */ *eax = 0x01ff01ff; *ebx = 0x01ff01ff; *ecx = 0x40020140; *edx = 0x40020140; break; case 0x80000006: - /* cache info (L2 cache) */ + /* cache info (L2 cache): 512KB L2, no L3 */ *eax = 0; *ebx = 0x42004200; *ecx = 0x02008140;