]> git.proxmox.com Git - mirror_ubuntu-eoan-kernel.git/commit
powerpc/ptdump: fix walk_pagetables() address mismatch
authorChristophe Leroy <christophe.leroy@c-s.fr>
Wed, 14 Aug 2019 12:36:10 +0000 (12:36 +0000)
committerKhalid Elmously <khalid.elmously@canonical.com>
Fri, 18 Oct 2019 08:26:17 +0000 (04:26 -0400)
commit69f867da7882631a43903f3fa9a66f44dfef8ecd
tree5970ca2b5e14ba173d7743c4e502e98b12726bb0
parentc17a3bf713ff6b10a42c054a2e54c2335846fa5e
powerpc/ptdump: fix walk_pagetables() address mismatch

BugLink: https://bugs.launchpad.net/bugs/1848047
[ Upstream commit e033829d2aaad85cb7cf46986c3be0bcc72f791e ]

walk_pagetables() always walk the entire pgdir from address 0
but considers PAGE_OFFSET or KERN_VIRT_START as the starting
address of the walk, resulting in a possible mismatch in the
displayed addresses.

Ex: on PPC32, when KERN_VIRT_START was locally defined as
PAGE_OFFSET, ptdump displayed 0x80000000
instead of 0xc0000000 for the first kernel page,
because 0xc0000000 + 0xc0000000 = 0x80000000

Start the walk at st->start_address instead of starting at 0.

Signed-off-by: Christophe Leroy <christophe.leroy@c-s.fr>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/5aa2ac513295f594cce8ddb1c649f61947bd063d.1565786091.git.christophe.leroy@c-s.fr
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Paolo Pisati <paolo.pisati@canonical.com>
Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
arch/powerpc/mm/ptdump/ptdump.c