From nobody Mon Feb 9 07:02:23 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass header.i=@intel.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=intel.com ARC-Seal: i=1; a=rsa-sha256; t=1763436235; cv=none; d=zohomail.com; s=zohoarc; b=Yenx/TpKuuvZE0BYCVHQjiY/aSsgj5eb0sY4MIW2j86lkChXETS2yWQc3JPZ+EpDkNG9/jRvHIkBdKfjlgqpCVEpEOP1f3CGK+OxeCrLPoaTrO/IW1cvMXsfxkjQIytgbABl2BuaSCSf3bPJ+ApR+RdUgMROi5mvtC9RlvX8TZA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1763436235; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=Q7MYSPfuteMbR0NRM6vi2wFhHczRB+QIjt0uOYRSZiw=; b=R6p8VgRYFScBNvkhBFTACL3w9C68Czfy9H1gQgyTTRfz45QHiX5J4w/hjYhOo4+bGEEwT7prEnbd0ZsG4XHNqVF7wnSeMEaCgCvdghujrx5UFWWPLytHQu1hsNCUVPVxT4b8KtxjQCf3p7/Q6hAykUv+odVfKCe4AYj+lGXCt7Q= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass header.i=@intel.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1763436235346545.3873715215818; Mon, 17 Nov 2025 19:23:55 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vLCGx-0001NP-Le; Mon, 17 Nov 2025 22:20:51 -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 1vLCGw-0001Mt-2r for qemu-devel@nongnu.org; Mon, 17 Nov 2025 22:20:50 -0500 Received: from mgamail.intel.com ([192.198.163.13]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vLCGu-0004Cz-HF for qemu-devel@nongnu.org; Mon, 17 Nov 2025 22:20:49 -0500 Received: from fmviesa001.fm.intel.com ([10.60.135.141]) by fmvoesa107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 17 Nov 2025 19:20:48 -0800 Received: from liuzhao-optiplex-7080.sh.intel.com ([10.239.160.39]) by fmviesa001.fm.intel.com with ESMTP; 17 Nov 2025 19:20:44 -0800 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1763436049; x=1794972049; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=fJBFcQVoKmgeoUmwsBmvZdBtcnTJvhtd89N47vMSmQc=; b=HUd3JsPOFNOuXqDwm3fJhSJMBJ4Zh9QaIPsbfXMjIEZO6yB7e+XCsBWE fVU2MNxmpkjtH0eUD/2HRhYzEsHafszX/dMhK1QIaJ8JZHDcWfl/blxOh cFs4LFVD5mXM1s9boPnLKKXLIv2AGA4Lly16wdkPIiLz/kurhFyfryz0d 1S6ZmCUjWxoGP+gZpm5cBzdXL9QBY538YaJjMOo+a17/anM2GieMKyIgm iscA8ojv15M37BiHoGwpjzmKZ6oo2oD4/lLKuxZPhVhpFYh85C3cNlkss Dkc623r7iI/k9wWjdl62qOJ1n8/NWQZENHMQ1CMa/Zu5i+IPckwVquPpM A==; X-CSE-ConnectionGUID: UfClem4FQGWxqAirqGUnYQ== X-CSE-MsgGUID: 5OOFnSklSeaQx2L0vDxL/Q== X-IronPort-AV: E=McAfee;i="6800,10657,11616"; a="68053809" X-IronPort-AV: E=Sophos;i="6.19,313,1754982000"; d="scan'208";a="68053809" X-CSE-ConnectionGUID: eNy4ULW9SyW1mjd4plv9QQ== X-CSE-MsgGUID: VpWYT4o1RpyXQV4OX8Lw4Q== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.19,313,1754982000"; d="scan'208";a="221537190" From: Zhao Liu To: Paolo Bonzini , Marcelo Tosatti Cc: qemu-devel@nongnu.org, kvm@vger.kernel.org, Chao Gao , Xin Li , John Allen , Babu Moger , Mathias Krause , Dapeng Mi , Zide Chen , Xiaoyao Li , Chenyi Qiang , Farrah Chen , Zhao Liu Subject: [PATCH v4 09/23] i386/cpu: Drop pmu check in CPUID 0x1C encoding Date: Tue, 18 Nov 2025 11:42:17 +0800 Message-Id: <20251118034231.704240-10-zhao1.liu@intel.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20251118034231.704240-1-zhao1.liu@intel.com> References: <20251118034231.704240-1-zhao1.liu@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=192.198.163.13; envelope-from=zhao1.liu@intel.com; helo=mgamail.intel.com X-Spam_score_int: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.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, 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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @intel.com) X-ZM-MESSAGEID: 1763436237287158500 Content-Type: text/plain; charset="utf-8" Since CPUID_7_0_EDX_ARCH_LBR will be masked off if pmu is disabled, there's no need to check CPUID_7_0_EDX_ARCH_LBR feature with pmu. Tested-by: Farrah Chen Reviewed-by: Zide Chen Reviewed-by: Xiaoyao Li Signed-off-by: Zhao Liu --- target/i386/cpu.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/target/i386/cpu.c b/target/i386/cpu.c index 56b4c57969c1..62769db3ebb7 100644 --- a/target/i386/cpu.c +++ b/target/i386/cpu.c @@ -8273,11 +8273,16 @@ void cpu_x86_cpuid(CPUX86State *env, uint32_t index= , uint32_t count, } break; } - case 0x1C: - if (cpu->enable_pmu && (env->features[FEAT_7_0_EDX] & CPUID_7_0_ED= X_ARCH_LBR)) { - x86_cpu_get_supported_cpuid(0x1C, 0, eax, ebx, ecx, edx); - *edx =3D 0; + case 0x1C: /* Last Branch Records Information Leaf */ + *eax =3D 0; + *ebx =3D 0; + *ecx =3D 0; + *edx =3D 0; + if (!(env->features[FEAT_7_0_EDX] & CPUID_7_0_EDX_ARCH_LBR)) { + break; } + x86_cpu_get_supported_cpuid(0x1C, 0, eax, ebx, ecx, edx); + *edx =3D 0; /* EDX is reserved. */ break; case 0x1D: { /* AMX TILE, for now hardcoded for Sapphire Rapids*/ --=20 2.34.1