Re: [patch 58/58] x86/apic: Turn on static calls

From: Thomas Gleixner
Date: Tue Jul 18 2023 - 09:35:26 EST


On Tue, Jul 18 2023 at 01:16, Thomas Gleixner wrote:
> static __always_inline void __apic_send_IPI_mask(const struct cpumask *mask, int vector)
> {
> - apic->send_IPI_mask(mask, vector);
> + static_call(apic_call_send_IPI_mask)(mask, vector);
> }
>
> static __always_inline void __apic_send_IPI_self(int vector)
> {
> - apic->send_IPI_self(vector);
> + static_call(apic_call_send_IPI_self)(vector);
> }

I obviously must have missed to read the huge documentation section
about static_call() and modules. These two need to be static_call_mod().

I've force pushed the fixed up git branch to:

git://git.kernel.org/pub/scm/linux/kernel/git/tglx/devel.git x86/apic

Delta patch on top of the original pile below.

Thanks,

tglx
---
diff --git a/arch/x86/include/asm/apic.h b/arch/x86/include/asm/apic.h
index 78dfe8aaed83..f7eb72a1ae00 100644
--- a/arch/x86/include/asm/apic.h
+++ b/arch/x86/include/asm/apic.h
@@ -429,7 +429,7 @@ static __always_inline void __apic_send_IPI(int cpu, int vector)

static __always_inline void __apic_send_IPI_mask(const struct cpumask *mask, int vector)
{
- static_call(apic_call_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)
@@ -449,7 +449,7 @@ static __always_inline void __apic_send_IPI_all(int vector)

static __always_inline void __apic_send_IPI_self(int vector)
{
- static_call(apic_call_send_IPI_self)(vector);
+ static_call_mod(apic_call_send_IPI_self)(vector);
}

static __always_inline void apic_wait_icr_idle(void)
diff --git a/arch/x86/kernel/apic/apic.c b/arch/x86/kernel/apic/apic.c
index 0c63d2d9d75c..66d531876d3b 100644
--- a/arch/x86/kernel/apic/apic.c
+++ b/arch/x86/kernel/apic/apic.c
@@ -1875,6 +1875,7 @@ static __init void try_to_enable_x2apic(int remap_mode)
* be addressed must not be brought online.
*/
x2apic_set_max_apicid(apic_limit);
+ x2apic_phys = 1;
}
x2apic_enable();
}