diff options
author | Peter Maydell <peter.maydell@linaro.org> | 2015-02-05 13:37:23 +0000 |
---|---|---|
committer | Peter Maydell <peter.maydell@linaro.org> | 2015-02-05 13:37:23 +0000 |
commit | c1e3781090b9d36c60e1a254ba297cb34011d3d4 (patch) | |
tree | 8d1f98324c00b060d33263e5ee78e95d4af96130 /target-arm/helper.c | |
parent | 949013ce111eb64f8bc81cf9a9f1cefd6a1678c3 (diff) |
target-arm: Define correct mmu_idx values and pass them in TB flags
We currently claim that for ARM the mmu_idx should simply be the current
exception level. However this isn't actually correct -- secure EL0 and EL1
should have separate indexes from non-secure EL0 and EL1 since their
VA->PA mappings may differ. We also will want an index for stage 2
translations when we properly support EL2.
Define and document all seven mmu index values that we require, and
pass the mmu index in the TB flags rather than exception level or
priv/user bit.
This change doesn't update the get_phys_addr() code, so our page
table walking still assumes a simplistic "user or priv?" model for
the moment.
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Greg Bellows <greg.bellows@linaro.org>
---
This leaves some odd gaps in the TB flags usage. I will circle
back and clean this up later (including moving the other common
flags like the singlestep ones to the top of the flags word),
but I didn't want to bloat this patchseries further.
Diffstat (limited to 'target-arm/helper.c')
-rw-r--r-- | target-arm/helper.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/target-arm/helper.c b/target-arm/helper.c index 3b054ad243..85d02af6d9 100644 --- a/target-arm/helper.c +++ b/target-arm/helper.c @@ -5179,7 +5179,8 @@ int arm_cpu_handle_mmu_fault(CPUState *cs, vaddr address, uint32_t syn; bool same_el = (arm_current_el(env) != 0); - is_user = mmu_idx == MMU_USER_IDX; + /* TODO: pass the translation regime to get_phys_addr */ + is_user = (arm_mmu_idx_to_el(mmu_idx) == 0); ret = get_phys_addr(env, address, access_type, is_user, &phys_addr, &prot, &page_size); if (ret == 0) { |