Skip to content

x86/apic: Decrapification and static calls

Thomas Gleixner lkml 3 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v3 Latest60 patches 11 repliesIn review
  2. v258 patches 21 repliesApplied
  3. v158 patches 31 repliesSuperseded

Patches in v3 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/60x86/cpu: Make identify_boot_cpu() staticarch/x86/include/asm/processor.h arch/x86/kernel/cpu/common.c+1 -20 replies
2/60x86/cpu: Remove unused physid_*() nonsensearch/x86/include/asm/mpspec.h+0 -260 replies
3/60x86/apic: Rename disable_apicarch/x86/include/asm/apic.h arch/x86/kernel/apic/apic.c arch/x86/kernel/apic/apic_noop.c +4 more+20 -200 replies
4/60x86/apic/ioapic: Rename skip_ioapic_setuparch/x86/include/asm/io_apic.h arch/x86/kernel/acpi/boot.c arch/x86/kernel/apic/apic.c +2 more+18 -170 replies
5/60x86/apic: Remove pointless x86_bios_cpu_apicidarch/x86/include/asm/apic.h arch/x86/include/asm/smp.h arch/x86/kernel/apic/apic.c +4 more+4 -150 replies
6/60x86/apic: Get rid of hard_smp_processor_id()arch/x86/include/asm/apic.h arch/x86/include/asm/smp.h arch/x86/kernel/apic/apic.c +7 more+17 -240 replies
7/60x86/apic: Remove unused max_physical_apicidarch/x86/kernel/apic/apic.c+0 -80 replies
8/60x86/apic: Nuke unused apic::inquire_remote_apic()arch/x86/include/asm/apic.h arch/x86/kernel/apic/apic_flat_64.c arch/x86/kernel/apic/apic_noop.c +8 more+0 -780 replies
9/60x86/apic: Get rid of boot_cpu_physical_apicid madnessarch/x86/include/asm/apic.h arch/x86/kernel/apic/apic.c arch/x86/kernel/mpparse.c+34 -740 replies
10/60x86/apic: Register boot CPU APIC earlyarch/x86/kernel/apic/apic.c+50 -700 replies
11/60x86/apic: Remove the pointless APIC version checkarch/x86/include/asm/mpspec.h arch/x86/kernel/acpi/boot.c arch/x86/kernel/apic/apic.c +4 more+13 -310 replies
12/60x86/of: Fix the APIC address registrationarch/x86/kernel/devicetree.c+5 -92 replies
13/60x86/apic: Make some APIC init functions boolarch/x86/include/asm/apic.h arch/x86/kernel/apic/apic.c arch/x86/kernel/devicetree.c+22 -220 replies
14/60x86/apic: Split register_apic_address()arch/x86/kernel/apic/apic.c+14 -80 replies
15/60x86/apic: Sanitize APIC address setuparch/x86/include/asm/mpspec.h arch/x86/kernel/apic/apic.c arch/x86/kernel/mpparse.c+12 -290 replies
16/60x86/xen/pv: Pretend that it found SMP configurationarch/x86/xen/smp_pv.c+2 -10 replies
17/60x86/apic: Sanitize num_processors handlingarch/x86/kernel/apic/apic.c arch/x86/kernel/smpboot.c+6 -210 replies
18/60x86/apic: Nuke another processor checkarch/x86/kernel/smpboot.c+0 -170 replies
19/60x86/apic: Remove check_phys_apicid_present()arch/x86/include/asm/apic.h arch/x86/kernel/apic/apic_common.c arch/x86/kernel/apic/apic_flat_64.c +8 more+0 -240 replies
20/60x86/apic: Get rid of apic_physarch/x86/kernel/apic/apic.c+10 -90 replies
21/60x86/apic/32: Sanitize logical APIC ID handlingarch/x86/include/asm/apic.h arch/x86/kernel/apic/apic.c arch/x86/kernel/apic/apic_noop.c +2 more+2 -510 replies
22/60x86/apic/32: Remove x86_cpu_to_logical_apicidarch/x86/include/asm/smp.h arch/x86/kernel/apic/apic.c arch/x86/kernel/apic/ipi.c +1 more+9 -680 replies
23/60x86/apic/ipi: Code cleanuparch/x86/kernel/apic/ipi.c+7 -160 replies
24/60x86/apic: Mop up early_per_cpu() abusearch/x86/kernel/apic/x2apic_uv_x.c+1 -10 replies
25/60x86/apic/32: Remove pointless default_acpi_madt_oem_check()arch/x86/include/asm/apic.h arch/x86/kernel/apic/bigsmp_32.c arch/x86/kernel/apic/probe_32.c+3 -240 replies
26/60x86/apic/32: Decrapify the def_bigsmp mechanismarch/x86/include/asm/mpspec.h arch/x86/kernel/apic/apic.c arch/x86/kernel/apic/bigsmp_32.c +4 more+41 -702 replies
27/60x86/apic/32: Remove bigsmp_cpu_present_to_apicid()arch/x86/kernel/apic/bigsmp_32.c+1 -90 replies
28/60x86/apic: Nuke empty init_apic_ldr() callbacksarch/x86/include/asm/apic.h arch/x86/kernel/apic/apic.c arch/x86/kernel/apic/apic_common.c +9 more+24 -770 replies
29/60x86/apic: Nuke apic::apicid_to_cpu_present()arch/x86/include/asm/apic.h arch/x86/kernel/apic/apic_flat_64.c arch/x86/kernel/apic/apic_noop.c +8 more+5 -180 replies
30/60x86/ioapic/32: Decrapify phys_id_present_map operationarch/x86/kernel/apic/io_apic.c+1 -40 replies
31/60x86/apic: Mop up *setup_apic_routing()arch/x86/include/asm/apic.h arch/x86/kernel/apic/apic.c arch/x86/kernel/apic/apic_flat_64.c +11 more+13 -410 replies
32/60x86/apic: Mop up apic::apic_id_registered()arch/x86/include/asm/apic.h arch/x86/kernel/apic/apic.c arch/x86/kernel/apic/apic_common.c +10 more+12 -680 replies
33/60x86/apic/ipi: Tidy up the code and fixup commentsarch/x86/kernel/apic/ipi.c arch/x86/kernel/apic/local.h+32 -440 replies
34/60x86/apic: Consolidate wait_icr_idle() implementationsarch/x86/include/asm/apic.h arch/x86/kernel/apic/apic.c arch/x86/kernel/apic/apic_flat_64.c +4 more+9 -140 replies
35/60x86/apic: Allow apic::wait_icr_idle() to be NULLarch/x86/include/asm/apic.h arch/x86/kernel/apic/apic_noop.c arch/x86/kernel/apic/apic_numachip.c +4 more+2 -240 replies
36/60x86/apic: Allow apic::safe_wait_icr_idle() to be NULLarch/x86/include/asm/apic.h arch/x86/kernel/apic/apic_noop.c arch/x86/kernel/apic/apic_numachip.c +4 more+1 -300 replies
37/60x86/apic: Move safe wait_icr_idle() next to apic_mem_wait_icr_idle()arch/x86/include/asm/apic.h arch/x86/kernel/apic/apic.c arch/x86/kernel/apic/apic_flat_64.c +4 more+22 -240 replies
38/60x86/apic/uv: Get rid of wrapper callbacksarch/x86/kernel/apic/x2apic_uv_x.c+1 -60 replies
39/60x86/apic/x2apic: Share all common IPI functionsarch/x86/kernel/apic/local.h arch/x86/kernel/apic/x2apic_cluster.c arch/x86/kernel/apic/x2apic_phys.c +1 more+28 -440 replies
40/60x86/apic/64: Uncopypaste probingarch/x86/kernel/apic/probe_64.c+11 -100 replies
41/60x86/apic: Wrap APIC ID validation into an inlinearch/x86/include/asm/apic.h arch/x86/kernel/acpi/boot.c arch/x86/kernel/apic/vector.c +2 more+11 -80 replies
42/60x86/apic: Add max_apic_id memberarch/x86/include/asm/apic.h arch/x86/kernel/apic/apic_flat_64.c arch/x86/kernel/apic/apic_noop.c +7 more+14 -00 replies
43/60x86/apic: Simplify X2APIC ID validationarch/x86/kernel/apic/x2apic_phys.c+2 -50 replies
44/60x86/apic: Prepare x2APIC for using apic::max_apic_idarch/x86/include/asm/apic.h arch/x86/kernel/apic/local.h arch/x86/kernel/apic/probe_64.c +2 more+14 -40 replies
45/60x86/apic: Sanitize APID ID range validationarch/x86/include/asm/apic.h arch/x86/kernel/apic/apic_common.c arch/x86/kernel/apic/apic_flat_64.c +9 more+1 -423 replies
46/60x86/apic: Remove pointless NULL initializationsarch/x86/kernel/apic/apic_flat_64.c arch/x86/kernel/apic/apic_noop.c arch/x86/kernel/apic/apic_numachip.c +3 more+0 -130 replies
47/60x86/apic/noop: Tidy up the codearch/x86/kernel/apic/apic_noop.c+8 -300 replies
48/60x86/apic: Remove pointless arguments from [native_]eoi_write()arch/x86/hyperv/hv_apic.c arch/x86/include/asm/apic.h arch/x86/kernel/apic/apic.c +10 more+38 -270 replies
49/60x86/apic: Nuke ack_APIC_irq()arch/x86/hyperv/hv_init.c arch/x86/include/asm/apic.h arch/x86/kernel/apic/apic.c +11 more+29 -390 replies
50/60x86/apic: Wrap apic->native_eoi() into a helperarch/x86/include/asm/apic.h arch/x86/kernel/kvm.c+7 -10 replies
51/60x86/apic: Provide common init infrastructurearch/x86/include/asm/apic.h arch/x86/kernel/apic/Makefile arch/x86/kernel/apic/apic.c +6 more+59 -631 reply
52/60x86/xen/apic: Use standard apic driver mechanism for Xen PVarch/x86/xen/apic.c arch/x86/xen/enlighten_pv.c+1 -140 replies
53/60x86/apic: Provide apic_update_callback()arch/x86/include/asm/apic.h arch/x86/kernel/apic/init.c arch/x86/kernel/setup.c+68 -10 replies
54/60x86/apic: Replace acpi_wake_cpu_handler_update() and apic_set_eoi_cb()arch/x86/hyperv/hv_apic.c arch/x86/hyperv/hv_vtl.c arch/x86/include/asm/apic.h +3 more+5 -350 replies
55/60x86/apic: Convert other overrides to apic_update_callback()arch/x86/hyperv/hv_apic.c arch/x86/kernel/kvm.c arch/x86/kernel/sev.c+15 -150 replies
56/60x86/xen/apic: Mark apic __ro_after_initarch/x86/xen/apic.c+13 -150 replies
57/60x86/apic: Mark all hotpath APIC callback wrappers __always_inlinearch/x86/include/asm/apic.h+9 -90 replies
58/60x86/apic: Wrap IPI calls into helper functionsarch/x86/hyperv/hv_spinlock.c arch/x86/include/asm/apic.h arch/x86/kernel/apic/apic.c +10 more+53 -220 replies
59/60x86/apic: Provide static call infrastructure for APIC callbacksarch/x86/include/asm/apic.h arch/x86/kernel/apic/init.c+74 -00 replies
60/60x86/apic: Turn on static callsarch/x86/include/asm/apic.h+13 -140 replies

