Linux MIPS Architecture development
 help / color / mirror / Atom feed
From: tsbogend@alpha.franken.de (Thomas Bogendoerfer)
To: Ralf Baechle <ralf@linux-mips.org>
Cc: Kumba <kumba@gentoo.org>, linux-mips@linux-mips.org
Subject: Re: IP22 64bit kernel
Date: Thu, 13 Sep 2007 20:23:48 +0200	[thread overview]
Message-ID: <20070913182348.GA11473@alpha.franken.de> (raw)
In-Reply-To: <20070913155059.GA8790@linux-mips.org>

On Thu, Sep 13, 2007 at 04:50:59PM +0100, Ralf Baechle wrote:
> The problem isn't limited to ARC firmware; basically any non-R8000 64-bit
> system can be affected.  A kernel may be using either addresses in XKPHYS
> or in CKSEG0 and the segment for which the kernel is linked is not
> necessarily the same that the firmware will load it to.

here is a patch:

Always jump to the place where the kernel is linked to. This helps
where the bootloaders/proms ignores the start address inside the ELF
header.

Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
---

diff --git a/arch/mips/kernel/head.S b/arch/mips/kernel/head.S
index e46782b..80d0ab9 100644
--- a/arch/mips/kernel/head.S
+++ b/arch/mips/kernel/head.S
@@ -27,16 +27,6 @@
 
 #include <kernel-entry-init.h>
 
-	.macro	ARC64_TWIDDLE_PC
-#if defined(CONFIG_ARC64) || defined(CONFIG_MAPPED_KERNEL)
-	/* We get launched at a XKPHYS address but the kernel is linked to
-	   run at a KSEG0 address, so jump there.  */
-	PTR_LA	t0, \@f
-	jr	t0
-\@:
-#endif
-	.endm
-
 	/*
 	 * inputs are the text nasid in t1, data nasid in t2.
 	 */
@@ -155,7 +145,11 @@ NESTED(kernel_entry, 16, sp)			# kernel entry point
 
 	setup_c0_status_pri
 
-	ARC64_TWIDDLE_PC
+	/* We might not get launched at the address the kernel is linked to,
+	   so we jump there.  */
+	PTR_LA	t0, 0f
+	jr	t0
+0:
 
 #ifdef CONFIG_MIPS_MT_SMTC
 	/*

-- 
Crap can work. Given enough thrust pigs will fly, but it's not necessary a
good idea.                                                [ RFC1925, 2.3 ]

  reply	other threads:[~2007-09-13 18:24 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-09-11 21:30 IP22 64bit kernel Thomas Bogendoerfer
2007-09-12 23:15 ` Ralf Baechle
2007-09-13  7:05 ` Kumba
2007-09-13 15:50   ` Ralf Baechle
2007-09-13 18:23     ` Thomas Bogendoerfer [this message]
2007-10-17 18:36       ` Ralf Baechle

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=20070913182348.GA11473@alpha.franken.de \
    --to=tsbogend@alpha.franken.de \
    --cc=kumba@gentoo.org \
    --cc=linux-mips@linux-mips.org \
    --cc=ralf@linux-mips.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox