From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KppRy-0002FB-Ay for qemu-devel@nongnu.org; Tue, 14 Oct 2008 15:20:58 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KppRx-0002Ex-Pf for qemu-devel@nongnu.org; Tue, 14 Oct 2008 15:20:57 -0400 Received: from [199.232.76.173] (port=46170 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KppRx-0002Eu-LQ for qemu-devel@nongnu.org; Tue, 14 Oct 2008 15:20:57 -0400 Received: from savannah.gnu.org ([199.232.41.3]:38596 helo=sv.gnu.org) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1KppRx-0003an-Bp for qemu-devel@nongnu.org; Tue, 14 Oct 2008 15:20:57 -0400 Received: from cvs.savannah.gnu.org ([199.232.41.69]) by sv.gnu.org with esmtp (Exim 4.63) (envelope-from ) id 1KppRw-0000cy-1e for qemu-devel@nongnu.org; Tue, 14 Oct 2008 19:20:56 +0000 Received: from aurel32 by cvs.savannah.gnu.org with local (Exim 4.63) (envelope-from ) id 1KppRu-0000cp-EO for qemu-devel@nongnu.org; Tue, 14 Oct 2008 19:20:55 +0000 MIME-Version: 1.0 Errors-To: aurel32 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit From: Aurelien Jarno Message-Id: Date: Tue, 14 Oct 2008 19:20:54 +0000 Subject: [Qemu-devel] [5488] target-i386: Add Core Duo Definition Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Revision: 5488 http://svn.sv.gnu.org/viewvc/?view=rev&root=qemu&revision=5488 Author: aurel32 Date: 2008-10-14 19:20:52 +0000 (Tue, 14 Oct 2008) Log Message: ----------- target-i386: Add Core Duo Definition This patch adds a CPU definition for the Core Duo CPU. I tried to resemble the original as closely as possible and document what features are missing still. This patch enables the use of a recent CPU definition on 32 bit platforms. It also fixes two issues that went along the line: - invalid xlevel in core2duo spec While looking though the CPUIDs again, I found that xlevel is actually 8. - non-PSE36 support The CoreDuo CPUID does not expose the PSE36 capability, but CPUID 0x80000008 is tied to 36 bits. This broke Windows XP installation for me, so I just set it to 32 bits width when PSE36 is not available. The original CPU also exposes 32 bit width in CPUID 0x80000008. Signed-off-by: Alexander Graf Signed-off-by: Aurelien Jarno Modified Paths: -------------- trunk/target-i386/helper.c trunk/target-i386/op_helper.c Modified: trunk/target-i386/helper.c =================================================================== --- trunk/target-i386/helper.c 2008-10-14 18:14:47 UTC (rev 5487) +++ trunk/target-i386/helper.c 2008-10-14 19:20:52 UTC (rev 5488) @@ -183,7 +183,7 @@ .ext_features = CPUID_EXT_SSE3 | CPUID_EXT_MONITOR | CPUID_EXT_SSSE3, .ext2_features = CPUID_EXT2_LM | CPUID_EXT2_SYSCALL | CPUID_EXT2_NX, /* Missing: .ext3_features = CPUID_EXT3_LAHF_LM */ - .xlevel = 0x8000000A, + .xlevel = 0x80000008, .model_id = "Intel(R) Core(TM)2 Duo CPU T7700 @ 2.40GHz", }, #endif @@ -199,6 +199,25 @@ .model_id = "QEMU Virtual CPU version " QEMU_VERSION, }, { + .name = "coreduo", + .level = 10, + .family = 6, + .model = 14, + .stepping = 8, + /* The original CPU also implements these features: + CPUID_DTS, CPUID_ACPI, CPUID_SS, CPUID_HT, + CPUID_TM, CPUID_PBE */ + .features = PPRO_FEATURES | CPUID_VME | + CPUID_MTRR | CPUID_CLFLUSH | CPUID_MCA, + /* The original CPU also implements these ext features: + CPUID_EXT_VMX, CPUID_EXT_EST, CPUID_EXT_TM2, CPUID_EXT_XTPR, + CPUID_EXT_PDCM */ + .ext_features = CPUID_EXT_SSE3 | CPUID_EXT_MONITOR, + .ext2_features = CPUID_EXT2_NX, + .xlevel = 0x80000008, + .model_id = "Genuine Intel(R) CPU T2600 @ 2.16GHz", + }, + { .name = "486", .level = 0, .family = 4, Modified: trunk/target-i386/op_helper.c =================================================================== --- trunk/target-i386/op_helper.c 2008-10-14 18:14:47 UTC (rev 5487) +++ trunk/target-i386/op_helper.c 2008-10-14 19:20:52 UTC (rev 5488) @@ -2026,7 +2026,10 @@ #if defined(USE_KQEMU) EAX = 0x00000020; /* 32 bits physical */ #else - EAX = 0x00000024; /* 36 bits physical */ + if (env->cpuid_features & CPUID_PSE36) + EAX = 0x00000024; /* 36 bits physical */ + else + EAX = 0x00000020; /* 32 bits physical */ #endif } EBX = 0;