kexec.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* RE: [PATCH] handle renamed init_level4_pgt -> init_top_pgt
@ 2017-11-07 10:20 Atsushi Kumagai
  2017-12-08  8:15 ` Atsushi Kumagai
  0 siblings, 1 reply; 22+ messages in thread
From: Atsushi Kumagai @ 2017-11-07 10:20 UTC (permalink / raw)
  To: Jeff Mahoney; +Cc: Keiichirou Suzuki, kexec@lists.infradead.org

>Linux 4.13 renamed init_level4_pgt to init_top_pgt in preparation for
>introducing 5-level page tables.  This patch follows the rename if
>the lookup for init_level4_pgt fails.  It also checks to see if
>5-level page tables are enabled and bails if it discovers they are.

Thanks Jeff, but could you rebase it on the current devel branch ?
vtop4 for x86_64 was modified in the commit below:

commit 8c89727155f4994b4e75a659e28e5eff16ff6cbc
Author: Takao Indoh <indou.takao@jp.fujitsu.com>
Date:   Thu Oct 26 20:32:54 2017 +0900

    [PATCH v3 2/4] Introduce vtop4_x86_64_pagetable

Regards,
Atsushi Kumagai

>Signed-off-by: Jeff Mahoney <jeffm@suse.com>
>---
> arch/x86_64.c  | 24 +++++++++++++++++++++---
> makedumpfile.c |  6 ++++++
> makedumpfile.h |  2 ++
> 3 files changed, 29 insertions(+), 3 deletions(-)
>
>diff --git a/arch/x86_64.c b/arch/x86_64.c
>index 08dd6b2..9b09035 100644
>--- a/arch/x86_64.c
>+++ b/arch/x86_64.c
>@@ -259,16 +259,26 @@ vtop4_x86_64(unsigned long vaddr)
> {
> 	unsigned long page_dir, pml4, pgd_paddr, pgd_pte, pmd_paddr, pmd_pte;
> 	unsigned long pte_paddr, pte;
>+	unsigned long init_level4_pgt;
>
>-	if (SYMBOL(init_level4_pgt) == NOT_FOUND_SYMBOL) {
>+	if (SYMBOL(init_level4_pgt) != NOT_FOUND_SYMBOL)
>+		init_level4_pgt = SYMBOL(init_level4_pgt);
>+	else if (SYMBOL(init_top_pgt) != NOT_FOUND_SYMBOL)
>+		init_level4_pgt = SYMBOL(init_top_pgt);
>+	else {
> 		ERRMSG("Can't get the symbol of init_level4_pgt.\n");
> 		return NOT_PADDR;
> 	}
>
>+	if (SYMBOL(level4_kernel_pgt) != NOT_FOUND_SYMBOL) {
>+		ERRMSG("Kernel is built with 5-level page tables\n");
>+		return NOT_PADDR;
>+	}
>+
> 	/*
> 	 * Get PGD.
> 	 */
>-	page_dir = SYMBOL(init_level4_pgt) - __START_KERNEL_map + info->phys_base;
>+	page_dir = init_level4_pgt - __START_KERNEL_map + info->phys_base;
> 	if (is_xen_memory()) {
> 		page_dir = ptom_xen(page_dir);
> 		if (page_dir == NOT_PADDR)
>@@ -549,8 +559,16 @@ find_vmemmap_x86_64()
> 	struct vmap_pfns *vmapp, *vmaphead = NULL, *cur, *tail;
>
> 	init_level4_pgt = SYMBOL(init_level4_pgt);
>+	if (init_level4_pgt == NOT_FOUND_SYMBOL)
>+		init_level4_pgt = SYMBOL(init_top_pgt);
>+
> 	if (init_level4_pgt == NOT_FOUND_SYMBOL) {
>-		ERRMSG("init_level4_pgt not found\n");
>+		ERRMSG("init_level4_pgt/init_top_pgt not found\n");
>+		return FAILED;
>+	}
>+
>+	if (SYMBOL(level4_kernel_pgt) != NOT_FOUND_SYMBOL) {
>+		ERRMSG("kernel is configured for 5-level page tables\n");
> 		return FAILED;
> 	}
> 	pagestructsize = size_table.page;
>diff --git a/makedumpfile.c b/makedumpfile.c
>index f85003a..6e5ec34 100644
>--- a/makedumpfile.c
>+++ b/makedumpfile.c
>@@ -1486,6 +1486,8 @@ get_symbol_info(void)
> 	SYMBOL_INIT(_stext, "_stext");
> 	SYMBOL_INIT(swapper_pg_dir, "swapper_pg_dir");
> 	SYMBOL_INIT(init_level4_pgt, "init_level4_pgt");
>+	SYMBOL_INIT(level4_kernel_pgt, "level4_kernel_pgt");
>+	SYMBOL_INIT(init_top_pgt, "init_top_pgt");
> 	SYMBOL_INIT(vmlist, "vmlist");
> 	SYMBOL_INIT(vmap_area_list, "vmap_area_list");
> 	SYMBOL_INIT(node_online_map, "node_online_map");
>@@ -2105,6 +2107,8 @@ write_vmcoreinfo_data(void)
> 	WRITE_SYMBOL("_stext", _stext);
> 	WRITE_SYMBOL("swapper_pg_dir", swapper_pg_dir);
> 	WRITE_SYMBOL("init_level4_pgt", init_level4_pgt);
>+	WRITE_SYMBOL("level4_kernel_pgt", level4_kernel_pgt);
>+	WRITE_SYMBOL("init_top_pgt", init_top_pgt);
> 	WRITE_SYMBOL("vmlist", vmlist);
> 	WRITE_SYMBOL("vmap_area_list", vmap_area_list);
> 	WRITE_SYMBOL("node_online_map", node_online_map);
>@@ -2500,6 +2504,8 @@ read_vmcoreinfo(void)
> 	READ_SYMBOL("_stext", _stext);
> 	READ_SYMBOL("swapper_pg_dir", swapper_pg_dir);
> 	READ_SYMBOL("init_level4_pgt", init_level4_pgt);
>+	READ_SYMBOL("level4_kernel_pgt", level4_kernel_pgt);
>+	READ_SYMBOL("init_top_pgt", init_top_pgt);
> 	READ_SYMBOL("vmlist", vmlist);
> 	READ_SYMBOL("vmap_area_list", vmap_area_list);
> 	READ_SYMBOL("node_online_map", node_online_map);
>diff --git a/makedumpfile.h b/makedumpfile.h
>index 8a05794..9357e47 100644
>--- a/makedumpfile.h
>+++ b/makedumpfile.h
>@@ -1517,6 +1517,8 @@ struct symbol_table {
> 	unsigned long long	_stext;
> 	unsigned long long	swapper_pg_dir;
> 	unsigned long long	init_level4_pgt;
>+	unsigned long long	level4_kernel_pgt;
>+	unsigned long long	init_top_pgt;
> 	unsigned long long	vmlist;
> 	unsigned long long	vmap_area_list;
> 	unsigned long long	phys_base;
>
>
>--
>Jeff Mahoney
>SUSE Labs



_______________________________________________
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec

^ permalink raw reply	[flat|nested] 22+ messages in thread
[parent not found: <mailman.7.1515009607.12089.kexec@lists.infradead.org>]

end of thread, other threads:[~2018-01-09  5:33 UTC | newest]

Thread overview: 22+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-11-07 10:20 [PATCH] handle renamed init_level4_pgt -> init_top_pgt Atsushi Kumagai
2017-12-08  8:15 ` Atsushi Kumagai
2017-12-20  7:24   ` Dave Young
2017-12-21  8:48     ` Atsushi Kumagai
2017-12-22  4:54       ` Dave Young
2017-12-22  5:48         ` Dave Young
2017-12-26  8:21           ` Atsushi Kumagai
2018-01-02  8:57             ` Dave Young
2018-01-02  9:08               ` Baoquan He
2018-01-03  2:30                 ` makedumpfile saving vmcore fails with dynamically allocated mem_section (was: Re: [PATCH] handle renamed init_level4_pgt -> init_top_pgt) Dave Young
2018-01-03  2:38                   ` Baoquan He
2018-01-05  8:19                     ` Atsushi Kumagai
2018-01-06  5:36                       ` Dave Young
2018-01-09  5:17                         ` Atsushi Kumagai
2018-01-09  5:33                           ` Dave Young
     [not found] <mailman.7.1515009607.12089.kexec@lists.infradead.org>
2018-01-03 20:21 ` Dave Anderson
2018-01-05  2:38   ` Dave Young
2018-01-05  3:19     ` Dave Young
2018-01-05 14:16     ` Dave Anderson
2018-01-06  6:13       ` Dave Young
2018-01-06 16:06         ` Dave Anderson
2018-01-08  8:40           ` Dave Young

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).