nuttx/arch/arm64/src
Marco Casaroli baeedc5009 arch/arm64: Synchronize the TTBR0 write before the TLB invalidation.
mmu_write_ttbr0() writes TTBR0_EL1 and then invalidates the TLB.  A write
to TTBR0_EL1 takes effect only at the next context synchronization event,
so until the ISB at the end of the invalidation, a table walk can still
use the old table.  The instruction fetches of the invalidation sequence
itself do such walks.  An entry that they cache after the TLBI completes
stays valid: walk cache entries are not tagged with the table base, and
the kernel and every process use ASID 0.

A kernel build then translates a user address of the new process through
a level 0 entry of the old table, and gets a level 1 translation fault.
Under QEMU with HVF on Apple silicon this happens on every boot of
qemu-armv8a:knsh: up_addrenv_va_to_pa() fails for the first user buffer,
and virtio gets a descriptor with address 0.  TCG has no walk caches, so
it does not show the problem.

Add an ISB after the write, as the Arm ARM sequence for a TTBR change
without an ASID change requires: write, ISB, TLBI, DSB, ISB.

Assisted-by: Claude Code:claude-opus-5-5
Signed-off-by: Marco Casaroli <marco.casaroli@gmail.com>
2026-10-08 15:55:02 -03:00
..
a64
a527
am62x arm64/am62x: Add TISCI client, GPIO and I2C drivers 2026-08-02 11:40:13 +08:00
bcm2711 arm64/bcm2711/pwm: Fix PWM defconfigs 2026-07-28 02:46:42 +08:00
cmake cmake: Use NUTTX(_DIR/_BIN_DIR) instead CMAKE(_SRC_DIR/_BIN_DIR) 2026-08-09 11:13:08 -03:00
common arch/arm64: Synchronize the TTBR0 write before the TLB invalidation. 2026-10-08 15:55:02 -03:00
fvp-v8r
goldfish
imx8
imx9 arch/arm64/imx9: reject PWM channels outside the timer 2026-09-30 09:24:36 -03:00
qemu
rk3399
rk3588
zynq-mpsoc
.gitignore
CMakeLists.txt arch: fix arch_interface guard for kernel builds 2026-08-06 02:39:03 +08:00
Makefile tools: fix stale archive members surviving a Kconfig-driven CSRCS change 2026-07-28 21:26:03 -03:00
Toolchain.defs arch, boards, cmake: Build C++ ELF modules without __cxa_atexit. 2026-09-04 15:44:24 -03:00