From patchwork Tue Feb 2 10:08:14 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andre Przywara X-Patchwork-Id: 44278 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 0AD2AB7D4E for ; Tue, 2 Feb 2010 21:57:33 +1100 (EST) Received: from localhost ([127.0.0.1]:37277 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NcGQt-000725-Rp for incoming@patchwork.ozlabs.org; Tue, 02 Feb 2010 05:56:35 -0500 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NcFgp-0002tN-NX for qemu-devel@nongnu.org; Tue, 02 Feb 2010 05:08:59 -0500 Received: from [199.232.76.173] (port=38617 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NcFgn-0002rr-To for qemu-devel@nongnu.org; Tue, 02 Feb 2010 05:08:58 -0500 Received: from Debian-exim by monty-python.gnu.org with spam-scanned (Exim 4.60) (envelope-from ) id 1NcFgU-0006wU-HC for qemu-devel@nongnu.org; Tue, 02 Feb 2010 05:08:57 -0500 Received: from va3ehsobe004.messaging.microsoft.com ([216.32.180.14]:34171 helo=VA3EHSOBE004.bigfish.com) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_ARCFOUR_MD5:16) (Exim 4.60) (envelope-from ) id 1NcFgR-0006uh-W8 for qemu-devel@nongnu.org; Tue, 02 Feb 2010 05:08:36 -0500 Received: from mail128-va3-R.bigfish.com (10.7.14.239) by VA3EHSOBE004.bigfish.com (10.7.40.24) with Microsoft SMTP Server id 8.1.240.5; Tue, 2 Feb 2010 10:08:35 +0000 Received: from mail128-va3 (localhost [127.0.0.1]) by mail128-va3-R.bigfish.com (Postfix) with ESMTP id AA4E14602BC; Tue, 2 Feb 2010 10:08:34 +0000 (UTC) X-SpamScore: -2 X-BigFish: VPS-2(zzab9bh936eMzz1202hzzz32i6bh43j61h) Received: from mail128-va3 (localhost.localdomain [127.0.0.1]) by mail128-va3 (MessageSwitch) id 1265105310624051_15186; Tue, 2 Feb 2010 10:08:30 +0000 (UTC) Received: from VA3EHSMHS024.bigfish.com (unknown [10.7.14.239]) by mail128-va3.bigfish.com (Postfix) with ESMTP id 81D3F16E80F3; Tue, 2 Feb 2010 10:08:27 +0000 (UTC) Received: from ausb3extmailp01.amd.com (163.181.251.8) by VA3EHSMHS024.bigfish.com (10.7.99.34) with Microsoft SMTP Server (TLS) id 14.0.482.39; Tue, 2 Feb 2010 10:08:26 +0000 Received: from ausb3twp02.amd.com ([163.181.250.38]) by ausb3extmailp01.amd.com (Switch-3.2.7/Switch-3.2.7) with ESMTP id o12AA4s4015738; Tue, 2 Feb 2010 04:10:09 -0600 X-WSS-ID: 0KX7LHW-02-G1J-02 X-M-MSG: Received: from sausexbh1.amd.com (sausexbh1.amd.com [163.181.22.101]) by ausb3twp02.amd.com (Tumbleweed MailGate 3.7.2) with ESMTP id 2E120C84E5; Tue, 2 Feb 2010 04:08:20 -0600 (CST) Received: from sausexmb1.amd.com ([163.181.3.156]) by sausexbh1.amd.com with Microsoft SMTPSVC(6.0.3790.3959); Tue, 2 Feb 2010 04:08:24 -0600 Received: from seurexmb1.amd.com ([165.204.9.130]) by sausexmb1.amd.com with Microsoft SMTPSVC(6.0.3790.3959); Tue, 2 Feb 2010 04:08:24 -0600 Received: from gwo.osrc.amd.com ([165.204.16.204]) by seurexmb1.amd.com with Microsoft SMTPSVC(6.0.3790.3959); Tue, 2 Feb 2010 11:08:19 +0100 Received: from localhost.localdomain (tronje.osrc.amd.com [165.204.15.48]) by gwo.osrc.amd.com (Postfix) with ESMTP id 8B02D49C203; Tue, 2 Feb 2010 10:08:38 +0000 (GMT) From: Andre Przywara To: qemu-devel@nongnu.org Date: Tue, 2 Feb 2010 11:08:14 +0100 Message-ID: <1265105301-3455-7-git-send-email-andre.przywara@amd.com> X-Mailer: git-send-email 1.6.4 In-Reply-To: <1265105301-3455-1-git-send-email-andre.przywara@amd.com> References: <1265105301-3455-1-git-send-email-andre.przywara@amd.com> X-OriginalArrivalTime: 02 Feb 2010 10:08:19.0712 (UTC) FILETIME=[A52C1000:01CAA3EF] MIME-Version: 1.0 X-Reverse-DNS: unknown X-detected-operating-system: by monty-python.gnu.org: Windows 2000 SP4, XP SP1+ Cc: john.cooper@redhat.com, Andre Przywara Subject: [Qemu-devel] [PATCH 06/13] cpuid: list all known x86 CPUID feature flags 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 -cpu ? currently gives us a list of known CPU models. Add "host" if using KVM and a list of known CPUID feature flags to the output. Signed-off-by: Andre Przywara --- target-i386/cpuid.c | 22 +++++++++++++++++++++- 1 files changed, 21 insertions(+), 1 deletions(-) diff --git a/target-i386/cpuid.c b/target-i386/cpuid.c index 19d58e1..3f56c50 100644 --- a/target-i386/cpuid.c +++ b/target-i386/cpuid.c @@ -573,10 +573,30 @@ error: void x86_cpu_list (FILE *f, int (*cpu_fprintf)(FILE *f, const char *fmt, ...)) { - unsigned int i; + unsigned int i, j; + const char **stringlist[] = {feature_name, ext_feature_name, + ext2_feature_name, ext3_feature_name}; for (i = 0; i < ARRAY_SIZE(x86_defs); i++) (*cpu_fprintf)(f, "x86 %16s\n", x86_defs[i].name); + if (kvm_enabled()) { + (*cpu_fprintf)(f, "x86 %16s\n", "host"); + } + + (*cpu_fprintf)(f, "x86 recognized feature flags:\n "); + for (j = 0; j < 4; j++) { + for (i = 0; i < 32; i++) { + if (j == 2 && ((1 << i) & EXT2_FEATURE_MASK)) + continue; + if (stringlist[j][i] == NULL) + continue; + (*cpu_fprintf)(f, "%s ", stringlist[j][i]); + if (i == 15) + (*cpu_fprintf)(f, "\n "); + } + (*cpu_fprintf)(f, "\n "); + } + return; } int cpu_x86_register (CPUX86State *env, const char *cpu_model)