Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Mobzp-0007tw-Ls for qemu-devel@nongnu.org; Fri, 18 Sep 2009 07:51:25 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Mobzh-0007qt-HH for qemu-devel@nongnu.org; Fri, 18 Sep 2009 07:51:21 -0400 Received: from [199.232.76.173] (port=38464 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Mobzg-0007qi-Hm for qemu-devel@nongnu.org; Fri, 18 Sep 2009 07:51:16 -0400 Received: from va3ehsobe005.messaging.microsoft.com ([216.32.180.15]:58235 helo=VA3EHSOBE006.bigfish.com) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_ARCFOUR_MD5:16) (Exim 4.60) (envelope-from ) id 1Mobzg-0003M5-39 for qemu-devel@nongnu.org; Fri, 18 Sep 2009 07:51:16 -0400 Received: from mail116-va3 (localhost.localdomain [127.0.0.1]) by mail116-va3-R.bigfish.com (Postfix) with ESMTP id 4E0AF2C010B for ; Fri, 18 Sep 2009 11:51:15 +0000 (UTC) Received: from svlb1extmailp02.amd.com (unknown [139.95.251.11]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail116-va3.bigfish.com (Postfix) with ESMTP id BDD5B1BE805B for ; Fri, 18 Sep 2009 11:51:13 +0000 (UTC) Received: from svlb1twp01.amd.com ([139.95.250.34]) by svlb1extmailp02.amd.com (Switch-3.2.7/Switch-3.2.7) with ESMTP id n8IBp7ng032298 for ; Fri, 18 Sep 2009 04:51:10 -0700 Received: from SSVLEXBH2.amd.com (ssvlexbh2.amd.com [139.95.53.183]) by svlb1twp01.amd.com (Tumbleweed MailGate 3.7.0) with ESMTP id 26FF619A0145 for ; Fri, 18 Sep 2009 04:51:05 -0700 (PDT) From: Andre Przywara Date: Fri, 18 Sep 2009 13:48:07 +0200 Message-ID: <1253274494-13244-15-git-send-email-andre.przywara@amd.com> In-Reply-To: <1253274494-13244-1-git-send-email-andre.przywara@amd.com> References: <1253274494-13244-1-git-send-email-andre.przywara@amd.com> MIME-Version: 1.0 Content-Type: text/plain Subject: [Qemu-devel] [PATCH v2 14/21] cpuid: decrease L2 cache for Intel and add comments List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Andre Przywara 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 9f43ccd..8ec730c 100644 --- a/target-i386/cpuid.c +++ b/target-i386/cpuid.c @@ -716,25 +716,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 */ @@ -813,14 +813,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; -- 1.6.1.3