summaryrefslogtreecommitdiffstats
path: root/target-arm/translate.h
diff options
context:
space:
mode:
authorPeter Maydell <peter.maydell@linaro.org>2015-02-05 13:37:23 +0000
committerPeter Maydell <peter.maydell@linaro.org>2015-02-05 13:37:23 +0000
commitc1e3781090b9d36c60e1a254ba297cb34011d3d4 (patch)
tree8d1f98324c00b060d33263e5ee78e95d4af96130 /target-arm/translate.h
parent949013ce111eb64f8bc81cf9a9f1cefd6a1678c3 (diff)
downloadhqemu-c1e3781090b9d36c60e1a254ba297cb34011d3d4.zip
hqemu-c1e3781090b9d36c60e1a254ba297cb34011d3d4.tar.gz
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/translate.h')
-rw-r--r--target-arm/translate.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/target-arm/translate.h b/target-arm/translate.h
index f6ee789..a1eb5b5 100644
--- a/target-arm/translate.h
+++ b/target-arm/translate.h
@@ -20,6 +20,7 @@ typedef struct DisasContext {
#if !defined(CONFIG_USER_ONLY)
int user;
#endif
+ ARMMMUIdx mmu_idx; /* MMU index to use for normal loads/stores */
bool ns; /* Use non-secure CPREG bank on access */
bool cpacr_fpen; /* FP enabled via CPACR.FPEN */
bool vfp_enabled; /* FP enabled via FPSCR.EN */
@@ -69,7 +70,7 @@ static inline int arm_dc_feature(DisasContext *dc, int feature)
static inline int get_mem_index(DisasContext *s)
{
- return s->current_el;
+ return s->mmu_idx;
}
/* target-specific extra values for is_jmp */
OpenPOWER on IntegriCloud