]> 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)
commit08a17d7a00dc232bc80abd76316ed764ad2050c8
tree82268f7aadf1ece46b4f60be174877b8273f8d49
parentc500bf03dd61631d5e3c021ab4526f656e287e40
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