Re: [PATCH v2 1/2] lkdtm/powerpc: add isync after slbmte to enforce SLB update ordering
From: IBM
Date: Mon May 18 2026 - 22:32:57 EST
Sayali Patil <sayalip@xxxxxxxxxxxxx> writes:
> 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.
>
Yup, CSI is required for before & after a slbmte. Given we are trying to
add duplicate slb entries, I think the isync()s added in this patch is
sufficient.
LGTM. Feel free to add:
Reviewed-by: Ritesh Harjani (IBM) <ritesh.list@xxxxxxxxx>
As Mpe added - This needs to be cc'd to Kees.
-> ./scripts/get_maintainer.pl -f drivers/misc/lkdtm/powerpc.c
Kees Cook <kees@xxxxxxxxxx> (maintainer:LINUX KERNEL DUMP TEST MODULE (LKDTM))
Arnd Bergmann <arnd@xxxxxxxx> (maintainer:CHAR and MISC DRIVERS)
Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx> (maintainer:CHAR and MISC DRIVERS)
linux-kernel@xxxxxxxxxxxxxxx (open list)
CHAR and MISC DRIVERS status: Supported
-ritesh