[PATCH 1/2] target/nios2: Replace magic value by MMU definitions

Philippe Mathieu-Daudé posted 2 patches 5 years ago
[PATCH 1/2] target/nios2: Replace magic value by MMU definitions
Posted by Philippe Mathieu-Daudé 5 years ago
cpu_get_phys_page_debug() uses 'DATA LOAD' MMU access type.
The first MMU is the supervisor one.

Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
---
 target/nios2/helper.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/target/nios2/helper.c b/target/nios2/helper.c
index 57c97bde3c6..fea34c957d9 100644
--- a/target/nios2/helper.c
+++ b/target/nios2/helper.c
@@ -209,7 +209,7 @@ hwaddr nios2_cpu_get_phys_page_debug(CPUState *cs, vaddr addr)
     unsigned int hit;
 
     if (cpu->mmu_present && (addr < 0xC0000000)) {
-        hit = mmu_translate(env, &lu, addr, 0, 0);
+        hit = mmu_translate(env, &lu, addr, MMU_DATA_LOAD, MMU_SUPERVISOR_IDX);
         if (hit) {
             vaddr = addr & TARGET_PAGE_MASK;
             paddr = lu.paddr + vaddr - lu.vaddr;
-- 
2.26.2

Re: [PATCH 1/2] target/nios2: Replace magic value by MMU definitions
Posted by Richard Henderson 5 years ago
On 1/27/21 1:41 PM, Philippe Mathieu-Daudé wrote:
> cpu_get_phys_page_debug() uses 'DATA LOAD' MMU access type.
> The first MMU is the supervisor one.
> 
> Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
> ---
>  target/nios2/helper.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

I'll note that mmu_idx isn't used by mmu_translate.

Reviewed-by: Richard Henderson <richard.henderson@linaro.org>


r~