DC ZVA does not fault on device memory type

Host environment

  • Operating system: Linux

  • OS/kernel version: 6.15.3

  • Architecture: x86_64

  • QEMU flavor: qemu-system-aarch64

  • QEMU version: 10.0.2

  • QEMU command line:

    ./qemu-system-aarch64 -cpu max -M virt,virtualization=on

Emulated/Virtualized environment

  • Operating system: Custom Hypervisor
  • OS/kernel version: Custom Hypervisor
  • Architecture: aarch64

Description of problem

The DC ZVA instruction is architecturally specified to generate an alignment fault if it operates on any type of device memory.

When SCTLR_EL2.M=0 (aka the MMU is off), the data cache overrides the memory type to Device-nGnRnE - see Arm Reference Manual, Section D8.2.12.1 titled "Behavior when stage 1 address translation is disabled", rule RWFZPW for the EL2 translation regime.

Consequently, execution of DC ZVA for any VA must alignment-fault in EL2 when SCTLR_EL2.M=0. On QEMU it doesn't. On real hardware it does.

Steps to reproduce

  1. Enter EL2 (HYP mode)
  2. Disable MMU by setting SCTLR_EL2.M=0
  3. Execute DC ZVA for any address
Edited by Udo Steinberg