diff mbox

PCI: PCIe access should always be little endian

Message ID 1502808257-17395-1-git-send-email-matt.redfearn@imgtec.com
State New
Headers show

Commit Message

Matt Redfearn Aug. 15, 2017, 2:44 p.m. UTC
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>
---

 hw/pci/pcie_host.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Marcel Apfelbaum Aug. 16, 2017, 10:25 a.m. UTC | #1
On 15/08/2017 17:44, Matt Redfearn wrote:
> 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>


Hi Matt,
Thanks for the patch.

> ---
> 
>   hw/pci/pcie_host.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/hw/pci/pcie_host.c b/hw/pci/pcie_host.c
> index dcebf57ed45e..553db56778b6 100644
> --- a/hw/pci/pcie_host.c
> +++ b/hw/pci/pcie_host.c
> @@ -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)
> 


Reviewed-by: Marcel Apfelbaum <marcel@redhat.com>

Thanks,
Marcel
Matt Redfearn Sept. 27, 2017, 8:27 a.m. UTC | #2
ping?


On 16/08/17 11:25, Marcel Apfelbaum wrote:
> On 15/08/2017 17:44, Matt Redfearn wrote:
>> 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>
>
>
> Hi Matt,
> Thanks for the patch.
>
>> ---
>>
>>   hw/pci/pcie_host.c | 2 +-
>>   1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/hw/pci/pcie_host.c b/hw/pci/pcie_host.c
>> index dcebf57ed45e..553db56778b6 100644
>> --- a/hw/pci/pcie_host.c
>> +++ b/hw/pci/pcie_host.c
>> @@ -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)
>>
>
>
> Reviewed-by: Marcel Apfelbaum <marcel@redhat.com>
>
> Thanks,
> Marcel
diff mbox

Patch

diff --git a/hw/pci/pcie_host.c b/hw/pci/pcie_host.c
index dcebf57ed45e..553db56778b6 100644
--- a/hw/pci/pcie_host.c
+++ b/hw/pci/pcie_host.c
@@ -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)