]> git.ipfire.org Git - thirdparty/kernel/stable.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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 14 May 2021 08:50:05 +0000 (10:50 +0200)
commitc634a3d628340172a58b02890c84255527630957
tree7021218d95dcd5de8f07f10a7ec45fb28ca7716f
parent1fbd7bf469a10f13f806ebd1c312b0f682e1c4e4
powerpc/64s: Use htab_convert_pte_flags() in hash__mark_rodata_ro()

[ Upstream commit 2c02e656a29d5f64193eb93da92781bcf0517146 ]

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: d94b827e89dc ("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
Signed-off-by: Sasha Levin <sashal@kernel.org>
arch/powerpc/mm/book3s64/hash_pgtable.c