From nobody Sat Jun 13 07:50:59 2026 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) (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 530762DA75C; Fri, 8 May 2026 22:00:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=193.142.43.55 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778277626; cv=none; b=vCaJ7SdmOOzIN1vCW4Zi6Zvd1jEEhFZWfhoKM3fMzOrex+MaMaKZIJT+HYoVQTeOLSrH4pJdI0FPPVuIpF43t6+c+MUTJD6Utn3xN2V9+U5i43wi1XWx/lOaGEZAe4XGFHMKEENjykeVqiPyXR/3crf/2Nk8aPlsHVdS+JdSBTg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778277626; c=relaxed/simple; bh=mXN7HnGtX4S2WMxH0bmCg2xmuJR//7vJR48ZW/LZe/8=; h=Date:From:To:Subject:Cc:MIME-Version:Message-ID:Content-Type; b=Yd0UUXYbt/LNMv8v/6NvIvn660rly8FKl+7iePmyOO+nE4FyLhckydcLx4SCRpWbBZk3FzIFCdNA0a4+2RBUUkMaUYIZDsOE1UozQ1wVNWwtHXtEEQNNavesWgnhusaiiHrT67xzTMSYUm6h9ncOKw2WNLOK83fggZnTV8jTkqk= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de; spf=pass smtp.mailfrom=linutronix.de; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=UVyPmkip; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=LSSLvUct; arc=none smtp.client-ip=193.142.43.55 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linutronix.de Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="UVyPmkip"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="LSSLvUct" Date: Fri, 08 May 2026 22:00:22 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1778277623; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=rJCum+zpQUlBLiZu49/tLEEPvSZq8hySD5f1U5F2brM=; b=UVyPmkippguEmPMEthuo7fOIwztfYvZqyBeM8OvInr3DtGuuI25doxMsBhZgoCaVpJj9rx 9UKzbcNq69S/mi62JvMVAeZbOq4U8qFQ2zDOj94aB+R73RZrndbXLBAwYwajN/wH4nNRLB Uf08WdLr26UgWwfGp2i8Yj56Dl+MB3mwIRU1hOaZyNJcvnayb1hEXy+DWVC33wtpfe/nkw rI0iCeuDqXZn0OfxXHhShN0NBcxztFc++M+CD5/W9BCVRgAaESxDB3cNOE42/qY4rpJtjW vUYr9kTDCaOeiT0MlWXeFAnR+UPuBDWIYjOAnUPpTxwqQidpTg6FRO2HIz37sA== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1778277623; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=rJCum+zpQUlBLiZu49/tLEEPvSZq8hySD5f1U5F2brM=; b=LSSLvUctGHbvKFlMPF/cEU7g8M6KzElSTJJuVp2cP0xstqXYyIZbLDYyghnE6cGX/vtuZx 8j9YAho8kYLo8FBw== From: "tip-bot2 for Ahmed S. Darwish" Sender: tip-bot2@linutronix.de Reply-to: linux-kernel@vger.kernel.org To: linux-tip-commits@vger.kernel.org Subject: [tip: x86/cpu] x86/cpuid: Rename cpuid_leaf()/cpuid_subleaf() APIs Cc: "Ahmed S. Darwish" , "Borislav Petkov (AMD)" , x86@kernel.org, linux-kernel@vger.kernel.org Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-ID: <177827762237.864.150853946935783466.tip-bot2@tip-bot2> Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails Precedence: bulk Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable The following commit has been merged into the x86/cpu branch of tip: Commit-ID: 5fbe09ebb4dc7e0fa54f7a26d6be72a33d7e6035 Gitweb: https://git.kernel.org/tip/5fbe09ebb4dc7e0fa54f7a26d6be72a33= d7e6035 Author: Ahmed S. Darwish AuthorDate: Fri, 27 Mar 2026 03:15:20 +01:00 Committer: Borislav Petkov (AMD) CommitterDate: Fri, 08 May 2026 23:10:14 +02:00 x86/cpuid: Rename cpuid_leaf()/cpuid_subleaf() APIs A new CPUID model will be added where its APIs will be designated as the official CPUID API. Free the cpuid_leaf() and cpuid_subleaf() function names for that API. Rename them accordingly to cpuid_read() and cpuid_read_subleaf(). For kernel/cpuid.c, rename its local file operations read function from cpuid_read() to cpuid_read_f() so that it does not conflict with the new API. No functional change. Signed-off-by: Ahmed S. Darwish Signed-off-by: Borislav Petkov (AMD) Link: https://lore.kernel.org/20260327021645.555257-1-darwi@linutronix.de --- arch/x86/include/asm/cpuid/api.h | 6 +++--- arch/x86/kernel/cpu/topology_amd.c | 2 +- arch/x86/kernel/cpu/topology_ext.c | 2 +- arch/x86/kernel/cpuid.c | 5 ++--- 4 files changed, 7 insertions(+), 8 deletions(-) diff --git a/arch/x86/include/asm/cpuid/api.h b/arch/x86/include/asm/cpuid/= api.h index 44fa82e..2b9750c 100644 --- a/arch/x86/include/asm/cpuid/api.h +++ b/arch/x86/include/asm/cpuid/api.h @@ -131,12 +131,12 @@ static inline void __cpuid_read(u32 leaf, u32 subleaf= , u32 *regs) __cpuid(regs + CPUID_EAX, regs + CPUID_EBX, regs + CPUID_ECX, regs + CPUI= D_EDX); } =20 -#define cpuid_subleaf(leaf, subleaf, regs) { \ +#define cpuid_read_subleaf(leaf, subleaf, regs) { \ static_assert(sizeof(*(regs)) =3D=3D 16); \ __cpuid_read(leaf, subleaf, (u32 *)(regs)); \ } =20 -#define cpuid_leaf(leaf, regs) { \ +#define cpuid_read(leaf, regs) { \ static_assert(sizeof(*(regs)) =3D=3D 16); \ __cpuid_read(leaf, 0, (u32 *)(regs)); \ } @@ -228,7 +228,7 @@ static inline u32 cpuid_base_hypervisor(const char *sig= , u32 leaves) */ static inline void cpuid_leaf_0x2(union leaf_0x2_regs *regs) { - cpuid_leaf(0x2, regs); + cpuid_read(0x2, regs); =20 /* * All Intel CPUs must report an iteration count of 1. In case diff --git a/arch/x86/kernel/cpu/topology_amd.c b/arch/x86/kernel/cpu/topol= ogy_amd.c index cc103c8..da080d7 100644 --- a/arch/x86/kernel/cpu/topology_amd.c +++ b/arch/x86/kernel/cpu/topology_amd.c @@ -80,7 +80,7 @@ static bool parse_8000_001e(struct topo_scan *tscan) if (!boot_cpu_has(X86_FEATURE_TOPOEXT)) return false; =20 - cpuid_leaf(0x8000001e, &leaf); + cpuid_read(0x8000001e, &leaf); =20 /* * If leaf 0xb/0x26 is available, then the APIC ID and the domain diff --git a/arch/x86/kernel/cpu/topology_ext.c b/arch/x86/kernel/cpu/topol= ogy_ext.c index eb915c7..60dfaa0 100644 --- a/arch/x86/kernel/cpu/topology_ext.c +++ b/arch/x86/kernel/cpu/topology_ext.c @@ -71,7 +71,7 @@ static inline bool topo_subleaf(struct topo_scan *tscan, = u32 leaf, u32 subleaf, default: return false; } =20 - cpuid_subleaf(leaf, subleaf, &sl); + cpuid_read_subleaf(leaf, subleaf, &sl); =20 if (!sl.num_processors || sl.type =3D=3D INVALID_TYPE) return false; diff --git a/arch/x86/kernel/cpuid.c b/arch/x86/kernel/cpuid.c index cbd04b6..b55fe9c 100644 --- a/arch/x86/kernel/cpuid.c +++ b/arch/x86/kernel/cpuid.c @@ -59,8 +59,7 @@ static void cpuid_smp_cpuid(void *cmd_block) complete(&cmd->done); } =20 -static ssize_t cpuid_read(struct file *file, char __user *buf, - size_t count, loff_t *ppos) +static ssize_t cpuid_read_f(struct file *file, char __user *buf, size_t co= unt, loff_t *ppos) { char __user *tmp =3D buf; struct cpuid_regs_done cmd; @@ -120,7 +119,7 @@ static int cpuid_open(struct inode *inode, struct file = *file) static const struct file_operations cpuid_fops =3D { .owner =3D THIS_MODULE, .llseek =3D no_seek_end_llseek, - .read =3D cpuid_read, + .read =3D cpuid_read_f, .open =3D cpuid_open, }; =20