]> git.ipfire.org Git - thirdparty/qemu.git/commit
target/arm: Don't allow stage 2 page table walks to downgrade to NS
authorPeter Maydell <peter.maydell@linaro.org>
Fri, 12 May 2023 14:43:37 +0000 (15:43 +0100)
committerMichael Tokarev <mjt@tls.msk.ru>
Fri, 3 Nov 2023 16:19:06 +0000 (19:19 +0300)
commit6861482deaf802e401def432ed730d99e06871c7
tree34e611541324d80371502754b3f93cc72512689a
parentd9da3f8dbd58109bf7bd9d67b63300fa7cb6539f
target/arm: Don't allow stage 2 page table walks to downgrade to NS

Bit 63 in a Table descriptor is only the NSTable bit for stage 1
translations; in stage 2 it is RES0.  We were incorrectly looking at
it all the time.

This causes problems if:
 * the stage 2 table descriptor was incorrectly setting the RES0 bit
 * we are doing a stage 2 translation in Secure address space for
   a NonSecure stage 1 regime -- in this case we would incorrectly
   do an immediate downgrade to NonSecure

A bug elsewhere in the code currently prevents us from getting
to the second situation, but when we fix that it will be possible.

Cc: qemu-stable@nongnu.org
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Message-id: 20230504135425.2748672-2-peter.maydell@linaro.org
(cherry picked from commit 21a4ab8318ba6f049aac244e237cd1557586e216)
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
target/arm/ptw.c