Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Npibu-0005Za-Pw for qemu-devel@nongnu.org; Thu, 11 Mar 2010 08:39:34 -0500 Received: from [199.232.76.173] (port=45894 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Npibu-0005ZJ-7M for qemu-devel@nongnu.org; Thu, 11 Mar 2010 08:39:34 -0500 Received: from Debian-exim by monty-python.gnu.org with spam-scanned (Exim 4.60) (envelope-from ) id 1Npibs-0001Se-Da for qemu-devel@nongnu.org; Thu, 11 Mar 2010 08:39:33 -0500 Received: from va3ehsobe005.messaging.microsoft.com ([216.32.180.15]:25511 helo=VA3EHSOBE006.bigfish.com) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_ARCFOUR_MD5:16) (Exim 4.60) (envelope-from ) id 1Npibs-0001SH-1t for qemu-devel@nongnu.org; Thu, 11 Mar 2010 08:39:32 -0500 From: Andre Przywara Date: Thu, 11 Mar 2010 14:39:07 +0100 Message-ID: <1268314747-11111-14-git-send-email-andre.przywara@amd.com> In-Reply-To: <1268314747-11111-1-git-send-email-andre.przywara@amd.com> References: <1268314747-11111-1-git-send-email-andre.przywara@amd.com> MIME-Version: 1.0 Content-Type: text/plain Subject: [Qemu-devel] [PATCH 13/13] x86/cpuid: Update qemu64/32 CPU models List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: anthony@codemonkey.ws Cc: Andre Przywara , qemu-devel@nongnu.org, aurelien@aurel32.net Since we now have a real TCG feature set, use it to describe the artificial qemu CPUs (both 64 and 32-bit). If new features are added to TCG, the capability of qemu64/32 will automatically be adjusted. Signed-off-by: Andre Przywara --- target-i386/cpuid.c | 25 +++++++++++++------------ 1 files changed, 13 insertions(+), 12 deletions(-) diff --git a/target-i386/cpuid.c b/target-i386/cpuid.c index 076f6cc..ec43596 100644 --- a/target-i386/cpuid.c +++ b/target-i386/cpuid.c @@ -227,6 +227,7 @@ typedef struct x86_def_t { CPUID_MSR | CPUID_MCE | CPUID_CX8 | CPUID_PGE | CPUID_CMOV | \ CPUID_PAT | CPUID_FXSR | CPUID_MMX | CPUID_SSE | CPUID_SSE2 | \ CPUID_PAE | CPUID_SEP | CPUID_APIC) +#define EXT2_FEATURES_64 (CPUID_EXT2_LM | CPUID_EXT2_SYSCALL | CPUID_EXT2_NX) #define EXT2_FEATURE_MASK 0x0183F3FF #define TCG_FEATURES (CPUID_FP87 | CPUID_PSE | CPUID_TSC | CPUID_MSR | \ @@ -259,16 +260,12 @@ static x86_def_t builtin_x86_defs[] = { .family = 6, .model = 2, .stepping = 3, - .features = PPRO_FEATURES | - /* these features are needed for Win64 and aren't fully implemented */ - CPUID_MTRR | CPUID_CLFLUSH | CPUID_MCA | - /* this feature is needed for Solaris and isn't fully implemented */ - CPUID_PSE36, - .ext_features = CPUID_EXT_SSE3 | CPUID_EXT_CX16 | CPUID_EXT_POPCNT, - .ext2_features = (PPRO_FEATURES & EXT2_FEATURE_MASK) | - CPUID_EXT2_LM | CPUID_EXT2_SYSCALL | CPUID_EXT2_NX, - .ext3_features = CPUID_EXT3_LAHF_LM | CPUID_EXT3_SVM | - CPUID_EXT3_ABM | CPUID_EXT3_SSE4A, + .features = TCG_FEATURES, + .ext_features = TCG_EXT_FEATURES, + /* 3DNow! is deprecated, so leave it out of the default feature set */ + .ext2_features = (TCG_EXT2_FEATURES | EXT2_FEATURES_64) & + ~(CPUID_EXT2_3DNOW | CPUID_EXT2_3DNOWEXT), + .ext3_features = TCG_EXT3_FEATURES, .xlevel = 0x8000000A, .model_id = "QEMU Virtual CPU version " QEMU_VERSION, }, @@ -354,8 +351,12 @@ static x86_def_t builtin_x86_defs[] = { .family = 6, .model = 3, .stepping = 3, - .features = PPRO_FEATURES, - .ext_features = CPUID_EXT_SSE3 | CPUID_EXT_POPCNT, + .features = TCG_FEATURES, + .ext_features = TCG_EXT_FEATURES, + /* 3DNow! is deprecated, so leave it out of the default feature set */ + .ext2_features = TCG_EXT2_FEATURES & + ~(CPUID_EXT2_3DNOW | CPUID_EXT2_3DNOWEXT), + .ext3_features = TCG_EXT3_FEATURES, .xlevel = 0x80000004, .model_id = "QEMU Virtual CPU version " QEMU_VERSION, }, -- 1.6.4