From patchwork Wed Feb 27 09:15:51 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Kiszka X-Patchwork-Id: 223562 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id E64BF2C0085 for ; Wed, 27 Feb 2013 20:16:07 +1100 (EST) Received: from localhost ([::1]:36313 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UAd7N-000169-5o for incoming@patchwork.ozlabs.org; Wed, 27 Feb 2013 04:16:05 -0500 Received: from eggs.gnu.org ([208.118.235.92]:38396) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UAd7F-000161-Nv for qemu-devel@nongnu.org; Wed, 27 Feb 2013 04:15:59 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UAd7E-0006Sw-Ip for qemu-devel@nongnu.org; Wed, 27 Feb 2013 04:15:57 -0500 Received: from thoth.sbs.de ([192.35.17.2]:18299) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UAd7E-0006SW-9E for qemu-devel@nongnu.org; Wed, 27 Feb 2013 04:15:56 -0500 Received: from mail1.siemens.de (localhost [127.0.0.1]) by thoth.sbs.de (8.13.6/8.13.6) with ESMTP id r1R9Fs8t001780; Wed, 27 Feb 2013 10:15:54 +0100 Received: from mchn199C.mchp.siemens.de ([139.22.37.225]) by mail1.siemens.de (8.13.6/8.13.6) with SMTP id r1R9FpbE024943; Wed, 27 Feb 2013 10:15:53 +0100 Message-ID: <512DCEC7.3030902@siemens.com> Date: Wed, 27 Feb 2013 10:15:51 +0100 From: Jan Kiszka User-Agent: Mozilla/5.0 (X11; U; Linux i686 (x86_64); de; rv:1.8.1.12) Gecko/20080226 SUSE/2.0.0.12-1.1 Thunderbird/2.0.0.12 Mnenhy/0.7.5.666 MIME-Version: 1.0 To: Anthony Liguori X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4.x X-Received-From: 192.35.17.2 Cc: Igor Mammedov , kvm , qemu-devel , =?ISO-8859-1?Q?Andreas_F=E4rber?= , Eduardo Habkost Subject: [Qemu-devel] [PATCH v2] target-i386: Improve x86_cpu_list output X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Several issues fixed: - We were missing a bunch of feature lists. Fix this by simply dumping the meta list feature_word_info. - kvm_enabled() cannot be true at this point because accelerators are initialized much later during init. Also, hiding this makes it very hard to discover for users. Simply dump unconditionally if CONFIG_KVM is set. - Add explanation for "host" CPU type. Signed-off-by: Jan Kiszka Reviewed-By: Igor Mammedov --- Changes in v2: - Do not dump "host" type if CONFIG_KVM is not set - Explain that "host" depends on KVM mode target-i386/cpu.c | 23 ++++++++++++----------- 1 files changed, 12 insertions(+), 11 deletions(-) diff --git a/target-i386/cpu.c b/target-i386/cpu.c index 5582e5f..b4189c3 100644 --- a/target-i386/cpu.c +++ b/target-i386/cpu.c @@ -1463,18 +1463,19 @@ void x86_cpu_list(FILE *f, fprintf_function cpu_fprintf) snprintf(buf, sizeof(buf), "%s", def->name); (*cpu_fprintf)(f, "x86 %16s %-48s\n", buf, def->model_id); } - if (kvm_enabled()) { - (*cpu_fprintf)(f, "x86 %16s\n", "[host]"); - } +#ifdef CONFIG_KVM + (*cpu_fprintf)(f, "x86 %16s %-48s\n", "host", + "KVM processor with all supported host features " + "(only available in KVM mode)"); +#endif + (*cpu_fprintf)(f, "\nRecognized CPUID flags:\n"); - listflags(buf, sizeof(buf), (uint32_t)~0, feature_name, 1); - (*cpu_fprintf)(f, " %s\n", buf); - listflags(buf, sizeof(buf), (uint32_t)~0, ext_feature_name, 1); - (*cpu_fprintf)(f, " %s\n", buf); - listflags(buf, sizeof(buf), (uint32_t)~0, ext2_feature_name, 1); - (*cpu_fprintf)(f, " %s\n", buf); - listflags(buf, sizeof(buf), (uint32_t)~0, ext3_feature_name, 1); - (*cpu_fprintf)(f, " %s\n", buf); + for (i = 0; i < ARRAY_SIZE(feature_word_info); i++) { + FeatureWordInfo *fw = &feature_word_info[i]; + + listflags(buf, sizeof(buf), (uint32_t)~0, fw->feat_names, 1); + (*cpu_fprintf)(f, " %s\n", buf); + } } CpuDefinitionInfoList *arch_query_cpu_definitions(Error **errp)