From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:33596) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bmyMt-00033B-5Y for qemu-devel@nongnu.org; Thu, 22 Sep 2016 03:24:32 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bmyMm-0006BQ-Lg for qemu-devel@nongnu.org; Thu, 22 Sep 2016 03:24:26 -0400 Received: from hall.aurel32.net ([2001:bc8:30d7:100::1]:57931) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bmyMm-000612-Fr for qemu-devel@nongnu.org; Thu, 22 Sep 2016 03:24:20 -0400 Date: Thu, 22 Sep 2016 09:23:47 +0200 From: Aurelien Jarno Message-ID: <20160922072347.7wrq66lmlif76cwx@aurel32.net> References: <1474477573-6386-1-git-send-email-lvivier@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-15 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable In-Reply-To: <1474477573-6386-1-git-send-email-lvivier@redhat.com> Subject: Re: [Qemu-devel] [PATCH] exec: fix tlb_vaddr_to_host() List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Laurent Vivier Cc: rth@twiddle.net, afaerber@suse.de, qemu-devel@nongnu.org On 2016-09-21 19:06, Laurent Vivier wrote: > When used in linux-user mode, tlb_vaddr_to_host(..., addr, ...)) > should return "g2h(addr)", but instead it returns "g2h(vaddr)". > As "vaddr" is "typedef uint64_t", the result of "g2h(vaddr)" is > "((void *)((unsigned long)(target_ulong)(uint64_t) + guest_base))". >=20 > This bug has been found trying to run "ls" with qemu-ppc. >=20 > Fixes: "c9f82d0 ppc: Speed up dcbz" > Reported-by: Andreas F=E4rber > Signed-off-by: Laurent Vivier > --- > include/exec/cpu_ldst.h | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) >=20 > diff --git a/include/exec/cpu_ldst.h b/include/exec/cpu_ldst.h > index b573df5..6eb5fe8 100644 > --- a/include/exec/cpu_ldst.h > +++ b/include/exec/cpu_ldst.h > @@ -401,7 +401,7 @@ static inline void *tlb_vaddr_to_host(CPUArchState *e= nv, target_ulong addr, > int access_type, int mmu_idx) > { > #if defined(CONFIG_USER_ONLY) > - return g2h(vaddr); > + return g2h(addr); > #else > int index =3D (addr >> TARGET_PAGE_BITS) & (CPU_TLB_SIZE - 1); > CPUTLBEntry *tlbentry =3D &env->tlb_table[mmu_idx][index]; That looks fine to me, sorry for the typo. Reviewed-by: Aurelien Jarno --=20 Aurelien Jarno GPG: 4096R/1DDD8C9B aurelien@aurel32.net http://www.aurel32.net