diff mbox

[1/2] powerpc/mm: fix up pgtable dump flags

Message ID 20170331013749.17874-1-oohall@gmail.com (mailing list archive)
State Accepted
Commit 70538eaa70c36340b4bb27206cad31839e916f40
Headers show

Commit Message

Oliver O'Halloran March 31, 2017, 1:37 a.m. UTC
On Book3s we have two PTE flags used to mark cache-inhibited mappings:
_PAGE_TOLERANT and _PAGE_NON_IDEMPOTENT. Currently the kernel page
table dumper only looks at the generic _PAGE_NO_CACHE which is
defined to be _PAGE_TOLERANT. This patch modifies the dumper so
both flags are shown in the dump.

Cc: Rashmica Gupta <rashmica.g@gmail.com>
Signed-off-by: Oliver O'Halloran <oohall@gmail.com>
---
 arch/powerpc/mm/dump_linuxpagetables.c | 13 +++++++++++++
 1 file changed, 13 insertions(+)

Comments

Rashmica Gupta April 12, 2017, 4:19 a.m. UTC | #1
On 31/03/17 12:37, Oliver O'Halloran wrote:
> On Book3s we have two PTE flags used to mark cache-inhibited mappings:
> _PAGE_TOLERANT and _PAGE_NON_IDEMPOTENT. Currently the kernel page
> table dumper only looks at the generic _PAGE_NO_CACHE which is
> defined to be _PAGE_TOLERANT. This patch modifies the dumper so
> both flags are shown in the dump.
>
> Cc: Rashmica Gupta <rashmica.g@gmail.com>
> Signed-off-by: Oliver O'Halloran <oohall@gmail.com>
Should we also add in _PAGE_SAO  that is in Book3s?


