Re: [Qemu-devel] [PATCH 15/20] target/arm: Fix calculation of secure mm_idx values

2017-10-05 Thread Richard Henderson
On 09/22/2017 11:00 AM, Peter Maydell wrote: > In cpu_mmu_index() we try to do this: > if (env->v7m.secure) { > mmu_idx += ARMMMUIdx_MSUser; > } > but it will give the wrong answer, because ARMMMUIdx_MSUser > includes the 0x40 ARM_MMU_IDX_M field, and so does the >

[Qemu-devel] [PATCH 15/20] target/arm: Fix calculation of secure mm_idx values

2017-09-22 Thread Peter Maydell
In cpu_mmu_index() we try to do this: if (env->v7m.secure) { mmu_idx += ARMMMUIdx_MSUser; } but it will give the wrong answer, because ARMMMUIdx_MSUser includes the 0x40 ARM_MMU_IDX_M field, and so does the mmu_idx we're adding to, and we'll end up with 0x8n rather than