summaryrefslogtreecommitdiffstats
path: root/hw/ppc/spapr_pci.c
diff options
context:
space:
mode:
authorAlexey Kardashevskiy2019-02-01 01:56:22 +0100
committerDavid Gibson2019-02-04 08:44:20 +0100
commit382b6f22258f3e68c6a4226790eae96e5527e791 (patch)
tree1439f080df27601ff2fb84b20d51fc176257e9db /hw/ppc/spapr_pci.c
parenttarget/ppc: remove various HOST_WORDS_BIGENDIAN hacks in int_helper.c (diff)
downloadqemu-382b6f22258f3e68c6a4226790eae96e5527e791.tar.gz
qemu-382b6f22258f3e68c6a4226790eae96e5527e791.tar.xz
qemu-382b6f22258f3e68c6a4226790eae96e5527e791.zip
spapr_pci: Fix endianness in assigned-addresses property
reg->phys_hi and assigned->phys_hi are big endian but we do an extra byteswap anyway when copying reg->phys_hi to assigned->phys_hi. To make things slightly more messy, we also add a relocatable bit (b_n()) although in the right endianness. This fixes endianness of assigned->phys_hi. This is unlikely to produce any visible difference though as we should end up there only in the case of PCI hotplug and even then I am not sure if (d->io_regions[i].addr == PCI_BAR_UNMAPPED) == true. Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Diffstat (limited to 'hw/ppc/spapr_pci.c')
-rw-r--r--hw/ppc/spapr_pci.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/hw/ppc/spapr_pci.c b/hw/ppc/spapr_pci.c
index 5cdc98513d..c99721cde8 100644
--- a/hw/ppc/spapr_pci.c
+++ b/hw/ppc/spapr_pci.c
@@ -964,7 +964,7 @@ static void populate_resource_props(PCIDevice *d, ResourceProps *rp)
}
assigned = &rp->assigned[assigned_idx++];
- assigned->phys_hi = cpu_to_be32(reg->phys_hi | b_n(1));
+ assigned->phys_hi = cpu_to_be32(be32_to_cpu(reg->phys_hi) | b_n(1));
assigned->phys_mid = cpu_to_be32(d->io_regions[i].addr >> 32);
assigned->phys_lo = cpu_to_be32(d->io_regions[i].addr);
assigned->size_hi = reg->size_hi;