From nobody Sat Jul 25 00:47:15 2026 Received: from BN1PR04CU002.outbound.protection.outlook.com (mail-eastus2azon11010001.outbound.protection.outlook.com [52.101.56.1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 2DD2E44607D; Tue, 21 Jul 2026 15:45:49 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=52.101.56.1 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784648751; cv=fail; b=fUpMh2O05bTHNLw+AXTbGGt/TmSKoaZHmt1WTsQ2Km3aHVp5l5GI4aU0YXD+bB4vfl2a7gnhXSyCUjeWdZ3Z0UMdro9BMjusrTZEZ74yi8mFz7k4c4CLZngVuky+GGaOyGCsj5707nQ8ib1KPO5DpE5Pc/vToRwUm0hHa4uLmzg= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784648751; c=relaxed/simple; bh=HiOFkjfB/MBfO1S/TanrOdUBgrv5pF7uc3fPQM6BwtM=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=agku/Llv3XYEyUyU6Z/oWWzJ2/AN8P52bSz68VZlsfbZsqT1KTzyx+8jozn4h9iqWJ1GTcGDF59gUZsS65za+eJEYkJZgInJ9lLcs+1FS+uW/ikaK4V9AWh4gLaOkxP1RCJogzk4PyE+Eh7LpLZ1U/UmeAC/tBqd3CYTxDdIP48= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=amd.com; spf=fail smtp.mailfrom=amd.com; dkim=pass (1024-bit key) header.d=amd.com header.i=@amd.com header.b=eVnM0nuU; arc=fail smtp.client-ip=52.101.56.1 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=amd.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=amd.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=amd.com header.i=@amd.com header.b="eVnM0nuU" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=vJEWy6zf+Fo8rg3jocX2qLxsAo3uKLsezdC/yRJ+JamTPEYqSjEa4SbamuoKnURwRME+IJyXGee98uCRfJ5wNqhFM+eCF4oLZMAKXeTkAkFSyIimpdJ99+1gEp1mOHvSpY+Qx/Ji/NihbS7oQoJ6fzxQgW0KmP/JoVbJBO6NMPZnP4rhS82rbst9DhhRvHEFk3YXepsEJWs3ftM/vAOssPXfoqSDjKBnOWh/ca8HziXI272ro2HLU348RlCmrMDcY5Af2UI96hGaQKbXju8G+Buit9U7+pirkdwTxgiNOiPdE9R0k6RoqxGLoByoGat+hgP+ayYM3s3CDM8R066YiA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=Iq/zY5T/JuhAvT0KiGtWfatENPOgIKJdhvRs8qkjJts=; b=DiCN/S5U6IkrpgbkZJOgWz8/z8ojG/NNPNc+iiAgz4bul3PHT97ohkxYjLghhsf/Bc/6qO+otuPWylG/u+E51EfdQ4Wv/kV5QI7MG/p1Hlog/1YVGetoAs/Aljnwh6/VmMFiS3obyvfbMblXpz207KuRmMMs3gYl7k3tsnNsiZoOUnqfkCEwJlpmz2jqP0duZ13+Q5E4n5ABBwUbYxQZxZazq3KNEEZ29PqoKxgEoTwg1lxEbCJSeWNfHoKvasUW8GQQkE7D0EsL+2jIF0RRtoQPFDshQqxizIiz71X/WUkYiHeSz/nVO4Gpqe4GZ/b58UUKD1QgYbhal6pWDAzhhA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=kernel.org smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=Iq/zY5T/JuhAvT0KiGtWfatENPOgIKJdhvRs8qkjJts=; b=eVnM0nuUvn9G1Q6elJTFPNoRpZMFFtPpmVE30HpMgjbRWvyMpb0paCqtrssWEOlcGCtTnOiKc0mVoWe2XB3Psa++IU+9Hm9Z7sm292HfVOUXqWebhJrT3O8aco0J3ljFUlqWrQozq0Q8K1lJ7l62zlk7gl6b9M1G7JyoWs93QhE= Received: from SN6PR2101CA0006.namprd21.prod.outlook.com (2603:10b6:805:106::16) by PH7PR12MB7017.namprd12.prod.outlook.com (2603:10b6:510:1b7::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.223.18; Tue, 21 Jul 2026 15:45:45 +0000 Received: from SA2PEPF00003AEA.namprd02.prod.outlook.com (2603:10b6:805:106:cafe::70) by SN6PR2101CA0006.outlook.office365.com (2603:10b6:805:106::16) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.21.270.4 via Frontend Transport; Tue, 21 Jul 2026 15:45:45 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=satlexmb07.amd.com; pr=C Received: from satlexmb07.amd.com (165.204.84.17) by SA2PEPF00003AEA.mail.protection.outlook.com (10.167.248.10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.245.5 via Frontend Transport; Tue, 21 Jul 2026 15:45:45 +0000 Received: from airavat.amd.com (10.180.168.240) by satlexmb07.amd.com (10.181.42.216) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.41; Tue, 21 Jul 2026 10:45:41 -0500 From: Vishal Badole To: , , , , , , , CC: , , , , , , Vishal Badole Subject: [PATCH v2 1/3] x86/topo: Map vendor CPU types to generic Linux such types Date: Tue, 21 Jul 2026 21:15:12 +0530 Message-ID: <20260721154514.2506972-2-Vishal.Badole@amd.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20260721154514.2506972-1-Vishal.Badole@amd.com> References: <20260721154514.2506972-1-Vishal.Badole@amd.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ClientProxiedBy: satlexmb08.amd.com (10.181.42.217) To satlexmb07.amd.com (10.181.42.216) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SA2PEPF00003AEA:EE_|PH7PR12MB7017:EE_ X-MS-Office365-Filtering-Correlation-Id: 41a6e7bb-0e26-403b-550a-08dee73f2114 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|23010399003|32650700020|82310400026|36860700016|7416014|376014|1800799024|10067099003|11063799006|56012099006|18002099003|22082099003; X-Microsoft-Antispam-Message-Info: pAVd6ymwiMbkyyAU3u938piH/4LH2h1ZanlDi8/VlOjiRp9zJcIkKKEO3hV9jTEisHIXOY/EJo78Wxj/CgEYKyNcYXvoTaEHI9snGDYtp1irf4+iY4w/pf/EPbCtrzHKRqWU1EWDEqoyPcmJAUoPbokLIC5G6gx+Nc6UjC9aMk1u40s8ofxxjBzA+rRNfBeRakY3Zehc6E7nCePYIYe9TztI/jfB0FpxR+lxjBk/EwUpH9RG8w3v4/121GUn2Z6CpkSvnzY3i5/ut6PqdmFw195Rc7JWiDZ2F++JszeRqJsNmRi0auC2iGNyOovNzrKHxBkJvF0NxGmi8+PA1xzf/zMPgU3/V9E9AxWsw3t3vIX0RwYDCymg/bbdGRHNddYRKir3ApXIaSNsQU1olRVxW8+shXKpAu/w8xF+/nsuCpaOm7OEvGGXdzQFFFMfQ06N8UEZwp4PQb51RO+U1g7Rx1sXGQsEqIM+ar24BiESwr7eA6NKxheAqgkoVKiBzGmIen3hRcceJNTK8fTpW0BIIZYYx62eWwvGcPKcdPgOvDMH85RKu98BLK6zSIXHr+X9+TpiAgWv9Ub1mcBiRFYJ6xg1gF8MeCh7mOrMuSrOjC4bu+DWFzvxhC5EUxTepGaeNOwwxAk7BRJnJR0KQYY2GA== X-Forefront-Antispam-Report: CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:satlexmb07.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(23010399003)(32650700020)(82310400026)(36860700016)(7416014)(376014)(1800799024)(10067099003)(11063799006)(56012099006)(18002099003)(22082099003);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: nGM+XjXaJj+59DMTrzISBHAtIhq6UjcKD4ke5NSeNqVHVOzbete80Z+IaX82FDU3juVDSzMc7Z7T12BOF6HsbD6AKtxGvex7Q1Ypjb/hLUOn5q8Ta3HD2q+5nz4HfjftKv61f1G4etyRpQKefCJQNP63/h/EbjlR6+a9nen7D7fUdO2fa67c1ABUa1t9Ez9i9ViJtx4tZ5IajnHXp6M1DKtpN79lKUUTQbq3AACyCV2Kfyr1LALpkJUeMnRLqGPmxjgC/22JOsISSQgv7dee9bXw2Wyq7y0kHSSk9RSV53L4npyuekPl94bQTrrEa8IDK1Q+3jUi22A0AKoLBREcShwP7SUFYwkxv6fTrRRWeYfdagM3hban6d5Zsl/Z7iOR9ADRNQpmgRqqBEN0rVqvxbi49Q6nVeABc8GAIcwROEIlgnVoBVOMqwWtroZmor04 X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Jul 2026 15:45:45.6450 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 41a6e7bb-0e26-403b-550a-08dee73f2114 X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[satlexmb07.amd.com] X-MS-Exchange-CrossTenant-AuthSource: SA2PEPF00003AEA.namprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH7PR12MB7017 From: "Borislav Petkov (AMD)" Sashiko reported=C2=B9 that a confusion could ensue if a vendor-specific CPU type 0 (performance) gets attempted to be used in a x86_cpu_id match table. The current logic treats 0 as the wildcard X86_CPU_TYPE_ANY and such a thing would end up matching the wrong CPUs. This is all backwards because we started using the vendor-specific CPU type number instead of using a Linux-defined, generic CPU type which is agnostic. Convert the current logic to it before users start appearing. =C2=B9https://sashiko.dev/#/patchset/20260629094349.533301-1-Vishal.Badol= e%40amd.com Signed-off-by: Borislav Petkov (AMD) Signed-off-by: Vishal Badole --- arch/x86/include/asm/processor.h | 18 ++++++++++++---- arch/x86/include/asm/topology.h | 7 ------- arch/x86/kernel/acpi/cppc.c | 4 ++-- arch/x86/kernel/cpu/match.c | 30 +-------------------------- arch/x86/kernel/cpu/topology.h | 1 + arch/x86/kernel/cpu/topology_amd.c | 6 ++++-- arch/x86/kernel/cpu/topology_common.c | 8 +++++-- 7 files changed, 28 insertions(+), 46 deletions(-) diff --git a/arch/x86/include/asm/processor.h b/arch/x86/include/asm/proces= sor.h index 87b1d4c0727e..fc0350fe8f5e 100644 --- a/arch/x86/include/asm/processor.h +++ b/arch/x86/include/asm/processor.h @@ -68,9 +68,13 @@ extern u16 __read_mostly tlb_lld_2m; extern u16 __read_mostly tlb_lld_4m; extern u16 __read_mostly tlb_lld_1g; =20 -/* - * CPU type and hardware bug flags. Kept separately for each CPU. - */ +enum x86_topology_cpu_type { + /* X86_CPU_TYPE_ANY */ + TOPO_CPU_TYPE_ANY =3D 0, + TOPO_CPU_TYPE_PERFORMANCE, + TOPO_CPU_TYPE_EFFICIENCY, + TOPO_CPU_TYPE_UNKNOWN, +}; =20 struct cpuinfo_topology { // Real APIC ID read from the local APIC @@ -104,7 +108,7 @@ struct cpuinfo_topology { =20 // Hardware defined CPU-type union { - u32 cpu_type; + u32 hw_cpu_type; struct { // CPUID.1A.EAX[23-0] u32 intel_native_model_id :24; @@ -119,8 +123,14 @@ struct cpuinfo_topology { amd_type :4; }; }; + + // Linux vendor-agnostic CPU type + enum x86_topology_cpu_type cpu_type; }; =20 +/* + * CPU type and hardware bug flags. Kept separately for each CPU. + */ struct cpuinfo_x86 { union { /* diff --git a/arch/x86/include/asm/topology.h b/arch/x86/include/asm/topolog= y.h index 8fb61d2465eb..ef76ba674f1b 100644 --- a/arch/x86/include/asm/topology.h +++ b/arch/x86/include/asm/topology.h @@ -114,12 +114,6 @@ enum x86_topology_domains { TOPO_MAX_DOMAIN, }; =20 -enum x86_topology_cpu_type { - TOPO_CPU_TYPE_PERFORMANCE, - TOPO_CPU_TYPE_EFFICIENCY, - TOPO_CPU_TYPE_UNKNOWN, -}; - struct x86_topology_system { unsigned int dom_shifts[TOPO_MAX_DOMAIN]; unsigned int dom_size[TOPO_MAX_DOMAIN]; @@ -160,7 +154,6 @@ extern unsigned int __num_nodes_per_package; struct cpuinfo_x86; =20 const char *get_topology_cpu_type_name(struct cpuinfo_x86 *c); -enum x86_topology_cpu_type get_topology_cpu_type(struct cpuinfo_x86 *c); =20 static inline unsigned int topology_max_packages(void) { diff --git a/arch/x86/kernel/acpi/cppc.c b/arch/x86/kernel/acpi/cppc.c index be4c5e9e5ff6..b8f5dd0a8117 100644 --- a/arch/x86/kernel/acpi/cppc.c +++ b/arch/x86/kernel/acpi/cppc.c @@ -241,7 +241,6 @@ EXPORT_SYMBOL_GPL(amd_detect_prefcore); */ int amd_get_boost_ratio_numerator(unsigned int cpu, u64 *numerator) { - enum x86_topology_cpu_type core_type =3D get_topology_cpu_type(&cpu_data(= cpu)); bool prefcore; int ret; u32 tmp; @@ -273,8 +272,9 @@ int amd_get_boost_ratio_numerator(unsigned int cpu, u64= *numerator) =20 /* detect if running on heterogeneous design */ if (cpu_feature_enabled(X86_FEATURE_AMD_HTR_CORES)) { - switch (core_type) { + switch (cpu_data(cpu).topo.cpu_type) { case TOPO_CPU_TYPE_UNKNOWN: + case TOPO_CPU_TYPE_ANY: pr_warn("Undefined core type found for cpu %d\n", cpu); break; case TOPO_CPU_TYPE_PERFORMANCE: diff --git a/arch/x86/kernel/cpu/match.c b/arch/x86/kernel/cpu/match.c index 4604802692da..7ab077f0cc66 100644 --- a/arch/x86/kernel/cpu/match.c +++ b/arch/x86/kernel/cpu/match.c @@ -5,34 +5,6 @@ #include #include =20 -/** - * x86_match_vendor_cpu_type - helper function to match the hardware defin= ed - * cpu-type for a single entry in the x86_cpu_= id - * table. Note, this function does not match t= he - * generic cpu-types TOPO_CPU_TYPE_EFFICIENCY = and - * TOPO_CPU_TYPE_PERFORMANCE. - * @c: Pointer to the cpuinfo_x86 structure of the CPU to match. - * @m: Pointer to the x86_cpu_id entry to match against. - * - * Return: true if the cpu-type matches, false otherwise. - */ -static bool x86_match_vendor_cpu_type(struct cpuinfo_x86 *c, const struct = x86_cpu_id *m) -{ - if (m->type =3D=3D X86_CPU_TYPE_ANY) - return true; - - /* Hybrid CPUs are special, they are assumed to match all cpu-types */ - if (cpu_feature_enabled(X86_FEATURE_HYBRID_CPU)) - return true; - - if (c->x86_vendor =3D=3D X86_VENDOR_INTEL) - return m->type =3D=3D c->topo.intel_type; - if (c->x86_vendor =3D=3D X86_VENDOR_AMD) - return m->type =3D=3D c->topo.amd_type; - - return false; -} - /** * x86_match_cpu - match current CPU against an array of x86_cpu_ids * @match: Pointer to array of x86_cpu_ids. Last entry terminated with @@ -81,7 +53,7 @@ const struct x86_cpu_id *x86_match_cpu(const struct x86_c= pu_id *match) continue; if (m->feature !=3D X86_FEATURE_ANY && !cpu_has(c, m->feature)) continue; - if (!x86_match_vendor_cpu_type(c, m)) + if (m->type !=3D X86_CPU_TYPE_ANY && c->topo.cpu_type !=3D m->type) continue; return m; } diff --git a/arch/x86/kernel/cpu/topology.h b/arch/x86/kernel/cpu/topology.h index 37326297f80c..74e02bacd854 100644 --- a/arch/x86/kernel/cpu/topology.h +++ b/arch/x86/kernel/cpu/topology.h @@ -22,6 +22,7 @@ void topology_set_dom(struct topo_scan *tscan, enum x86_t= opology_domains dom, bool cpu_parse_topology_ext(struct topo_scan *tscan); void cpu_parse_topology_amd(struct topo_scan *tscan); void cpu_topology_fixup_amd(struct topo_scan *tscan); +enum x86_topology_cpu_type get_topology_cpu_type(struct cpuinfo_x86 *c); =20 static inline u32 topo_shift_apicid(u32 apicid, enum x86_topology_domains = dom) { diff --git a/arch/x86/kernel/cpu/topology_amd.c b/arch/x86/kernel/cpu/topol= ogy_amd.c index da080d732e10..c5a6944df86a 100644 --- a/arch/x86/kernel/cpu/topology_amd.c +++ b/arch/x86/kernel/cpu/topology_amd.c @@ -177,8 +177,10 @@ static void topoext_fixup(struct topo_scan *tscan) =20 static void parse_topology_amd(struct topo_scan *tscan) { - if (cpu_feature_enabled(X86_FEATURE_AMD_HTR_CORES)) - tscan->c->topo.cpu_type =3D cpuid_ebx(0x80000026); + if (cpu_feature_enabled(X86_FEATURE_AMD_HTR_CORES)) { + tscan->c->topo.hw_cpu_type =3D cpuid_ebx(0x80000026); + tscan->c->topo.cpu_type =3D get_topology_cpu_type(tscan->c); + } =20 /* * Try to get SMT, CORE, TILE, and DIE shifts from extended diff --git a/arch/x86/kernel/cpu/topology_common.c b/arch/x86/kernel/cpu/to= pology_common.c index cf7513416b70..b9d025f3373a 100644 --- a/arch/x86/kernel/cpu/topology_common.c +++ b/arch/x86/kernel/cpu/topology_common.c @@ -168,8 +168,12 @@ static void parse_topology(struct topo_scan *tscan, bo= ol early) case X86_VENDOR_INTEL: if (!IS_ENABLED(CONFIG_CPU_SUP_INTEL) || !cpu_parse_topology_ext(tscan)) parse_legacy(tscan); - if (c->cpuid_level >=3D 0x1a) - c->topo.cpu_type =3D cpuid_eax(0x1a); + + if (c->cpuid_level >=3D 0x1a) { + c->topo.hw_cpu_type =3D cpuid_eax(0x1a); + c->topo.cpu_type =3D get_topology_cpu_type(c); + } + break; } } --=20 2.34.1 From nobody Sat Jul 25 00:47:15 2026 Received: from SN4PR2101CU001.outbound.protection.outlook.com (mail-southcentralusazon11012053.outbound.protection.outlook.com [40.93.195.53]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 66F5C31F99C; Tue, 21 Jul 2026 15:45:59 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.93.195.53 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784648764; cv=fail; b=K/8g/TOyOJS+3u5uX1MYvMaqddfET/EziHSvrfiOMRyvFlUJfj8pait3hnLDIMl6+NtOZuhaArc0/d6exjqLWAiGVLhNk5B8wvonkWliEscPs6vazYFi3XOYR/8HV+BRZd4BB3MYbCjhV2LFLBZwyndjio++5b5C3NGBx9zH1j4= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784648764; c=relaxed/simple; bh=pRX95jPAXtzqjd55QEM7pl9oAL7+eHMPZ076dODemOo=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=KcbAFBnSOwprqDO6Z2wa9OGvX4EYfHo8CGPrOrho4mIQAdt9o+4DnUiHLSnv4TEOppRRCkIpemI4OkA1h02n7PvWKk25aQyXmQxog7m+elOPwDY7lWXW3EDFnXQ725DfrAbRrenuigUC3ZIUTO7sjNeUmpPgRmy7jQKh6P18eXM= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=amd.com; spf=fail smtp.mailfrom=amd.com; dkim=pass (1024-bit key) header.d=amd.com header.i=@amd.com header.b=ioGgyOdJ; arc=fail smtp.client-ip=40.93.195.53 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=amd.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=amd.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=amd.com header.i=@amd.com header.b="ioGgyOdJ" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=myvc+qrGJ/c00Ztg+/Hi2uKk9P/73lfFfGdh/WxI3KcBVJ8XOv+ICjwGJPuG/SpAmcwcjRBZeFsG0+CiUZXJuS0+XBLiCk3471/isSahr6vcJD87wWlc+jMFes/YmzQPExOf8APGZJN0rS/3tN8tSfy3rBa5LygRZ7YploF4oVj0DjppRP7pVKZWrNVsM0kxxduLvmlaMYw2RiXJYUxqI3s4cIyQCwnsKQkQdD8vV0gMCs6Tfv3ZEvt4QgC43goO6wVYJZLgEa2FPqCHe2o9pIM3H2OQfYJLNloeGB6lv/gA0enupOzcWRv5/hLQxMwCcXyUGKcM4oY2hLtOYzq0ww== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=iIPQbX+Ki0YmUoxL0n/peqkCwBEP4tPvgF/+NCd/pnU=; b=iM+wyZTILroGI/eQRTVSUfeDOQCQ8O6EFI7Hs6BhKZ98NX1AGddCpmX9pb8ugTPk77OmhiDt//bzd5U7txKLufFQjHAbTh4+xfEBayTuvz/Zj2rSxebS0aUmXeJ9kq2CJtLsswDYk0RxOnQz8X4zUW2FnpJooPHHJlh/jyaRNp65PMImR3MbtX7eEw44eRdDVi9gwOH+B8W0e1+ZG0BOvd7mRdu1USxCdIOkqouWWPclr4i9l6vtpem3n+DzCom2tpXUJBKoXtb4b4GlIEraXD4jL1hf1nrlg+4QypdKnKKf62OlE82ssxIMdKH05kY5XcV1UIZu+y1Ubdm8w+GHNA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=kernel.org smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=iIPQbX+Ki0YmUoxL0n/peqkCwBEP4tPvgF/+NCd/pnU=; b=ioGgyOdJhPW0wvG24IVuuXGt+XaC2zCMW9g3VGw4A9TNGVL+/sbcNYqWB939sOsUA+6TcoZhTp+7N6o+OGBG8lk3GyvST1nS+Djcrx2ckJSiMaHqSY16hCZLUK81JUJvQM0U0QzxwWk9BSpOYqX30rygj35XF9Vn023hBGhrw7E= Received: from SA0PR11CA0067.namprd11.prod.outlook.com (2603:10b6:806:d2::12) by PH0PR12MB7472.namprd12.prod.outlook.com (2603:10b6:510:1e9::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.245.10; Tue, 21 Jul 2026 15:45:50 +0000 Received: from SA2PEPF00003AE5.namprd02.prod.outlook.com (2603:10b6:806:d2:cafe::68) by SA0PR11CA0067.outlook.office365.com (2603:10b6:806:d2::12) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.21.245.10 via Frontend Transport; Tue, 21 Jul 2026 15:45:50 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=satlexmb07.amd.com; pr=C Received: from satlexmb07.amd.com (165.204.84.17) by SA2PEPF00003AE5.mail.protection.outlook.com (10.167.248.5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.245.5 via Frontend Transport; Tue, 21 Jul 2026 15:45:49 +0000 Received: from airavat.amd.com (10.180.168.240) by satlexmb07.amd.com (10.181.42.216) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.41; Tue, 21 Jul 2026 10:45:45 -0500 From: Vishal Badole To: , , , , , , , CC: , , , , , , Vishal Badole Subject: [PATCH v2 2/3] x86/topology: Name the AMD core-type values Date: Tue, 21 Jul 2026 21:15:13 +0530 Message-ID: <20260721154514.2506972-3-Vishal.Badole@amd.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20260721154514.2506972-1-Vishal.Badole@amd.com> References: <20260721154514.2506972-1-Vishal.Badole@amd.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-ClientProxiedBy: satlexmb08.amd.com (10.181.42.217) To satlexmb07.amd.com (10.181.42.216) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SA2PEPF00003AE5:EE_|PH0PR12MB7472:EE_ X-MS-Office365-Filtering-Correlation-Id: e972d1d3-9caa-4020-75c1-08dee73f2382 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|23010399003|1800799024|32650700020|82310400026|36860700016|376014|7416014|11063799006|56012099006|10067099003|22082099003|18002099003; X-Microsoft-Antispam-Message-Info: iKNg/Xe8B6OCqWtlru5cEaJSjoruvTqVmU8a9K3Z/ZwfNi9u+JLXiDy6oeiUwiMaY07ImdMITC++aK2YwR3Arb/NhUOR4e+Jhqlo+ts1Aa3pTISCRZ6IxP+bx0C1pnAs9rNMeeiEjQ/H/Kx55/NxRnSKTHhU3Vnkco7gXvMtT2yJAIke0AE+uJU8geke+CwSL49d8T1B/TpNi6CP3GfLgRY/ZJRiY8umdDbRT7ZoTW69cz8yqfbadg9oGzVTRVc+/Uf1klwemyT1kNrV0im74FF77kHIJFaBKQkGlvIQ0Bs+16iCSeHY/dYsJhSxhcgB0n7MsKBra+v17Mvl5fYdmjgWKxMGpazSnJr42+AO+mArL9ROGJcTzg+VrVBcJ1g8CYXAP94hcoD0MDFFZDIbVX61vgymZ/pAXE6XCL6w1NFAc0RJpcR2zTFjce/4UybnzFZod4pJJVsaHEG7csiz0CGK/k3PW3SNMbCmB085/rr4+s6dFDOpWF585RrrhT/fgMFdFAIxynW0wthRqa1CpSVisLt6YepJijWIefY24I0OCnpLxLTPYDbwnCoMxsG/VHsa9HBRSm4NClhi64dI9nuC0/xa6kcJTMaJiMGl2YbDLGCUbBHKUTPEG5n7y/qmaQTK82fNVAi1360MBfSkquO89fAVBcmiIq/l1EL7+Rupla1t/IvlwfbUcWEC75PcmN3c5J0ZXry45Pl3zrgSgQ== X-Forefront-Antispam-Report: CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:satlexmb07.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(23010399003)(1800799024)(32650700020)(82310400026)(36860700016)(376014)(7416014)(11063799006)(56012099006)(10067099003)(22082099003)(18002099003);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: BrwW/r9fElYtKtQoedF8Yyr6KNNWMH8qwExEWo079T7TkqCKgPIGHmuWNZXg3IjYA3CI0URIksg+J7WAIQIBrmFRekLWeOCrO/uqaOJKCrvuMcaEV2D9PjgT8LDOwxnJxjQmFGkdJfupxaBci2czB7AScIFGF3aLJ5gldC7AiaHyHCji2welQO46JabNPatoixN3cMjXWe4UHjvX6wkf+F8R6OH9jQB4SpU5cVqELWjf6iRGuKgTJ/xH80z7wyopzDzP2K9tsDxuRMr6Fr3GWDNFZJrmsqKfT4xjz4TQlfBl6nU70ZOab2QD4FgMGMxZW58w4/gBuO8+F9EY1gB42yKKWJzL19O1yFByTZKuUpxmDHk5ZHJRbQfOKCAfQ3UtGkH+SICsO6Y/Ch3QXcFnj3TbKLqLoJRyKCODSBhiz+p7Da7g0UiG9hCreD72CcWR X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Jul 2026 15:45:49.7262 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: e972d1d3-9caa-4020-75c1-08dee73f2382 X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[satlexmb07.amd.com] X-MS-Exchange-CrossTenant-AuthSource: SA2PEPF00003AE5.namprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH0PR12MB7472 Content-Type: text/plain; charset="utf-8" Replace the bare 0/1 in get_topology_cpu_type() with named constants that mirror what the AMD APM publishes for CPUID Fn0x80000026 EBX[31:28] (Extended CPU Topology, Core Type): 0 - Performance core 1 - Efficient core 2 - Low-power core (used by a follow-up) No functional change. Suggested-by: Borislav Petkov (AMD) Signed-off-by: Vishal Badole --- arch/x86/include/asm/topology.h | 6 ++++++ arch/x86/kernel/cpu/topology_common.c | 4 ++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/arch/x86/include/asm/topology.h b/arch/x86/include/asm/topolog= y.h index ef76ba674f1b..1825691af941 100644 --- a/arch/x86/include/asm/topology.h +++ b/arch/x86/include/asm/topology.h @@ -114,6 +114,12 @@ enum x86_topology_domains { TOPO_MAX_DOMAIN, }; =20 +enum amd_cpu_type { + AMD_CPU_TYPE_PERFORMANCE =3D 0, + AMD_CPU_TYPE_EFFICIENCY =3D 1, + AMD_CPU_TYPE_LOW_POWER =3D 2, +}; + struct x86_topology_system { unsigned int dom_shifts[TOPO_MAX_DOMAIN]; unsigned int dom_size[TOPO_MAX_DOMAIN]; diff --git a/arch/x86/kernel/cpu/topology_common.c b/arch/x86/kernel/cpu/to= pology_common.c index b9d025f3373a..71b6c33afe0b 100644 --- a/arch/x86/kernel/cpu/topology_common.c +++ b/arch/x86/kernel/cpu/topology_common.c @@ -42,8 +42,8 @@ enum x86_topology_cpu_type get_topology_cpu_type(struct c= puinfo_x86 *c) } if (c->x86_vendor =3D=3D X86_VENDOR_AMD) { switch (c->topo.amd_type) { - case 0: return TOPO_CPU_TYPE_PERFORMANCE; - case 1: return TOPO_CPU_TYPE_EFFICIENCY; + case AMD_CPU_TYPE_PERFORMANCE: return TOPO_CPU_TYPE_PERFORMANCE; + case AMD_CPU_TYPE_EFFICIENCY: return TOPO_CPU_TYPE_EFFICIENCY; } } =20 --=20 2.34.1 From nobody Sat Jul 25 00:47:15 2026 Received: from PH7PR06CU001.outbound.protection.outlook.com (mail-westus3azon11010057.outbound.protection.outlook.com [52.101.201.57]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C52A446A5FB; Tue, 21 Jul 2026 15:46:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=52.101.201.57 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784648762; cv=fail; b=Va3HI23Mag8Tpq1AYOfOuTW3vdS+XyW0/rNFntVQn5dS88NE8HgwAwU+G+AyBP/3pMV9hT6abfrQsf8uUbiCJKpPsubW6rRtfmbtY5cqFyvOxLUlWzqI36rWw7f7faC9YdP2Tp7DW0P+9dW5us1Dcaa6SqrUWaG6hzcRmWE1/Qo= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784648762; c=relaxed/simple; bh=vsHws8csidWrNpib+d6gedcuqwlPTJkobPTf94DVBkw=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=XlqGpHdhO2mO84BR+uVc59RxlV0bwLtNAyo7l/RMv6M08NMdg3CMVRoxEiloq38zEt+hBHf0eP/NRhzpCZSCdxsibgVBa1WEWCcObkO+Pq148C4UetzSshj6qKIJsJ73KlPIzs11sBMeD8WSOOEMSl02C+Eiv0hNb4ndy7zSufw= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=amd.com; spf=fail smtp.mailfrom=amd.com; dkim=pass (1024-bit key) header.d=amd.com header.i=@amd.com header.b=XUcbOZLy; arc=fail smtp.client-ip=52.101.201.57 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=amd.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=amd.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=amd.com header.i=@amd.com header.b="XUcbOZLy" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=wohYrkiv+fYRR4903HCvgz3gf4Eux5Gvw+ARGF3y9AZWx99rE8V87gqwCLkkWUz9bWJamCVwT5by/LyTs0lVBvQd+InMYYHs3WGxBNMlJOcD5PDGULXuwfPtUpyqlDaBuEARDJe/Jag4EWxr3mTeCJDJu+1XG3Lc+vhrrZyqL89fKP32RS5dHEhsh9aqZ+cB6o5DG9uZTwzbOKJWzumNGejH/1WfKGkP2Y02ZQrVm/nJloi/F6xd41WYGDqMYrQJYoBIXb4w670OiBGzPTMVLdHU5todAl3DtHxhv5uxPqwmxB5wOn2Q6al1CImzE2kQ9CtU5bbRe5pIE128rdu9EA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=/L07o1ww/inBh7UnCF4XcmyOo4tV7197IvO+EVv/ivQ=; b=IuvXMEFWd7KZvRsjmnegwWRF0R2vF+7Eo8pQ9cvpY4LqIhtNJD0aaQ/R/kvDDGtqtlwXXR+0GtGAZcr7ZYR8ZCsvx3F5+utdKC30RAw7zqUuD0Kkh3SvUgkVmqEl7LZr/NfCcy+2sw7VkfcWeVQEZAbLSwXDtdIGeC+UuOZ+yT97Z2PNjQwZNAVjV1sk9T+8nSQnd1J1dpOxuFKQqN6lco3ishcsWCHdfuV2do4CkALIYCr/R3B3ukrjKieszhKzgofF+qiJAPbYYxjQ/rSQoLmh3NH9QscHR/asI+OnVYt8McMMDFXzvcptWkcki8VCmtVHYsrTl9yKhIJ/6L8Uqg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=kernel.org smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=/L07o1ww/inBh7UnCF4XcmyOo4tV7197IvO+EVv/ivQ=; b=XUcbOZLynVLy1SM4/GaJFBEX72XAbEH1WujZbTsEB5xbAOMPktRIb2p29amOkmICeiLquu0xc7rjwxY+5TGtv67IuIRAo0gDI9VoPbaHfuU3l/jJV+ELUlxWIbOulIc2J66MjlYXKXKqtfUUti955CzhjlUsMjkcMXNpym17GwU= Received: from SA0PR11CA0076.namprd11.prod.outlook.com (2603:10b6:806:d2::21) by CH3PR12MB8660.namprd12.prod.outlook.com (2603:10b6:610:177::5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.223.18; Tue, 21 Jul 2026 15:45:54 +0000 Received: from SA2PEPF00003AE5.namprd02.prod.outlook.com (2603:10b6:806:d2:cafe::3f) by SA0PR11CA0076.outlook.office365.com (2603:10b6:806:d2::21) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.21.245.10 via Frontend Transport; Tue, 21 Jul 2026 15:45:53 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=satlexmb07.amd.com; pr=C Received: from satlexmb07.amd.com (165.204.84.17) by SA2PEPF00003AE5.mail.protection.outlook.com (10.167.248.5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.245.5 via Frontend Transport; Tue, 21 Jul 2026 15:45:53 +0000 Received: from airavat.amd.com (10.180.168.240) by satlexmb07.amd.com (10.181.42.216) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.41; Tue, 21 Jul 2026 10:45:49 -0500 From: Vishal Badole To: , , , , , , , CC: , , , , , , Vishal Badole Subject: [PATCH v2 3/3] x86/topology: Add TOPO_CPU_TYPE_LOW_POWER Date: Tue, 21 Jul 2026 21:15:14 +0530 Message-ID: <20260721154514.2506972-4-Vishal.Badole@amd.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20260721154514.2506972-1-Vishal.Badole@amd.com> References: <20260721154514.2506972-1-Vishal.Badole@amd.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-ClientProxiedBy: satlexmb08.amd.com (10.181.42.217) To satlexmb07.amd.com (10.181.42.216) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SA2PEPF00003AE5:EE_|CH3PR12MB8660:EE_ X-MS-Office365-Filtering-Correlation-Id: 3f361262-ef2e-4f53-3826-08dee73f2600 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|376014|23010399003|7416014|36860700016|32650700020|82310400026|1800799024|6133799003|10067099003|56012099006|5023799004|11063799006|18002099003|22082099003; X-Microsoft-Antispam-Message-Info: osFh1vO/ZEiLwIj98V2TOff5aVuve4oCt9jZrY6saqqRekmFKiSkM2Tw71X6s4cQqKCq0b/sBz/sLMRrZ2UgBEUjYjXM+7+pFMeGFA16fzsgaHqXzx6Tc2OxVl5GvxRcjsZ2182KD/pLgB57OV8rXCB8vo1wP96kLQHAjpOKHen0ng+GY2GMMrsnDnlbyZBuKEbxKImrOS2esMa15p/Q5XOAfszaRsWxqhLB2sAYK4JaSkzdUl2KY+ZRlixZUplJq5f238/lm64Ch/fj3b8ho5EIXcHgXnjoPDo5mC7R+jSgXoh1g1Vyj+EJxRjRns88DNg02k2HXNkID2gZlgXqbdyD+YDPGNxxd+es2gz2tjT4TUNIWrwXzsslfKaygP08JV5TF0F9+sKpj0xCjHhRrXcHJpDHhs8dOqIEfYphwqa1AviF1LZmrAC7wtIbVqaTUoEtKMxy2tnEpktNBFx+13PnoJEC0L7zrwJV+bmgej0Vl/06J4gP2fDVjewvZQvZXOnAirvcYbeiwXdiVqhsucEK53yZ9OxlJ1jyhQoYdYU8k68JKu4NzgpYUtY3hbWZAnL5VimZvX1MKUgAZGboCpu7otl1tm47+zXF3UHmiiC4HhZUuxMx+CROw8KmVH4jkeMOghgeJ+UNbUZ/PEH8h17rtpnOzHehY3b04U+4d1nYIe3xpQgtKU81sBFD6y0HS6bBgGl0FSlbECxYfGA76g== X-Forefront-Antispam-Report: CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:satlexmb07.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(376014)(23010399003)(7416014)(36860700016)(32650700020)(82310400026)(1800799024)(6133799003)(10067099003)(56012099006)(5023799004)(11063799006)(18002099003)(22082099003);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: vWHC2gwdxsK9XCa4nSdXjyR1lg3YwfK1T2LpOBfJs0R01XAZEdl3JQzbCU3aXhqTPoinjhyESW45ofazpyzWnRQ7IBxWvk/iGCFZjTNvoAvdW0nYbTNmtb5mBtGMb3a4RrwEgKqg2jYEXgeBwsitjoGCjF7O1+Mc4ZPy92DCMkhwv7Tmb+P88uYWfJJtsylkkoMCwsi8NNC1J9svJ5Ub97oII6nPqJ53Xk50Px++m6h9d8b3njvBfK9F1hhQtuRXz8yODH58w/e+9i9brXEbc9yTSAQv0ahF4g4Yfyt/gRSI/WIwQtgGi2gF3Fv+kNIWZgwhNdJWLhrIFjKSyn8Hokq489z6njKUTwrF5gYGiv7Wao2qptxeNKokZslbmO6PdTHtvKatD1LnG/jfVBXPdq0yWAU1H7REOKm4AyhpdktKZ6qb+Vkl7KlfN3geMWz+ X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Jul 2026 15:45:53.9059 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 3f361262-ef2e-4f53-3826-08dee73f2600 X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[satlexmb07.amd.com] X-MS-Exchange-CrossTenant-AuthSource: SA2PEPF00003AE5.namprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH3PR12MB8660 Content-Type: text/plain; charset="utf-8" AMD heterogeneous parts report a third core type via CPUID Fn0x80000026 EBX[31:28] (Extended CPU Topology, Core Type): 0 - Performance 1 - Efficiency 2 - Low Power get_topology_cpu_type() only translates the first two, so on parts that ship low-power cores the third type falls through to TOPO_CPU_TYPE_UNKNOWN. That has two visible effects: - /sys/kernel/debug/x86/topo/cpus/* reports cpu_type "unknown" via get_topology_cpu_type_name(). - amd_get_boost_ratio_numerator() hits the default arm of its x86_topology_cpu_type switch and uses the CPPC_HIGHEST_PERF_PREFCORE fallback instead of scaling by amd_get_highest_perf() as efficiency cores do. Add TOPO_CPU_TYPE_LOW_POWER, translate AMD_CPU_TYPE_LOW_POWER to it in get_topology_cpu_type(), and expose a "low_power" name via get_topology_cpu_type_name(). In amd_get_boost_ratio_numerator(), share the efficiency-core arm of the switch with the new type so low-power cores scale by amd_get_highest_perf() rather than the performance-core ceiling. The new case sits under the existing cpu_feature_enabled(X86_FEATURE_AMD_HTR_CORES) gate and therefore applies to every HTR_CORES-capable AMD/Hygon part that reports core type 2. Signed-off-by: Vishal Badole --- arch/x86/include/asm/processor.h | 1 + arch/x86/kernel/acpi/cppc.c | 3 ++- arch/x86/kernel/cpu/topology_common.c | 3 +++ 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/arch/x86/include/asm/processor.h b/arch/x86/include/asm/proces= sor.h index fc0350fe8f5e..9e8183441888 100644 --- a/arch/x86/include/asm/processor.h +++ b/arch/x86/include/asm/processor.h @@ -73,6 +73,7 @@ enum x86_topology_cpu_type { TOPO_CPU_TYPE_ANY =3D 0, TOPO_CPU_TYPE_PERFORMANCE, TOPO_CPU_TYPE_EFFICIENCY, + TOPO_CPU_TYPE_LOW_POWER, TOPO_CPU_TYPE_UNKNOWN, }; =20 diff --git a/arch/x86/kernel/acpi/cppc.c b/arch/x86/kernel/acpi/cppc.c index b8f5dd0a8117..bbade0da5130 100644 --- a/arch/x86/kernel/acpi/cppc.c +++ b/arch/x86/kernel/acpi/cppc.c @@ -281,8 +281,9 @@ int amd_get_boost_ratio_numerator(unsigned int cpu, u64= *numerator) /* use the max scale for performance cores */ *numerator =3D CPPC_HIGHEST_PERF_PERFORMANCE; return 0; + case TOPO_CPU_TYPE_LOW_POWER: case TOPO_CPU_TYPE_EFFICIENCY: - /* use the highest perf value for efficiency cores */ + /* use the highest perf value for efficiency and low-power cores */ ret =3D amd_get_highest_perf(cpu, &tmp); if (ret) return ret; diff --git a/arch/x86/kernel/cpu/topology_common.c b/arch/x86/kernel/cpu/to= pology_common.c index 71b6c33afe0b..581f2fcd7e42 100644 --- a/arch/x86/kernel/cpu/topology_common.c +++ b/arch/x86/kernel/cpu/topology_common.c @@ -44,6 +44,7 @@ enum x86_topology_cpu_type get_topology_cpu_type(struct c= puinfo_x86 *c) switch (c->topo.amd_type) { case AMD_CPU_TYPE_PERFORMANCE: return TOPO_CPU_TYPE_PERFORMANCE; case AMD_CPU_TYPE_EFFICIENCY: return TOPO_CPU_TYPE_EFFICIENCY; + case AMD_CPU_TYPE_LOW_POWER: return TOPO_CPU_TYPE_LOW_POWER; } } =20 @@ -57,6 +58,8 @@ const char *get_topology_cpu_type_name(struct cpuinfo_x86= *c) return "performance"; case TOPO_CPU_TYPE_EFFICIENCY: return "efficiency"; + case TOPO_CPU_TYPE_LOW_POWER: + return "low_power"; default: return "unknown"; } --=20 2.34.1