Skip to content

Commit d755bd2

Browse files
committed
parisc: Ensure page alignment in flush functions
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+
1 parent 829632d commit d755bd2

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

arch/parisc/kernel/pacache.S

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -889,6 +889,7 @@ ENDPROC_CFI(flush_icache_page_asm)
889889
ENTRY_CFI(flush_kernel_dcache_page_asm)
890890
88: ldil L%dcache_stride, %r1
891891
ldw R%dcache_stride(%r1), %r23
892+
depi_safe 0, 31,PAGE_SHIFT, %r26 /* Clear any offset bits */
892893

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

929931
#ifdef CONFIG_64BIT
930932
depdi,z 1, 63-PAGE_SHIFT,1, %r25

0 commit comments

Comments
 (0)