summaryrefslogtreecommitdiffstats
path: root/target/arm
diff options
context:
space:
mode:
authorRichard Henderson2022-10-11 05:18:56 +0200
committerPeter Maydell2022-10-20 12:27:49 +0200
commit4e7a2c9860eabd21376da522ef11e6b39fe36f85 (patch)
treeeb8891760dede384bf076a4a6cd7855abf9addf7 /target/arm
parenttarget/arm: Plumb debug into S1Translate (diff)
downloadqemu-4e7a2c9860eabd21376da522ef11e6b39fe36f85.tar.gz
qemu-4e7a2c9860eabd21376da522ef11e6b39fe36f85.tar.xz
qemu-4e7a2c9860eabd21376da522ef11e6b39fe36f85.zip
target/arm: Move be test for regime into S1TranslateResult
Hoist this test out of arm_ld[lq]_ptw into S1_ptw_translate. Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Richard Henderson <richard.henderson@linaro.org> Message-id: 20221011031911.2408754-10-richard.henderson@linaro.org Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'target/arm')
-rw-r--r--target/arm/ptw.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/target/arm/ptw.c b/target/arm/ptw.c
index 8fa0088d98..c58788ac69 100644
--- a/target/arm/ptw.c
+++ b/target/arm/ptw.c
@@ -19,6 +19,7 @@ typedef struct S1Translate {
bool in_secure;
bool in_debug;
bool out_secure;
+ bool out_be;
hwaddr out_phys;
} S1Translate;
@@ -277,6 +278,7 @@ static bool S1_ptw_translate(CPUARMState *env, S1Translate *ptw,
ptw->out_secure = is_secure;
ptw->out_phys = addr;
+ ptw->out_be = regime_translation_big_endian(env, ptw->in_mmu_idx);
return true;
}
@@ -296,7 +298,7 @@ static uint32_t arm_ldl_ptw(CPUARMState *env, S1Translate *ptw, hwaddr addr,
addr = ptw->out_phys;
attrs.secure = ptw->out_secure;
as = arm_addressspace(cs, attrs);
- if (regime_translation_big_endian(env, ptw->in_mmu_idx)) {
+ if (ptw->out_be) {
data = address_space_ldl_be(as, addr, attrs, &result);
} else {
data = address_space_ldl_le(as, addr, attrs, &result);
@@ -324,7 +326,7 @@ static uint64_t arm_ldq_ptw(CPUARMState *env, S1Translate *ptw, hwaddr addr,
addr = ptw->out_phys;
attrs.secure = ptw->out_secure;
as = arm_addressspace(cs, attrs);
- if (regime_translation_big_endian(env, ptw->in_mmu_idx)) {
+ if (ptw->out_be) {
data = address_space_ldq_be(as, addr, attrs, &result);
} else {
data = address_space_ldq_le(as, addr, attrs, &result);