[Crash-utility] crash version 4.0-3.21 is available

Dmitry Antipov antipov at ru.mvista.com
Mon Mar 19 16:35:47 UTC 2007


Dave Anderson wrote:

> Bernhard Walle wrote:
> 
>> * Dave Anderson <anderson at redhat.com> [2007-03-16 21:29]:
>>> - In current 2.6 kernels, it is now possible to recognize ppc BOOKE
>>>   processors, which is the current default in crash.  If the processor
>>>   is confirmed to not be BOOKE, then page table translation is done
>>>   differently.  (antipov at ru.mvista.com)
>> The current code doesn't build on PPC32. Follwing patch fixes the
>> problem. However, I consider the patch as evil, so maybe it would be
>> better to change some data types that are involved here, but I don't
>> really know.
>>
> 
> Figures...  I took that patch on blind faith since I don't have
> any 32-bit ppc hardware to compile it on, never mind test it:
> 
>   https://www.redhat.com/archives/crash-utility/2007-March/msg00020.html
> 
> Anyway, I'll still defer to the MontaVista guys to come up with
> a patch that they can confirm works -- and that compiles, please...

Argh, I've broke the build :-(. What a silly error :-((.
But, it may be better to avoid conversion to long long and back, like
the following:

--- .orig-ppc.c 2007-03-16 22:35:05.000000000 +0300
+++ ppc.c       2007-03-19 19:23:48.000000000 +0300
@@ -301,8 +301,8 @@
         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));
+               page_table = (ulong *)(((pgd_pte & (ulong)machdep->pagemask) + machdep->kvbase) +
+                                      ((ulong)BTOP(vaddr) & (PTRS_PER_PTE-1)));

         if (verbose)
                 fprintf(fp, "  PMD: %lx => %lx\n",(ulong)page_middle,
@@ -389,8 +389,8 @@
         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));
+               page_table = (ulong *)(((pgd_pte & (ulong)machdep->pagemask) + machdep->kvbase) +
+                                      ((ulong)BTOP(kvaddr) & (PTRS_PER_PTE-1)));

         if (verbose)
                 fprintf(fp, "  PMD: %lx => %lx\n", (ulong)page_middle,

But I should check that we didn't loss anything while doing the conversion.

Dmitry




More information about the Crash-utility mailing list