]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
parisc: Flush correct cache in cacheflush() syscall
authorHelge Deller <deller@gmx.de>
Mon, 9 Mar 2026 14:16:37 +0000 (15:16 +0100)
committerHelge Deller <deller@gmx.de>
Sun, 15 Mar 2026 08:28:49 +0000 (09:28 +0100)
The assembly flush instructions were swapped for I- and D-cache flags:

SYSCALL_DEFINE3(cacheflush, ...)
{
if (cache & DCACHE) {
"fic ...\n"
}
if (cache & ICACHE && error == 0) {
"fdc ...\n"
}

Fix it by using fdc for DCACHE, and fic for ICACHE flushing.

Reported-by: Felix Lechner <felix.lechner@lease-up.com>
Fixes: c6d96328fecd ("parisc: Add cacheflush() syscall")
Cc: <stable@vger.kernel.org> # v6.5+
Signed-off-by: Helge Deller <deller@gmx.de>
arch/parisc/kernel/cache.c

index 4c5240d3a3c7cfbee54a96c3f3c4b83fe445b556..b189265785dc7949acc5998e737b1bc2a507790b 100644 (file)
@@ -953,7 +953,7 @@ SYSCALL_DEFINE3(cacheflush, unsigned long, addr, unsigned long, bytes,
 #else
                        "1: cmpb,<<,n   %0,%2,1b\n"
 #endif
-                       "   fic,m       %3(%4,%0)\n"
+                       "   fdc,m       %3(%4,%0)\n"
                        "2: sync\n"
                        ASM_EXCEPTIONTABLE_ENTRY_EFAULT(1b, 2b, "%1")
                        : "+r" (start), "+r" (error)
@@ -968,7 +968,7 @@ SYSCALL_DEFINE3(cacheflush, unsigned long, addr, unsigned long, bytes,
 #else
                        "1: cmpb,<<,n   %0,%2,1b\n"
 #endif
-                       "   fdc,m       %3(%4,%0)\n"
+                       "   fic,m       %3(%4,%0)\n"
                        "2: sync\n"
                        ASM_EXCEPTIONTABLE_ENTRY_EFAULT(1b, 2b, "%1")
                        : "+r" (start), "+r" (error)