<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
<html>
Itsuro ODA wrote:
<blockquote TYPE=CITE>Hi Dave,
<p>The attached patch enables to analyze dom0 linux from
<br>whole memory dump on IA64. (for crash-4.0-4.1)
<br>It is just quick hack.
<br>(I was asked from IA64 Xen developers and made it.)
<p>Each domain manages own machine memory by domain.arch.mm.pgd
<br>in IA64. It is 3-level page table.
<br>I thougnt the mfn of domain.arch.mm.pgd can be regarded as
<br>p2m_mfn.
<p>I intended to modify as less existent code as possible.
<br>But this patch is a bit tricky. And the memory usage is
<br>large if the machine memory layout is sparse.
<br>(maybe xen_kdump_p2m should be prepare for each arch ?)
<p>Would you consider to support dom0 analysis for IA64 ?
<p>I prepared two sample dumps. Please find from the following
<br>URLs.
<p>1) <a href="http://people.valinux.co.jp/~oda/20070510-sample-dump-1.tar">http://people.valinux.co.jp/~oda/20070510-sample-dump-1.tar</a>
<br>  contents:
<br>  - vmcore.gz
<br>    This is taken by a hard assist dump. netdump style
ELF vmcore.
<br>    So XEN_ELFNOTE_CRASH_INFO does not exist.
<br>  - vmcore.ka.gz
<br>    It is coverted to kdump style and added XEN_ELFNOTE_CRASH_INFO
<br>    manually.
<br>  - vmlinux.debug.gz
<br>    for dom0 analysis
<br>  - xen-syms-2.6.18-8.el5.gz
<br>    for xencrash
<p>  To get p2m_mfn, xencrash's doms command is usefull.
<br>--------------------------------------------------------------------------
<br># crash xen-syms-2.6.18-8.el5 vmcore
<br>...
<br>crash> doms
<br>   DID       DOMAIN     
ST T  MAXPAGE  TOTPAGE VCPU     SHARED_I         
P2M_MFN
<br>  32753 f000000007ac8080 RU O     0       
0      0         
0             
----
<br>  32754 f000000007acc080 RU X     0       
0      0         
0             
----
<br>> 32767 f000000007ff8080 RU I     0       
0      4         
0             
----
<br>      0 f000000007aa4080 RU 0  
10000    fc28     1  f000000007a88000      
1abb7
<br>>*    1 f000000007a78080 RU U   10603   
10603    3  f000000007a5c000      
1a909
<br>crash>
<br>----------------------------------------------------------------------------
<p>  Then normal crash session with --p2m_mfn option.
<br>----------------------------------------------------------------------------
<br># crash --p2m_mfn=1abb7 vmlinux.debug vmcore
<br>...
<br>----------------------------------------------------------------------------
<p>  vmcore.ka has XEN_ELFNOTE_CRASH_INFO. so --p2m_mfn option not
need.
<br>----------------------------------------------------------------------------
<br># crash vmlinux.debug vmcore.ka
<br>...
<br>----------------------------------------------------------------------------
<p>  --p2m_mfn option is effective only if a vmcore has XEN_ELFNOTE_CRASH_INFO
<br>  now.
<br>  I think specifying --p2m_mfn option is regarded as the vmcore
is
<br>  XEN_CORE_DUMPFILE(). The patch supports this.
<br>  I think it is necessary for dumps which does not have
<br>  XEN_ELFNOTE_CRASH_INFO such as above sample.
<br> </blockquote>
<tt>OK, I finally got these all downloaded.  However, the xen-syms</tt>
<br><tt>binary in the "sample-1" directory has no debug data:</tt><tt></tt>
<p><tt># file xen-syms-2.6.18-8.el5</tt>
<br><tt>xen-syms-2.6.18-8.el5: ELF 64-bit LSB executable, IA-64, version
1 (SYSV), statically linked, stripped</tt>
<br><tt>#</tt><tt></tt>
<p><tt>And I see that check_netdump_xen() is only called if the</tt>
<br><tt>netdump (?) vmcore is used, since it needs the --p2m_mfn</tt>
<br><tt>argument.  I have no idea where check_kdump_xen() would</tt>
<br><tt>apply?</tt><tt></tt>
<p><tt>In any case, I really prefer not to support whatever that</tt>
<br><tt>first "hard assist dump. netdump style ELF" vmcore file.</tt>
<br><tt>(What is that???)</tt><tt></tt>
<p><tt>I don't see why the support for dom0 ia64 kdumps should</tt>
<br><tt>be any different than for x86 and x86_64, both of which</tt>
<br><tt>have XEN_ELFNOTE_CRASH_INFO notes containing the p2m mfn</tt>
<br><tt>value.</tt>
<p><tt>Therefore, the check_netdump_xen() and check_kdump_xen()</tt>
<br><tt>can be thrown out, and all that is really required is the</tt>
<br><tt>implementation of ia64_xen_kdump_p2m_create() for the vmlinux</tt>
<br><tt>side.  But it will still need a fix to deal with that</tt>
<br><tt>over-sized (?) 512k p2m_frame list.  Can you look into fixing</tt>
<br><tt>that?</tt><tt></tt>
<p><tt>Also, I don't quite understand the changes to xen_kdump_p2m().</tt>
<br><tt>The first (generic) part is probably a safe thing to do:</tt><tt></tt>
<p><tt>+       if (mfn_idx >= xkd->p2m_frames)</tt>
<br><tt>+              
return P2M_FAILURE;</tt><tt></tt>
<p><tt>But if the above code is put into place, how would it</tt>
<br><tt>be possible for the resultant mfn_frame to be 0?</tt><tt></tt>
<p><tt>+ #ifdef IA64</tt>
<br><tt>+         if (mfn_frame
== 0)</tt>
<br><tt>+                
return P2M_FAILURE;</tt>
<br><tt>+ #endif</tt><tt></tt>
<p><tt>And I don't understand this part at all:</tt><tt></tt>
<p><tt>+ #ifdef IA64</tt>
<br><tt>+         if (!(*mfnptr
& 0x1))</tt>
<br><tt>+                
return P2M_FAILURE;</tt>
<br><tt>+         paddr = *mfnptr
& _PFN_MASK;</tt>
<br><tt>+ #else</tt>
<br><tt>+         paddr = (physaddr_t)PTOB((ulonglong)(*mfnptr));</tt>
<br><tt>+ #endif</tt><tt></tt>
<p><tt>Although, after putting in a debug printf of what the mfns</tt>
<br><tt>actually look like on an ia64, I guess I see why it's</tt>
<br><tt>necessary.</tt><tt></tt>
<p><tt>On x86 and x86_64, the mfnptr points to a simple mfn value.</tt><tt></tt>
<p><tt>But on the ia64, I see mfns that look like 81000007bf3c761,</tt>
<br><tt>where the "1-bit" is always set.  And you don't shift the</tt>
<br><tt>mfn value like x86/x86_64 do.  Can you help me understand</tt>
<br><tt>the format of the ia64 mfns?  In other words, what part of
a</tt>
<br><tt>value such as 81000007bf3c761 is the actual mfn?  Are there</tt>
<br><tt>page flags or something in the lower bits of the number?</tt><tt></tt>
<p><tt>Thanks,</tt>
<br><tt>  Dave</tt>
<blockquote TYPE=CITE> 
<br>2) <a href="http://people.valinux.co.jp/~oda/20070510-sample-dump-2.tar">http://people.valinux.co.jp/~oda/20070510-sample-dump-2.tar</a>
<br>  contents:
<br>  - vmcore.tiger.iomem_machine.gz
<br>    taken by Xen kdump
<br>  - vmlinux-xen-ia64.bz2
<br>  - xen-syms-ia64.bz2
<p>  I asked Xen kdump developper (simon@valinux) to add "p2m_mfn"
to
<br>  XEN_ELFNOTE_CRASH_INFO.
<br>  So this change of Xen kdump is not open yet.
<br>  If this is OK for crash, it will be commited.
<p>Thanks.
<br>--
<br>Itsuro ODA <oda@valinux.co.jp>
<p>  ------------------------------------------------------------------------------------------------------------------------
<br>                   
Name: diff-20070510
<br>   diff-20070510    Type: unspecified type
(application/octet-stream)
<br>               
Encoding: base64
<p>  ------------------------------------------------------------------------------------------------------------------------
<br>--
<br>Crash-utility mailing list
<br>Crash-utility@redhat.com
<br><a href="https://www.redhat.com/mailman/listinfo/crash-utility">https://www.redhat.com/mailman/listinfo/crash-utility</a></blockquote>
</html>