From: Petr Tesarik <ptesarik@suse.cz>
To: kexec@lists.infradead.org
Cc: Norbert Trapp <Norbert.Trapp@ts.fujitsu.com>
Subject: [PATCHv3 1/9] Make max_pfn symbol optional for Xen dumps
Date: Fri, 24 Aug 2012 17:41:42 +0200 [thread overview]
Message-ID: <201208241741.42527.ptesarik@suse.cz> (raw)
After commit ec5b5835a113cf62a168d4a7354564a38de6b52c, makedumpfile fails
on Xen dumps unless the "max_pfn" symbol is known. This happens even when
the dump level is 0 and 1, where it worked previously. This is especially
bad for kernels which do not put the "max_pfn" symbol into its VMCOREINFO.
With this patch, the "max_pfn" symbol is required only if the specified
dump level needs it.
Note that we cannot call get_dom0_mapnr() from initial_xen(), because
"max_pfn" is a Linux symbol, which means that:
1. its address is determined in initial() (called after initial_xen)
2. it tries to read a Dom0 symbol, and Dom0 physical->machine mapping is
initialized in get_machdep_info (called from initial).
Signed-off-by: Petr Tesarik <ptesarik@suse.cz>
---
makedumpfile.c | 34 ++++++++++++++++++++--------------
1 file changed, 20 insertions(+), 14 deletions(-)
--- a/makedumpfile.c
+++ b/makedumpfile.c
@@ -143,13 +143,15 @@ get_dom0_mapnr()
{
unsigned long max_pfn;
- if (SYMBOL(max_pfn) == NOT_FOUND_SYMBOL)
- return FALSE;
-
- if (!readmem(VADDR, SYMBOL(max_pfn), &max_pfn, sizeof max_pfn))
- return FALSE;
+ if (SYMBOL(max_pfn) != NOT_FOUND_SYMBOL) {
+ if (!readmem(VADDR, SYMBOL(max_pfn), &max_pfn, sizeof max_pfn)) {
+ ERRMSG("Can't read domain-0 max_pfn.\n");
+ return FALSE;
+ }
- info->dom0_mapnr = max_pfn;
+ info->dom0_mapnr = max_pfn;
+ DEBUG_MSG("domain-0 pfn : %llx\n", info->dom0_mapnr);
+ }
return TRUE;
}
@@ -2430,14 +2432,6 @@ get_mem_map(void)
{
int ret;
- if (is_xen_memory()) {
- if (!get_dom0_mapnr()) {
- ERRMSG("Can't domain-0 pfn.\n");
- return FALSE;
- }
- DEBUG_MSG("domain-0 pfn : %llx\n", info->dom0_mapnr);
- }
-
switch (get_mem_type()) {
case SPARSEMEM:
DEBUG_MSG("\n");
@@ -2706,6 +2700,9 @@ out:
return FALSE;
}
+ if (is_xen_memory() && !get_dom0_mapnr())
+ return FALSE;
+
return TRUE;
}
@@ -3475,6 +3472,10 @@ exclude_free_page(void)
ERRMSG("Can't get necessary structures for excluding free pages.
\n");
return FALSE;
}
+ if (is_xen_memory() && !info->dom0_mapnr) {
+ ERRMSG("Can't get max domain-0 PFN for excluding free pages.\n");
+ return FALSE;
+ }
/*
* Detect free pages and update 2nd-bitmap.
@@ -3749,6 +3750,11 @@ exclude_unnecessary_pages(void)
struct mem_map_data *mmd;
struct timeval tv_start;
+ if (is_xen_memory() && !info->dom0_mapnr) {
+ ERRMSG("Can't get max domain-0 PFN for excluding pages.\n");
+ return FALSE;
+ }
+
gettimeofday(&tv_start, NULL);
for (mm = 0; mm < info->num_mem_map; mm++) {
_______________________________________________
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec
reply other threads:[~2012-08-24 15:41 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=201208241741.42527.ptesarik@suse.cz \
--to=ptesarik@suse.cz \
--cc=Norbert.Trapp@ts.fujitsu.com \
--cc=kexec@lists.infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox