Re: [PATCH] Alpha: Emulate unaligned LDx_L/STx_C for data consistency

From: Maciej W. Rozycki
Date: Tue Feb 25 2025 - 15:46:55 EST


On Wed, 19 Feb 2025, Maciej W. Rozycki wrote:

> Interestingly enough no kernel mode traps have triggered with a kernel
> built with GCC 12 (and with most user traps coming from GCC verification):
>
> kernel unaligned acc : 0 (pc=0,va=0)
> user unaligned acc : 1766720 (pc=20000053064,va=120020189)
>
> but with GCC 15 a small quantity happened (even before I ran GCC testing):
>
> kernel unaligned acc : 78 (pc=fffffc0000ad5194,va=fffffc0002db5784)
> user unaligned acc : 883452 (pc=20000053064,va=120020189)
>
> It seems a compiler regression worth checking -- the trap recorded was in
> `icmp6_dst_alloc' with a pair of quadword writes to `rt->rt6i_dst.addr',
> which however by its type (`struct in6_addr') is only longword-aligned and
> indeed starts at offset 148 from the outermost struct. I have a sneaking
> suspicion one of my earlier GCC changes might be at fault. At least I now
> have a test case to experiment with.

FYI my suspicion wasn't wrong, I have submitted a compiler fix now[1].

My plan has been to complete the GCC side first as it's more urgent given
its annual only release cycle model targetting April/May, whereas I think
the Linux side can slip a release or two in our roughly bi-monthly cycle.
I'm going to schedule my time accordinly and with my upcoming holiday also
in the picture I may not be able to post v2 of this proposal until around
end of March the earliest.

References:

[1] "Alpha: Fix base block alignment calculation regression",
<https://inbox.sourceware.org/gcc-patches/alpine.DEB.2.21.2502251934260.65342@xxxxxxxxxxxxxxxxx/>

Maciej