Skip to content

Commit

Permalink
parisc: Ensure page alignment in flush functions
Browse files Browse the repository at this point in the history
commit d755bd2 upstream.

Matthew Wilcox noticed, that if ARCH_HAS_FLUSH_ON_KUNMAP is defined
(which is the case for PA-RISC), __kunmap_local() calls
kunmap_flush_on_unmap(), which may call the parisc flush functions with
a non-page-aligned address and thus the page might not be fully flushed.

This patch ensures that flush_kernel_dcache_page_asm() and
flush_kernel_dcache_page_asm() will always operate on page-aligned
addresses.

Signed-off-by: Helge Deller <deller@gmx.de>
Cc: <stable@vger.kernel.org> # v6.0+
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
hdeller authored and gregkh committed May 11, 2023
1 parent 409042e commit ce914d3
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions arch/parisc/kernel/pacache.S
Original file line number Diff line number Diff line change
Expand Up @@ -889,6 +889,7 @@ ENDPROC_CFI(flush_icache_page_asm)
ENTRY_CFI(flush_kernel_dcache_page_asm)
88: ldil L%dcache_stride, %r1
ldw R%dcache_stride(%r1), %r23
depi_safe 0, 31,PAGE_SHIFT, %r26 /* Clear any offset bits */

#ifdef CONFIG_64BIT
depdi,z 1, 63-PAGE_SHIFT,1, %r25
Expand Down Expand Up @@ -925,6 +926,7 @@ ENDPROC_CFI(flush_kernel_dcache_page_asm)
ENTRY_CFI(purge_kernel_dcache_page_asm)
88: ldil L%dcache_stride, %r1
ldw R%dcache_stride(%r1), %r23
depi_safe 0, 31,PAGE_SHIFT, %r26 /* Clear any offset bits */

#ifdef CONFIG_64BIT
depdi,z 1, 63-PAGE_SHIFT,1, %r25
Expand Down

0 comments on commit ce914d3

Please sign in to comment.