]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
x86/cpuid: Rename cpuid_leaf()/cpuid_subleaf() APIs
authorAhmed S. Darwish <darwi@linutronix.de>
Fri, 27 Mar 2026 02:15:20 +0000 (03:15 +0100)
committerBorislav Petkov (AMD) <bp@alien8.de>
Fri, 8 May 2026 21:10:14 +0000 (23:10 +0200)
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 <darwi@linutronix.de>
Signed-off-by: Borislav Petkov (AMD) <bp@alien8.de>
Link: https://lore.kernel.org/20260327021645.555257-1-darwi@linutronix.de
arch/x86/include/asm/cpuid/api.h
arch/x86/kernel/cpu/topology_amd.c
arch/x86/kernel/cpu/topology_ext.c
arch/x86/kernel/cpuid.c

index 44fa82e1267ce98c7f5f92f69b58f79e235f7261..2b9750cc8a7571b2da2978f08b6eef533a628676 100644 (file)
@@ -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 + CPUID_EDX);
 }
 
-#define cpuid_subleaf(leaf, subleaf, regs) {           \
+#define cpuid_read_subleaf(leaf, subleaf, regs) {      \
        static_assert(sizeof(*(regs)) == 16);           \
        __cpuid_read(leaf, subleaf, (u32 *)(regs));     \
 }
 
-#define cpuid_leaf(leaf, regs) {                       \
+#define cpuid_read(leaf, regs) {                       \
        static_assert(sizeof(*(regs)) == 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);
 
        /*
         * All Intel CPUs must report an iteration count of 1.  In case
index cc103c85b96d8930377ff38a795d100833a3370c..da080d732e107f754a398e1bf9c560c2c7f5a07d 100644 (file)
@@ -80,7 +80,7 @@ static bool parse_8000_001e(struct topo_scan *tscan)
        if (!boot_cpu_has(X86_FEATURE_TOPOEXT))
                return false;
 
-       cpuid_leaf(0x8000001e, &leaf);
+       cpuid_read(0x8000001e, &leaf);
 
        /*
         * If leaf 0xb/0x26 is available, then the APIC ID and the domain
index eb915c73895f89af13fcc4af91a539d0884a33f2..60dfaa02ffd0deb1bf202a08fc7ffab7c52ae35c 100644 (file)
@@ -71,7 +71,7 @@ static inline bool topo_subleaf(struct topo_scan *tscan, u32 leaf, u32 subleaf,
        default: return false;
        }
 
-       cpuid_subleaf(leaf, subleaf, &sl);
+       cpuid_read_subleaf(leaf, subleaf, &sl);
 
        if (!sl.num_processors || sl.type == INVALID_TYPE)
                return false;
index cbd04b677fd1b66fecb6c9e7a136f6157271d943..b55fe9c7359add1b26393567f56938474ade8f38 100644 (file)
@@ -59,8 +59,7 @@ static void cpuid_smp_cpuid(void *cmd_block)
        complete(&cmd->done);
 }
 
-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 count, loff_t *ppos)
 {
        char __user *tmp = 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 = {
        .owner = THIS_MODULE,
        .llseek = no_seek_end_llseek,
-       .read = cpuid_read,
+       .read = cpuid_read_f,
        .open = cpuid_open,
 };