Re: [Qemu-devel] [PATCH] loader: Fix misaligned member access

2018-04-23 Thread Peter Maydell
On 23 April 2018 at 16:49, Philippe Mathieu-Daudé wrote: > I think I never noticed ldq_he_p(), good to know. > > $ git grep -E '(ld|st)._he_' > net/checksum.c:130:stw_he_p(&tcp->th_sum, 0); > net/checksum.c:151:stw_he_p(&udp->uh_sum, 0); > util/bufferiszero.c:47:uint64_t t

Re: [Qemu-devel] [PATCH] loader: Fix misaligned member access

2018-04-23 Thread Philippe Mathieu-Daudé
On 04/23/2018 12:32 PM, Peter Maydell wrote: > On 23 April 2018 at 15:26, Philippe Mathieu-Daudé wrote: >>> On 04/23/2018 11:04 AM, Peter Maydell wrote: On 23 April 2018 at 14:57, Philippe Mathieu-Daudé wrote: > On 04/23/2018 12:16 AM, David Gibson wrote: >> On Sun, Apr 22, 2018 at 1

Re: [Qemu-devel] [PATCH] loader: Fix misaligned member access

2018-04-23 Thread Peter Maydell
On 23 April 2018 at 15:26, Philippe Mathieu-Daudé wrote: >> On 04/23/2018 11:04 AM, Peter Maydell wrote: >>> On 23 April 2018 at 14:57, Philippe Mathieu-Daudé wrote: On 04/23/2018 12:16 AM, David Gibson wrote: > On Sun, Apr 22, 2018 at 11:41:20AM +0100, Peter Maydell wrote: >> If we

Re: [Qemu-devel] [PATCH] loader: Fix misaligned member access

2018-04-23 Thread Philippe Mathieu-Daudé
> On 04/23/2018 11:04 AM, Peter Maydell wrote: >> On 23 April 2018 at 14:57, Philippe Mathieu-Daudé wrote: >>> On 04/23/2018 12:16 AM, David Gibson wrote: On Sun, Apr 22, 2018 at 11:41:20AM +0100, Peter Maydell wrote: > If we need to do an unaligned load, then ldl_p() is the > right w

Re: [Qemu-devel] [PATCH] loader: Fix misaligned member access

2018-04-23 Thread Philippe Mathieu-Daudé
On 04/23/2018 11:04 AM, Peter Maydell wrote: > On 23 April 2018 at 14:57, Philippe Mathieu-Daudé wrote: >> On 04/23/2018 12:16 AM, David Gibson wrote: >>> On Sun, Apr 22, 2018 at 11:41:20AM +0100, Peter Maydell wrote: If we need to do an unaligned load, then ldl_p() is the right way to d

Re: [Qemu-devel] [PATCH] loader: Fix misaligned member access

2018-04-23 Thread Peter Maydell
On 23 April 2018 at 14:57, Philippe Mathieu-Daudé wrote: > On 04/23/2018 12:16 AM, David Gibson wrote: >> On Sun, Apr 22, 2018 at 11:41:20AM +0100, Peter Maydell wrote: >>> If we need to do an unaligned load, then ldl_p() is the >>> right way to do it. (We could also just do >>> *addr = ldl_be_p(

Re: [Qemu-devel] [PATCH] loader: Fix misaligned member access

2018-04-23 Thread Philippe Mathieu-Daudé
On 04/23/2018 12:16 AM, David Gibson wrote: > On Sun, Apr 22, 2018 at 11:41:20AM +0100, Peter Maydell wrote: >> On 21 April 2018 at 22:16, Philippe Mathieu-Daudé wrote: >>> This fixes the following ASan warning: >>> >>> $ mips64el-softmmu/qemu-system-mips64el -M boston -kernel vmlinux.gz.itb >>

Re: [Qemu-devel] [PATCH] loader: Fix misaligned member access

2018-04-22 Thread David Gibson
On Sun, Apr 22, 2018 at 11:41:20AM +0100, Peter Maydell wrote: > On 21 April 2018 at 22:16, Philippe Mathieu-Daudé wrote: > > This fixes the following ASan warning: > > > > $ mips64el-softmmu/qemu-system-mips64el -M boston -kernel vmlinux.gz.itb > > -nographic > > hw/core/loader-fit.c:108:17:

Re: [Qemu-devel] [PATCH] loader: Fix misaligned member access

2018-04-22 Thread Peter Maydell
On 21 April 2018 at 22:16, Philippe Mathieu-Daudé wrote: > This fixes the following ASan warning: > > $ mips64el-softmmu/qemu-system-mips64el -M boston -kernel vmlinux.gz.itb > -nographic > hw/core/loader-fit.c:108:17: runtime error: load of misaligned address > 0x7f95cd7e4264 for type 'fdt6

[Qemu-devel] [PATCH] loader: Fix misaligned member access

2018-04-21 Thread Philippe Mathieu-Daudé
This fixes the following ASan warning: $ mips64el-softmmu/qemu-system-mips64el -M boston -kernel vmlinux.gz.itb -nographic hw/core/loader-fit.c:108:17: runtime error: load of misaligned address 0x7f95cd7e4264 for type 'fdt64_t', which requires 8 byte alignment 0x7f95cd7e4264: note: pointer