]> git.baikalelectronics.ru Git - kernel.git/commitdiff
powerpc/ptdump: Fix display of RW pages on FSL_BOOK3E
authorChristophe Leroy <christophe.leroy@csgroup.eu>
Tue, 28 Jun 2022 14:43:35 +0000 (16:43 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 25 Aug 2022 09:17:25 +0000 (11:17 +0200)
commit 7b4cbe14563688192b50b7ef7f84e46c13eb54d5 upstream.

On FSL_BOOK3E, _PAGE_RW is defined with two bits, one for user and one
for supervisor. As soon as one of the two bits is set, the page has
to be display as RW. But the way it is implemented today requires both
bits to be set in order to display it as RW.

Instead of display RW when _PAGE_RW bits are set and R otherwise,
reverse the logic and display R when _PAGE_RW bits are all 0 and
RW otherwise.

This change has no impact on other platforms as _PAGE_RW is a single
bit on all of them.

Fixes: 0796cc493713 ("powerpc/mm: Dump linux pagetables")
Cc: stable@vger.kernel.org
Signed-off-by: Christophe Leroy <christophe.leroy@csgroup.eu>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/0c33b96317811edf691e81698aaee8fa45ec3449.1656427391.git.christophe.leroy@csgroup.eu
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
arch/powerpc/mm/ptdump/shared.c

index 784f8df17f732a0db52ef047bd36c03fe6337cb0..f10f2158c8afb835d87e6937e0fcf08668bf15f0 100644 (file)
@@ -17,9 +17,9 @@ static const struct flag_info flag_array[] = {
                .clear  = "    ",
        }, {
                .mask   = _PAGE_RW,
-               .val    = _PAGE_RW,
-               .set    = "rw",
-               .clear  = "r ",
+               .val    = 0,
+               .set    = "r ",
+               .clear  = "rw",
        }, {
                .mask   = _PAGE_EXEC,
                .val    = _PAGE_EXEC,