Re: [GIT PULL] arm64 fixes for -rc7

From: Linus Torvalds
Date: Fri Mar 14 2025 - 16:35:26 EST


On Fri, 14 Mar 2025 at 06:05, Will Deacon <will@xxxxxxxxxx> wrote:
>
> Summary in the tag, but the main one is a horrible macro fix for our
> TLB flushing code which resulted in over-invalidation on the MMU
> notifier path.

>From a quick look, that macro is still quite broken. Maybe not in ways
that matter, but still...

In particular, the 'stride' argument is used multiple times, and
without parentheses.

The 'lpa' argument is also used multiple times, and the input to that
is typically something like kvm_lpa2_is_enabled(), so I think it
potentially generates lots of pointless duplicate code with that
BUG_ON() in system_supports_lpa2() -> cpus_have_final_cap().

Maybe the compiler figures it out. But that macro is bad, bad, bad.
When it looks like a function, it should act like a function, and not
evaluate its arguments multiple times.

The most immediate bug may have been fixed, but not the actual real
horror of that thing.

Linus