Skip to content

Commit db4a408

Browse files
committed
x86/apic: Use u32 for wakeup_secondary_cpu[_64]()
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 <[email protected]> Tested-by: Juergen Gross <[email protected]> Tested-by: Sohil Mehta <[email protected]> Tested-by: Michael Kelley <[email protected]> Tested-by: Peter Zijlstra (Intel) <[email protected]> Tested-by: Zhang Rui <[email protected]> Reviewed-by: Arjan van de Ven <[email protected]> Acked-by: Peter Zijlstra (Intel) <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent 59f7928 commit db4a408

File tree

7 files changed

+10
-10
lines changed

7 files changed

+10
-10
lines changed

arch/x86/hyperv/hv_vtl.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,7 @@ static int hv_vtl_apicid_to_vp_id(u32 apic_id)
196196
return ret;
197197
}
198198

199-
static int hv_vtl_wakeup_secondary_cpu(int apicid, unsigned long start_eip)
199+
static int hv_vtl_wakeup_secondary_cpu(u32 apicid, unsigned long start_eip)
200200
{
201201
int vp_id;
202202

arch/x86/include/asm/apic.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -302,9 +302,9 @@ struct apic {
302302
u32 (*set_apic_id)(u32 apicid);
303303

304304
/* wakeup_secondary_cpu */
305-
int (*wakeup_secondary_cpu)(int apicid, unsigned long start_eip);
305+
int (*wakeup_secondary_cpu)(u32 apicid, unsigned long start_eip);
306306
/* wakeup secondary CPU using 64-bit wakeup point */
307-
int (*wakeup_secondary_cpu_64)(int apicid, unsigned long start_eip);
307+
int (*wakeup_secondary_cpu_64)(u32 apicid, unsigned long start_eip);
308308

309309
char *name;
310310
};
@@ -322,8 +322,8 @@ struct apic_override {
322322
void (*send_IPI_self)(int vector);
323323
u64 (*icr_read)(void);
324324
void (*icr_write)(u32 low, u32 high);
325-
int (*wakeup_secondary_cpu)(int apicid, unsigned long start_eip);
326-
int (*wakeup_secondary_cpu_64)(int apicid, unsigned long start_eip);
325+
int (*wakeup_secondary_cpu)(u32 apicid, unsigned long start_eip);
326+
int (*wakeup_secondary_cpu_64)(u32 apicid, unsigned long start_eip);
327327
};
328328

329329
/*

arch/x86/kernel/acpi/boot.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -359,7 +359,7 @@ acpi_parse_lapic_nmi(union acpi_subtable_headers * header, const unsigned long e
359359
}
360360

361361
#ifdef CONFIG_X86_64
362-
static int acpi_wakeup_cpu(int apicid, unsigned long start_ip)
362+
static int acpi_wakeup_cpu(u32 apicid, unsigned long start_ip)
363363
{
364364
/*
365365
* Remap mailbox memory only for the first call to acpi_wakeup_cpu().

arch/x86/kernel/apic/apic_noop.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ static void noop_send_IPI_allbutself(int vector) { }
2727
static void noop_send_IPI_all(int vector) { }
2828
static void noop_send_IPI_self(int vector) { }
2929
static void noop_apic_icr_write(u32 low, u32 id) { }
30-
static int noop_wakeup_secondary_cpu(int apicid, unsigned long start_eip) { return -1; }
30+
static int noop_wakeup_secondary_cpu(u32 apicid, unsigned long start_eip) { return -1; }
3131
static u64 noop_apic_icr_read(void) { return 0; }
3232
static u32 noop_phys_pkg_id(u32 cpuid_apic, int index_msb) { return 0; }
3333
static u32 noop_get_apic_id(u32 apicid) { return 0; }

arch/x86/kernel/apic/apic_numachip.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ static void numachip2_apic_icr_write(int apicid, unsigned int val)
7171
numachip2_write32_lcsr(NUMACHIP2_APIC_ICR, (apicid << 12) | val);
7272
}
7373

74-
static int numachip_wakeup_secondary(int phys_apicid, unsigned long start_rip)
74+
static int numachip_wakeup_secondary(u32 phys_apicid, unsigned long start_rip)
7575
{
7676
numachip_apic_icr_write(phys_apicid, APIC_DM_INIT);
7777
numachip_apic_icr_write(phys_apicid, APIC_DM_STARTUP |

arch/x86/kernel/apic/x2apic_uv_x.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -701,7 +701,7 @@ static __init void build_uv_gr_table(void)
701701
}
702702
}
703703

704-
static int uv_wakeup_secondary(int phys_apicid, unsigned long start_rip)
704+
static int uv_wakeup_secondary(u32 phys_apicid, unsigned long start_rip)
705705
{
706706
unsigned long val;
707707
int pnode;

arch/x86/kernel/sev.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -940,7 +940,7 @@ static void snp_cleanup_vmsa(struct sev_es_save_area *vmsa)
940940
free_page((unsigned long)vmsa);
941941
}
942942

943-
static int wakeup_cpu_via_vmgexit(int apic_id, unsigned long start_ip)
943+
static int wakeup_cpu_via_vmgexit(u32 apic_id, unsigned long start_ip)
944944
{
945945
struct sev_es_save_area *cur_vmsa, *vmsa;
946946
struct ghcb_state state;

0 commit comments

Comments
 (0)