]> git.proxmox.com Git - mirror_qemu.git/commit - target/arm/internals.h
target/arm: Don't allow guest to use unimplemented granule sizes
authorPeter Maydell <peter.maydell@linaro.org>
Mon, 3 Oct 2022 16:23:13 +0000 (17:23 +0100)
committerPeter Maydell <peter.maydell@linaro.org>
Mon, 10 Oct 2022 13:52:25 +0000 (14:52 +0100)
commit104f703d93c9f12984a165985af653f83527c84e
tree9996b833143bf69ce234b5a8e25c205452e32753
parent0ff993193fe759b735e382fbe06b8258b537f95d
target/arm: Don't allow guest to use unimplemented granule sizes

Arm CPUs support some subset of the granule (page) sizes 4K, 16K and
64K.  The guest selects the one it wants using bits in the TCR_ELx
registers.  If it tries to program these registers with a value that
is either reserved or which requests a size that the CPU does not
implement, the architecture requires that the CPU behaves as if the
field was programmed to some size that has been implemented.
Currently we don't implement this, and instead let the guest use any
granule size, even if the CPU ID register fields say it isn't
present.

Make aa64_va_parameters() check against the supported granule size
and force use of a different one if it is not implemented.

(A subsequent commit will make ARMVAParameters use the new enum
rather than the current pair of using16k/using64k bools.)

Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Message-id: 20221003162315.2833797-2-peter.maydell@linaro.org
target/arm/cpu.h
target/arm/helper.c
target/arm/internals.h