target-arm: Use correct mmu_idx for unprivileged loads and stores
commit579d21cce63f3dd2f6ee49c0b02a14e92cb4a836
authorPeter Maydell <peter.maydell@linaro.org>
Thu, 5 Feb 2015 13:37:23 +0000 (5 13:37 +0000)
committerPeter Maydell <peter.maydell@linaro.org>
Thu, 5 Feb 2015 13:37:23 +0000 (5 13:37 +0000)
treefb0e6d36e637f06254b2135530ae5925d7e207ef
parentc1e3781090b9d36c60e1a254ba297cb34011d3d4
target-arm: Use correct mmu_idx for unprivileged loads and stores

The MMU index to use for unprivileged loads and stores is more
complicated than we currently implement:
 * for A64, it should be "if at EL1, access as if EL0; otherwise
   access at current EL"
 * for A32/T32, it should be "if EL2, UNPREDICTABLE; otherwise
   access as if at EL0".

In both cases, if we want to make the access for Secure EL0
this is not the same mmu_idx as for Non-Secure EL0.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Greg Bellows <greg.bellows@linaro.org>
target-arm/translate-a64.c
target-arm/translate.c