Skip to content

Commit 7a116a2

Browse files
Kuppuswamy SathyanarayananKAGA-KOKO
authored andcommitted
x86/apic: Do apic driver probe for "nosmp" use case
For the "nosmp" use case, the APIC initialization code selects "APIC_SYMMETRIC_IO_NO_ROUTING" as the default interrupt mode and avoids probing APIC drivers. This works well for the default APIC modes, but for the x2APIC case the probe function is required to allocate the cluster_hotplug mask. So in the APIC_SYMMETRIC_IO_NO_ROUTING case when the x2APIC is initialized it dereferences a NULL pointer and the kernel crashes. This was observed on a TDX platform where x2APIC is enabled and "nosmp" command line option is allowed. To fix this issue, probe APIC drivers via default_setup_apic_routing() for the APIC_SYMMETRIC_IO_NO_ROUTING interrupt mode too. Suggested-by: Kirill A. Shutemov <[email protected]> Suggested-by: Rafael J. Wysocki <[email protected]> Signed-off-by: Kuppuswamy Sathyanarayanan <[email protected]> Signed-off-by: Thomas Gleixner <[email protected]> Reviewed-by: Tony Luck <[email protected]> Link: https://lore.kernel.org/r/a64f864e1114bcd63593286aaf61142cfce384ea.1650076869.git.sathyanarayanan.kuppuswamy@intel.com
1 parent daf3af4 commit 7a116a2

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

arch/x86/kernel/apic/apic.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1428,22 +1428,21 @@ void __init apic_intr_mode_init(void)
14281428
return;
14291429
case APIC_VIRTUAL_WIRE:
14301430
pr_info("APIC: Switch to virtual wire mode setup\n");
1431-
default_setup_apic_routing();
14321431
break;
14331432
case APIC_VIRTUAL_WIRE_NO_CONFIG:
14341433
pr_info("APIC: Switch to virtual wire mode setup with no configuration\n");
14351434
upmode = true;
1436-
default_setup_apic_routing();
14371435
break;
14381436
case APIC_SYMMETRIC_IO:
14391437
pr_info("APIC: Switch to symmetric I/O mode setup\n");
1440-
default_setup_apic_routing();
14411438
break;
14421439
case APIC_SYMMETRIC_IO_NO_ROUTING:
14431440
pr_info("APIC: Switch to symmetric I/O mode setup in no SMP routine\n");
14441441
break;
14451442
}
14461443

1444+
default_setup_apic_routing();
1445+
14471446
if (x86_platform.apic_post_init)
14481447
x86_platform.apic_post_init();
14491448

0 commit comments

Comments
 (0)