[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [qemu-s390x] [Qemu-devel] [PATCH v6 20/26] memory: Access MemoryRegi
From: |
Richard Henderson |
Subject: |
Re: [qemu-s390x] [Qemu-devel] [PATCH v6 20/26] memory: Access MemoryRegion with endianness |
Date: |
Wed, 7 Aug 2019 10:49:29 -0700 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0 |
On 8/7/19 1:33 AM, address@hidden 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_BSWAP. */
> memory_region_dispatch_write(mr, addr, val, size_memop(len),
> MEMTXATTRS_UNSPECIFIED);
> }
Here is an example of where Paolo is quite right -- you cannot simply add MO_TE
via size_memop(). In patch 22 we see
> @@ -542,16 +542,15 @@ void virtio_address_space_write(VirtIOPCIProxy *proxy,
> hwaddr addr,
> val = pci_get_byte(buf);
> break;
> case 2:
> - val = cpu_to_le16(pci_get_word(buf));
> + val = pci_get_word(buf);
> break;
> case 4:
> - val = cpu_to_le32(pci_get_long(buf));
> + val = pci_get_long(buf);
> break;
> default:
> /* As length is under guest control, handle illegal values. */
> return;
> }
> - /* FIXME: memory_region_dispatch_write ignores MO_BSWAP. */
> memory_region_dispatch_write(mr, addr, val, size_memop(len),
> MEMTXATTRS_UNSPECIFIED);
This is a little-endian store -- MO_LE not MO_TE.
r~
- Re: [qemu-s390x] [Qemu-devel] [PATCH v6 16/26] exec: Map device_endian onto MemOp, (continued)
- [qemu-s390x] [Qemu-devel] [PATCH v6 23/26] cpu: TLB_FLAGS_MASK bit to force memory slow path, tony.nguyen, 2019/08/07
- [qemu-s390x] [Qemu-devel] [PATCH v6 22/26] memory: Single byte swap along the I/O path, tony.nguyen, 2019/08/07
- [qemu-s390x] [Qemu-devel] [PATCH v6 21/26] cputlb: Replace size and endian operands for MemOp, tony.nguyen, 2019/08/07
- [qemu-s390x] [Qemu-devel] [PATCH v6 24/26] cputlb: Byte swap memory transaction attribute, tony.nguyen, 2019/08/07
- [qemu-s390x] [Qemu-devel] [PATCH v6 25/26] target/sparc: Add TLB entry with attributes, tony.nguyen, 2019/08/07
- [qemu-s390x] [Qemu-devel] [PATCH v6 26/26] target/sparc: sun4u Invert Endian TTE bit, tony.nguyen, 2019/08/07