Reviews trailers per patch

58 of 60 patches have a Reviewed-by or Acked-by.

PatchPeter Zijlstra (Intel)Wei LiuJuergen GrossSohil MehtaMichael Kelley
SeriesT-b T-b T-b
1/60A-b
2/60A-b
3/60A-b
4/60A-b
5/60A-b
6/60A-b
7/60A-b
8/60A-b
9/60A-b
10/60A-b
11/60A-b
12/60A-b
13/60A-b
14/60A-b
15/60A-b
16/60
17/60A-b
18/60A-b
19/60A-b
20/60A-b
21/60A-b
22/60A-b
23/60A-b
24/60A-b
25/60A-b
26/60A-b
27/60A-b
28/60A-b
29/60A-b
30/60A-b
31/60A-b
32/60A-b
33/60A-b
34/60A-b
35/60A-b
36/60A-b
37/60A-b
38/60A-b
39/60A-b
40/60A-b
41/60A-b
42/60A-b
43/60A-b
44/60A-b
45/60A-b
46/60A-b
47/60A-b
48/60A-b R-b
49/60A-b R-b
50/60A-b
51/60A-b
52/60
53/60A-b
54/60A-b R-b
55/60A-b
56/60A-b
57/60A-b
58/60A-b
59/60A-b
60/60A-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 5 reviewers.

