powerpc pci: fixed packing of ranges[]
PATCH 1/1 powerpc pci: fixed packing of ranges[]
By default mingw-gcc is trying to pack structures the way to preserve binary compatibility with MS Visual C what leads to incorrect and unexpected padding in the PCI bus ranges property of the sPAPR PHB.
The patch replaces __attribute__((packed)) with more strict QEMU_PACKED which actually is __attribute__((gcc_struct, packed)) on Windows.
--- hw/spapr_pci.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
hw/spapr_pci.c +1 -1
@@ -418,7 +418,7 @@ int spapr_populate_pci_dt(sPAPRPHBState *phb,uint64_t child;uint64_t parent;uint64_t size; - } __attribute__((packed)) ranges[] = { + }QEMU_PACKED ranges[] = { {cpu_to_be32 (b_ss (1 )),cpu_to_be64 (0 ),cpu_to_be64 (phb->io_win_addr),
Signature · 1 line
1.7.10.4
Am 18.07.2012 10:22, schrieb Alexey Kardashevskiy:
Quoted 18 lines
By default mingw-gcc is trying to pack structures the way to preserve binary compatibility with MS Visual C what leads to incorrect and unexpected padding in the PCI bus ranges property of the sPAPR PHB.
The patch replaces __attribute__((packed)) with more strict
QEMU_PACKEDwhich actually is__attribute__((gcc_struct, packed))on Windows.Signed-off-by Alexey Kardashevskiy <[email protected]>--- hw/spapr_pci.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)hw/spapr_pci.c +0
-0
hw/spapr_pci.c int spapr_populate_pci_dt(sPAPRPHBState *phb, · line 424
Quoted 8 lines
hw/spapr_pci.c +1
-1@@ -418,7 +418,7 @@ int spapr_populate_pci_dt(sPAPRPHBState *phb,uint64_t child;uint64_t parent;uint64_t size; - } __attribute__((packed)) ranges[] = { + }QEMU_PACKED ranges[] = { {cpu_to_be32 (b_ss (1 )),cpu_to_be64 (0 ),cpu_to_be64 (phb->io_win_addr),
The patch changes sizeof(ranges[0]) from 32 to 28 bytes and can be applied as a trivial patch.
Alexander Graf
Acked-byQuoted 32 lines · Stefan Weil
Am 18.07.2012 10:22, schrieb Alexey Kardashevskiy:
Quoted 18 lines
By default mingw-gcc is trying to pack structures the way to preserve binary compatibility with MS Visual C what leads to incorrect and unexpected padding in the PCI bus ranges property of the sPAPR PHB.
The patch replaces __attribute__((packed)) with more strict
QEMU_PACKEDwhich actually is__attribute__((gcc_struct, packed))on Windows.Signed-off-by Alexey Kardashevskiy <[email protected]>--- hw/spapr_pci.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)hw/spapr_pci.c +0
-0hw/spapr_pci.c int spapr_populate_pci_dt(sPAPRPHBState *phb, · line 424
Quoted 8 lines
hw/spapr_pci.c +1
-1@@ -418,7 +418,7 @@ int spapr_populate_pci_dt(sPAPRPHBState *phb,uint64_t child;uint64_t parent;uint64_t size; - } __attribute__((packed)) ranges[] = { + }QEMU_PACKED ranges[] = { {cpu_to_be32 (b_ss (1 )),cpu_to_be64 (0 ),cpu_to_be64 (phb->io_win_addr),The patch changes
sizeof(ranges[0])from 32 to 28 bytes and can be applied as a trivial patch.
Quoted 3 lines
Tested-by Stefan Weil <[email protected]>Reviewed-by Stefan Weil <[email protected]>
So do you want to take it through the trivial queue? I'm fine either way.
Alex
Stefan Hajnoczi
AppliedQuoted 33 lines · Alexander Graf
Quoted 32 lines · Stefan Weil
Am 18.07.2012 10:22, schrieb Alexey Kardashevskiy:
Quoted 18 lines
By default mingw-gcc is trying to pack structures the way to preserve binary compatibility with MS Visual C what leads to incorrect and unexpected padding in the PCI bus ranges property of the sPAPR PHB.
The patch replaces __attribute__((packed)) with more strict
QEMU_PACKEDwhich actually is__attribute__((gcc_struct, packed))on Windows.Signed-off-by Alexey Kardashevskiy <[email protected]>--- hw/spapr_pci.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)hw/spapr_pci.c +0
-0hw/spapr_pci.c int spapr_populate_pci_dt(sPAPRPHBState *phb, · line 424
Quoted 8 lines
hw/spapr_pci.c +1
-1@@ -418,7 +418,7 @@ int spapr_populate_pci_dt(sPAPRPHBState *phb,uint64_t child;uint64_t parent;uint64_t size; - } __attribute__((packed)) ranges[] = { + }QEMU_PACKED ranges[] = { {cpu_to_be32 (b_ss (1 )),cpu_to_be64 (0 ),cpu_to_be64 (phb->io_win_addr),The patch changes
sizeof(ranges[0])from 32 to 28 bytes and can be applied as a trivial patch.
Quoted 7 lines
Quoted 3 lines
Tested-by Stefan Weil <[email protected]>Reviewed-by Stefan Weil <[email protected]>So do you want to take it through the trivial queue? I'm fine either way.
Acked-by Alexander Graf <[email protected]>
Merged into the trivial patches tree with your Acked-by:.
Stefan