]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
x86/apic: Use u32 for phys_pkg_id()
authorThomas Gleixner <tglx@linutronix.de>
Mon, 14 Aug 2023 08:18:43 +0000 (10:18 +0200)
committerThomas Gleixner <tglx@linutronix.de>
Tue, 10 Oct 2023 12:38:19 +0000 (14:38 +0200)
APIC IDs are used with random data types u16, u32, int, unsigned int,
unsigned long.

Make it all consistently use u32 because that reflects the hardware
register width even if that callback going to be removed soonish.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Tested-by: Juergen Gross <jgross@suse.com>
Tested-by: Sohil Mehta <sohil.mehta@intel.com>
Tested-by: Michael Kelley <mikelley@microsoft.com>
Tested-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Tested-by: Zhang Rui <rui.zhang@intel.com>
Reviewed-by: Arjan van de Ven <arjan@linux.intel.com>
Acked-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Link: https://lore.kernel.org/r/20230814085113.113097126@linutronix.de
arch/x86/include/asm/apic.h
arch/x86/kernel/apic/apic_flat_64.c
arch/x86/kernel/apic/apic_noop.c
arch/x86/kernel/apic/apic_numachip.c
arch/x86/kernel/apic/bigsmp_32.c
arch/x86/kernel/apic/local.h
arch/x86/kernel/apic/probe_32.c
arch/x86/kernel/apic/x2apic_phys.c
arch/x86/kernel/apic/x2apic_uv_x.c
arch/x86/kernel/vsmp_64.c
arch/x86/xen/apic.c

index 42a6adf6a7ac4fbf66465a68ab90c150df3b365e..0788c4663b6df503fcbef75dcce5fa1dab7d4330 100644 (file)
@@ -296,7 +296,7 @@ struct apic {
        void    (*init_apic_ldr)(void);
        void    (*ioapic_phys_id_map)(physid_mask_t *phys_map, physid_mask_t *retmap);
        u32     (*cpu_present_to_apicid)(int mps_cpu);
-       int     (*phys_pkg_id)(int cpuid_apic, int index_msb);
+       u32     (*phys_pkg_id)(u32 cpuid_apic, int index_msb);
 
        u32     (*get_apic_id)(unsigned long x);
        u32     (*set_apic_id)(unsigned int id);
index a5364a4265907dcb0ea0bf5886d63b5f423b3492..ca05acaf5a6b38ed0c7cc827e0522d4ad38c9dca 100644 (file)
@@ -66,7 +66,7 @@ static u32 set_apic_id(unsigned int id)
        return (id & 0xFF) << 24;
 }
 
-static int flat_phys_pkg_id(int initial_apic_id, int index_msb)
+static u32 flat_phys_pkg_id(u32 initial_apic_id, int index_msb)
 {
        return initial_apic_id >> index_msb;
 }
index f834a2064d736aafdb2c9641ad1a2dcd7dbdab41..28ea3427a893e127cb78c1c89739ad89c20f14a7 100644 (file)
@@ -29,7 +29,7 @@ static void noop_send_IPI_self(int vector) { }
 static void noop_apic_icr_write(u32 low, u32 id) { }
 static int noop_wakeup_secondary_cpu(int apicid, unsigned long start_eip) { return -1; }
 static u64 noop_apic_icr_read(void) { return 0; }
-static int noop_phys_pkg_id(int cpuid_apic, int index_msb) { return 0; }
+static u32 noop_phys_pkg_id(u32 cpuid_apic, int index_msb) { return 0; }
 static unsigned int noop_get_apic_id(unsigned long x) { return 0; }
 static void noop_apic_eoi(void) { }
 
index 32a5e03238944bb222baa07a09bab65882ff7c53..c35181c4aa144cc1dca52994f03e6759fef4cb09 100644 (file)
@@ -56,7 +56,7 @@ static u32 numachip2_set_apic_id(unsigned int id)
        return id << 24;
 }
 
