Skip to content

aarch64: enabling MMU causes instruction abort

Host environment

  • Operating system: Linux
  • OS/kernel version: Linux ArchLaptop 5.17.5-arch1-1 #1 SMP PREEMPT Wed, 27 Apr 2022 20:56:11 +0000 x86_64 GNU/Linux
  • Architecture: x86_64
  • QEMU flavor: qemu-system-aarch64
  • QEMU version: 7.1.0-rc2
  • QEMU command line:
    qemu-system-aarch64 -M raspi3b -serial stdio -kernel Kernel

Emulated/Virtualized environment

  • Operating system: SerenityOS
  • OS/kernel version: commit ca0e32e59fcf67a662e5d3a994d44cd7c941624a
  • Architecture: aarch64 Raspberry PI3

Description of problem

The title describes the problem pretty accurately, we get an instruction abort when enabling the MMU with a pretty simple set of page tables. This has been regressed from qemu 6.x.

Steps to reproduce

  1. Run the provided Kernel binary with the command line specified above.
  2. Notice the hang after 'Initialize MMU'. I traced it down to being an instructions abort after the write to the SCTLR_EL1 register.
  3. Try to run with qemu 6.x, and notice that it works.

Additional information

This does work on actual hardware, so it has to be a qemu bug.

A binary of the Serenity Kernel has been attached to the issue. The source of that binary can be found at commit ca0e32e59fcf67a662e5d3a994d44cd7c941624a of SerenityOS.

Kernel
Edited by Timon Kruiper
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information