HomeFreeBSD

amd64: prevent KCSan false positives on LAPIC mapping

Description

amd64: prevent KCSan false positives on LAPIC mapping

For configurations without x2APIC support (guests, older hardware), the global
LAPIC MMIO mapping will trigger false-positive KCSan reports as it will appear
that multiple CPUs are concurrently reading and writing the same address.
This isn't actually true, as the underlying physical access will be performed
on the local CPU's APIC. Additionally, because LAPIC access can happen during
event timer configuration, the resulting KCSan printf can produce a panic due
to attempted recursion on event timer resources.

Add a __nosanitizethread preprocessor define to prevent the compiler from
inserting TSan hooks, and apply it to the x86 LAPIC accessors.

PR: 249149
Reported by: gbe
Reviewed by: andrew, kib
Tested by: gbe
Differential Revision: https://reviews.freebsd.org/D26354

Details

Provenance
jahAuthored on
Reviewer
andrew
Differential Revision
D26354: amd64: prevent KCSan false positives on LAPIC mapping
Parents
rS365651: Regen src.conf(5) after r365649
Branches
Unknown
Tags
Unknown