[Qemu-devel] [PATCH v2 10/36] target-microblaze: Bypass MMU with MMU_NOMMU_IDX

Edgar E. Iglesias posted 36 patches 7 years, 5 months ago
Only 35 patches received!
There is a newer version of this series
[Qemu-devel] [PATCH v2 10/36] target-microblaze: Bypass MMU with MMU_NOMMU_IDX
Posted by Edgar E. Iglesias 7 years, 5 months ago
From: "Edgar E. Iglesias" <edgar.iglesias@xilinx.com>

Bypass MMU translation when mmu-index MMU_NOMMU_IDX is used.

Reviewed-by: Alistair Francis <alistair.francis@wdc.com>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Edgar E. Iglesias <edgar.iglesias@xilinx.com>
---
 target/microblaze/helper.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/target/microblaze/helper.c b/target/microblaze/helper.c
index a9f4ca93e3..261dcc74c7 100644
--- a/target/microblaze/helper.c
+++ b/target/microblaze/helper.c
@@ -58,7 +58,8 @@ int mb_cpu_handle_mmu_fault(CPUState *cs, vaddr address, int size, int rw,
     int prot;
 
     /* Translate if the MMU is available and enabled.  */
-    if (cpu->cfg.use_mmu && (env->sregs[SR_MSR] & MSR_VM)) {
+    if (cpu->cfg.use_mmu && (env->sregs[SR_MSR] & MSR_VM)
+        && mmu_idx != MMU_NOMMU_IDX) {
         uint32_t vaddr, paddr;
         struct microblaze_mmu_lookup lu;
 
-- 
2.14.1


Re: [Qemu-devel] [PATCH v2 10/36] target-microblaze: Bypass MMU with MMU_NOMMU_IDX
Posted by Richard Henderson 7 years, 5 months ago
On 05/08/2018 10:31 AM, Edgar E. Iglesias wrote:
> +    if (cpu->cfg.use_mmu && (env->sregs[SR_MSR] & MSR_VM)
> +        && mmu_idx != MMU_NOMMU_IDX) {

For future cleanup, the first condition should be moved to cpu_mmu_index (the
second condition is already there).  At which point here you need check nothing
but mmu_idx.


r~

Re: [Qemu-devel] [PATCH v2 10/36] target-microblaze: Bypass MMU with MMU_NOMMU_IDX
Posted by Edgar E. Iglesias 7 years, 5 months ago
On Wed, May 09, 2018 at 01:51:31PM -0700, Richard Henderson wrote:
> On 05/08/2018 10:31 AM, Edgar E. Iglesias wrote:
> > +    if (cpu->cfg.use_mmu && (env->sregs[SR_MSR] & MSR_VM)
> > +        && mmu_idx != MMU_NOMMU_IDX) {
> 
> For future cleanup, the first condition should be moved to cpu_mmu_index (the
> second condition is already there).  At which point here you need check nothing
> but mmu_idx.

Thanks, I've added a followup patch that does this.

Cheers,
Edgar