<apalos>
But I am going to backpaddle from that patch a bit,
<apalos>
Talking to some clang developers, I am pretty sure this warning is harmless
<apalos>
So i'd prefer going with Toms suggestion of explicitly suppressing it, instead of replacing the efi_guid_t with an unaligned variabt
<apalos>
xypron: what do you think ?
<Tartarus>
Ah that patch
<Tartarus>
I was leaving it up to you and xypron and the rest of the EFI experts to figure out what's best
<apalos>
If my understanding is correct, it's just clang complaining for the wrong reasons
<apalos>
basically because the struct is packed and can be placed at any offset, clang complains because the efi_guid_t requires a 4byte alignment
<apalos>
but it reaslly should be harmless to begin with since the compiler needs to generate safe ua code to begin with
<apalos>
So I really think your patch is better
<apalos>
and the reason it only complains for one is quite obvious. Every other definition within a packed struct just happens to be 4b aligned
runcom has joined #u-boot
<Tartarus>
I've moved my patch back to new
<rfs613>
marex: just pinging you regarding rz/n1, I posted v5 of the patch series, and have just checked it against -rc1. The DDR controller is still not ideal, hopefully we can do something to improve. Am trying to get contact with the other cdns users.
runcom has quit [Ping timeout: 250 seconds]
<marex>
rfs613: I am massively overloaded, sorry, please wait
runcom has joined #u-boot
Tooniis[m] has quit [Quit: Bridge terminating on SIGTERM]
mvaittin has quit [Quit: Bridge terminating on SIGTERM]
LinuxHackerman has quit [Quit: Bridge terminating on SIGTERM]
vulpes2[m] has quit [Quit: Bridge terminating on SIGTERM]
konradybcio[m] has quit [Quit: Bridge terminating on SIGTERM]
Mis012[m] has quit [Quit: Bridge terminating on SIGTERM]
jluthra has quit [Quit: Bridge terminating on SIGTERM]
sylensky[m] has quit [Quit: Bridge terminating on SIGTERM]
<rfs613>
marex: ok thanks
Perflosopher has quit [Ping timeout: 240 seconds]
LinuxHackerman has joined #u-boot
d-s-e has joined #u-boot
Perflosopher has joined #u-boot
rfs613 has quit [Ping timeout: 268 seconds]
mvaittin has joined #u-boot
sylensky[m] has joined #u-boot
vulpes2[m] has joined #u-boot
Tooniis[m] has joined #u-boot
Mis012[m] has joined #u-boot
jluthra has joined #u-boot
konradybcio[m] has joined #u-boot
rfs613 has joined #u-boot
runcom has quit [Ping timeout: 248 seconds]
<sjg1>
apalos: __packed means more that we would like it to. It allows a struct to be on an unaligned boundary, as I understand it, meaning that converting something to __packed can add a lot to the code size. Best to avoid it unless there is a bug
<apalos>
sjg1: i just said that didnt i ?
<apalos>
apalos | basically because the struct is packed and can be placed at any offset, clang complains because the efi_guid_t requires a 4byte alignment
<apalos>
but it's the spec that defines those as packed, so you really need to respect it
<sjg1>
apalos: Oh, I thought you meant that the compiler can assume it is alligned? But there is no way to tell it that, right?
<sjg1>
apalos: What spec?
<apalos>
that struct is defined in the EFI specification
<apalos>
so what happens is that we define is as packed. The spec also says (woth some ambiguation) that efi_guid_t needs to be 8b aligned unless 'otherwise specified'
<apalos>
in practice everyone uses 4b alignment incuding us
<apalos>
So what happens here, is that you place a 4b aligned thing into a packed struct that can be placed in aany boundary
<apalos>
I think that's why clang complains, but it's invalid to begin with
<apalos>
Since packed means the compiler will go and generate extra code for the potential unaligned accesses
<apalos>
and that's why I think Tom's patch is fine
<apalos>
we got a bunch of structs including an efi_guid_t. The reason we only see the compiler complaining on this one, is because all other occurences just happened to be internally aligned
<apalos>
IOW a u16 or any combinations that ends up having efi_guid_t 4b aligned precedes
<apalos>
The reports struct is the only one that has {u8 xxx; efi_guid_t yyy;} and that's what triggers the warning
<apalos>
the reported struct*
frieder has quit [Remote host closed the connection]
<sjg1>
apalos: OK I see. Yes well we should avoid packed unless needed. The EFI spec may have been written in the x86 dark ages before people bothered about alignment. It's a hardware problem after all :-)
redbrain has quit [Read error: Connection reset by peer]