[Crash-utility] using crash for ARM

paawan oza paawan1982 at yahoo.com
Thu Oct 4 11:30:58 UTC 2012


Hi,

I added the code, but I am still getting mismatch for following kernel virtual addresses.
<ignore the text, its my writing, but adding below patch did not help >

looks like we have to check 20th bit and take it into consideration.

Physical address mismatch detected @ section @ vaddress :0xc0100000 and phy_addr : 0x82000000
corrupt page tables;invalid virtual address 0xC0100000
Physical address mismatch detected @ section @ vaddress :0xc0100004 and phy_addr : 0x82000004
corrupt page tables;invalid virtual address 0xC0100004
Physical address mismatch detected @ section @ vaddress :0xc0100008 and phy_addr : 0x82000008
corrupt page tables;invalid virtual address 0xC0100008
Physical address mismatch detected @ section @ vaddress :0xc010000c and phy_addr : 0x8200000C
corrupt page tables;invalid virtual address 0xC010000C
Physical address mismatch detected @ section @ vaddress :0xc0100010 and phy_addr : 0x82000010
corrupt page tables;invalid virtual address 0xC0100010
Physical address mismatch detected @ section @ vaddress :0xc0100014 and phy_addr : 0x82000014
corrupt page tables;invalid virtual address 0xC0100014
Physical address mismatch detected @ section @ vaddress :0xc0100018 and phy_addr : 0x82000018
corrupt page tables;invalid virtual address 0xC0100018
Physical address mismatch detected @ section @ vaddress :0xc010001c and phy_addr : 0x8200001C
corrupt page tables;invalid virtual address 0xC010001C
Physical address mismatch detected @ section @ vaddress :0xc0100020 and phy_addr : 0x82000020
corrupt page tables;invalid virtual address 0xC0100020
Physical address mismatch detected @ section @ vaddress :0xc0100024 and phy_addr : 0x82000024
corrupt page tables;invalid virtual address 0xC0100024
Physical address mismatch detected @ section @ vaddress :0xc0100028 and phy_addr : 0x82000028
corrupt page tables;invalid virtual address 0xC0100028
Physical address mismatch detected @ section @ vaddress :0xc010002c and phy_addr : 0x8200002C
corrupt page tables;invalid virtual address 0xC010002C
Physical address mism

Regards,
Oza.




________________________________
 From: Rabin Vincent <rabin at rab.in>
To: "Discussion list for crash utility usage, maintenance and development" <crash-utility at redhat.com> 
Cc: Thomas Fänge <thomas.fange at sonymobile.com> 
Sent: Thursday, 4 October 2012 2:35 PM
Subject: Re: [Crash-utility] using crash for ARM
 
2012/10/4 Mika Westerberg <mika.westerberg at iki.fi>:
> The unity-mapped region is mapped using 1MB pages. However, we actually have
> (when using the Linux ARM 2-level translation scheme):
>
> see arch/arm/include/asm/pgtable-2level.h:
>
> #define PMD_SHIFT               21
> #define PGDIR_SHIFT             21
>
> #define PTRS_PER_PGD            2048
>
> So we have 2048 entries in a PGD instead of 4096 making a PGD entry an array
> of "two pointers".
>
> Anyway as you and Paawan suggested it looks like a bug - we always use the
> first entry instead of the second given that bit 20 is set in the virtual
> address.

Isn't the problem actually that we read the section entry wrong?
The following (and attached) is the fix I've been using for this.

Rabin

diff --git a/arm.c b/arm.c
index 5930c02..4e7b6dc 100644
--- a/arm.c
+++ b/arm.c
@@ -957,12 +957,14 @@ arm_vtop(ulong vaddr, ulong *pgd, physaddr_t
*paddr, int verbose)
            MKSTR((ulong)page_middle)), pmd_pte);

    if ((pmd_pte & PMD_TYPE_MASK) == PMD_TYPE_SECT) {
+        ulong sectionbase = pmd_pte & _SECTION_PAGE_MASK;
+
        if (verbose) {
            fprintf(fp, " PAGE: %s  (1MB)\n\n",
                mkstring(buf, VADDR_PRLEN, RJUST | LONG_HEX,
-                MKSTR(PAGEBASE(pmd_pte))));
+                MKSTR(sectionbase)));
        }
-        *paddr = PAGEBASE(pmd_pte) + (vaddr & ~_SECTION_PAGE_MASK);
+        *paddr = sectionbase + (vaddr & ~_SECTION_PAGE_MASK);
        return TRUE;
    }

--
Crash-utility mailing list
Crash-utility at redhat.com
https://www.redhat.com/mailman/listinfo/crash-utility
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listman.redhat.com/archives/crash-utility/attachments/20121004/34dce20d/attachment.htm>


More information about the Crash-utility mailing list