Hello, this patch introduces a kind of detection of PPC32 CPU type in attempt to determine the valid kvtop()/uvtop() addresses translation method. It also assumes that you have a quite recent 2.6 kernel, btw. Dmitry
diff -ur .orig-crash-4.0-3.20/defs.h crash-4.0-3.20/defs.h --- .orig-crash-4.0-3.20/defs.h 2007-02-21 23:52:01.000000000 +0300 +++ crash-4.0-3.20/defs.h 2007-02-22 16:16:41.000000000 +0300 @@ -3747,6 +3747,8 @@ #define display_idt_table() \ error(FATAL, "-d option is not applicable to PowerPC architecture\n") #define KSYMS_START (0x1) +/* This should match PPC_FEATURE_BOOKE from include/asm-powerpc/cputable.h */ +#define CPU_BOOKE (0x00008000) #endif /* diff -ur .orig-crash-4.0-3.20/ppc.c crash-4.0-3.20/ppc.c --- .orig-crash-4.0-3.20/ppc.c 2007-02-21 23:52:01.000000000 +0300 +++ crash-4.0-3.20/ppc.c 2007-02-22 16:21:32.000000000 +0300 @@ -51,6 +51,9 @@ void ppc_init(int when) { + target_uint cpu_features; + target_ptr cur_cpu_spec; + switch (when) { case PRE_SYMTAB: @@ -140,6 +143,13 @@ if (THIS_KERNEL_VERSION >= LINUX(2,6,0)) machdep->hz = 1000; } + if (symbol_exists("cur_cpu_spec")) { + get_symbol_ptr("cur_cpu_spec", &cur_cpu_spec); + readmem_uint(cur_cpu_spec + MEMBER_OFFSET("cpu_spec", "cpu_user_features"), + KVADDR, &cpu_features, "cpu user features", FAULT_ON_ERROR); + if (cpu_features & CPU_BOOKE) + machdep->flags |= CPU_BOOKE; + } machdep->section_size_bits = _SECTION_SIZE_BITS; machdep->max_physmem_bits = _MAX_PHYSMEM_BITS; break; @@ -285,7 +295,11 @@ page_middle = (ulong *)pgd_pte; - page_table = page_middle + (BTOP(vaddr) & (PTRS_PER_PTE - 1)); + if (machdep->flags & CPU_BOOKE) + page_table = page_middle + (BTOP(vaddr) & (PTRS_PER_PTE - 1)); + else + page_table = ((page_middle & machdep->pagemask) + machdep->kvbase) + + (BTOP(vaddr) & (PTRS_PER_PTE-1)); if (verbose) fprintf(fp, " PMD: %lx => %lx\n",(ulong)page_middle, @@ -369,7 +383,11 @@ page_middle = (ulong *)pgd_pte; - page_table = page_middle + (BTOP(kvaddr) & (PTRS_PER_PTE-1)); + if (machdep->flags & CPU_BOOKE) + page_table = page_middle + (BTOP(kvaddr) & (PTRS_PER_PTE - 1)); + else + page_table = ((page_middle & machdep->pagemask) + machdep->kvbase) + + (BTOP(kvaddr) & (PTRS_PER_PTE-1)); if (verbose) fprintf(fp, " PMD: %lx => %lx\n", (ulong)page_middle,
-- Crash-utility mailing list Crash-utility@xxxxxxxxxx https://www.redhat.com/mailman/listinfo/crash-utility