All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] powerpc pci: fixed packing of ranges[]
@ 2012-07-18  8:22 Alexey Kardashevskiy
  2012-07-18 15:40 ` Stefan Weil
  0 siblings, 1 reply; 4+ messages in thread
From: Alexey Kardashevskiy @ 2012-07-18  8:22 UTC (permalink / raw)
  To: Alexander Graf; +Cc: Alexey Kardashevskiy, qemu-ppc, qemu-devel, David Gibson

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.

Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
---
 hw/spapr_pci.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/hw/spapr_pci.c b/hw/spapr_pci.c
index b3032d2..0261d2e 100644
--- a/hw/spapr_pci.c
+++ b/hw/spapr_pci.c
@@ -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),
-- 
1.7.10.4

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [Qemu-devel] [PATCH] powerpc pci: fixed packing of ranges[]
  2012-07-18  8:22 [Qemu-devel] [PATCH] powerpc pci: fixed packing of ranges[] Alexey Kardashevskiy
@ 2012-07-18 15:40 ` Stefan Weil
  2012-07-18 15:41   ` Alexander Graf
  0 siblings, 1 reply; 4+ messages in thread
From: Stefan Weil @ 2012-07-18 15:40 UTC (permalink / raw)
  To: Alexey Kardashevskiy
  Cc: qemu-trivial, David Gibson, qemu-ppc, Alexander Graf, qemu-devel

Am 18.07.2012 10:22, schrieb Alexey Kardashevskiy:
> 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.
>
> Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
> ---
>   hw/spapr_pci.c |    2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/hw/spapr_pci.c b/hw/spapr_pci.c
> index b3032d2..0261d2e 100644
> --- a/hw/spapr_pci.c
> +++ b/hw/spapr_pci.c
> @@ -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.

Tested-by: Stefan Weil <sw@weilnetz.de>
Reviewed-by: Stefan Weil <sw@weilnetz.de>

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [Qemu-devel] [PATCH] powerpc pci: fixed packing of ranges[]
  2012-07-18 15:40 ` Stefan Weil
@ 2012-07-18 15:41   ` Alexander Graf
  2012-07-21  9:41     ` Stefan Hajnoczi
  0 siblings, 1 reply; 4+ messages in thread
From: Alexander Graf @ 2012-07-18 15:41 UTC (permalink / raw)
  To: Stefan Weil
  Cc: Alexey Kardashevskiy, qemu-trivial, qemu-ppc, qemu-devel, David Gibson

On 07/18/2012 05:40 PM, Stefan Weil wrote:
> Am 18.07.2012 10:22, schrieb Alexey Kardashevskiy:
>> 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.
>>
>> Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
>> ---
>>   hw/spapr_pci.c |    2 +-
>>   1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/hw/spapr_pci.c b/hw/spapr_pci.c
>> index b3032d2..0261d2e 100644
>> --- a/hw/spapr_pci.c
>> +++ b/hw/spapr_pci.c
>> @@ -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.
>
> Tested-by: Stefan Weil <sw@weilnetz.de>
> Reviewed-by: Stefan Weil <sw@weilnetz.de>
>

So do you want to take it through the trivial queue? I'm fine either way.

Acked-by: Alexander Graf <agraf@suse.de>


Alex

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [Qemu-devel] [PATCH] powerpc pci: fixed packing of ranges[]
  2012-07-18 15:41   ` Alexander Graf
@ 2012-07-21  9:41     ` Stefan Hajnoczi
  0 siblings, 0 replies; 4+ messages in thread
From: Stefan Hajnoczi @ 2012-07-21  9:41 UTC (permalink / raw)
  To: Alexander Graf
  Cc: Alexey Kardashevskiy, Stefan Weil, qemu-devel, qemu-trivial,
	qemu-ppc, David Gibson

On Wed, Jul 18, 2012 at 05:41:36PM +0200, Alexander Graf wrote:
> On 07/18/2012 05:40 PM, Stefan Weil wrote:
> >Am 18.07.2012 10:22, schrieb Alexey Kardashevskiy:
> >>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.
> >>
> >>Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
> >>---
> >>  hw/spapr_pci.c |    2 +-
> >>  1 file changed, 1 insertion(+), 1 deletion(-)
> >>
> >>diff --git a/hw/spapr_pci.c b/hw/spapr_pci.c
> >>index b3032d2..0261d2e 100644
> >>--- a/hw/spapr_pci.c
> >>+++ b/hw/spapr_pci.c
> >>@@ -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.
> >
> >Tested-by: Stefan Weil <sw@weilnetz.de>
> >Reviewed-by: Stefan Weil <sw@weilnetz.de>
> >
> 
> So do you want to take it through the trivial queue? I'm fine either way.
> 
> Acked-by: Alexander Graf <agraf@suse.de>

Merged into the trivial patches tree with your Acked-by:.

Stefan

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2012-07-21  9:41 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-07-18  8:22 [Qemu-devel] [PATCH] powerpc pci: fixed packing of ranges[] Alexey Kardashevskiy
2012-07-18 15:40 ` Stefan Weil
2012-07-18 15:41   ` Alexander Graf
2012-07-21  9:41     ` Stefan Hajnoczi

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.