Skip to contentSkip to conversation

Fix tlb_vaddr_to_host with CONFIG_USER_ONLY

PATCH In review Benjamin Herrenschmidt 2 participants 2 messages Sep 21, 2016 – Sep 22, 2016

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Fix tlb_vaddr_to_host with CONFIG_USER_ONLY

We use the wrong argument name for the g2h() macro !

The result ends up being something like (target_ulong)(uint64) + guest_base which is obviously wrong.

---
 include/exec/cpu_ldst.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
include/exec/cpu_ldst.h +1 -1
index b573df5..6eb5fe8 100644
@@ -401,7 +401,7 @@ static inline void *tlb_vaddr_to_host(CPUArchState *env, target_ulong addr,
                                       int access_type, int mmu_idx)
 {
 #if defined(CONFIG_USER_ONLY)
-    return g2h(vaddr);
+    return g2h(addr);
 #else
     int index = (addr >> TARGET_PAGE_BITS) & (CPU_TLB_SIZE - 1);
     CPUTLBEntry *tlbentry = &env->tlb_table[mmu_idx][index];
Reviewed-by on v1 1/1
#1 lore raw
Quoted 6 lines · Benjamin Herrenschmidt

We use the wrong argument name for the g2h() macro !

The result ends up being something like (target_ulong)(uint64) + guest_base which is obviously wrong.

Tested-by; Laurent Vivier <[email protected]>

Your original mail has the R-b from pmaydell, my duplicate patch from aurel32.

And according to get_maintainer script, maintainers are: pbonzini, crosthwaite.peter, [email protected]

Thanks,
Laurent

Quoted 19 lines
---
 include/exec/cpu_ldst.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
include/exec/cpu_ldst.h +1 -1
index b573df5..6eb5fe8 100644
@@ -401,7 +401,7 @@ static inline void *tlb_vaddr_to_host(CPUArchState *env, target_ulong addr,
                                       int access_type, int mmu_idx)
 {
 #if defined(CONFIG_USER_ONLY)
-    return g2h(vaddr);
+    return g2h(addr);
 #else
     int index = (addr >> TARGET_PAGE_BITS) & (CPU_TLB_SIZE - 1);
     CPUTLBEntry *tlbentry = &env->tlb_table[mmu_idx][index];