freebsd-dev/sys/arm64
Mark Johnston 2c10be9e06 arm64: Handle translation faults for thread structures
The break-before-make requirement poses a problem when promoting or
demoting mappings containing thread structures: a CPU may raise a
translation fault while accessing curthread, and data_abort() accesses
the thread again before pmap_fault() can translate the address and
return.

Normally this isn't a problem because we have a hack to ensure that
slabs used by the thread zone are always accessed via the direct map,
where promotions and demotions are rare.  However, this hack doesn't
work properly with UMA_MD_SMALL_ALLOC disabled, as is the case with
KASAN configured (since our KASAN implementation does not shadow the
direct map and so tries to force the use of the kernel map wherever
possible).

Fix the problem by modifying data_abort() to handle translation faults
in the kernel map without dereferencing "td", i.e., curthread, and
without enabling interrupts.  pmap_klookup() has special handling for
translation faults which makes it safe to call in this context.  Then,
revert the aforementioned hack.

Reviewed by:	kevans, alc, kib, andrew
MFC after:	1 month
Sponsored by:	Juniper Networks, Inc.
Sponsored by:	Klara, Inc.
Differential Revision:	https://reviews.freebsd.org/D37231
2022-11-02 13:46:25 -04:00
..
acpica acpica: Merge ACPICA 20221020 2022-10-27 22:04:32 -04:00
arm64 arm64: Handle translation faults for thread structures 2022-11-02 13:46:25 -04:00
broadcom genet: add another case where headers need pullup 2022-10-29 07:52:57 -05:00
cavium Add fdt to name of a fdt specific function 2022-05-23 15:24:35 +01:00
conf Disable Hyper-V on arm64 2022-10-28 22:17:00 +01:00
coresight arm64: coresight: fix the build without FDT 2022-09-29 14:33:33 -05:00
freescale/imx arm/arm64 freescale: Remove unused devclass arguments to DRIVER_MODULE. 2022-05-09 14:26:44 -07:00
include arm64: Implement cpu_ptrace(). 2022-10-27 23:25:56 +02:00
intel arm64 intel: Remove unused devclass arguments to DRIVER_MODULE. 2022-05-09 14:26:45 -07:00
iommu iommu_gas: Eliminate redundant parameters and push down lock acquisition 2022-07-30 14:28:48 -05:00
linux sys: use .S for assembly language files that use the preprocessor 2022-11-02 10:29:00 -04:00
nvidia/tegra210 sys: Nuke double-semicolons 2022-11-02 09:34:20 -06:00
qoriq arm64, qoriq_therm: fix handling sites on version 1 and 2 2022-07-18 11:51:03 +00:00
qualcomm arm/arm64 qualcomm: Remove unused devclass arguments to DRIVER_MODULE. 2022-05-09 14:26:45 -07:00
rockchip Set denominator to 1 if it is 0 in the init phase. 2022-10-01 02:01:59 +00:00