]> git.baikalelectronics.ru Git - kernel.git/commit
powerpc/mm: implement set_memory_attr()
authorChristophe Leroy <christophe.leroy@csgroup.eu>
Wed, 9 Jun 2021 01:34:30 +0000 (11:34 +1000)
committerMichael Ellerman <mpe@ellerman.id.au>
Mon, 21 Jun 2021 11:13:21 +0000 (21:13 +1000)
commit4843f42ec147691b49e7ee63f7bb5c6f9efdc89d
tree82268f7aadf1ece46b4f60be174877b8273f8d49
parent0a4858327e11af2aa0893b86a6b869f9857004b0
powerpc/mm: implement set_memory_attr()

In addition to the set_memory_xx() functions which allows to change
the memory attributes of not (yet) used memory regions, implement a
set_memory_attr() function to:
- set the final memory protection after init on currently used
kernel regions.
- enable/disable kernel memory regions in the scope of DEBUG_PAGEALLOC.

Unlike the set_memory_xx() which can act in three step as the regions
are unused, this function must modify 'on the fly' as the kernel is
executing from them. At the moment only PPC32 will use it and changing
page attributes on the fly is not an issue.

Reported-by: kbuild test robot <lkp@intel.com>
[ruscur: cast "data" to unsigned long instead of int]
Signed-off-by: Christophe Leroy <christophe.leroy@csgroup.eu>
Signed-off-by: Russell Currey <ruscur@russell.cc>
Signed-off-by: Jordan Niethe <jniethe5@gmail.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/20210609013431.9805-9-jniethe5@gmail.com
arch/powerpc/include/asm/set_memory.h
arch/powerpc/mm/pageattr.c