FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Redhat > Crash Utility

 
 
LinkBack Thread Tools
 
Old 06-18-2010, 02:44 PM
Petr Tesarik
 
Default Fix reading x86_64 xendump cores on 2.6.27+

Hi,

the crash utility is unable to read xendump cores from kernel versions
2.6.27 or newer. Bernhard fixed this only for kdump Xen cores.

With 2.6.27 and newer kernels, the max_pfn symbol should be used
to get the highest PFN in the system. However, xendump code still
tries to use end_pfn. Without the patch, early initialization
fails with the error message: "crash: cannot resolve "end_pfn".

Signed-off-by: Petr Tesarik <ptesarik@suse.cz>

---
x86_64.c | 22 ++++++++++++++++++++--
1 file changed, 20 insertions(+), 2 deletions(-)

--- a/x86_64.c
+++ b/x86_64.c
@@ -4851,6 +4851,7 @@ x86_64_xen_kdump_p2m_create(struct xen_k
ulong frames;
ulong frame_mfn[MAX_X86_64_FRAMES] = { 0 };
int mfns[MAX_X86_64_FRAMES] = { 0 };
+ struct syment *sp;

/*
* Temporarily read physical (machine) addresses from vmcore by
@@ -4932,7 +4933,15 @@ use_cr3:
x86_64_debug_dump_page(fp, machdep->machspec->pml4,
"contents of PML4 page:");

- kvaddr = symbol_value("end_pfn");
+ /*
+ * kernel version < 2.6.27 => end_pfn
+ * kernel version >= 2.6.27 => max_pfn
+ */
+ if ((sp = symbol_search("end_pfn")))
+ kvaddr = sp->value;
+ else
+ kvaddr = symbol_value("max_pfn");
+
if (!x86_64_xen_kdump_load_page(kvaddr, xkd->page))
return FALSE;
up = (ulong *)(xkd->page + PAGEOFFSET(kvaddr));
@@ -5262,6 +5271,7 @@ x86_64_xendump_p2m_create(struct xendump
ulong mfn, kvaddr, ctrlreg[8], ctrlreg_offset;
ulong *up;
off_t offset;
+ struct syment *sp;

if (!symbol_exists("phys_to_machine_mapping")) {
xd->flags |= XC_CORE_NO_P2M;
@@ -5299,7 +5309,15 @@ x86_64_xendump_p2m_create(struct xendump
x86_64_debug_dump_page(xd->ofp, machdep->machspec->pml4,
"contents of PML4 page:");

- kvaddr = symbol_value("end_pfn");
+ /*
+ * kernel version < 2.6.27 => end_pfn
+ * kernel version >= 2.6.27 => max_pfn
+ */
+ if ((sp = symbol_search("end_pfn")))
+ kvaddr = sp->value;
+ else
+ kvaddr = symbol_value("max_pfn");
+
if (!x86_64_xendump_load_page(kvaddr, xd))
return FALSE;



--
Crash-utility mailing list
Crash-utility@redhat.com
https://www.redhat.com/mailman/listinfo/crash-utility
 
Old 06-18-2010, 02:56 PM
Dave Anderson
 
Default Fix reading x86_64 xendump cores on 2.6.27+

----- "Petr Tesarik" <ptesarik@suse.cz> wrote:

> Hi,
>
> the crash utility is unable to read xendump cores from kernel versions
> 2.6.27 or newer. Bernhard fixed this only for kdump Xen cores.
>
> With 2.6.27 and newer kernels, the max_pfn symbol should be used
> to get the highest PFN in the system. However, xendump code still
> tries to use end_pfn. Without the patch, early initialization
> fails with the error message: "crash: cannot resolve "end_pfn".
>
> Signed-off-by: Petr Tesarik <ptesarik@suse.cz>

Looks good to me -- queued for next release.

Thanks,
Dave

>
> ---
> x86_64.c | 22 ++++++++++++++++++++--
> 1 file changed, 20 insertions(+), 2 deletions(-)
>
> --- a/x86_64.c
> +++ b/x86_64.c
> @@ -4851,6 +4851,7 @@ x86_64_xen_kdump_p2m_create(struct xen_k
> ulong frames;
> ulong frame_mfn[MAX_X86_64_FRAMES] = { 0 };
> int mfns[MAX_X86_64_FRAMES] = { 0 };
> + struct syment *sp;
>
> /*
> * Temporarily read physical (machine) addresses from vmcore
> by
> @@ -4932,7 +4933,15 @@ use_cr3:
> x86_64_debug_dump_page(fp, machdep->machspec->pml4,
> "contents of PML4 page:");
>
> - kvaddr = symbol_value("end_pfn");
> + /*
> + * kernel version < 2.6.27 => end_pfn
> + * kernel version >= 2.6.27 => max_pfn
> + */
> + if ((sp = symbol_search("end_pfn")))
> + kvaddr = sp->value;
> + else
> + kvaddr = symbol_value("max_pfn");
> +
> if (!x86_64_xen_kdump_load_page(kvaddr, xkd->page))
> return FALSE;
> up = (ulong *)(xkd->page + PAGEOFFSET(kvaddr));
> @@ -5262,6 +5271,7 @@ x86_64_xendump_p2m_create(struct xendump
> ulong mfn, kvaddr, ctrlreg[8], ctrlreg_offset;
> ulong *up;
> off_t offset;
> + struct syment *sp;
>
> if (!symbol_exists("phys_to_machine_mapping")) {
> xd->flags |= XC_CORE_NO_P2M;
> @@ -5299,7 +5309,15 @@ x86_64_xendump_p2m_create(struct xendump
> x86_64_debug_dump_page(xd->ofp, machdep->machspec->pml4,
> "contents of PML4 page:");
>
> - kvaddr = symbol_value("end_pfn");
> + /*
> + * kernel version < 2.6.27 => end_pfn
> + * kernel version >= 2.6.27 => max_pfn
> + */
> + if ((sp = symbol_search("end_pfn")))
> + kvaddr = sp->value;
> + else
> + kvaddr = symbol_value("max_pfn");
> +
> if (!x86_64_xendump_load_page(kvaddr, xd))
> return FALSE;
>
>
>
> --
> Crash-utility mailing list
> Crash-utility@redhat.com
> https://www.redhat.com/mailman/listinfo/crash-utility

--
Crash-utility mailing list
Crash-utility@redhat.com
https://www.redhat.com/mailman/listinfo/crash-utility
 

Thread Tools




All times are GMT. The time now is 09:45 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org