Re: [Qemu-devel] [PATCH] cpu-all.h: Don't accidentally sign extend in g2h()

2012-03-12 Thread Anthony Liguori
On 03/09/2012 08:33 AM, Peter Maydell wrote: Cast the argument of the g2h() macro to a target_ulong so that it isn't accidentally sign-extended if it is a signed 32 bit type and long is a 64 bit type. In particular, this fixes a bug where it would return the wrong value for 32 bit guests on 64 bi

Re: [Qemu-devel] [PATCH] cpu-all.h: Don't accidentally sign extend in g2h()

2012-03-09 Thread Peter Maydell
On 9 March 2012 14:55, Andreas Färber wrote: > Am 09.03.2012 15:33, schrieb Peter Maydell: >> Cast the argument of the g2h() macro to a target_ulong so that >> it isn't accidentally sign-extended if it is a signed 32 bit >> type and long is a 64 bit type. In particular, this fixes a >> bug where i

Re: [Qemu-devel] [PATCH] cpu-all.h: Don't accidentally sign extend in g2h()

2012-03-09 Thread Andreas Färber
Am 09.03.2012 15:33, schrieb Peter Maydell: > Cast the argument of the g2h() macro to a target_ulong so that > it isn't accidentally sign-extended if it is a signed 32 bit > type and long is a 64 bit type. In particular, this fixes a > bug where it would return the wrong value for 32 bit guests > o

[Qemu-devel] [PATCH] cpu-all.h: Don't accidentally sign extend in g2h()

2012-03-09 Thread Peter Maydell
Cast the argument of the g2h() macro to a target_ulong so that it isn't accidentally sign-extended if it is a signed 32 bit type and long is a 64 bit type. In particular, this fixes a bug where it would return the wrong value for 32 bit guests on 64 bit hosts when passed in one of the arg* values f