It would be nice to be able to dump page tables in a
particular context
Example use cases
Dumping PTE contents to see the keys (useful for debugging)
c0000000ba48c880 c0000000bab438b0 2677 2675 T 2 protection_keys
0:mon> ds c0000000ba48c880 0x7ffff7f70000
translating tsk c0000000ba48c880, addr 7ffff7f70000
G: 0xb95b6400 U: 0xb6334000 M: 0xb6543000 PA: 0x012c0000, PTE: 0xd4800000012c0504
Dumping vmalloc space
0:mon> ds 0 d000000000000000
translating tsk (null), addr d000000000000000
G: 0x3d450400 U: 0xbc184000 M: 0x3d460000 PA: 0x7e010000, PTE: 0xc08000007e01018e
I did not replicate the complex code of dump_pagetable and have no support
for bolted linear mapping, thats why I've called it software pagetable
dumping support. The format of the PTE can be expanded to add more useful
information about the flags in the PTE if required.
Signed-off-by: Balbir Singh <bsingharora@gmail.com>
---
arch/powerpc/xmon/xmon.c | 97 ++++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 97 insertions(+)
This patch readjusts the SPR's adds support for IAMR/AMR
UAMOR/AMOR based on their supported ISA revisions. The
HDEC SPR is now printed with 16 hex digits instead of 8,
so that we can see the expanded values on ISA 300.
There is also support for printing the PIDR/TIDR for
ISA 300 and PSSCR and PTCR in ISA 300 hypervisor mode.
Signed-off-by: Balbir Singh <bsingharora@gmail.com>
---
arch/powerpc/xmon/xmon.c | 28 +++++++++++++++++++++++++++-
1 file changed, 27 insertions(+), 1 deletion(-)
From: Michael Ellerman <mpe@ellerman.id.au> Date: 2017-07-21 06:59:36
Nice !
Balbir Singh [off-list ref] writes:
It would be nice to be able to dump page tables in a
particular context
Example use cases
Dumping PTE contents to see the keys (useful for debugging)
c0000000ba48c880 c0000000bab438b0 2677 2675 T 2 protection_keys
Without reading the code I don't grok what G/U/M mean.
Feel free to use more than one line of output :)
Dumping vmalloc space
0:mon> ds 0 d000000000000000
I suspect we will want to do that a lot. So I'd rather the arguments
were reversed, and the second (task) can be omitted.
So:
0:mon> ds x == translate x via init_mm
0:mon> ds x y == translate x via &y->mm
I guess it's easier for folks to find a task rather than an mm directly?
Otherwise it could take an mm not a task.
translating tsk (null), addr d000000000000000
We should special case that to say "using kernel page tables" or similar.
I did not replicate the complex code of dump_pagetable and have no support
for bolted linear mapping, thats why I've called it software pagetable
dumping support.
Not sure about that naming. On hash it makes sense, but not on radix or
on other platforms.
Maybe 'dv' for dump Virtual address ?
It doesn't dump a PTE, it tries to translate an address into a PTE.
cheers
On Fri, 2017-07-21 at 16:59 +1000, Michael Ellerman wrote:
Nice !
Balbir Singh [off-list ref] writes:
quoted
It would be nice to be able to dump page tables in a
particular context
Example use cases
Dumping PTE contents to see the keys (useful for debugging)
c0000000ba48c880 c0000000bab438b0 2677 2675 T 2 protection_keys
What is that ^ ?
Thats extra, the output of P (print all tasks, I've used that task selection)
Without reading the code I don't grok what G/U/M mean.
PGD, PUD and PMD, I'll expand on them.
Feel free to use more than one line of output :)
quoted
Dumping vmalloc space
0:mon> ds 0 d000000000000000
I suspect we will want to do that a lot. So I'd rather the arguments
were reversed, and the second (task) can be omitted.
I considered that as well, can do
So:
0:mon> ds x == translate x via init_mm
0:mon> ds x y == translate x via &y->mm
I guess it's easier for folks to find a task rather than an mm directly?
Otherwise it could take an mm not a task.
we already have commands for task, via (P), which is why I thought
task makes sense.
quoted
translating tsk (null), addr d000000000000000
We should special case that to say "using kernel page tables" or similar.
quoted
G: 0x3d450400 U: 0xbc184000 M: 0x3d460000 PA: 0x7e010000, PTE: 0xc08000007e01018e
I did not replicate the complex code of dump_pagetable and have no support
for bolted linear mapping, thats why I've called it software pagetable
dumping support.
Not sure about that naming. On hash it makes sense, but not on radix or
on other platforms.
Maybe 'dv' for dump Virtual address ?
It doesn't dump a PTE, it tries to translate an address into a PTE.
Done, will do a v2
Thanks for the review!
Balbir Singh.
On Fri, Jul 21, 2017 at 03:24:05PM +1000, Balbir Singh wrote:
It would be nice to be able to dump page tables in a
particular context
Example use cases
Dumping PTE contents to see the keys (useful for debugging)
c0000000ba48c880 c0000000bab438b0 2677 2675 T 2 protection_keys
0:mon> ds c0000000ba48c880 0x7ffff7f70000
translating tsk c0000000ba48c880, addr 7ffff7f70000
G: 0xb95b6400 U: 0xb6334000 M: 0xb6543000 PA: 0x012c0000, PTE: 0xd4800000012c0504
Dumping vmalloc space
0:mon> ds 0 d000000000000000
translating tsk (null), addr d000000000000000
G: 0x3d450400 U: 0xbc184000 M: 0x3d460000 PA: 0x7e010000, PTE: 0xc08000007e01018e
I did not replicate the complex code of dump_pagetable and have no support
for bolted linear mapping, thats why I've called it software pagetable
dumping support. The format of the PTE can be expanded to add more useful
information about the flags in the PTE if required.
yes. a nice way of dumping all the flags in the PTE will be handy.
especially; my favorite, protection key values.