]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blob - pending-5.1/arm64-print-physical-address-of-page-table-base-in-s.patch
Fix up backported ptrace patch
[thirdparty/kernel/stable-queue.git] / pending-5.1 / arm64-print-physical-address-of-page-table-base-in-s.patch
1 From 151b413ebc0531bcfea660157f02043c5e308542 Mon Sep 17 00:00:00 2001
2 From: Will Deacon <will.deacon@arm.com>
3 Date: Tue, 14 May 2019 12:25:28 +0100
4 Subject: arm64: Print physical address of page table base in show_pte()
5
6 [ Upstream commit 48caebf7e1313eb9f0a06fe59a07ac05b38a5806 ]
7
8 When dumping the page table in response to an unexpected kernel page
9 fault, we print the virtual (hashed) address of the page table base, but
10 display physical addresses for everything else.
11
12 Make the page table dumping code in show_pte() consistent, by printing
13 the page table base pointer as a physical address.
14
15 Reported-by: Mark Rutland <mark.rutland@arm.com>
16 Signed-off-by: Will Deacon <will.deacon@arm.com>
17 Signed-off-by: Sasha Levin <sashal@kernel.org>
18 ---
19 arch/arm64/mm/fault.c | 5 +++--
20 1 file changed, 3 insertions(+), 2 deletions(-)
21
22 diff --git a/arch/arm64/mm/fault.c b/arch/arm64/mm/fault.c
23 index 9a6099a2c633..f637447e96b0 100644
24 --- a/arch/arm64/mm/fault.c
25 +++ b/arch/arm64/mm/fault.c
26 @@ -171,9 +171,10 @@ void show_pte(unsigned long addr)
27 return;
28 }
29
30 - pr_alert("%s pgtable: %luk pages, %u-bit VAs, pgdp = %p\n",
31 + pr_alert("%s pgtable: %luk pages, %u-bit VAs, pgdp=%016lx\n",
32 mm == &init_mm ? "swapper" : "user", PAGE_SIZE / SZ_1K,
33 - mm == &init_mm ? VA_BITS : (int) vabits_user, mm->pgd);
34 + mm == &init_mm ? VA_BITS : (int)vabits_user,
35 + (unsigned long)virt_to_phys(mm->pgd));
36 pgdp = pgd_offset(mm, addr);
37 pgd = READ_ONCE(*pgdp);
38 pr_alert("[%016lx] pgd=%016llx", addr, pgd_val(pgd));
39 --
40 2.20.1
41