<html><body><div style="color:#000; background-color:#fff; font-family:times new roman, new york, times, serif;font-size:12pt">Is there anyway we can submit the patch and contribute form our side ?<br><br>Regards,<br>Oza.<br><div><span><br></span></div><div><br></div>  <div style="font-family: times new roman,new york,times,serif; font-size: 12pt;"> <div style="font-family: times new roman,new york,times,serif; font-size: 12pt;"> <div dir="ltr"> <font face="Arial" size="2"> <hr size="1">  <b><span style="font-weight: bold;">From:</span></b> Dave Anderson <anderson@redhat.com><br> <b><span style="font-weight: bold;">To:</span></b> paawan oza <paawan1982@yahoo.com> <br><b><span style="font-weight: bold;">Cc:</span></b> "Discussion list for crash utility usage, maintenance and development" <crash-utility@redhat.com>; Mika Westerberg <mika.westerberg@iki.fi>; Thomas Fänge <thomas.fange@sonymobile.com>; jan karlsson
 <jan.karlsson@sonymobile.com> <br> <b><span style="font-weight: bold;">Sent:</span></b> Wednesday, 3 October 2012 7:15 PM<br> <b><span style="font-weight: bold;">Subject:</span></b> Re: [Crash-utility] using crash for ARM<br> </font> </div> <br>Paawan,<br><br>Right -- it looks to be a bug, presuming that ARM is using 1MB pages<br>for the unity-mapped region:<br> <br> crash> vtop c0000000 | grep PAGE:<br>  PAGE:    11000  (1MB)<br> crash> vtop c0100000 | grep PAGE:<br>  PAGE:    11000  (1MB)<br> crash> vtop c0200000 | grep PAGE:<br>  PAGE:   211000  (1MB)<br> crash> vtop c0300000 | grep PAGE:<br>  PAGE:   211000  (1MB)<br> crash> vtop c0400000 | grep PAGE:<br>  PAGE:   411000  (1MB)<br> crash> vtop c0500000 | grep PAGE:<br>  PAGE:   411000  (1MB)<br> crash><br><br>And confusing the issue even more, when the virtual memory is
 read,<br>the data at c0000000 and c0100000 is different (as expected), but the<br>virtual-to-physical translation "paddr:" value indicates different<br>physical addresses that what are shown above:<br><br> crash> set debug 4<br> debug: 4<br> crash> rd c0000000<br> <addr: c0000000 count: 1 flag: 488 (KVADDR)><br> <readmem: c0000000, KVADDR, "32-bit KVADDR", 4, (FOE), ff8bea60><br> <read_kdump: addr: c0000000 paddr: 0 cnt: 4><br> c0000000:  ea000012                              ....<br> crash> rd c0100000<br> <addr: c0100000 count: 1 flag: 488 (KVADDR)><br> <readmem: c0100000, KVADDR, "32-bit KVADDR", 4, (FOE), ff8bea60><br> <read_kdump: addr: c0100000 paddr: 100000 cnt: 4><br> c0100000:  3694c21d                              ...6<br> crash><br><br>In
 other words, above it shows that c0000000 is at physical address 0,<br>and that c0100000 is at 100000, i.e., not 11000 as shown by the <br>verbose vtop display.<br><br>I'll leave it up to the crash utility's ARM maintainers to come up<br>with the proper answer and fix for the verbose vtop display.  I've<br>cc'd them with this email.  Also please use the <a ymailto="mailto:crash-utility@redhat.com" href="mailto:crash-utility@redhat.com">crash-utility@redhat.com</a><br>mailing list for these kinds of discussions.<br><br>Thanks,<br>  Dave<br><br><br><br>----- Original Message -----<br>> <br>> Hi Dave,<br>> <br>> The section translation inside 'arm_vtop' function and getting to the<br>> physical address looks beyond my understanding.<br>> <br>> if (verbose)<br>> fprintf(fp, "PAGE DIRECTORY: %lx\n", (ulong)pgd);<br>> <br>> /*<br>> * pgd_offset(pgd, vaddr)<br>> */<br>> page_dir = pgd + PGD_OFFSET(vaddr) *
 2;<br>> FILL_PGD(PAGEBASE(pgd), KVADDR, PGDIR_SIZE());<br>> pgd_pte = ULONG(machdep->pgd + PGDIR_OFFSET(page_dir));<br>> <br>> if (verbose)<br>> fprintf(fp, " PGD: %s => %lx\n",<br>> mkstring(buf, VADDR_PRLEN, RJUST | LONG_HEX,<br>> MKSTR((ulong)page_dir)), pgd_pte);<br>> <br>> if (!pgd_pte)<br>> return FALSE;<br>> <br>> /*<br>> * pmd_offset(pgd, vaddr)<br>> *<br>> * Here PMD is folded into a PGD.<br>> */<br>> pmd_pte = pgd_pte;<br>> page_middle = page_dir;<br>> <br>> if (verbose)<br>> fprintf(fp, " PMD: %s => %lx\n",<br>> mkstring(buf, VADDR_PRLEN, RJUST | LONG_HEX,<br>> MKSTR((ulong)page_middle)), pmd_pte);<br>> <br>> if ((pmd_pte & PMD_TYPE_MASK) == PMD_TYPE_SECT) {<br>> if (verbose) {<br>> fprintf(fp, " PAGE: %s (1MB)\n\n",<br>> mkstring(buf, VADDR_PRLEN, RJUST | LONG_HEX,<br>> MKSTR(PAGEBASE(pmd_pte))));<br>> }<br>> *paddr = PAGEBASE(pmd_pte) +
 (vaddr & ~_SECTION_PAGE_MASK);<br>> return TRUE;<br>> }<br>> <br>> <br>> <br>> <br>> <br>> if you look at<br>> page_dir = pgd + PGD_OFFSET(vaddr) * 2;<br>> FILL_PGD(PAGEBASE(pgd), KVADDR, PGDIR_SIZE());<br>> pgd_pte = ULONG(machdep->pgd + PGDIR_OFFSET(page_dir));<br>> <br>> <br>> the final first level discriptor is not coming properly for<br>> kernel virtual address with [20st counting from 0....n] bit set.<br>> <br>> <br>> <br>> <br>> if you look at the following output:<br>> <br>> <br>> crash> vtop 0xc010005c<br>> VIRTUAL PHYSICAL<br>> c010005c 8210005c<br>> <br>> PAGE DIRECTORY: c0004000<br>> PGD: c0007000 => 8200040e<br>> PMD: c0007000 => 8200040e<br>> PAGE: 82000000 (1MB)<br>> <br>> <br>> PAGE PHYSICAL MAPPING INDEX CNT FLAGS<br>> c103c000 82000000 c1d16f28 3 54 8027c<br>> crash> vtop 0xc000005c<br>> VIRTUAL
 PHYSICAL<br>> c000005c 8200005c<br>> <br>> PAGE DIRECTORY: c0004000<br>> PGD: c0007000 => 8200040e<br>> PMD: c0007000 => 8200040e<br>> PAGE: 82000000 (1MB)<br>> <br>> <br>> PAGE PHYSICAL MAPPING INDEX CNT FLAGS<br>> c103c000 82000000 c1d16f28 3 54 8027c<br>> <br>> <br>> <br>> virtual to physical mapping is fine, because it doesnt even go<br>> through arm_vtop() function.<br>> as it is straight one to one mapping, you use VTOP macro.<br>> so basically section code snippet which I sent you never come into<br>> picture.<br>> if you have a look at the both kernel virtual addresses<br>> <br>> <br>> 0xc010005c and<br>> 0xc000005c<br>> both are 1MB apart. but still following contents are same.<br>> <br>> PAGE DIRECTORY: c0004000<br>> PGD: c0007000 => 8200040e<br>> PMD: c0007000 => 8200040e<br>> <br>> PAGE: 82000000 (1MB)<br>> <br>> <br>> I shall
 clarify more, If you require more info.<br>> I hope I am not missing anything here.<br>> <br>> <br>> <br>> PS:<br>> If I want to have correct physical address corresponding to<br>> 0xc010005c<br>> <br>> <br>> then I have to do workaround for section level physical addresses as<br>> follows.<br>> page_dir = pgd + PGD_OFFSET(vaddr) * 2;<br>> if (bit(vaddr,20)) //if bit is set then move to the next pgd */<br>> page_dir = page_dir + 1;<br>> FILL_PGD(PAGEBASE(pgd), KVADDR, PGDIR_SIZE());<br>> pgd_pte = ULONG(machdep->pgd + PGDIR_OFFSET(page_dir));<br>> <br>> <br>> <br>> Regards,<br>> Oza.<br>> <br>> <br>> <br>> <br>> <br>> <br>> From: Dave Anderson <<a ymailto="mailto:anderson@redhat.com" href="mailto:anderson@redhat.com">anderson@redhat.com</a>><br>> To: paawan oza <<a ymailto="mailto:paawan1982@yahoo.com"
 href="mailto:paawan1982@yahoo.com">paawan1982@yahoo.com</a>><br>> Cc: "Discussion list for crash utility usage, maintenance and<br>> development" <<a ymailto="mailto:crash-utility@redhat.com" href="mailto:crash-utility@redhat.com">crash-utility@redhat.com</a>><br>> Sent: Tuesday, 14 August 2012 7:46 PM<br>> Subject: Re: [Crash-utility] using crash for ARM<br>> <br>> <br>> <br>> ----- Original Message -----<br>> > <br>> > <br>> > strings ./vmlinux | grep "Linux version"<br>> > Linux version 3.0.15+ (oza@lc-blr-291) (gcc version 4.4.3 (GCC) )<br>> > #4 PREEMPT Mon Aug 13 12:02:58 IST 2012<br>> > <br>> > cat /proc/version<br>> > Linux version 3.0.15+ (oza@lc-blr-291) (gcc version 4.4.3 (GCC) )<br>> > #4 PREEMPT Mon Aug 13 12:02:58 IST 2012<br>> <br>> Looks OK -- so you'll have to debug verify_namelist(). It does a<br>> popen("/usr/bin/strings ./vmlinux") and
 searches for the linux_banner<br>> string here:<br>> <br>> while (fgets(buffer, BUFSIZE-1, pipe)) {<br>> if (!strstr(buffer, "Linux version 2.") &&<br>> !strstr(buffer, "Linux version 3."))<br>> continue;<br>> <br>> and when it finds it, it picks out the gcc version number. I don't<br>> know why it's not working in your case.<br>> <br>> Also, since your vmlinux file is identical to /proc/version, why are<br>> you using a System.map argument again?<br>> <br>> > <br>> > crash> ptype struct kmem_cache<br>> > type = struct kmem_cache {<br>> > struct array_cache *array[1];<br>> > unsigned int batchcount;<br>> > unsigned int limit;<br>> > unsigned int shared;<br>> > unsigned int buffer_size;<br>> > u32 reciprocal_buffer_size;<br>> > unsigned int flags;<br>> > unsigned int num;<br>> > unsigned int gfporder;<br>> > gfp_t
 gfpflags;<br>> > size_t colour;<br>> > unsigned int colour_off;<br>> > struct kmem_cache *slabp_cache;<br>> > unsigned int slab_size;<br>> > unsigned int dflags;<br>> > void (*ctor)(void *);<br>> > const char *name;<br>> > struct list_head next;<br>> > struct kmem_list3 *nodelists[1];<br>> > }<br>> <br>> OK, in this case you'll have to debug get_array_length(), and figure<br>> out why it's not finding the lookfor2 string -- which should be set<br>> to "*array[" -- in the ptype command output. Again, I don't know<br>> why it's not finding it.<br>> <br>> Dave<br>> <br>> <br>> <br><br><br> </div> </div>  </div></body></html>