x86/apic: Turn on static calls

Convert all the APIC callback inline wrappers from apic->foo() to
static_call(apic_call_foo)(), except for the safe_wait_icr_idle() one which
is only used during SMP bringup when sending INIT/SIPI. That really can do
the conditional callback. The regular wait_icr_idle() matters as it is used
in irq_work_raise(), so X2APIC machines spare the conditional.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Dave Hansen <dave.hansen@linux.intel.com>
Acked-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Tested-by: Juergen Gross <jgross@suse.com> # Xen PV (dom0 and unpriv. guest)
Tested-by: Michael Kelley <mikelley@microsoft.com>
Tested-by: Sohil Mehta <sohil.mehta@intel.com>
This commit is contained in:
Thomas Gleixner 2023-08-08 15:04:24 -07:00 коммит произвёл Dave Hansen
Родитель 3b7c27e678
Коммит f8542a5549
1 изменённых файлов: 13 добавлений и 14 удалений

Просмотреть файл

@ -394,68 +394,67 @@ DECLARE_APIC_CALL(write);
static __always_inline u32 apic_read(u32 reg)
{
return apic->read(reg);
return static_call(apic_call_read)(reg);
}
static __always_inline void apic_write(u32 reg, u32 val)
{
apic->write(reg, val);
static_call(apic_call_write)(reg, val);
}
static __always_inline void apic_eoi(void)
{
apic->eoi();
static_call(apic_call_eoi)();
}
static __always_inline void apic_native_eoi(void)
{
apic->native_eoi();
static_call(apic_call_native_eoi)();
}
static __always_inline u64 apic_icr_read(void)
{
return apic->icr_read();
return static_call(apic_call_icr_read)();
}
static __always_inline void apic_icr_write(u32 low, u32 high)
{
apic->icr_write(low, high);
static_call(apic_call_icr_write)(low, high);
}
static __always_inline void __apic_send_IPI(int cpu, int vector)
{
apic->send_IPI(cpu, vector);
static_call(apic_call_send_IPI)(cpu, vector);
}
static __always_inline void __apic_send_IPI_mask(const struct cpumask *mask, int vector)
{
apic->send_IPI_mask(mask, vector);
static_call_mod(apic_call_send_IPI_mask)(mask, vector);
}
static __always_inline void __apic_send_IPI_mask_allbutself(const struct cpumask *mask, int vector)
{
apic->send_IPI_mask_allbutself(mask, vector);
static_call(apic_call_send_IPI_mask_allbutself)(mask, vector);
}
static __always_inline void __apic_send_IPI_allbutself(int vector)
{
apic->send_IPI_allbutself(vector);
static_call(apic_call_send_IPI_allbutself)(vector);
}
static __always_inline void __apic_send_IPI_all(int vector)
{
apic->send_IPI_all(vector);
static_call(apic_call_send_IPI_all)(vector);
}
static __always_inline void __apic_send_IPI_self(int vector)
{
apic->send_IPI_self(vector);
static_call_mod(apic_call_send_IPI_self)(vector);
}
static __always_inline void apic_wait_icr_idle(void)
{
if (apic->wait_icr_idle)
apic->wait_icr_idle();
static_call_cond(apic_call_wait_icr_idle)();
}
static __always_inline u32 safe_apic_wait_icr_idle(void)