[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [PATCH] x86/IO-APIC: fix build with gcc9



On Thu, May 23, 2019 at 03:35:01PM +0100, Andrew Cooper wrote:
> On 23/05/2019 15:20, Wei Liu wrote:
> > On Thu, May 23, 2019 at 07:54:10AM -0600, Jan Beulich wrote:
> >> There are a number of pointless __packed attributes which cause gcc 9 to
> >> legitimately warn:
> >>
> >> utils.c: In function 'vtd_dump_iommu_info':
> >> utils.c:287:33: error: converting a packed 'struct IO_APIC_route_entry' 
> >> pointer (alignment 1) to a 'struct IO_APIC_route_remap_entry' pointer 
> >> (alignment 8) may result in an unaligned pointer value 
> >> [-Werror=address-of-packed-member]
> >>   287 |                 remap = (struct IO_APIC_route_remap_entry *) &rte;
> >>       |                                 ^~~~~~~~~~~~~~~~~~~~~~~~~
> >>
> >> intremap.c: In function 'ioapic_rte_to_remap_entry':
> >> intremap.c:343:25: error: converting a packed 'struct IO_APIC_route_entry' 
> >> pointer (alignment 1) to a 'struct IO_APIC_route_remap_entry' pointer 
> >> (alignment 8) may result in an unaligned pointer value 
> >> [-Werror=address-of-packed-member]
> >>   343 |     remap_rte = (struct IO_APIC_route_remap_entry *) old_rte;
> >>       |                         ^~~~~~~~~~~~~~~~~~~~~~~~~
> >>
> >> Simply drop these attributes. Take the liberty and also re-format the
> >> structure definitions at the same time.
> >>
> >> Reported-by: Charles Arnold <carnold@xxxxxxxx>
> >> Signed-off-by: Jan Beulich <jbeulich@xxxxxxxx>
> > Reviewed-by: Wei Liu <wei.liu2@xxxxxxxxxx>
> 
> Reviewed-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
> 
> I've got another identical patch which I hadn't got around to sending
> upstream.
> 
> We've got further issues with UBSAN.  While I've got the API fixes
> sorted, the resutling binary crashes almost immediately on boot and I
> haven't figured out why yet.

Probably more missed filtering -- you don't want early boot code to get
compiled with UBSAN enabled.

Wei.

> 
> ~Andrew

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/xen-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.