Re: [GIT pull] x86/urgent for v5.15-rc3

From: Linus Torvalds
Date: Sun Sep 26 2021 - 15:11:13 EST


On Sun, Sep 26, 2021 at 11:15 AM Borislav Petkov <bp@xxxxxxxxx> wrote:
>
> There's this other rather "theoretical" thing of Intel PT
> decoding being done on any arch but get_unaligned() from
> include/asm-generic/unaligned.h looks as generic and as arch-agnostic as
> they get, to me...

It does now. It used to be a mess where every architecture did their
own thing, including nothing (x86) or lots of inline asm (several).

Arnd cleaned it all up fairly recently.

It turns out doing nothing is wrong - not because of architecture
issues, but because of compiler issues - and doing inline asms is
counter-productive because the compilers will handle the unaligned
case for us.

So every architecture uses that <asm-generic/unaligned.h> and is happy about it.

A couple of architectures still have their own <asm/unaligned.h>, but
that's just because they have some additional stuff for legacy reasons
there. They still use the generic header for the actual unaligned
handling.

Linus