diff options
author | Christophe Leroy <christophe.leroy@csgroup.eu> | 2020-05-19 08:49:13 +0300 |
---|---|---|
committer | Michael Ellerman <mpe@ellerman.id.au> | 2020-05-26 15:22:21 +0300 |
commit | f76c8f6d257cefda60221c83af7f97d9f74cb3ce (patch) | |
tree | da25e8a9b2cfeb9171485e1d5e5c7a7c5c71e67e /arch/powerpc/sysdev | |
parent | 5d4656696c30cef56b2ab506b203533c818af04d (diff) | |
download | linux-f76c8f6d257cefda60221c83af7f97d9f74cb3ce.tar.xz |
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