Re: [PATCH v3] x86/asm: Force native_apic_mem_read to use mov

From: Ard Biesheuvel
Date: Fri Feb 09 2024 - 10:22:39 EST


On Thu, 8 Feb 2024 at 16:48, Dave Hansen <dave.hansen@xxxxxxxxx> wrote:
>
> On 2/6/24 14:36, Adam Dunlap wrote:
> ...
> > In particular, when compiled with clang and run as a SEV-ES or
> > SEV-SNP guest, the compiler would emit a testl instruction which is
> > not supported by the SEV-ES emulator
>
> What changed? Why is this a bug that we're only noticing now? The line
> of code that's modified here is from 2008.
>
> I assume that it's something new in clang, but it'd be great to know
> that for sure.
>

Might be the use of LTO in the Google prod[uction]kernel. Adam, can you confirm?

> Also, considering the age of the last commit to touch that line:
>
> Fixes: 67c5fc5c330f ("x86: merge apic_32/64.h")
>
> this seems like the kind of thing we'll want in -stable in case folks
> are compiling stable kernels with new clangs.

LTO support was introduced in v5.12 afaict.