OSDN Git Service

PCI: PCIe access should always be little endian
authorMatt Redfearn <matt.redfearn@imgtec.com>
Tue, 15 Aug 2017 14:44:17 +0000 (15:44 +0100)
committerMichael S. Tsirkin <mst@redhat.com>
Sun, 15 Oct 2017 02:54:42 +0000 (05:54 +0300)
PCIe busses are always little endian, so set the endianness of the
memory region to little endian rather than native such that operations
work as expected on big endian targets.

Signed-off-by: Matt Redfearn <matt.redfearn@imgtec.com>
Reviewed-by: Marcel Apfelbaum <marcel@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
hw/pci/pcie_host.c

index dcebf57..553db56 100644 (file)
@@ -81,7 +81,7 @@ static uint64_t pcie_mmcfg_data_read(void *opaque,
 static const MemoryRegionOps pcie_mmcfg_ops = {
     .read = pcie_mmcfg_data_read,
     .write = pcie_mmcfg_data_write,
-    .endianness = DEVICE_NATIVE_ENDIAN,
+    .endianness = DEVICE_LITTLE_ENDIAN,
 };
 
 static void pcie_host_init(Object *obj)