> ---
>   arch/powerpc/mm/dump_linuxpagetables.c | 13 +++++++++++++
>   1 file changed, 13 insertions(+)
>
> diff --git a/arch/powerpc/mm/dump_linuxpagetables.c b/arch/powerpc/mm/dump_linuxpagetables.c
> index 49abaf4dc8e3..e7cbfd5a0940 100644
> --- a/arch/powerpc/mm/dump_linuxpagetables.c
> +++ b/arch/powerpc/mm/dump_linuxpagetables.c
> @@ -154,11 +154,24 @@ static const struct flag_info flag_array[] = {
>   		.clear	= "             ",
>   	}, {
>   #endif
> +#ifndef CONFIG_PPC_BOOK3S_64
>   		.mask	= _PAGE_NO_CACHE,
>   		.val	= _PAGE_NO_CACHE,
>   		.set	= "no cache",
>   		.clear	= "        ",
>   	}, {
> +#else
> +		.mask	= _PAGE_NON_IDEMPOTENT,
> +		.val	= _PAGE_NON_IDEMPOTENT,
> +		.set	= "non-idempotent",
> +		.clear	= "              ",
> +	}, {
> +		.mask	= _PAGE_TOLERANT,
> +		.val	= _PAGE_TOLERANT,
> +		.set	= "tolerant",
> +		.clear	= "        ",
> +	}, {
> +#endif
>   #ifdef CONFIG_PPC_BOOK3S_64
>   		.mask	= H_PAGE_BUSY,
>   		.val	= H_PAGE_BUSY,
Michael Ellerman April 12, 2017, 6:52 a.m. UTC | #2
Rashmica Gupta <rashmica.g@gmail.com> writes:

> On 31/03/17 12:37, Oliver O'Halloran wrote:
>> On Book3s we have two PTE flags used to mark cache-inhibited mappings:
>> _PAGE_TOLERANT and _PAGE_NON_IDEMPOTENT. Currently the kernel page
>> table dumper only looks at the generic _PAGE_NO_CACHE which is
>> defined to be _PAGE_TOLERANT. This patch modifies the dumper so
>> both flags are shown in the dump.
>>
>> Cc: Rashmica Gupta <rashmica.g@gmail.com>
>> Signed-off-by: Oliver O'Halloran <oohall@gmail.com>

> Should we also add in _PAGE_SAO  that is in Book3s?

I don't think we ever expect to see it in the kernel page tables. But if
we did that would be "interesting".

I've forgotten what the code does with unknown bits, does it already
print them in some way?

If not we should either add that or add _PAGE_SAO and everything else
that could possibly ever be there.

cheers
Oliver O'Halloran April 13, 2017, 2:48 a.m. UTC | #3
On Wed, Apr 12, 2017 at 4:52 PM, Michael Ellerman <mpe@ellerman.id.au> wrote:
> Rashmica Gupta <rashmica.g@gmail.com> writes:
>
>> On 31/03/17 12:37, Oliver O'Halloran wrote:
>>> On Book3s we have two PTE flags used to mark cache-inhibited mappings:
>>> _PAGE_TOLERANT and _PAGE_NON_IDEMPOTENT. Currently the kernel page
>>> table dumper only looks at the generic _PAGE_NO_CACHE which is
>>> defined to be _PAGE_TOLERANT. This patch modifies the dumper so
>>> both flags are shown in the dump.
>>>
>>> Cc: Rashmica Gupta <rashmica.g@gmail.com>
>>> Signed-off-by: Oliver O'Halloran <oohall@gmail.com>
>
>> Should we also add in _PAGE_SAO  that is in Book3s?
>
> I don't think we ever expect to see it in the kernel page tables. But if
> we did that would be "interesting".
>
> I've forgotten what the code does with unknown bits, does it already
> print them in some way?

Currently it just traverses the list of known bits and prints out a
message for each. Printing any unknown bits is probably a good idea.
I'll send another patch to add that though and leave this one as-is.

> If not we should either add that or add _PAGE_SAO and everything else
> that could possibly ever be there.

ok
Michael Ellerman April 13, 2017, 5:39 a.m. UTC | #4
Oliver O'Halloran <oohall@gmail.com> writes:

> On Wed, Apr 12, 2017 at 4:52 PM, Michael Ellerman <mpe@ellerman.id.au> wrote:
>> Rashmica Gupta <rashmica.g@gmail.com> writes:
>>
>>> On 31/03/17 12:37, Oliver O'Halloran wrote:
>>>> On Book3s we have two PTE flags used to mark cache-inhibited mappings:
>>>> _PAGE_TOLERANT and _PAGE_NON_IDEMPOTENT. Currently the kernel page
>>>> table dumper only looks at the generic _PAGE_NO_CACHE which is
>>>> defined to be _PAGE_TOLERANT. This patch modifies the dumper so
>>>> both flags are shown in the dump.
>>>>
>>>> Cc: Rashmica Gupta <rashmica.g@gmail.com>
>>>> Signed-off-by: Oliver O'Halloran <oohall@gmail.com>
>>
>>> Should we also add in _PAGE_SAO  that is in Book3s?
>>
>> I don't think we ever expect to see it in the kernel page tables. But if
>> we did that would be "interesting".
>>
>> I've forgotten what the code does with unknown bits, does it already
>> print them in some way?
>
> Currently it just traverses the list of known bits and prints out a
> message for each. Printing any unknown bits is probably a good idea.
> I'll send another patch to add that though and leave this one as-is.

Thanks.

cheers
Michael Ellerman April 13, 2017, 11:23 a.m. UTC | #5
On Fri, 2017-03-31 at 01:37:48 UTC, Oliver O'Halloran wrote:
> On Book3s we have two PTE flags used to mark cache-inhibited mappings:
> _PAGE_TOLERANT and _PAGE_NON_IDEMPOTENT. Currently the kernel page
> table dumper only looks at the generic _PAGE_NO_CACHE which is
> defined to be _PAGE_TOLERANT. This patch modifies the dumper so
> both flags are shown in the dump.
> 
> Cc: Rashmica Gupta <rashmica.g@gmail.com>
> Signed-off-by: Oliver O'Halloran <oohall@gmail.com>

Series applied to powerpc next, thanks.

https://git.kernel.org/powerpc/c/70538eaa70c36340b4bb27206cad31

cheers
diff mbox

Patch

diff --git a/arch/powerpc/mm/dump_linuxpagetables.c b/arch/powerpc/mm/dump_linuxpagetables.c
index 49abaf4dc8e3..e7cbfd5a0940 100644
--- a/arch/powerpc/mm/dump_linuxpagetables.c
+++ b/arch/powerpc/mm/dump_linuxpagetables.c
@@ -154,11 +154,24 @@  static const struct flag_info flag_array[] = {
 		.clear	= "             ",
 	}, {
 #endif
+#ifndef CONFIG_PPC_BOOK3S_64
 		.mask	= _PAGE_NO_CACHE,
 		.val	= _PAGE_NO_CACHE,
 		.set	= "no cache",
 		.clear	= "        ",
 	}, {
+#else
+		.mask	= _PAGE_NON_IDEMPOTENT,
+		.val	= _PAGE_NON_IDEMPOTENT,
+		.set	= "non-idempotent",
+		.clear	= "              ",
+	}, {
+		.mask	= _PAGE_TOLERANT,
+		.val	= _PAGE_TOLERANT,
+		.set	= "tolerant",
+		.clear	= "        ",
+	}, {
+#endif
 #ifdef CONFIG_PPC_BOOK3S_64
 		.mask	= H_PAGE_BUSY,
 		.val	= H_PAGE_BUSY,