Commit 2744a7ce authored by Thomas Gleixner's avatar Thomas Gleixner Committed by Dave Hansen
Browse files

x86/apic: Replace acpi_wake_cpu_handler_update() and apic_set_eoi_cb()



Switch them over to apic_update_callback() and remove the code.

Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
Signed-off-by: default avatarDave Hansen <dave.hansen@linux.intel.com>
Reviewed-by: default avatarWei Liu <wei.liu@kernel.org>
Acked-by: default avatarPeter Zijlstra (Intel) <peterz@infradead.org>
Tested-by: default avatarMichael Kelley <mikelley@microsoft.com>
Tested-by: default avatarSohil Mehta <sohil.mehta@intel.com>
Tested-by: Juergen Gross <jgross@suse.com> # Xen PV (dom0 and unpriv. guest)
parent bef4f379
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -310,7 +310,7 @@ void __init hv_apic_init(void)
		 * lazy EOI when available, but the same accessor works for
		 * both xapic and x2apic because the field layout is the same.
		 */
		apic_set_eoi_cb(hv_apic_eoi_write);
		apic_update_callback(eoi, hv_apic_eoi_write);
		if (!x2apic_enabled()) {
			apic->read      = hv_apic_read;
			apic->write     = hv_apic_write;
+1 −1
Original line number Diff line number Diff line
@@ -222,7 +222,7 @@ static int __init hv_vtl_early_init(void)
			  "Please add 'noxsave' to the kernel command line.\n");

	real_mode_header = &hv_vtl_real_mode_header;
	apic->wakeup_secondary_cpu_64 = hv_vtl_wakeup_secondary_cpu;
	apic_update_callback(wakeup_secondary_cpu_64, hv_vtl_wakeup_secondary_cpu);

	return 0;
}
+0 −3
Original line number Diff line number Diff line
@@ -417,8 +417,6 @@ static inline bool apic_id_valid(u32 apic_id)
	return apic_id <= apic->max_apic_id;
}

extern void __init apic_set_eoi_cb(void (*eoi)(void));

#else /* CONFIG_X86_LOCAL_APIC */

static inline u32 apic_read(u32 reg) { return 0; }
@@ -478,7 +476,6 @@ static inline unsigned int read_apic_id(void)

#ifdef CONFIG_X86_64
typedef int (*wakeup_cpu_handler)(int apicid, unsigned long start_eip);
extern void acpi_wake_cpu_handler_update(wakeup_cpu_handler handler);
extern int default_acpi_madt_oem_check(char *, char *);
extern void x86_64_probe_apic(void);
#else
+1 −1
Original line number Diff line number Diff line
@@ -1174,7 +1174,7 @@ static int __init acpi_parse_mp_wake(union acpi_subtable_headers *header,

	acpi_mp_wake_mailbox_paddr = mp_wake->base_address;

	acpi_wake_cpu_handler_update(acpi_wakeup_cpu);
	apic_update_callback(wakeup_secondary_cpu_64, acpi_wakeup_cpu);

	return 0;
}
+0 −27
Original line number Diff line number Diff line
@@ -55,30 +55,3 @@ void __init apic_install_driver(struct apic *driver)

	pr_info("Switched APIC routing to: %s\n", driver->name);
}

#ifdef CONFIG_X86_64
void __init acpi_wake_cpu_handler_update(wakeup_cpu_handler handler)
{
	struct apic **drv;

	for (drv = __apicdrivers; drv < __apicdrivers_end; drv++)
		(*drv)->wakeup_secondary_cpu_64 = handler;
}
#endif

/*
 * Override the generic EOI implementation with an optimized version.
 * Only called during early boot when only one CPU is active and with
 * interrupts disabled, so we know this does not race with actual APIC driver
 * use.
 */
void __init apic_set_eoi_cb(void (*eoi)(void))
{
	struct apic **drv;

	for (drv = __apicdrivers; drv < __apicdrivers_end; drv++) {
		/* Should happen once for each apic */
		WARN_ON((*drv)->eoi == eoi);
		(*drv)->eoi = eoi;
	}
}
Loading