Read the v3 thread

Cover letter [patch V3 00/60] x86/apic: Decrapification and static calls

Hi!

This is the follow up to:

https://lore.kernel.org/lkml/[email protected]

which addresses the XEN PV fallout decoded by Juergen.

TLDR: This cleans up accrued and partially unused gunk in order to convert the APIC callbacks to static calls.

The changes vs. V2:

- Unbreak XEN/PV - Juergen

Resulting delta patch below.

- Rebased to 6.5-rc4 in preparation for the CPUID overhaul on top, which has some collisions due to the recent mitigation muck.

The series is also available from git:

git://git.kernel.org/pub/scm/linux/kernel/git/tglx/devel.git apic-static-call-v3

Thanks,

tglx
---

arch/x86/xen/apic.c +1 -12
index 468406f511ff..7ad91225fdf4 100644
@@ -155,20 +155,9 @@ static struct apic xen_pv_apic __ro_after_init = {
 	.icr_read			= xen_apic_icr_read,
 	.icr_write			= xen_apic_icr_write,
 };
-
-static void __init xen_apic_check(void)
-{
-	apic_install_driver(&xen_pv_apic);
-}
+apic_driver(xen_pv_apic);
 
 void __init xen_init_apic(void)
 {
 	x86_apic_ops.io_apic_read = xen_io_apic_read;
-	/* On PV guests the APIC CPUID bit is disabled so none of the
-	 * routines end up executing. */
-	if (!xen_initial_domain())
-		apic_install_driver(&xen_pv_apic);
-
-	x86_platform.apic_post_init = xen_apic_check;
 }
