All of lore.kernel.org
 help / color / mirror / Atom feed
From: Michael Ellerman <michael@ellerman.id.au>
To: Steffen Rumler <steffen.rumler.ext@nsn.com>
Cc: linuxppc-dev@lists.ozlabs.org
Subject: Re: kernel panic during kernel module load (powerpc specific part)
Date: Thu, 31 May 2012 09:24:02 +1000	[thread overview]
Message-ID: <1338420242.27402.2.camel@concordia> (raw)
In-Reply-To: <4FC62FB9.8010701@nsn.com>

On Wed, 2012-05-30 at 16:33 +0200, Steffen Rumler wrote:
> Hi,
> 
> The system crashes inside the return of the init entry point of the kernel module.
> 
> I've found the following root cause:
> 
>      (6) Unfortunately, the trampoline code (do_plt_call()) is using register r11 to setup the jump.
>            It looks like the prologue and epilogue are using also the register r11, in order to point to the previous stack frame.
>            This is a conflict !!! The trampoline code is damaging the content of r11.

Hi Steffen,

Great bug report!

I can't quite work out what the standards say, the versions I'm looking
at are probably old anyway.

Have you tried the obvious fix?

cheers


diff --git a/arch/powerpc/kernel/module_32.c b/arch/powerpc/kernel/module_32.c
index 0b6d796..989d79a 100644
--- a/arch/powerpc/kernel/module_32.c
+++ b/arch/powerpc/kernel/module_32.c
@@ -205,9 +205,9 @@ static uint32_t do_plt_call(void *location,
        }
 
        /* Stolen from Paul Mackerras as well... */
-       entry->jump[0] = 0x3d600000+((val+0x8000)>>16); /* lis r11,sym@ha */
-       entry->jump[1] = 0x396b0000 + (val&0xffff);     /* addi r11,r11,sym@l*/
-       entry->jump[2] = 0x7d6903a6;                    /* mtctr r11 */
+       entry->jump[0] = 0x3d800000+((val+0x8000)>>16); /* lis r12,sym@ha */
+       entry->jump[1] = 0x398c0000 + (val&0xffff);     /* addi r12,r12,sym@l*/
+       entry->jump[2] = 0x7d8903a6;                    /* mtctr r12 */
        entry->jump[3] = 0x4e800420;                    /* bctr */
 
        DEBUGP("Initialized plt for 0x%x at %p\n", val, entry);

  reply	other threads:[~2012-05-30 23:24 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-05-30 14:33 kernel panic during kernel module load (powerpc specific part) Steffen Rumler
2012-05-30 23:24 ` Michael Ellerman [this message]
2012-05-31  7:04   ` Wrobel Heinz-R39252
2012-05-31 11:04     ` Gabriel Paubert
2012-06-01  9:18       ` Benjamin Herrenschmidt
2012-06-01 11:33         ` Wrobel Heinz-R39252
2012-06-04  7:43           ` Steffen Rumler
2012-06-04 10:53             ` Paul Mackerras
2012-06-04 11:03           ` Gabriel Paubert
2012-06-04 22:00             ` Benjamin Herrenschmidt
2012-06-05 10:44               ` Gabriel Paubert
2012-06-05 22:47                 ` Benjamin Herrenschmidt
2012-06-05 11:32               ` Gabriel Paubert
2012-06-05 22:14                 ` Benjamin Herrenschmidt
2012-06-06  7:36             ` Steffen Rumler
2012-06-06 11:32               ` Benjamin Herrenschmidt
2012-06-06 14:37                 ` [PATCH] " Steffen Rumler
2012-06-21 15:27                   ` roger blofeld

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1338420242.27402.2.camel@concordia \
    --to=michael@ellerman.id.au \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=steffen.rumler.ext@nsn.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.