HomeFreeBSD

arm: Clear TTBCR before enabling the MMU

Description

arm: Clear TTBCR before enabling the MMU

Upon reset, this register is supposed to have a value of zero. But when
booting certain v7 CPUs in QEMU, we enter the kernel with several bits
set, including the EAE bit, which enables ARM's PAE extension. I'm not
sure if QEMU is setting it or if it's the uboot loader. Because FreeBSD
doesn't implement that extension and uses regular 32-bit page tables,
the kernel hangs immediately after enabling the MMU.

Just clear everything in TTBCR before enabling the MMU, to match the
reset value. FreeBSD doesn't toggle anything in that register.

PR: 251187
Reviewed by: imp
Sponsored by: The FreeBSD Foundation

(cherry picked from commit e9552d8b45d67ca44d91b3ec09c91253e7e99b28)

Details

Provenance
markjAuthored on Aug 5 2022, 8:21 PM
Parents
rG057b43b26235: bpf: Fix BIOCPROMISC locking
Branches
Unknown
Tags
Unknown