mbox series

[GIT,PULL] arm64 fixes for -rc7

Message ID 20250314160458.GA9438@willie-the-truck (mailing list archive)
State New
Headers show
Series [GIT,PULL] arm64 fixes for -rc7 | expand

Pull-request

git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux.git tags/arm64-fixes

Message

Will Deacon March 14, 2025, 4:04 p.m. UTC
Hi Linus,

Please pull this pair of arm64 mm fixes for -rc7.

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.

Cheers,

Will

--->8

The following changes since commit eed6bfa8b28230382b797a88569f2c7569a1a419:

  arm64: hugetlb: Fix flush_hugetlb_tlb_range() invalidation level (2025-02-27 17:40:58 +0000)

are available in the Git repository at:

  git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux.git tags/arm64-fixes

for you to fetch changes up to f7edb07ad7c66eab3dce57384f33b9799d579133:

  Fix mmu notifiers for range-based invalidates (2025-03-11 11:37:43 +0000)

----------------------------------------------------------------
arm64 fixes for -rc7

- Fix population of the vmemmap for regions of memory that are smaller
  than a section (128 MiB)

- Fix range-based TLB over-invalidation when invoked via a MMU notifier

----------------------------------------------------------------
Piotr Jaroszynski (1):
      Fix mmu notifiers for range-based invalidates

Zhenhua Huang (1):
      arm64: mm: Populate vmemmap at the page level if not section aligned

 arch/arm64/include/asm/tlbflush.h | 22 ++++++++++++----------
 arch/arm64/mm/mmu.c               |  5 ++++-
 2 files changed, 16 insertions(+), 11 deletions(-)

Comments

Linus Torvalds March 14, 2025, 8:34 p.m. UTC | #1
On Fri, 14 Mar 2025 at 06:05, Will Deacon <will@kernel.org> 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
pr-tracker-bot@kernel.org March 14, 2025, 9:03 p.m. UTC | #2
The pull request you sent on Fri, 14 Mar 2025 16:04:59 +0000:

> git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux.git tags/arm64-fixes

has been merged into torvalds/linux.git:
https://git.kernel.org/torvalds/c/ef9248676f81c0342d6e8f90a380a9e0b8c25280

Thank you!