<html><body><div style="color:#000; background-color:#fff; font-family:times new roman, new york, times, serif;font-size:12pt">Hi,<br><br>I added the code, but I am still getting mismatch for following kernel virtual addresses.<br><ignore the text, its my writing, but adding below patch did not help ><br><br>looks like we have to check 20th bit and take it into consideration.<br><br>Physical address mismatch detected @ section @ vaddress :0xc0100000 and phy_addr : 0x82000000<br>corrupt page tables;invalid virtual address 0xC0100000<br>Physical address mismatch detected @ section @ vaddress :0xc0100004 and phy_addr : 0x82000004<br>corrupt page tables;invalid virtual address 0xC0100004<br>Physical address mismatch detected @ section @ vaddress :0xc0100008 and phy_addr : 0x82000008<br>corrupt page tables;invalid virtual address 0xC0100008<br>Physical address mismatch detected @ section @ vaddress :0xc010000c and phy_addr : 0x8200000C<br>corrupt page
 tables;invalid virtual address 0xC010000C<br>Physical address mismatch detected @ section @ vaddress :0xc0100010 and phy_addr : 0x82000010<br>corrupt page tables;invalid virtual address 0xC0100010<br>Physical address mismatch detected @ section @ vaddress :0xc0100014 and phy_addr : 0x82000014<br>corrupt page tables;invalid virtual address 0xC0100014<br>Physical address mismatch detected @ section @ vaddress :0xc0100018 and phy_addr : 0x82000018<br>corrupt page tables;invalid virtual address 0xC0100018<br>Physical address mismatch detected @ section @ vaddress :0xc010001c and phy_addr : 0x8200001C<br>corrupt page tables;invalid virtual address 0xC010001C<br>Physical address mismatch detected @ section @ vaddress :0xc0100020 and phy_addr : 0x82000020<br>corrupt page tables;invalid virtual address 0xC0100020<br>Physical address mismatch detected @ section @ vaddress :0xc0100024 and phy_addr : 0x82000024<br>corrupt page tables;invalid virtual address
 0xC0100024<br>Physical address mismatch detected @ section @ vaddress :0xc0100028 and phy_addr : 0x82000028<br>corrupt page tables;invalid virtual address 0xC0100028<br>Physical address mismatch detected @ section @ vaddress :0xc010002c and phy_addr : 0x8200002C<br>corrupt page tables;invalid virtual address 0xC010002C<br>Physical address mism<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> Rabin Vincent <rabin@rab.in><br> <b><span style="font-weight: bold;">To:</span></b> "Discussion list for crash utility usage, maintenance and development" <crash-utility@redhat.com> <br><b><span style="font-weight: bold;">Cc:</span></b> Thomas Fänge
 <thomas.fange@sonymobile.com> <br> <b><span style="font-weight: bold;">Sent:</span></b> Thursday, 4 October 2012 2:35 PM<br> <b><span style="font-weight: bold;">Subject:</span></b> Re: [Crash-utility] using crash for ARM<br> </font> </div> <br>2012/10/4 Mika Westerberg <<a ymailto="mailto:mika.westerberg@iki.fi" href="mailto:mika.westerberg@iki.fi">mika.westerberg@iki.fi</a>>:<br>> The unity-mapped region is mapped using 1MB pages. However, we actually have<br>> (when using the Linux ARM 2-level translation scheme):<br>><br>> see arch/arm/include/asm/pgtable-2level.h:<br>><br>> #define PMD_SHIFT               21<br>> #define PGDIR_SHIFT             21<br>><br>> #define PTRS_PER_PGD            2048<br>><br>> So we have 2048 entries in a PGD instead of 4096 making a PGD entry an array<br>> of "two
 pointers".<br>><br>> Anyway as you and Paawan suggested it looks like a bug - we always use the<br>> first entry instead of the second given that bit 20 is set in the virtual<br>> address.<br><br>Isn't the problem actually that we read the section entry wrong?<br>The following (and attached) is the fix I've been using for this.<br><br>Rabin<br><br>diff --git a/arm.c b/arm.c<br>index 5930c02..4e7b6dc 100644<br>--- a/arm.c<br>+++ b/arm.c<br>@@ -957,12 +957,14 @@ arm_vtop(ulong vaddr, ulong *pgd, physaddr_t<br>*paddr, int verbose)<br>             MKSTR((ulong)page_middle)), pmd_pte);<br><br>     if ((pmd_pte & PMD_TYPE_MASK) == PMD_TYPE_SECT) {<br>+        ulong sectionbase = pmd_pte & _SECTION_PAGE_MASK;<br>+<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>+                MKSTR(sectionbase)));<br>         }<br>-        *paddr = PAGEBASE(pmd_pte) + (vaddr & ~_SECTION_PAGE_MASK);<br>+        *paddr = sectionbase + (vaddr & ~_SECTION_PAGE_MASK);<br>         return TRUE;<br>     }<br><br>--<br>Crash-utility mailing list<br><a ymailto="mailto:Crash-utility@redhat.com" href="mailto:Crash-utility@redhat.com">Crash-utility@redhat.com</a><br><a href="https://www.redhat.com/mailman/listinfo/crash-utility"
 target="_blank">https://www.redhat.com/mailman/listinfo/crash-utility</a><br><br> </div> </div>  </div></body></html>