From patchwork Mon Dec 7 11:05:38 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andre Przywara X-Patchwork-Id: 40452 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 ozlabs.org (Postfix) with ESMTPS id 26806B6F0D for ; Mon, 7 Dec 2009 22:18:04 +1100 (EST) Received: from localhost ([127.0.0.1]:43566 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NHbbM-00014w-KZ for incoming@patchwork.ozlabs.org; Mon, 07 Dec 2009 06:18:00 -0500 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NHbQ8-0000GE-Ij for qemu-devel@nongnu.org; Mon, 07 Dec 2009 06:06:24 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NHbQ4-0000DA-LM for qemu-devel@nongnu.org; Mon, 07 Dec 2009 06:06:24 -0500 Received: from [199.232.76.173] (port=38105 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NHbQ4-0000Cx-B5 for qemu-devel@nongnu.org; Mon, 07 Dec 2009 06:06:20 -0500 Received: from tx2ehsobe003.messaging.microsoft.com ([65.55.88.13]:2278 helo=TX2EHSOBE005.bigfish.com) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_ARCFOUR_MD5:16) (Exim 4.60) (envelope-from ) id 1NHbQ3-000057-Rg for qemu-devel@nongnu.org; Mon, 07 Dec 2009 06:06:20 -0500 Received: from mail180-tx2-R.bigfish.com (10.9.14.239) by TX2EHSOBE005.bigfish.com (10.9.40.25) with Microsoft SMTP Server id 8.1.340.0; Mon, 7 Dec 2009 11:06:17 +0000 Received: from mail180-tx2 (localhost.localdomain [127.0.0.1]) by mail180-tx2-R.bigfish.com (Postfix) with ESMTP id 54884F581F2; Mon, 7 Dec 2009 11:06:17 +0000 (UTC) X-SpamScore: -3 X-BigFish: VPS-3(z5edIz936eMab9bhzz1202hzzz32i6bh43j61h) X-Spam-TCS-SCL: 0:0 Received: from mail180-tx2 (localhost.localdomain [127.0.0.1]) by mail180-tx2 (MessageSwitch) id 1260183945700623_13352; Mon, 7 Dec 2009 11:05:45 +0000 (UTC) Received: from TX2EHSMHS008.bigfish.com (unknown [10.9.14.236]) by mail180-tx2.bigfish.com (Postfix) with ESMTP id 32BB317E8078; Mon, 7 Dec 2009 11:05:44 +0000 (UTC) Received: from ausb3extmailp01.amd.com (163.181.251.8) by TX2EHSMHS008.bigfish.com (10.9.99.108) with Microsoft SMTP Server (TLS) id 14.0.482.32; Mon, 7 Dec 2009 11:05:42 +0000 Received: from ausb3twp01.amd.com ([163.181.250.37]) by ausb3extmailp01.amd.com (Switch-3.2.7/Switch-3.2.7) with ESMTP id nB7B5Y3t015948; Mon, 7 Dec 2009 05:05:37 -0600 X-WSS-ID: 0KUA45C-01-479-02 X-M-MSG: Received: from sausexbh2.amd.com (SAUSEXBH2.amd.com [163.181.22.102]) by ausb3twp01.amd.com (Tumbleweed MailGate 3.7.2) with ESMTP id 290681029956; Mon, 7 Dec 2009 05:05:35 -0600 (CST) Received: from sausexmb4.amd.com ([163.181.3.15]) by sausexbh2.amd.com with Microsoft SMTPSVC(6.0.3790.3959); Mon, 7 Dec 2009 05:05:38 -0600 Received: from seurexmb1.amd.com ([165.204.9.130]) by sausexmb4.amd.com with Microsoft SMTPSVC(6.0.3790.3959); Mon, 7 Dec 2009 05:05:37 -0600 Received: from gwo.osrc.amd.com ([165.204.16.204]) by seurexmb1.amd.com with Microsoft SMTPSVC(6.0.3790.3959); Mon, 7 Dec 2009 12:05:35 +0100 Received: from localhost.localdomain (tronje.osrc.amd.com [165.204.15.48]) by gwo.osrc.amd.com (Postfix) with ESMTP id 64E3C49C150; Mon, 7 Dec 2009 11:05:35 +0000 (GMT) From: Andre Przywara To: aliguori@linux.vnet.ibm.com Date: Mon, 7 Dec 2009 12:05:38 +0100 Message-ID: <1260183938-22492-1-git-send-email-andre.przywara@amd.com> X-Mailer: git-send-email 1.6.4 X-OriginalArrivalTime: 07 Dec 2009 11:05:35.0661 (UTC) FILETIME=[339C85D0:01CA772D] MIME-Version: 1.0 X-Reverse-DNS: unknown X-detected-operating-system: by monty-python.gnu.org: Windows 2000 SP4, XP SP1+ Cc: Andre Przywara , qemu-devel@nongnu.org Subject: [Qemu-devel] [FOR 0.12][PATCH] cpuid: Update QEMU/TCG feature set 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 CPUID features QEMU presented to the guest were not up-to-date with QEMU's emulated feature set. Add the missing bits of recent (and not so recent) additions to QEMU's emulation engine. For stability reasons only the user mode usable bits are exposed for now, features like Monitor or CR8LEG are left out. Signed-off-by: Andre Przywara --- target-i386/helper.c | 25 ++++++++++++------------- 1 files changed, 12 insertions(+), 13 deletions(-) diff --git a/target-i386/helper.c b/target-i386/helper.c index f0ecd50..f1ff577 100644 --- a/target-i386/helper.c +++ b/target-i386/helper.c @@ -139,10 +139,11 @@ static x86_def_t x86_defs[] = { CPUID_MTRR | CPUID_CLFLUSH | CPUID_MCA | /* this feature is needed for Solaris and isn't fully implemented */ CPUID_PSE36, - .ext_features = CPUID_EXT_SSE3, + .ext_features = CPUID_EXT_SSE3 | CPUID_EXT_CX16 | CPUID_EXT_POPCNT, .ext2_features = (PPRO_FEATURES & 0x0183F3FF) | CPUID_EXT2_LM | CPUID_EXT2_SYSCALL | CPUID_EXT2_NX, - .ext3_features = CPUID_EXT3_SVM, + .ext3_features = CPUID_EXT3_LAHF_LM | CPUID_EXT3_SVM | + CPUID_EXT3_ABM | CPUID_EXT3_SSE4A, .xlevel = 0x8000000A, .model_id = "QEMU Virtual CPU version " QEMU_VERSION, }, @@ -159,18 +160,19 @@ static x86_def_t x86_defs[] = { .features = PPRO_FEATURES | CPUID_MTRR | CPUID_CLFLUSH | CPUID_MCA | CPUID_PSE36, - /* Missing: CPUID_EXT_CX16, CPUID_EXT_POPCNT */ - .ext_features = CPUID_EXT_SSE3 | CPUID_EXT_MONITOR, + .ext_features = CPUID_EXT_SSE3 | CPUID_EXT_MONITOR | CPUID_EXT_CX16 | + CPUID_EXT_POPCNT, /* Missing: CPUID_EXT2_PDPE1GB, CPUID_EXT2_RDTSCP */ .ext2_features = (PPRO_FEATURES & 0x0183F3FF) | CPUID_EXT2_LM | CPUID_EXT2_SYSCALL | CPUID_EXT2_NX | CPUID_EXT2_3DNOW | CPUID_EXT2_3DNOWEXT | CPUID_EXT2_MMXEXT | CPUID_EXT2_FFXSR, - /* Missing: CPUID_EXT3_LAHF_LM, CPUID_EXT3_CMP_LEG, CPUID_EXT3_EXTAPIC, - CPUID_EXT3_CR8LEG, CPUID_EXT3_ABM, CPUID_EXT3_SSE4A, + /* Missing: CPUID_EXT3_CMP_LEG, CPUID_EXT3_EXTAPIC, + CPUID_EXT3_CR8LEG, CPUID_EXT3_MISALIGNSSE, CPUID_EXT3_3DNOWPREFETCH, CPUID_EXT3_OSVW, CPUID_EXT3_IBS */ - .ext3_features = CPUID_EXT3_SVM, + .ext3_features = CPUID_EXT3_LAHF_LM | CPUID_EXT3_SVM | + CPUID_EXT3_ABM | CPUID_EXT3_SSE4A, .xlevel = 0x8000001A, .model_id = "AMD Phenom(tm) 9550 Quad-Core Processor" }, @@ -191,7 +193,7 @@ static x86_def_t x86_defs[] = { CPUID_EXT_TM2, CPUID_EXT_CX16, CPUID_EXT_XTPR, CPUID_EXT_PDCM */ .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 */ + .ext3_features = CPUID_EXT3_LAHF_LM, .xlevel = 0x80000008, .model_id = "Intel(R) Core(TM)2 Duo CPU T7700 @ 2.40GHz", }, @@ -229,7 +231,7 @@ static x86_def_t x86_defs[] = { .model = 3, .stepping = 3, .features = PPRO_FEATURES, - .ext_features = CPUID_EXT_SSE3, + .ext_features = CPUID_EXT_SSE3 | CPUID_EXT_POPCNT, .xlevel = 0, .model_id = "QEMU Virtual CPU version " QEMU_VERSION, }, @@ -1791,11 +1793,8 @@ void cpu_x86_cpuid(CPUX86State *env, uint32_t index, uint32_t count, } if (kvm_enabled()) { - /* Nested SVM not yet supported in KVM */ + /* Nested SVM not yet supported in upstream QEMU */ *ecx &= ~CPUID_EXT3_SVM; - } else { - /* AMD 3DNow! is not supported in QEMU */ - *edx &= ~(CPUID_EXT2_3DNOW | CPUID_EXT2_3DNOWEXT); } break; case 0x80000002: