Re: [Qemu-devel] [PATCH v6 20/26] memory: Access MemoryRegion with endianness

2019-08-07 Thread Richard Henderson
On 8/7/19 11:00 AM, Paolo Bonzini wrote: > On 07/08/19 19:49, Richard Henderson wrote: >> On 8/7/19 1:33 AM, tony.ngu...@bt.com wrote: >>> @@ -551,6 +551,7 @@ void virtio_address_space_write(VirtIOPCIProxy *proxy, >>> hwaddr addr, >>> /* As length is under guest control, handle illegal va

Re: [Qemu-devel] [PATCH v6 20/26] memory: Access MemoryRegion with endianness

2019-08-07 Thread Paolo Bonzini
On 07/08/19 19:49, Richard Henderson wrote: > On 8/7/19 1:33 AM, tony.ngu...@bt.com wrote: >> @@ -551,6 +551,7 @@ void virtio_address_space_write(VirtIOPCIProxy *proxy, >> hwaddr addr, >> /* As length is under guest control, handle illegal values. */ >> return; >> } >> +

Re: [Qemu-devel] [PATCH v6 20/26] memory: Access MemoryRegion with endianness

2019-08-07 Thread Richard Henderson
On 8/7/19 1:33 AM, tony.ngu...@bt.com wrote: > @@ -551,6 +551,7 @@ void virtio_address_space_write(VirtIOPCIProxy *proxy, > hwaddr addr, > /* As length is under guest control, handle illegal values. */ > return; > } > +/* FIXME: memory_region_dispatch_write ignores MO_BS

Re: [Qemu-devel] [PATCH v6 20/26] memory: Access MemoryRegion with endianness

2019-08-07 Thread Paolo Bonzini
On 07/08/19 10:33, tony.ngu...@bt.com wrote: > +#ifdef NEED_CPU_H > +    return ctz32(size) | MO_TE; > +#else >      return ctz32(size); > +#endif Please use two separate functions for this, for example size_to_memop and target_size_to_memop, or even just add MO_TE to the callers that need it (onl

[Qemu-devel] [PATCH v6 20/26] memory: Access MemoryRegion with endianness

2019-08-07 Thread tony.nguyen
Preparation for collapsing the two byte swaps adjust_endianness and handle_bswap into the former. Call memory_region_dispatch_{read|write} with endianness encoded into the "MemOp op" operand. This patch does not change any behaviour as memory_region_dispatch_{read|write} is yet to handle the endi