<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
<html>
Dave Anderson wrote:
<blockquote TYPE=CITE>Dave Anderson wrote:
<blockquote TYPE=CITE>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> </blockquote>
<tt>I'm still downloading the above, so I haven't been able</tt>
<br><tt>to test it yet...</tt>
<blockquote TYPE=CITE>...
<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.
<p>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>
<br> </blockquote>

<p><br><tt>This all sounds good, and I agree that the p2m_mfn should</tt>
<br><tt>be added to the ia64 XEN_ELFNOTE_CRASH_INFO.</tt>
<p><tt>However, there's something incorrect in your calculation of</tt>
<br><tt>"xkd->p2m_frames" in your ia64_xen_kdump_p2m_create() implementation.</tt>
<br><tt>It looks like it should be 32, but it's set to 524288.  As
a result</tt>
<br><tt>that wastes a lot of memory, and "help -n" is pretty much unusable</tt>
<br><tt>since wants to dump all ~512k entries:</tt>
<p><tt>$ ./crash vmlinux-xen-ia64 vmcore.tiger.iomem_machine</tt>
<br><tt>...</tt>
<br><tt>crash> help -n</tt>
<br><tt>...</tt>
<br><tt>         xen_kdump_data:</tt>
<br><tt>                   
flags: 5 (KDUMP_P2M_INIT|KDUMP_MFN_LIST)</tt>
<br><tt>                 
p2m_mfn: 1f62c</tt>
<br><tt>                     
cr3: 0</tt>
<br><tt>           
last_mfn_read: 1fd09</tt>
<br><tt>                    
page: 6000000000c96bd0</tt>
<br><tt>                
accesses: 1340</tt>
<br><tt>              
cache_hits: 1255 (95%)</tt>
<br><tt>              
p2m_frames: 524288</tt>
<br><tt>       p2m_mfn_frame_list: 200000000539c010</tt>
<br><tt>1efba 1f5cc 1fd09 1e185 1d984 1d183 1c982 1c181 1b980 1b17f 1a97e
1a17d 1997c 1917b 1897a 18179 17978 17177 16976 16175 15974 15173 14972
14171 13970 1316f 1296e 1216d 1196c 1116b 1096a 10169 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0</tt>
<br><tt>0 0 1efb8 1efb7 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0</tt>
<br><tt>0 0 0 0 0 0 0 0 0 1efb6 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0</tt>
<br><tt>0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0</tt>
<br><tt>0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0</tt>
<br><tt>0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0</tt>
<br><tt>0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0</tt>
<br><tt>0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0</tt>
<br><tt>0 0 0 0 0 0 0</tt>
<p><tt>If you enter "crash -d2", you'll also see all 512k, mostly useless,</tt>
<br><tt>entries...</tt>
<br> </blockquote>

<p><br><tt>Perhaps I am misunderstanding the reference you made with respect</tt>
<br><tt>to the "machine memory layout is sparse"?</tt>
<p><tt>In the other xen arches, the p2m_frame list reflects contiguous</tt>
<br><tt>pseudo-physical memory, so I don't understand why, on your ia64</tt>
<br><tt>sample dump which has 1GB of memory, that there would be more</tt>
<br><tt>than 32 p2m frames?</tt>
<p><tt>Each p2m frame would contain 2048 entries (given 16k pages).</tt>
<br><tt>So with 32 p2m frames, that would account for 65536 pages,</tt>
<br><tt>which equates to 1GB of pseudo-physical memory.</tt>
<p><tt>Am I missing something?</tt>
<p><tt>Dave</tt></blockquote>

<p><br><tt>And finally...</tt><tt></tt>
<p><tt>I don't understand what check_netdump_xen() and check_kdump_xen()</tt>
<br><tt>are for.  Both of them check whether "xen_kdump_data.p2m_mfn"
has</tt>
<br><tt>been initialized, and if so, they to initialize several things</tt>
<br><tt>that should already have been initialized when xen_kdump_data.p2m_mfn</tt>
<br><tt>was originally set?</tt>
<br><tt> </tt>
<br><tt>Are they ia64 only?</tt><tt></tt>
<p><tt>Or are they *only* necessary for the strange case where the</tt>
<br><tt>--p2m_mfn over-ride is used on that kludged-up netdump-to-kdump</tt>
<br><tt>vmcore?  I still don't understand how that dumpfile was even</tt>
<br><tt>created -- should we even worry about that type of dumpfile</tt>
<br><tt>even existing?</tt><tt></tt>
<p><tt>Dave</tt>
<br><tt></tt> 
<br><tt></tt> </html>