]> xenbits.xensource.com Git - qemu-xen.git/commitdiff
target-microblaze: mmu: Add a configurable output address mask
authorEdgar E. Iglesias <edgar.iglesias@xilinx.com>
Mon, 16 Apr 2018 17:37:16 +0000 (19:37 +0200)
committerEdgar E. Iglesias <edgar.iglesias@xilinx.com>
Tue, 29 May 2018 07:35:14 +0000 (09:35 +0200)
Add a configurable output address mask, used to mimic the
configurable physical address bit width.

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/cpu.c
target/microblaze/mmu.c
target/microblaze/mmu.h

index 6ee15ac80002d9596c3621f43a5d29a35cd567ea..71fc8d09feb31c24b8ff72cb6f07a93a00c00a60 100644 (file)
@@ -128,6 +128,7 @@ static void mb_cpu_reset(CPUState *s)
     env->mmu.c_mmu = 3;
     env->mmu.c_mmu_tlb_access = 3;
     env->mmu.c_mmu_zones = 16;
+    env->mmu.c_addr_mask = MAKE_64BIT_MASK(0, cpu->cfg.addr_size);
 #endif
 }
 
index a379968618b65a25a60a1b75bfafcf2f74d8f263..166c79908cb40492796986f2134d2a9f680f37a2 100644 (file)
@@ -164,6 +164,7 @@ unsigned int mmu_translate(struct microblaze_mmu *mmu,
             tlb_rpn = d & TLB_RPN_MASK;
 
             lu->vaddr = tlb_tag;
+            lu->paddr = tlb_rpn & mmu->c_addr_mask;
             lu->paddr = tlb_rpn;
             lu->size = tlb_size;
             lu->err = ERR_HIT;
index 1714caf82e6627cdf8f70beb39cea752eb87b59b..9fbdf38f36cbfef6045767a7a65d92d05188dc74 100644 (file)
@@ -72,6 +72,7 @@ struct microblaze_mmu
     int c_mmu;
     int c_mmu_tlb_access;
     int c_mmu_zones;
+    uint64_t c_addr_mask; /* Mask to apply to physical addresses.  */
 };
 
 struct microblaze_mmu_lookup