All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 0/2] sparc64: D-cache alias flushing fixes
@ 2026-09-28 13:21 Imre Kaloz
  2026-09-28 13:21 ` [PATCH v2 1/2] sparc64: flush only the aliased page, not its whole folio Imre Kaloz
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Imre Kaloz @ 2026-09-28 13:21 UTC (permalink / raw)
  To: Andreas Larsson, David S. Miller
  Cc: Matthew Wilcox (Oracle), Mike Rapoport (IBM), Andrew Morton,
	sparclinux, linux-kernel

Two fixes to D-cache alias flushing on sparc64 CPUs with a virtually
indexed L1 D-cache.

Patch 1 makes move_pte() and tlb_batch_add() flush only the page a PTE
maps, instead of every page of its folio once per PTE, so the number
of cross-calls for an mremap() of a large folio no longer grows with
the square of its size.

Patch 2 implements flush_cache_vmap() and flush_cache_vunmap(), which
have been no-ops on sparc64.  Stale lines left by a vmalloc mapping
corrupt BPF programs and module data on UltraSPARC III.  It uses
flush_dcache_page_all() as patch 1 restores it.

Both patches are tagged for stable.  Tested on a Sun Ultra 45.

Changes in v2:
- Patch 2: flush_cache_vmap() also runs on the vmemmap, from
  sparse_init() before init_IRQ() sets up the cross-call mondo
  blocks; skip addresses outside vmalloc and module space, since the
  vmemmap has no aliases to flush.  Picked up Stian Halseth's
  Tested-by.

Imre Kaloz (2):
  sparc64: flush only the aliased page, not its whole folio
  sparc64: flush vmalloc ranges from the D-cache on map and unmap

 arch/sparc/include/asm/cacheflush_64.h |  9 ++--
 arch/sparc/include/asm/pgtable_64.h    |  7 ++-
 arch/sparc/kernel/smp_64.c             | 42 ++++++++++++-----
 arch/sparc/mm/init_64.c                | 65 ++++++++++++++++++++++++++
 arch/sparc/mm/tlb.c                    |  2 +-
 arch/sparc/mm/ultra.S                  | 25 ++++++++++
 6 files changed, 132 insertions(+), 18 deletions(-)


base-commit: fe2ec83746e501645709761605c2464a44fd2929
--
2.47.3


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2026-10-11  9:33 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-09-28 13:21 [PATCH v2 0/2] sparc64: D-cache alias flushing fixes Imre Kaloz
2026-09-28 13:21 ` [PATCH v2 1/2] sparc64: flush only the aliased page, not its whole folio Imre Kaloz
2026-09-28 13:21 ` [PATCH v2 2/2] sparc64: flush vmalloc ranges from the D-cache on map and unmap Imre Kaloz
2026-10-11  9:33 ` [PATCH v2 0/2] sparc64: D-cache alias flushing fixes John Paul Adrian Glaubitz

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.