target/openrisc: Fix cpu_mmu_index

The code in cpu_mmu_index does not properly honor SR_DME.
This bug has workarounds elsewhere in that we flush the
tlb more often than necessary, on the state changes that
should be reflected in a change of mmu_index.

Fixing this means that we can respect the mmu_index that
is given to tlb_flush.

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Stafford Horne <shorne@gmail.com>
This commit is contained in:
Richard Henderson 2018-05-22 19:51:00 -07:00 committed by Stafford Horne
parent fffde6695f
commit b9bed1b9ab
6 changed files with 49 additions and 32 deletions

View file

@ -55,7 +55,7 @@ static inline bool is_user(DisasContext *dc)
#ifdef CONFIG_USER_ONLY
return true;
#else
return dc->mem_idx == MMU_USER_IDX;
return !(dc->tb_flags & TB_FLAGS_SM);
#endif
}