Commit 01ccf9bb authored by Thomas Gleixner's avatar Thomas Gleixner
Browse files

x86/apic: Use u32 for phys_pkg_id()



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: default avatarThomas Gleixner <tglx@linutronix.de>
Tested-by: default avatarJuergen Gross <jgross@suse.com>
Tested-by: default avatarSohil Mehta <sohil.mehta@intel.com>
Tested-by: default avatarMichael Kelley <mikelley@microsoft.com>
Tested-by: default avatarPeter Zijlstra (Intel) <peterz@infradead.org>
Tested-by: default avatarZhang Rui <rui.zhang@intel.com>
Reviewed-by: default avatarArjan van de Ven <arjan@linux.intel.com>
Acked-by: default avatarPeter Zijlstra (Intel) <peterz@infradead.org>
Link: https://lore.kernel.org/r/20230814085113.113097126@linutronix.de
parent 8aa2a417
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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);
+1 −1
Original line number Diff line number Diff line
@@ -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;
}
+1 −1
Original line number Diff line number Diff line
@@ -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) { }

+1 −1
Original line number Diff line number Diff line
@@ -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;
}
+1 −1
Original line number Diff line number Diff line
@@ -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;
}
Loading