Re: [Regression] [PATCH v5 2/4] vdso: Switch get/put unaligned from packed struct to memcpy

From: Marc Kleine-Budde

Date: Mon Oct 19 2026 - 08:42:38 EST


On 10.10.2026 08:04:42, Ian Rogers wrote:
[...]
> So completely fwiw, I speak to the compiler folks within Google and
> there has always been unanimous support for code using memcpy over
> type punning. I'm not sure where the inlining decisions would be
> impacted, as to my understanding those are made later in the compiler
> pipeline and things like __unqual_scalar_typeof are almost at the
> stage of the preprocessor. If -Os is not inlining small fixed size
> memcpys, this sounds like another compiler bug. It would also be
> completely valid for the compiler to lower packed struct accesses to
> memcpys.
>
> I was trying to reach an implementation that avoided undefined
> behavior and benefited both user and kernel code. Performance
> regressions aren't a benefit and fixing compilers can be tricky, so
> work remains. I'd prefer to avoid undefined behavior at least in user
> land. I'd also prefer to avoid config values, so using packed structs
> for __KERNEL__ code is a possibility. It seems a little sad that we've
> lived with a strict-aliasing-compliant implementation for a year, and
> we could regress that for the sake of ARMv5. I don't feel strongly
> enough to argue for kernel land; hopefully, Thomas can say what
> motivated moving the patch series forward as I'm pretty certain it
> wouldn't be undefined behavior in the perf tool :-)

Can we revert commit a339671db64b ("vdso: Switch get/put_unaligned()
from packed struct to memcpy()")? It touches "include/vdso/unaligned.h"
only, so the perf header will be unaffected. Or is there an automagic
copying to "tools/include/vdso/unaligned.h" happening?

regards,
Marc

--
Pengutronix e.K. | Marc Kleine-Budde |
Embedded Linux | https://www.pengutronix.de |
Vertretung Nürnberg | Phone: +49-5121-206917-129 |
Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-9 |

Attachment: signature.asc
Description: PGP signature