Skip to contentSkip to conversation

powerpc/vdso: Fix __kernel_sync_dicache sequence with coherent icache

PATCH Applied Nicholas Piggin 2 participants 2 messages May 20, 2022 – Jul 29, 2022 PowerPC

lore
Share & tools
lore

Nicholas Piggin

author reviewer
#0 lore raw

PATCH 1/1 powerpc/vdso: Fix __kernel_sync_dicache sequence with coherent icache

Processors with coherent icache require the sequence sync ; icbi ; isync to entire store->execute coherency. icbi (to any address) must be executed to ensure isync flushes the pipeline. See "POWER9 Processor User's Manual, 4.6.2.2 Instruction Cache Block Invalidate (icbi)" for details.

__kernel_sync_dicache is missing icbi for the coherent icache path. Add it.

---
 arch/powerpc/kernel/vdso/cacheflush.S | 1 +
 1 file changed, 1 insertion(+)
arch/powerpc/kernel/vdso/cacheflush.S +1 -0
index d4e43ab2d5df..0085ae464dac 100644
@@ -91,6 +91,7 @@ END_FTR_SECTION_IFSET(CPU_FTR_COHERENT_ICACHE)
 3:
 	crclr	cr0*4+so
 	sync
+	icbi	0,r1
 	isync
 	li	r3,0
 	blr
Signature · 1 line
2.35.1
#1 lore raw
Quoted 10 lines · Nicholas Piggin

Processors with coherent icache require the sequence sync ; icbi ; isync to entire store->execute coherency. icbi (to any address) must be executed to ensure isync flushes the pipeline. See "POWER9 Processor User's Manual, 4.6.2.2 Instruction Cache Block Invalidate (icbi)" for details.

__kernel_sync_dicache is missing icbi for the coherent icache path. Add it.

[...]

Applied to powerpc/next.

[1/1] powerpc/vdso: Fix __kernel_sync_dicache sequence with coherent icache

      https://git.kernel.org/powerpc/c/28f07fab26319dacc5675ae01dfc84d82122c59b

cheers