Fix tlb_vaddr_to_host with CONFIG_USER_ONLY
PATCH 1/2 Fix tlb_vaddr_to_host with CONFIG_USER_ONLY
We use the wrong argument name for the g2h() macro !
Signed-off-by Benjamin Herrenschmidt <[email protected]>
---
Not sure who to CC for this...
include/exec/cpu_ldst.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
include/exec/cpu_ldst.h +1 -1
@@ -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];
Quoted 15 lines · Benjamin Herrenschmidt
We use the wrong argument name for the
g2h()macro !Signed-off-by Benjamin Herrenschmidt <[email protected]>---
Not sure who to CC for this...
include/exec/cpu_ldst.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)include/exec/cpu_ldst.h +0
-0
include/exec/cpu_ldst.h static inline void *tlb_vaddr_to_host(CPUArchState *env, target_ulong addr, · line 407
Quoted 8 lines
include/exec/cpu_ldst.h +1
-1@@ -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 Peter Maydell <[email protected]>
I don't understand why this didn't cause compile failures...
thanks
-- PMM
Quoted 2 lines · Peter Maydell
I don't understand why this didn't cause compile failures...
I didn't either. I found:
include/qom/cpu.h:typedef uint64_t vaddr;
So g2h becomes something like (target_ulong)(uint64) + guest_base
Which does build ;-)
Cheers,
Ben.