Skip to content
Commit ea7bdc65 authored by Jan Kiszka's avatar Jan Kiszka Committed by Ingo Molnar
Browse files

x86/apic: Plug racy xAPIC access of CPU hotplug code



apic_icr_write() and its users in smpboot.c were apparently
written under the assumption that this code would only run
during early boot. But nowadays we also execute it when onlining
a CPU later on while the system is fully running. That will make
wakeup_cpu_via_init_nmi and, thus, also native_apic_icr_write
run in plain process context. If we migrate the caller to a
different CPU at the wrong time or interrupt it and write to
ICR/ICR2 to send unrelated IPIs, we can end up sending INIT,
SIPI or NMIs to wrong CPUs.

Fix this by disabling interrupts during the write to the ICR
halves and disable preemption around waiting for ICR
availability and using it.

Signed-off-by: default avatarJan Kiszka <jan.kiszka@siemens.com>
Tested-By: default avatarIgor Mammedov <imammedo@redhat.com>
Link: http://lkml.kernel.org/r/52E6AFFE.3030004@siemens.com


Signed-off-by: default avatarIngo Molnar <mingo@kernel.org>
parent dc9788f4
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment