]> git.hungrycats.org Git - linux/commit
lkdtm/powerpc: add isync after slbmte to enforce SLB update ordering
authorSayali Patil <sayalip@linux.ibm.com>
Mon, 18 May 2026 06:56:04 +0000 (12:26 +0530)
committerKees Cook <kees@kernel.org>
Thu, 21 May 2026 10:21:00 +0000 (03:21 -0700)
commit3f21a4426e6fc87447bda557655708c2c02cbabc
tree377fc40e58f990bfdf6a9e764b44fc4c785256c0
parenta34039981e6deb0580cf3215bfda02731596eada
lkdtm/powerpc: add isync after slbmte to enforce SLB update ordering

The slbmte instruction modifies the Segment Lookaside Buffer, but without
a context synchronizing operation the CPU is not guaranteed to observe
the updated SLB state for subsequent instructions. This can result in
use of stale translation state when memory is accessed immediately after
SLB modifications.

Add isync after each slbmte in the PPC_SLB_MULTIHIT test to ensure proper
ordering of SLB updates before subsequent memory accesses.

This aligns with Power ISA context synchronization requirements for changes
in address translation state and improves the reliability of SLB multihit
injection tests in hash MMU mode.

Suggested-by: Ritesh Harjani (IBM) <ritesh.list@gmail.com>
Signed-off-by: Sayali Patil <sayalip@linux.ibm.com>
Reviewed-by: Ritesh Harjani (IBM) <ritesh.list@gmail.com>
Reviewed-by: Michael Ellerman <mpe@kernel.org>
Link: https://patch.msgid.link/2f8d430962a96a7498903b994f081deee4a4d97a.1778975974.git.sayalip@linux.ibm.com
Signed-off-by: Kees Cook <kees@kernel.org>
drivers/misc/lkdtm/powerpc.c