Skip to contentSkip to conversation

PCI: PCIe access should always be little endian

PATCH In review Matt Redfearn 2 participants 4 messages Aug 15, 2017 – Sep 29, 2017

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 PCI: PCIe access should always be little endian

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.

---

 hw/pci/pcie_host.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
hw/pci/pcie_host.c +1 -1
index dcebf57ed45e..553db56778b6 100644
@@ -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)
Signature · 1 line
2.7.4
Reviewed-by on v1 1/1
#1 lore raw
Quoted 5 lines · Matt Redfearn

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.

Hi Matt,
Thanks for the patch.

Quoted 11 lines

---

  hw/pci/pcie_host.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
hw/pci/pcie_host.c +0 -0
index dcebf57ed45e..553db56778b6 100644

hw/pci/pcie_host.c static uint64_t pcie_mmcfg_data_read(void *opaque, · line 87

Quoted 8 lines
hw/pci/pcie_host.c +1 -1
@@ -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)

Thanks,
Marcel

#2 lore raw

ping?

Quoted 35 lines · Marcel Apfelbaum
Quoted 5 lines · Matt Redfearn

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.

Hi Matt,
Thanks for the patch.

Quoted 10 lines

---

  hw/pci/pcie_host.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
hw/pci/pcie_host.c +0 -0
index dcebf57ed45e..553db56778b6 100644

hw/pci/pcie_host.c static uint64_t pcie_mmcfg_data_read(void *opaque, · line 87

Quoted 8 lines
hw/pci/pcie_host.c +1 -1
@@ -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)
 

Thanks,
Marcel

#3 lore raw
Quoted 2 lines · Matt Redfearn

ping?

Hi Matt,

I think Michael is in PTO, he'll pick up
the patch as soon he is back.

Thanks,
Marcel

Quoted 38 lines · Marcel Apfelbaum
Quoted 35 lines · Matt Redfearn
Quoted 5 lines

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.

Hi Matt,
Thanks for the patch.

Quoted 10 lines

---

  hw/pci/pcie_host.c | 2 +-

  1 file changed, 1 insertion(+), 1 deletion(-)
hw/pci/pcie_host.c +0 -0
index dcebf57ed45e..553db56778b6 100644

hw/pci/pcie_host.c static uint64_t pcie_mmcfg_data_read(void *opaque, · line 87

Quoted 8 lines
hw/pci/pcie_host.c +1 -1
@@ -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)
 

Thanks,
Marcel