Skip to content

Commit 1687d8a

Browse files
committed
Merge tag 'x86_apic_for_6.6-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
Pull x86 apic updates from Dave Hansen: "This includes a very thorough rework of the 'struct apic' handlers. Quite a variety of them popped up over the years, especially in the 32-bit days when odd apics were much more in vogue. The end result speaks for itself, which is a removal of a ton of code and static calls to replace indirect calls. If there's any breakage here, it's likely to be around the 32-bit museum pieces that get light to no testing these days. Summary: - Rework apic callbacks, getting rid of unnecessary ones and coalescing lots of silly duplicates. - Use static_calls() instead of indirect calls for apic->foo() - Tons of cleanups an crap removal along the way" * tag 'x86_apic_for_6.6-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (64 commits) x86/apic: Turn on static calls x86/apic: Provide static call infrastructure for APIC callbacks x86/apic: Wrap IPI calls into helper functions x86/apic: Mark all hotpath APIC callback wrappers __always_inline x86/xen/apic: Mark apic __ro_after_init x86/apic: Convert other overrides to apic_update_callback() x86/apic: Replace acpi_wake_cpu_handler_update() and apic_set_eoi_cb() x86/apic: Provide apic_update_callback() x86/xen/apic: Use standard apic driver mechanism for Xen PV x86/apic: Provide common init infrastructure x86/apic: Wrap apic->native_eoi() into a helper x86/apic: Nuke ack_APIC_irq() x86/apic: Remove pointless arguments from [native_]eoi_write() x86/apic/noop: Tidy up the code x86/apic: Remove pointless NULL initializations x86/apic: Sanitize APIC ID range validation x86/apic: Prepare x2APIC for using apic::max_apic_id x86/apic: Simplify X2APIC ID validation x86/apic: Add max_apic_id member x86/apic: Wrap APIC ID validation into an inline ...
2 parents 87fa732 + f8542a5 commit 1687d8a

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

69 files changed

+841
-1420
lines changed

arch/x86/hyperv/hv_apic.c

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -86,14 +86,14 @@ static void hv_apic_write(u32 reg, u32 val)
8686
}
8787
}
8888

89-
static void hv_apic_eoi_write(u32 reg, u32 val)
89+
static void hv_apic_eoi_write(void)
9090
{
9191
struct hv_vp_assist_page *hvp = hv_vp_assist_page[smp_processor_id()];
9292

9393
if (hvp && (xchg(&hvp->apic_assist, 0) & 0x1))
9494
return;
9595

96-
wrmsr(HV_X64_MSR_EOI, val, 0);
96+
wrmsr(HV_X64_MSR_EOI, APIC_EOI_ACK, 0);
9797
}
9898

9999
static bool cpu_is_self(int cpu)
@@ -286,12 +286,12 @@ void __init hv_apic_init(void)
286286
*/
287287
orig_apic = *apic;
288288

289-
apic->send_IPI = hv_send_ipi;
290-
apic->send_IPI_mask = hv_send_ipi_mask;
291-
apic->send_IPI_mask_allbutself = hv_send_ipi_mask_allbutself;
292-
apic->send_IPI_allbutself = hv_send_ipi_allbutself;
293-
apic->send_IPI_all = hv_send_ipi_all;
294-
apic->send_IPI_self = hv_send_ipi_self;
289+
apic_update_callback(send_IPI, hv_send_ipi);
290+
apic_update_callback(send_IPI_mask, hv_send_ipi_mask);
291+
apic_update_callback(send_IPI_mask_allbutself, hv_send_ipi_mask_allbutself);
292+
apic_update_callback(send_IPI_allbutself, hv_send_ipi_allbutself);
293+
apic_update_callback(send_IPI_all, hv_send_ipi_all);
294+
apic_update_callback(send_IPI_self, hv_send_ipi_self);
295295
}
296296

297297
if (ms_hyperv.hints & HV_X64_APIC_ACCESS_RECOMMENDED) {
@@ -308,12 +308,12 @@ void __init hv_apic_init(void)
308308
* lazy EOI when available, but the same accessor works for
309309
* both xapic and x2apic because the field layout is the same.
310310
*/
311-
apic_set_eoi_write(hv_apic_eoi_write);
311+
apic_update_callback(eoi, hv_apic_eoi_write);
312312
if (!x2apic_enabled()) {
313-
apic->read = hv_apic_read;
314-
apic->write = hv_apic_write;
315-
apic->icr_write = hv_apic_icr_write;
316-
apic->icr_read = hv_apic_icr_read;
313+
apic_update_callback(read, hv_apic_read);
314+
apic_update_callback(write, hv_apic_write);
315+
apic_update_callback(icr_write, hv_apic_icr_write);
316+
apic_update_callback(icr_read, hv_apic_icr_read);
317317
}
318318
}
319319
}

arch/x86/hyperv/hv_init.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ static inline bool hv_reenlightenment_available(void)
162162

163163
DEFINE_IDTENTRY_SYSVEC(sysvec_hyperv_reenlightenment)
164164
{
165-
ack_APIC_irq();
165+
apic_eoi();
166166
inc_irq_stat(irq_hv_reenlightenment_count);
167167
schedule_delayed_work(&hv_reenlightenment_work, HZ/10);
168168
}

arch/x86/hyperv/hv_spinlock.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ static bool __initdata hv_pvspin = true;
2020

2121
static void hv_qlock_kick(int cpu)
2222
{
23-
apic->send_IPI(cpu, X86_PLATFORM_IPI_VECTOR);
23+
__apic_send_IPI(cpu, X86_PLATFORM_IPI_VECTOR);
2424
}
2525

2626
static void hv_qlock_wait(u8 *byte, u8 val)

arch/x86/hyperv/hv_vtl.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,7 @@ static int __init hv_vtl_early_init(void)
226226
"Please add 'noxsave' to the kernel command line.\n");
227227

228228
real_mode_header = &hv_vtl_real_mode_header;
229-
apic->wakeup_secondary_cpu_64 = hv_vtl_wakeup_secondary_cpu;
229+
apic_update_callback(wakeup_secondary_cpu_64, hv_vtl_wakeup_secondary_cpu);
230230

231231
return 0;
232232
}

0 commit comments

Comments
 (0)