Re: [PATCH] sparc64: replace move_pte() with a D-cache flush in flush_cache_range()
From: Pedro Falcato
Date: Wed Nov 04 2026 - 08:41:51 EST
On Wed, Nov 04, 2026 at 11:52:58AM +0100, Imre Kaloz wrote:
> mremap() can move a page to an address of the other D-cache color,
> leaving lines of the old color in the virtually indexed D-cache of
> Spitfire and Cheetah CPUs. move_pte() flushed the page for each PTE
> moved, which is only correct while move_ptes() handles one PTE at a
> time.
>
> Drop move_pte(), which no other architecture defines, and flush the
> whole D-cache in flush_cache_range(), which mremap() calls on the old
> range before moving the PTEs. This keeps the fix in sparc64 without
> a page table walk.
>
> Suggested-by: David Hildenbrand (Arm) <david@xxxxxxxxxx>
> Link: https://lore.kernel.org/all/409079fe-ab52-4389-9fe0-d7246eb27bad@xxxxxxxxxx/
> Signed-off-by: Imre Kaloz <kaloz@xxxxxxxxxx>
yay!
Reviewed-by: Pedro Falcato <pfalcato@xxxxxxx>
--
Pedro