]> git.baikalelectronics.ru Git - kernel.git/commit
powerpc/64s: Use htab_convert_pte_flags() in hash__mark_rodata_ro()
authorMichael Ellerman <mpe@ellerman.id.au>
Wed, 31 Mar 2021 00:38:42 +0000 (11:38 +1100)
committerMichael Ellerman <mpe@ellerman.id.au>
Thu, 8 Apr 2021 11:17:43 +0000 (21:17 +1000)
commitcc7ff647d0c14db6da061523d56809e07931fe61
treea3e9e24d033a50a1078ca6084075257f7b190b3c
parent001b2f4ab104630974a2a00bb181298ceffa0f1c
powerpc/64s: Use htab_convert_pte_flags() in hash__mark_rodata_ro()

In hash__mark_rodata_ro() we pass the raw PP_RXXX value to
hash__change_memory_range(). That has the effect of setting the key to
zero, because PP_RXXX contains no key value.

Fix it by using htab_convert_pte_flags(), which knows how to convert a
pgprot into a pp value, including the key.

Fixes: 6aa21b14a771 ("powerpc/book3s64/kuap: Use Key 3 for kernel mapping with hash translation")
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Reviewed-by: Daniel Axtens <dja@axtens.net>
Link: https://lore.kernel.org/r/20210331003845.216246-3-mpe@ellerman.id.au
arch/powerpc/mm/book3s64/hash_pgtable.c