* [PATCH] x86/mm: fix dump_pagetables with Xen PV
@ 2020-02-21 10:38 Juergen Gross
2020-02-21 10:51 ` [Xen-devel] " Julien Grall
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: Juergen Gross @ 2020-02-21 10:38 UTC (permalink / raw)
To: xen-devel, x86, linux-kernel
Cc: Juergen Gross, Dave Hansen, Andy Lutomirski, Peter Zijlstra,
Thomas Gleixner, Ingo Molnar, Borislav Petkov, H. Peter Anvin
Commit 2ae27137b2db89 ("x86: mm: convert dump_pagetables to use
walk_page_range") broke Xen PV guests as the hypervisor reserved hole
in the memory map was not taken into account.
Fix that by starting the kernel range only at GUARD_HOLE_END_ADDR.
Fixes: 2ae27137b2db89 ("x86: mm: convert dump_pagetables to use walk_page_range")
Reported-by: Julien Grall <julien@xen.org>
Signed-off-by: Juergen Gross <jgross@suse.com>
---
arch/x86/mm/dump_pagetables.c | 7 +------
1 file changed, 1 insertion(+), 6 deletions(-)
diff --git a/arch/x86/mm/dump_pagetables.c b/arch/x86/mm/dump_pagetables.c
index 64229dad7eab..69309cd56fdf 100644
--- a/arch/x86/mm/dump_pagetables.c
+++ b/arch/x86/mm/dump_pagetables.c
@@ -363,13 +363,8 @@ static void ptdump_walk_pgd_level_core(struct seq_file *m,
{
const struct ptdump_range ptdump_ranges[] = {
#ifdef CONFIG_X86_64
-
-#define normalize_addr_shift (64 - (__VIRTUAL_MASK_SHIFT + 1))
-#define normalize_addr(u) ((signed long)((u) << normalize_addr_shift) >> \
- normalize_addr_shift)
-
{0, PTRS_PER_PGD * PGD_LEVEL_MULT / 2},
- {normalize_addr(PTRS_PER_PGD * PGD_LEVEL_MULT / 2), ~0UL},
+ {GUARD_HOLE_END_ADDR, ~0UL},
#else
{0, ~0UL},
#endif
--
2.16.4
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [Xen-devel] [PATCH] x86/mm: fix dump_pagetables with Xen PV
2020-02-21 10:38 [PATCH] x86/mm: fix dump_pagetables with Xen PV Juergen Gross
@ 2020-02-21 10:51 ` Julien Grall
2020-02-28 15:30 ` Jürgen Groß
2020-02-29 11:49 ` [tip: x86/urgent] x86/mm: Fix " tip-bot2 for Juergen Gross
2 siblings, 0 replies; 4+ messages in thread
From: Julien Grall @ 2020-02-21 10:51 UTC (permalink / raw)
To: Juergen Gross, xen-devel, x86, linux-kernel
Cc: Peter Zijlstra, Dave Hansen, Ingo Molnar, Borislav Petkov,
Andy Lutomirski, H. Peter Anvin, Thomas Gleixner
Hi Juergen,
On 21/02/2020 10:38, Juergen Gross wrote:
> Commit 2ae27137b2db89 ("x86: mm: convert dump_pagetables to use
> walk_page_range") broke Xen PV guests as the hypervisor reserved hole
> in the memory map was not taken into account.
>
> Fix that by starting the kernel range only at GUARD_HOLE_END_ADDR.
>
> Fixes: 2ae27137b2db89 ("x86: mm: convert dump_pagetables to use walk_page_range")
> Reported-by: Julien Grall <julien@xen.org>
> Signed-off-by: Juergen Gross <jgross@suse.com>
I can confirm the crash has now disappeared:
Tested-by: Julien Grall <julien@xen.org>
Cheers,
--
Julien Grall
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] x86/mm: fix dump_pagetables with Xen PV
2020-02-21 10:38 [PATCH] x86/mm: fix dump_pagetables with Xen PV Juergen Gross
2020-02-21 10:51 ` [Xen-devel] " Julien Grall
@ 2020-02-28 15:30 ` Jürgen Groß
2020-02-29 11:49 ` [tip: x86/urgent] x86/mm: Fix " tip-bot2 for Juergen Gross
2 siblings, 0 replies; 4+ messages in thread
From: Jürgen Groß @ 2020-02-28 15:30 UTC (permalink / raw)
To: xen-devel, x86, linux-kernel
Cc: Dave Hansen, Andy Lutomirski, Peter Zijlstra, Thomas Gleixner,
Ingo Molnar, Borislav Petkov, H. Peter Anvin
Friendly ping...
On 21.02.20 11:38, Juergen Gross wrote:
> Commit 2ae27137b2db89 ("x86: mm: convert dump_pagetables to use
> walk_page_range") broke Xen PV guests as the hypervisor reserved hole
> in the memory map was not taken into account.
>
> Fix that by starting the kernel range only at GUARD_HOLE_END_ADDR.
>
> Fixes: 2ae27137b2db89 ("x86: mm: convert dump_pagetables to use walk_page_range")
> Reported-by: Julien Grall <julien@xen.org>
> Signed-off-by: Juergen Gross <jgross@suse.com>
> ---
> arch/x86/mm/dump_pagetables.c | 7 +------
> 1 file changed, 1 insertion(+), 6 deletions(-)
>
> diff --git a/arch/x86/mm/dump_pagetables.c b/arch/x86/mm/dump_pagetables.c
> index 64229dad7eab..69309cd56fdf 100644
> --- a/arch/x86/mm/dump_pagetables.c
> +++ b/arch/x86/mm/dump_pagetables.c
> @@ -363,13 +363,8 @@ static void ptdump_walk_pgd_level_core(struct seq_file *m,
> {
> const struct ptdump_range ptdump_ranges[] = {
> #ifdef CONFIG_X86_64
> -
> -#define normalize_addr_shift (64 - (__VIRTUAL_MASK_SHIFT + 1))
> -#define normalize_addr(u) ((signed long)((u) << normalize_addr_shift) >> \
> - normalize_addr_shift)
> -
> {0, PTRS_PER_PGD * PGD_LEVEL_MULT / 2},
> - {normalize_addr(PTRS_PER_PGD * PGD_LEVEL_MULT / 2), ~0UL},
> + {GUARD_HOLE_END_ADDR, ~0UL},
> #else
> {0, ~0UL},
> #endif
>
^ permalink raw reply [flat|nested] 4+ messages in thread
* [tip: x86/urgent] x86/mm: Fix dump_pagetables with Xen PV
2020-02-21 10:38 [PATCH] x86/mm: fix dump_pagetables with Xen PV Juergen Gross
2020-02-21 10:51 ` [Xen-devel] " Julien Grall
2020-02-28 15:30 ` Jürgen Groß
@ 2020-02-29 11:49 ` tip-bot2 for Juergen Gross
2 siblings, 0 replies; 4+ messages in thread
From: tip-bot2 for Juergen Gross @ 2020-02-29 11:49 UTC (permalink / raw)
To: linux-tip-commits; +Cc: Julien Grall, Juergen Gross, Thomas Gleixner, x86, LKML
The following commit has been merged into the x86/urgent branch of tip:
Commit-ID: bba42affa732d6fd5bd5c9678e6deacde2de1547
Gitweb: https://git.kernel.org/tip/bba42affa732d6fd5bd5c9678e6deacde2de1547
Author: Juergen Gross <jgross@suse.com>
AuthorDate: Fri, 21 Feb 2020 11:38:51 +01:00
Committer: Thomas Gleixner <tglx@linutronix.de>
CommitterDate: Sat, 29 Feb 2020 12:43:10 +01:00
x86/mm: Fix dump_pagetables with Xen PV
Commit 2ae27137b2db89 ("x86: mm: convert dump_pagetables to use
walk_page_range") broke Xen PV guests as the hypervisor reserved hole in
the memory map was not taken into account.
Fix that by starting the kernel range only at GUARD_HOLE_END_ADDR.
Fixes: 2ae27137b2db89 ("x86: mm: convert dump_pagetables to use walk_page_range")
Reported-by: Julien Grall <julien@xen.org>
Signed-off-by: Juergen Gross <jgross@suse.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Tested-by: Julien Grall <julien@xen.org>
Link: https://lkml.kernel.org/r/20200221103851.7855-1-jgross@suse.com
---
arch/x86/mm/dump_pagetables.c | 7 +------
1 file changed, 1 insertion(+), 6 deletions(-)
diff --git a/arch/x86/mm/dump_pagetables.c b/arch/x86/mm/dump_pagetables.c
index 64229da..69309cd 100644
--- a/arch/x86/mm/dump_pagetables.c
+++ b/arch/x86/mm/dump_pagetables.c
@@ -363,13 +363,8 @@ static void ptdump_walk_pgd_level_core(struct seq_file *m,
{
const struct ptdump_range ptdump_ranges[] = {
#ifdef CONFIG_X86_64
-
-#define normalize_addr_shift (64 - (__VIRTUAL_MASK_SHIFT + 1))
-#define normalize_addr(u) ((signed long)((u) << normalize_addr_shift) >> \
- normalize_addr_shift)
-
{0, PTRS_PER_PGD * PGD_LEVEL_MULT / 2},
- {normalize_addr(PTRS_PER_PGD * PGD_LEVEL_MULT / 2), ~0UL},
+ {GUARD_HOLE_END_ADDR, ~0UL},
#else
{0, ~0UL},
#endif
^ permalink raw reply related [flat|nested] 4+ messages in thread
end of thread, other threads:[~2020-02-29 11:49 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-02-21 10:38 [PATCH] x86/mm: fix dump_pagetables with Xen PV Juergen Gross
2020-02-21 10:51 ` [Xen-devel] " Julien Grall
2020-02-28 15:30 ` Jürgen Groß
2020-02-29 11:49 ` [tip: x86/urgent] x86/mm: Fix " tip-bot2 for Juergen Gross
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).