-static int numachip_phys_pkg_id(int initial_apic_id, int index_msb)
+static u32 numachip_phys_pkg_id(u32 initial_apic_id, int index_msb)
 {
        return initial_apic_id >> index_msb;
 }
index 52ac447b568e0130db22c87bf66feeaaa1d2ae5f..3c95e0b03e8637929b4c0101a2cc05647ed31a49 100644 (file)
@@ -29,7 +29,7 @@ static void bigsmp_ioapic_phys_id_map(physid_mask_t *phys_map, physid_mask_t *re
        physids_promote(0xFFL, retmap);
 }
 
-static int bigsmp_phys_pkg_id(int cpuid_apic, int index_msb)
+static u32 bigsmp_phys_pkg_id(u32 cpuid_apic, int index_msb)
 {
        return cpuid_apic >> index_msb;
 }
index 860d90b6bd5064d60633a37937e7dcabcb16fe39..2bf0d1c78d71ed4141444e971d11575a20cb6a49 100644 (file)
@@ -17,7 +17,7 @@
 void __x2apic_send_IPI_dest(unsigned int apicid, int vector, unsigned int dest);
 unsigned int x2apic_get_apic_id(unsigned long id);
 u32 x2apic_set_apic_id(unsigned int id);
-int x2apic_phys_pkg_id(int initial_apicid, int index_msb);
+u32 x2apic_phys_pkg_id(u32 initial_apicid, int index_msb);
 
 void x2apic_send_IPI_all(int vector);
 void x2apic_send_IPI_allbutself(int vector);
index 9a06df6cdd6807412343a0af0bf328b8cf5dc466..2867fa61c4cdde51502848dae103cbc98990f3e4 100644 (file)
@@ -18,7 +18,7 @@
 
 #include "local.h"
 
-static int default_phys_pkg_id(int cpuid_apic, int index_msb)
+static u32 default_phys_pkg_id(u32 cpuid_apic, int index_msb)
 {
        return cpuid_apic >> index_msb;
 }
index 788cdb4ee394dae662e4618644e8e240b3666429..55cbceccea085fc4577c2155887c858d4988cfb5 100644 (file)
@@ -134,7 +134,7 @@ u32 x2apic_set_apic_id(unsigned int id)
        return id;
 }
 
-int x2apic_phys_pkg_id(int initial_apicid, int index_msb)
+u32 x2apic_phys_pkg_id(u32 initial_apicid, int index_msb)
 {
        return initial_apicid >> index_msb;
 }
index d9f5d7492f8371df1004159297a4b4ad48c78e63..3589ab610dbc48179266ee0b8921fc29c01c164b 100644 (file)
@@ -789,7 +789,7 @@ static unsigned int uv_read_apic_id(void)
        return x2apic_get_apic_id(apic_read(APIC_ID));
 }
 
-static int uv_phys_pkg_id(int initial_apicid, int index_msb)
+static u32 uv_phys_pkg_id(u32 initial_apicid, int index_msb)
 {
        return uv_read_apic_id() >> index_msb;
 }
index 65e96b76c42321afdfd3cb29579476c412697ce6..d3fc017705587de1f921c02f3da83edf6e73368f 100644 (file)
@@ -127,7 +127,7 @@ static void __init vsmp_cap_cpus(void)
 #endif
 }
 
-static int apicid_phys_pkg_id(int initial_apic_id, int index_msb)
+static u32 apicid_phys_pkg_id(u32 initial_apic_id, int index_msb)
 {
        return read_apic_id() >> index_msb;
 }
index c830ad4175a88bfe130b0740f39d00dcb3ae826a..40538b23e20b4d474be66d22087dd8b45c39cf75 100644 (file)
@@ -110,7 +110,7 @@ static int xen_madt_oem_check(char *oem_id, char *oem_table_id)
        return xen_pv_domain();
 }
 
-static int xen_phys_pkg_id(int initial_apic_id, int index_msb)
+static u32 xen_phys_pkg_id(u32 initial_apic_id, int index_msb)
 {
        return initial_apic_id >> index_msb;
 }