]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
powerpc/mm: Fix return type of pgd_val()
authorChristophe Leroy <christophe.leroy@csgroup.eu>
Thu, 22 Aug 2024 07:58:42 +0000 (09:58 +0200)
committerMichael Ellerman <mpe@ellerman.id.au>
Thu, 22 Aug 2024 12:52:38 +0000 (22:52 +1000)
commit3b1f7a46977fe2ff9384d08651a6e0d272ae6a60
treea9eba0c95a2c5c5ce33e456dba8ae3c3c64e0aba
parent6114139c3bdde992f4a19264e4f9bfc100d8d776
powerpc/mm: Fix return type of pgd_val()

Commit 6b0e82791bd0 ("powerpc/e500: switch to 64 bits PGD on 85xx
(32 bits)") switched PGD entries to 64 bits, but pgd_val() returns
an unsigned long which is 32 bits on PPC32. This is not a problem
for regular PMD entries because the upper part is always NULL, but
when PMD entries are leaf they contain 64 bits values, so pgd_val()
must return an unsigned long long instead of an unsigned long.

Also change the condition to CONFIG_PPC_85xx instead of CONFIG_PPC_E500
as the change was meant for 32 bits only. Allthough this should be
harmless on PPC64, it generates a warning with pgd_ERROR print.

Fixes: 6b0e82791bd0 ("powerpc/e500: switch to 64 bits PGD on 85xx (32 bits)")
Signed-off-by: Christophe Leroy <christophe.leroy@csgroup.eu>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://msgid.link/45f8fdf298ec3df7573b66d21b03a5cda92e2cb1.1724313510.git.christophe.leroy@csgroup.eu
arch/powerpc/include/asm/nohash/32/pgtable.h
arch/powerpc/include/asm/pgtable-types.h