1
0
Fork 0
mirror of synced 2025-03-06 20:59:54 +01:00
linux/arch/x86/kernel/acpi
Zhiquan Li ab84ba647f x86/acpi: Remove __ro_after_init from acpi_mp_wake_mailbox
On a platform using the "Multiprocessor Wakeup Structure"[1] to startup
secondary CPUs the control processor needs to memremap() the physical
address of the MP Wakeup Structure mailbox to the variable
acpi_mp_wake_mailbox, which holds the virtual address of mailbox.

To wake up the AP the control processor writes the APIC ID of AP, the
wakeup vector and the ACPI_MP_WAKE_COMMAND_WAKEUP command into the mailbox.

Current implementation doesn't consider the case which restricts boot time
CPU bringup to 1 with the kernel parameter "maxcpus=1" and brings other
CPUs online later from user space as it sets acpi_mp_wake_mailbox to
read-only after init.  So when the first AP is tried to brought online
after init, the attempt to update the variable results in a kernel panic.

The memremap() call that initializes the variable cannot be moved into
acpi_parse_mp_wake() because memremap() is not functional at that point in
the boot process. Also as the APs might never be brought up, keep the
memremap() call in acpi_wakeup_cpu() so that the operation only takes place
when needed.

Fixes: 24dd05da8c ("x86/apic: Mark acpi_mp_wake_* variables as __ro_after_init")
Signed-off-by: Zhiquan Li <zhiquan1.li@intel.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Reviewed-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
Link: https://lore.kernel.org/all/20240805103531.1230635-1-zhiquan1.li@intel.com
2024-08-07 20:04:38 +02:00
..
apei.c x86/mce, cper: Pass x86 CPER through the MCA handling chain 2020-11-21 12:05:41 +01:00
boot.c x86/acpi: Extract ACPI MADT wakeup code into a separate file 2024-06-17 17:45:25 +02:00
cppc.c ACPI: CPPC: enable AMD CPPC V2 support for family 17h processors 2024-03-05 13:23:12 +01:00
cstate.c cpuidle: ACPI/intel: fix MWAIT hint target C-state computation 2024-03-05 21:25:18 +01:00
madt_playdead.S x86/acpi: Add support for CPU offlining for ACPI MADT wakeup method 2024-06-17 17:46:25 +02:00
madt_wakeup.c x86/acpi: Remove __ro_after_init from acpi_mp_wake_mailbox 2024-08-07 20:04:38 +02:00
Makefile x86/acpi: Add support for CPU offlining for ACPI MADT wakeup method 2024-06-17 17:46:25 +02:00
sleep.c x86/smpboot: Support parallel startup of secondary CPUs 2023-05-15 13:45:04 +02:00
sleep.h x86/acpi: Remove unused extern declaration acpi_copy_wakeup_routine() 2023-06-21 10:57:54 -07:00
wakeup_32.S x86: Prepare asm files for straight-line-speculation 2021-12-08 12:25:37 +01:00
wakeup_64.S x86/acpi: Use %rip-relative addressing in wakeup_64.S 2023-11-30 20:09:49 +01:00