aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/sysdev
diff options
context:
space:
mode:
authorChristophe Leroy <christophe.leroy@csgroup.eu>2020-05-19 05:49:13 +0000
committerMichael Ellerman <mpe@ellerman.id.au>2020-05-26 22:22:21 +1000
commitf76c8f6d257cefda60221c83af7f97d9f74cb3ce (patch)
treeda25e8a9b2cfeb9171485e1d5e5c7a7c5c71e67e /arch/powerpc/sysdev
parentpowerpc/8xx: Move PPC_PIN_TLB options into 8xx Kconfig (diff)
downloadlinux-dev-f76c8f6d257cefda60221c83af7f97d9f74cb3ce.tar.xz
linux-dev-f76c8f6d257cefda60221c83af7f97d9f74cb3ce.zip
powerpc/8xx: Add function to set pinned TLBs
Pinned TLBs cannot be modified when the MMU is enabled. Create a function to rewrite the pinned TLB entries with MMU off. To set pinned TLB, we have to turn off MMU, disable pinning, do a TLB flush (Either with tlbie and tlbia) then reprogam the TLB entries, enable pinning and turn on MMU. If using tlbie, it cleared entries in both instruction and data TLB regardless whether pinning is disabled or not. If using tlbia, it clears all entries of the TLB which has disabled pinning. To make it easy, just clear all entries in both TLBs, and reprogram them. The function takes two arguments, the top of the memory to consider and whether data is RO under _sinittext. When DEBUG_PAGEALLOC is set, the top is the end of kernel rodata. Otherwise, that's the top of physical RAM. Everything below _sinittext is set RX, over _sinittext that's RW. Signed-off-by: Christophe Leroy <christophe.leroy@csgroup.eu> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au> Link: https://lore.kernel.org/r/c17806014bb1c06513ad1e1d510faea31984b177.1589866984.git.christophe.leroy@csgroup.eu
Diffstat (limited to 'arch/powerpc/sysdev')
0 files changed, 0 insertions, 0 deletions