x86/apic: Use u32 for wakeup_secondary_cpu[_64]()
authorThomas Gleixner <tglx@linutronix.de>
Mon, 14 Aug 2023 08:18:45 +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.

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.233274223@linutronix.de
arch/x86/hyperv/hv_vtl.c
arch/x86/include/asm/apic.h
arch/x86/kernel/acpi/boot.c
arch/x86/kernel/apic/apic_noop.c
arch/x86/kernel/apic/apic_numachip.c
arch/x86/kernel/apic/x2apic_uv_x.c
arch/x86/kernel/sev.c

index 36a5622180104f29e9c3ab5fc99c8d1bca7a3c6a..052c5b509a6c655719dd3998b9fc6449d83e3f94 100644 (file)
@@ -196,7 +196,7 @@ static int hv_vtl_apicid_to_vp_id(u32 apic_id)
        return ret;
 }
 
-static int hv_vtl_wakeup_secondary_cpu(int apicid, unsigned long start_eip)
+static int hv_vtl_wakeup_secondary_cpu(u32 apicid, unsigned long start_eip)
 {
        int vp_id;
 
index e7b45f224c47dae6eea80322e19c56bcc882fa6e..b0d192f613b7b4e7621221ab7f4297b7f9a91065 100644 (file)
@@ -302,9 +302,9 @@ struct apic {
        u32     (*set_apic_id)(u32 apicid);
 
        /* wakeup_secondary_cpu */
-       int     (*wakeup_secondary_cpu)(int apicid, unsigned long start_eip);
+       int     (*wakeup_secondary_cpu)(u32 apicid, unsigned long start_eip);
        /* wakeup secondary CPU using 64-bit wakeup point */
-       int     (*wakeup_secondary_cpu_64)(int apicid, unsigned long start_eip);
+       int     (*wakeup_secondary_cpu_64)(u32 apicid, unsigned long start_eip);
 
        char    *name;
 };
@@ -322,8 +322,8 @@ struct apic_override {
        void    (*send_IPI_self)(int vector);
        u64     (*icr_read)(void);
        void    (*icr_write)(u32 low, u32 high);
-       int     (*wakeup_secondary_cpu)(int apicid, unsigned long start_eip);
-       int     (*wakeup_secondary_cpu_64)(int apicid, unsigned long start_eip);
+       int     (*wakeup_secondary_cpu)(u32 apicid, unsigned long start_eip);
+       int     (*wakeup_secondary_cpu_64)(u32 apicid, unsigned long start_eip);
 };
 
 /*
index f3e4d35bb20e88f77c637e7df057f6ea52f15809..c5450706be7661c12586cb5ad2dd84eacdfef6a6 100644 (file)
@@ -359,7 +359,7 @@ acpi_parse_lapic_nmi(union acpi_subtable_headers * header, const unsigned long e
 }
 
 #ifdef CONFIG_X86_64
-static int acpi_wakeup_cpu(int apicid, unsigned long start_ip)
+static int acpi_wakeup_cpu(u32 apicid, unsigned long start_ip)
 {
        /*
         * Remap mailbox memory only for the first call to acpi_wakeup_cpu().
index f1114861938c5f9556c4a6f696eaf4e90362814b..b00d52ae84fa95ae3dd77816eb1c243bac1b3557 100644 (file)
@@ -27,7 +27,7 @@ static void noop_send_IPI_allbutself(int vector) { }
 static void noop_send_IPI_all(int vector) { }
 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 int noop_wakeup_secondary_cpu(u32 apicid, unsigned long start_eip) { return -1; }
 static u64 noop_apic_icr_read(void) { return 0; }
 static u32 noop_phys_pkg_id(u32 cpuid_apic, int index_msb) { return 0; }
 static u32 noop_get_apic_id(u32 apicid) { return 0; }
index af350b4dad564418a6a8c2bfaf88c0d8e4476eae..456a14c44f67abcc8fba1f71dc9d5c3bc181ce53 100644 (file)
@@ -71,7 +71,7 @@ static void numachip2_apic_icr_write(int apicid, unsigned int val)
        numachip2_write32_lcsr(NUMACHIP2_APIC_ICR, (apicid << 12) | val);
 }
 
-static int numachip_wakeup_secondary(int phys_apicid, unsigned long start_rip)
+static int numachip_wakeup_secondary(u32 phys_apicid, unsigned long start_rip)
 {
        numachip_apic_icr_write(phys_apicid, APIC_DM_INIT);
        numachip_apic_icr_write(phys_apicid, APIC_DM_STARTUP |
index 46d4de2f00a1b2d7111cb6c250b5187b14726b43..6efc499d5c14a4db2937c73fa3b853268c4de170 100644 (file)
@@ -701,7 +701,7 @@ static __init void build_uv_gr_table(void)
        }
 }
 
-static int uv_wakeup_secondary(int phys_apicid, unsigned long start_rip)
+static int uv_wakeup_secondary(u32 phys_apicid, unsigned long start_rip)
 {
        unsigned long val;
        int pnode;
index 2787826d9f607798da1d2b2fca4d8550a601eb0c..edf9b74b6f73d0d9eef8b69c797de33c8d97b859 100644 (file)
@@ -940,7 +940,7 @@ static void snp_cleanup_vmsa(struct sev_es_save_area *vmsa)
                free_page((unsigned long)vmsa);
 }
 
-static int wakeup_cpu_via_vmgexit(int apic_id, unsigned long start_ip)
+static int wakeup_cpu_via_vmgexit(u32 apic_id, unsigned long start_ip)
 {
        struct sev_es_save_area *cur_vmsa, *vmsa;
        struct ghcb_state state;