-apic_driver(xen_pv_apic);
arch/x86/xen/enlighten_pv.c +1 -3
index 93b658248d01..c393c44892ac 100644
@@ -1326,7 +1326,7 @@ asmlinkage __visible void __init xen_start_kernel(struct start_info *si)
 
 	x86_init.resources.memory_setup = xen_memory_setup;
 	x86_init.irqs.intr_mode_select	= x86_init_noop;
-	x86_init.irqs.intr_mode_init	= x86_init_noop;
+	x86_init.irqs.intr_mode_init	= x86_64_probe_apic;
 	x86_init.oem.arch_setup = xen_arch_setup;
 	x86_init.oem.banner = xen_banner;
 	x86_init.hyper.init_platform = xen_pv_init_platform;
@@ -1366,12 +1366,10 @@ asmlinkage __visible void __init xen_start_kernel(struct start_info *si)
 
 	xen_init_capabilities();
 
-#ifdef CONFIG_X86_LOCAL_APIC
 	/*
 	 * set up the basic apic ops.
 	 */
 	xen_init_apic();
-#endif
 
 	machine_ops = xen_machine_ops;
 
arch/x86/xen/smp_pv.c +2 -1
index c6b42c66c60c..a0f07bbfcd6e 100644
@@ -182,7 +182,8 @@ static void __init _get_smp_config(unsigned int early)
 	if (subtract)
 		set_nr_cpu_ids(nr_cpu_ids - subtract);
 #endif
-
+	/* Pretend to be a proper enumerated system */
+	smp_found_config = 1;
 }
 
 static void __init xen_pv_smp_prepare_boot_cpu(void)