1
0
Fork 0
mirror of synced 2025-03-06 20:59:54 +01:00
linux/arch/x86/kernel/apic
Yuntao Wang 0ecc5be200 x86/apic: Make x2apic_disable() work correctly
x2apic_disable() clears x2apic_state and x2apic_mode unconditionally, even
when the state is X2APIC_ON_LOCKED, which prevents the kernel to disable
it thereby creating inconsistent state.

Due to the early state check for X2APIC_ON, the code path which warns about
a locked X2APIC cannot be reached.

Test for state < X2APIC_ON instead and move the clearing of the state and
mode variables to the place which actually disables X2APIC.

[ tglx: Massaged change log. Added Fixes tag. Moved clearing so it's at the
  	right place for back ports ]

Fixes: a57e456a7b ("x86/apic: Fix fallout from x2apic cleanup")
Signed-off-by: Yuntao Wang <yuntao.wang@linux.dev>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Cc: stable@vger.kernel.org
Link: https://lore.kernel.org/all/20240813014827.895381-1-yuntao.wang@linux.dev
2024-08-13 15:15:19 +02:00
..
apic.c x86/apic: Make x2apic_disable() work correctly 2024-08-13 15:15:19 +02:00
apic_common.c x86/apic: Remove yet another dubious callback 2024-02-15 22:07:41 +01:00
apic_flat_64.c x86/apic: Remove yet another dubious callback 2024-02-15 22:07:41 +01:00
apic_noop.c x86/apic: Remove check_apicid_used() and ioapic_phys_id_map() 2024-02-15 22:07:39 +01:00
apic_numachip.c x86/apic: Remove the pointless writeback of boot_cpu_physical_apicid 2024-02-15 22:07:41 +01:00
bigsmp_32.c x86/apic: Remove the pointless writeback of boot_cpu_physical_apicid 2024-02-15 22:07:41 +01:00
hw_nmi.c * Rework apic callbacks, getting rid of unnecessary ones and 2023-08-30 10:44:46 -07:00
init.c x86/apic: Provide static call infrastructure for APIC callbacks 2023-08-09 12:00:55 -07:00
io_apic.c Rework of APIC enumeration and topology evaluation: 2024-03-11 15:45:55 -07:00
ipi.c Major microcode loader restructuring, cleanup and improvements by Thomas 2023-11-04 08:46:37 -10:00
local.h x86/apic: Remove yet another dubious callback 2024-02-15 22:07:41 +01:00
Makefile arch/x86: Fix typos 2024-01-03 11:46:22 +01:00
msi.c Revert "x86/apic/msi: Enable PCI/IMS" 2024-05-15 17:02:04 -05:00
probe_32.c x86/apic: Remove yet another dubious callback 2024-02-15 22:07:41 +01:00
probe_64.c x86/apic: Provide common init infrastructure 2023-08-09 11:58:34 -07:00
vector.c genirq/cpuhotplug, x86/vector: Prevent vector leak during CPU offline 2024-05-23 21:51:50 +02:00
x2apic_cluster.c x86/cpu: Improve readability of per-CPU cpumask initialization code 2024-04-10 07:02:33 +02:00
x2apic_phys.c x86/apic: Remove the pointless writeback of boot_cpu_physical_apicid 2024-02-15 22:07:41 +01:00
x2apic_uv_x.c x86/apic: Remove the pointless writeback of boot_cpu_physical_apicid 2024-02-15 22:07:41 +01:00