]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
Make lapic_ipi_vectored(APIC_IPI_DEST_SELF) NMI safe.
authormav <mav@FreeBSD.org>
Fri, 24 Jul 2020 19:54:15 +0000 (19:54 +0000)
committermav <mav@FreeBSD.org>
Fri, 24 Jul 2020 19:54:15 +0000 (19:54 +0000)
commitd6837dc54b7b9f69e74a66253de825924244b0d6
tree5152280ceba6001b2d7a48401cf932d1ff4cabe7
parentae7297f512ed3cc6d91ac911b77113a55ed49011
Make lapic_ipi_vectored(APIC_IPI_DEST_SELF) NMI safe.

Sending IPI to self or all CPUs does not require write into upper part of
the ICR, prone to races.  Previously the code disabled interrupts, but it
was not enough for NMIs.  Instead of that when possible write only lower
part of the register, or use special SELF IPI register in x2APIC mode.

This also removes ICR reads used to preserve reserved bits on write.
It was there from the beginning, but I failed to find explanation why,
neither I see Linux doing it.  Specification even tells that ICR content
may be lost in deep C-states, so if hardware does not bother to preserve
it, why should we?

MFC after: 2 weeks
Sponsored by: iXsystems, Inc.
sys/x86/x86/local_apic.c