Re: [Qemu-devel] [PATCH 2/2] Fix g2h() for 32-bit targets on 64-bit hosts

2016-08-03 Thread Benjamin Herrenschmidt
On Wed, 2016-08-03 at 11:48 +0100, Peter Maydell wrote: > > As to why you don't hit the bug on ARM, well, maybe you don't > > many helpers using tlb_vaddr_to_host ? Also address randomization makes > > things hit or miss here ... > > The only uses of tlb_vaddr_to_host in the tree are > (a) in a no

Re: [Qemu-devel] [PATCH 2/2] Fix g2h() for 32-bit targets on 64-bit hosts

2016-08-03 Thread Peter Maydell
On 3 August 2016 at 11:18, Benjamin Herrenschmidt wrote: > On Wed, 2016-08-03 at 19:50 +1000, Benjamin Herrenschmidt wrote: >> >> > I'm confused. Is this just swapping the order of the operands to >> > '+'? >> > I wouldn't expect that to make any difference because typecast has >> > higher precede

Re: [Qemu-devel] [PATCH 2/2] Fix g2h() for 32-bit targets on 64-bit hosts

2016-08-03 Thread Benjamin Herrenschmidt
On Wed, 2016-08-03 at 19:50 +1000, Benjamin Herrenschmidt wrote: >  > > I'm confused. Is this just swapping the order of the operands to > > '+'? > > I wouldn't expect that to make any difference because typecast has > > higher precedence than '+'... > > The typecast to target_ulong which is 32-bi

Re: [Qemu-devel] [PATCH 2/2] Fix g2h() for 32-bit targets on 64-bit hosts

2016-08-03 Thread Benjamin Herrenschmidt
On Wed, 2016-08-03 at 09:40 +0100, Peter Maydell wrote: > > index 6eb5fe8..0164535 100644 > > --- a/include/exec/cpu_ldst.h > > +++ b/include/exec/cpu_ldst.h > > @@ -49,7 +49,7 @@ > > > >  #if defined(CONFIG_USER_ONLY) > >  /* All direct uses of g2h and h2g need to go away for usermode softmmu.  */

Re: [Qemu-devel] [PATCH 2/2] Fix g2h() for 32-bit targets on 64-bit hosts

2016-08-03 Thread Peter Maydell
On 3 August 2016 at 04:15, Benjamin Herrenschmidt wrote: > The current constructs ends up cropping the host address to 32-bit > which crashes for me running 32-bit ppc programs on an x86_64. > > Signed-off-by: Benjamin Herrenschmidt > --- > > Not sure who to CC for this... > > include/exec/cpu_l

[Qemu-devel] [PATCH 2/2] Fix g2h() for 32-bit targets on 64-bit hosts

2016-08-02 Thread Benjamin Herrenschmidt
The current constructs ends up cropping the host address to 32-bit which crashes for me running 32-bit ppc programs on an x86_64. Signed-off-by: Benjamin Herrenschmidt --- Not sure who to CC for this... include/exec/cpu_ldst.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a