]> sourceware.org Git - newlib-cygwin.git/commit
amd64: prevent KCSan false positives on LAPIC mapping
authorjah <jah@FreeBSD.org>
Sat, 12 Sep 2020 07:04:00 +0000 (07:04 +0000)
committerSebastian Huber <sebastian.huber@embedded-brains.de>
Mon, 26 Oct 2020 13:18:46 +0000 (14:18 +0100)
commit303c61925d9256be02dcbda8f1e5e0d4adf8b3b9
tree4e5780399f69d8c5c4b57530a0573363d5ef895e
parent47efca5ac3da9aacc3a4216a1725ed2d62dd27b1
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
newlib/libc/include/sys/cdefs.h
This page took 0.02869 seconds and 5 git commands to generate.