[PATCH 8/8] powerpc: last bits to support kdump on ppc32

Michael Ellerman michael at ellerman.id.au
Mon Aug 4 00:40:43 EST 2008


On Fri, 2008-08-01 at 18:14 +0400, Anton Vorontsov wrote:
> From: Dale Farnsworth <dale at farnsworth.org>
> 
> Wire up the trampoline code for ppc32 to relay exceptions from the
> vectors at address 0 to vectors at address 32MB, and modify Kconfig
> to enable Kdump support for all powerpcs (except BookE, for now).
> 
> Signed-off-by: Dale Farnsworth <dale at farnsworth.org>
> Signed-off-by: Anton Vorontsov <avorontsov at ru.mvista.com>

> diff --git a/arch/powerpc/kernel/crash_dump.c b/arch/powerpc/kernel/crash_dump.c
> index e0debcc..96cd521 100644
> --- a/arch/powerpc/kernel/crash_dump.c
> +++ b/arch/powerpc/kernel/crash_dump.c
> @@ -34,7 +34,11 @@ void __init reserve_kdump_trampoline(void)
>  
>  static void __init create_trampoline(unsigned long addr)
>  {
> -	unsigned int *p = (unsigned int *)addr;
> +	unsigned int *p;
> +
> +	/* XXX: why this code is working without += PAGE_OFFSET on PPC64? */
> +	addr += PAGE_OFFSET;
> +	p = (unsigned int *)addr;

Because we're still in real mode when we call it.

It's kind of funny that it works on 32-bit as well. You're creating a
branch from 0xc0000000 to 0xc2000000, and then expecting it to work when
you're in real mode and you actually want to jump from 0x0 to 0x2000000
- luckily it's a relative branch :)

To clean this up you should just be able to change the definitions for
KDUMP_TRAMPOLINE_START/END to include PAGE_OFFSET and that should work
for 32 & 64-bit.

cheers

-- 
Michael Ellerman
OzLabs, IBM Australia Development Lab

wwweb: http://michael.ellerman.id.au
phone: +61 2 6212 1183 (tie line 70 21183)

We do not inherit the earth from our ancestors,
we borrow it from our children. - S.M.A.R.T Person
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
URL: <http://lists.ozlabs.org/pipermail/linuxppc-dev/attachments/20080804/e1d71907/attachment.pgp>


More information about the Linuxppc-dev mailing list