From patchwork Tue Dec 17 12:39:31 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Xiaoyao Li X-Patchwork-Id: 13911708 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 09EB5E77184 for ; Tue, 17 Dec 2024 12:54:56 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tNX5L-0000Ar-2e; Tue, 17 Dec 2024 07:53:59 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tNX5H-00009d-KL for qemu-devel@nongnu.org; Tue, 17 Dec 2024 07:53:55 -0500 Received: from mgamail.intel.com ([198.175.65.18]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tNX5G-0005Dm-4r for qemu-devel@nongnu.org; Tue, 17 Dec 2024 07:53:55 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1734440034; x=1765976034; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=eP9ccYSBy7WauejSMKCP7v6630KiEs32C3sTsU8g46Y=; b=Nh+B6fmib3jYwKAGkNOkx9X80zujMIc7YRlbUq0wjvN5cRF41amblvMv J4udurNbWiRrhHGUmFqHHkUwSsTMre21GzrA3D3Zw1NFPJkSAHIR8gyI4 GLf0WQts9lclD+kxjazHeMYq0D+Hxk1DBPHBxQhHGYGEifP6G4/POe4f4 hul1F+ZHszrewu/KQ6d0pv1RlPFM56tqFeZX+aAvmVF9bjoPzASyojP4H +USSjQxfXEYU+5+EW9W8KF7kB4BK44WwsCxV6c8wCeJJ3NF7d5V2hB83y ozafkH6mcGsIRLabmxNfvQVGBxMcQv9S81+w37vtxZ0tZpgj3hO6I/AnW Q==; X-CSE-ConnectionGUID: zOQtWqgTShqNNGS4z0D3oA== X-CSE-MsgGUID: zdWApjetQEyWaad8ug11ww== X-IronPort-AV: E=McAfee;i="6700,10204,11288"; a="34993238" X-IronPort-AV: E=Sophos;i="6.12,241,1728975600"; d="scan'208";a="34993238" Received: from fmviesa008.fm.intel.com ([10.60.135.148]) by orvoesa110.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 17 Dec 2024 04:53:51 -0800 X-CSE-ConnectionGUID: M4b/ap9nSbyKrtqK9UQIUw== X-CSE-MsgGUID: eGgFOjKxScaJfq4ryYMwOA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.12,241,1728975600"; d="scan'208";a="97760190" Received: from lxy-clx-4s.sh.intel.com ([10.239.48.52]) by fmviesa008.fm.intel.com with ESMTP; 17 Dec 2024 04:53:50 -0800 From: Xiaoyao Li To: Paolo Bonzini Cc: Zhao Liu , qemu-devel@nongnu.org Subject: [PATCH 1/2] i386: Remove unused parameter "uint32_t bit" in feature_word_description() Date: Tue, 17 Dec 2024 07:39:31 -0500 Message-Id: <20241217123932.948789-2-xiaoyao.li@intel.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241217123932.948789-1-xiaoyao.li@intel.com> References: <20241217123932.948789-1-xiaoyao.li@intel.com> MIME-Version: 1.0 Received-SPF: pass client-ip=198.175.65.18; envelope-from=xiaoyao.li@intel.com; helo=mgamail.intel.com X-Spam_score_int: -33 X-Spam_score: -3.4 X-Spam_bar: --- X-Spam_report: (-3.4 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, HK_RANDOM_ENVFROM=0.001, HK_RANDOM_FROM=0.998, RCVD_IN_DNSWL_MED=-2.3, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org From: Lei Wang Parameter "uint32_t bit" is not used in function feature_word_description(), so remove it. Signed-off-by: Lei Wang Reviewed-by: Igor Mammedov Reviewed-by: Xiaoyao Li Signed-off-by: Xiaoyao Li Reviewed-by: Zhao Liu --- target/i386/cpu.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/target/i386/cpu.c b/target/i386/cpu.c index 525339945920..d09e2f868c35 100644 --- a/target/i386/cpu.c +++ b/target/i386/cpu.c @@ -5451,7 +5451,7 @@ static const TypeInfo max_x86_cpu_type_info = { .class_init = max_x86_cpu_class_init, }; -static char *feature_word_description(FeatureWordInfo *f, uint32_t bit) +static char *feature_word_description(FeatureWordInfo *f) { assert(f->type == CPUID_FEATURE_WORD || f->type == MSR_FEATURE_WORD); @@ -5490,6 +5490,7 @@ static void mark_unavailable_features(X86CPU *cpu, FeatureWord w, uint64_t mask, CPUX86State *env = &cpu->env; FeatureWordInfo *f = &feature_word_info[w]; int i; + g_autofree char *feat_word_str = feature_word_description(f); if (!cpu->force_features) { env->features[w] &= ~mask; @@ -5502,7 +5503,6 @@ static void mark_unavailable_features(X86CPU *cpu, FeatureWord w, uint64_t mask, for (i = 0; i < 64; ++i) { if ((1ULL << i) & mask) { - g_autofree char *feat_word_str = feature_word_description(f, i); warn_report("%s: %s%s%s [bit %d]", verbose_prefix, feat_word_str, From patchwork Tue Dec 17 12:39:32 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Xiaoyao Li X-Patchwork-Id: 13911709 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id F2118E7717F for ; Tue, 17 Dec 2024 12:54:56 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tNX5L-0000As-33; Tue, 17 Dec 2024 07:53:59 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tNX5J-0000AC-Rr for qemu-devel@nongnu.org; Tue, 17 Dec 2024 07:53:57 -0500 Received: from mgamail.intel.com ([198.175.65.18]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tNX5H-0005DQ-RX for qemu-devel@nongnu.org; Tue, 17 Dec 2024 07:53:57 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1734440036; x=1765976036; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=FxrxvgyTxe7v2slGilL0hs9RicUqXHpApITr+EHT6TU=; b=ALXJ5zmQ4AnEDBgy+/xdfQEoI9UfcbfjLIR9Ul3+2Mg9Mk0dtzlVekVJ 98rCOjBWVbZjirs0Y4dTeXjrE6UpOudegvDNaX9F7LrGDYxL7kPMtHxbw W5D6BIWjUCsOBbA0FcamWP+vAxx/GvZmqHZxeyaxzIw2mzjWjsgGMWmL3 axHIlgn4nOtQsQYfWO/BEwmruO3AYw1y6phr2A6/mA+MjzLqBic89T0sx jKUDc/E6F2zxcDagFXBDvqnSk9Fri/kkjuvx5KZyqo14WXGnqkb9VRq3g a9uuTAh2yBVEGme3JjjpYJVXCgPPI7/bJOP3+UWAMNsBfXhTTJUSCHaw6 w==; X-CSE-ConnectionGUID: d7WDq8bjSmWMmhbdigzwUQ== X-CSE-MsgGUID: JTEPH3nsSI2cBIwBgqaAkA== X-IronPort-AV: E=McAfee;i="6700,10204,11288"; a="34993244" X-IronPort-AV: E=Sophos;i="6.12,241,1728975600"; d="scan'208";a="34993244" Received: from fmviesa008.fm.intel.com ([10.60.135.148]) by orvoesa110.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 17 Dec 2024 04:53:52 -0800 X-CSE-ConnectionGUID: Xrux9+hATXWF/a9AVGVCdQ== X-CSE-MsgGUID: rfymQn0eRoqLK8H1V60LZg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.12,241,1728975600"; d="scan'208";a="97760211" Received: from lxy-clx-4s.sh.intel.com ([10.239.48.52]) by fmviesa008.fm.intel.com with ESMTP; 17 Dec 2024 04:53:51 -0800 From: Xiaoyao Li To: Paolo Bonzini Cc: Zhao Liu , qemu-devel@nongnu.org Subject: [PATCH 2/2] target/i386: Print CPUID subleaf info for unsupported feature Date: Tue, 17 Dec 2024 07:39:32 -0500 Message-Id: <20241217123932.948789-3-xiaoyao.li@intel.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241217123932.948789-1-xiaoyao.li@intel.com> References: <20241217123932.948789-1-xiaoyao.li@intel.com> MIME-Version: 1.0 Received-SPF: pass client-ip=198.175.65.18; envelope-from=xiaoyao.li@intel.com; helo=mgamail.intel.com X-Spam_score_int: -33 X-Spam_score: -3.4 X-Spam_bar: --- X-Spam_report: (-3.4 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, HK_RANDOM_ENVFROM=0.001, HK_RANDOM_FROM=0.998, RCVD_IN_DNSWL_MED=-2.3, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Some CPUID leaves have meaningful subleaf index. Print the subleaf info in feature_word_description for CPUID features. Signed-off-by: Xiaoyao Li Reviewed-by: Eduardo Habkost Reviewed-by: Zhao Liu --- target/i386/cpu.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/target/i386/cpu.c b/target/i386/cpu.c index d09e2f868c35..3a697834e3ad 100644 --- a/target/i386/cpu.c +++ b/target/i386/cpu.c @@ -5460,8 +5460,9 @@ static char *feature_word_description(FeatureWordInfo *f) { const char *reg = get_register_name_32(f->cpuid.reg); assert(reg); - return g_strdup_printf("CPUID.%02XH:%s", - f->cpuid.eax, reg); + return g_strdup_printf("CPUID.%02XH_%02XH:%s", + f->cpuid.eax, + f->cpuid.needs_ecx ? f->cpuid.ecx : 0, reg); } case MSR_FEATURE_WORD: return g_strdup_printf("MSR(%02XH)",