* [PATCH] powerpc: Fix dynamic relocation
@ 2013-03-09 1:02 Alexander Graf
2013-03-09 7:29 ` Benjamin Herrenschmidt
[not found] ` <1362814152.6977.32.camel__2059.78525705195$1362814216$gmane$org@pasglop>
0 siblings, 2 replies; 4+ messages in thread
From: Alexander Graf @ 2013-03-09 1:02 UTC (permalink / raw)
To: linuxppc-dev; +Cc: Anton Blanchard
Commit 5ac47f7a introduced dynamic relocation of code by manually
relocating TOC entries. However, we need to access the TOC using
the physical address that we have for it, not the virtual address
that we can't even access yet.
Drop the offset from the TOC accessing pointer.
This fixes Linux 3.9 booting on OpenBIOS for me.
Signed-off-by: Alexander Graf <agraf@suse.de>
---
I've also encountered breakage on a G5 Mac, not sure if it's related.
I'll have to test whether this is the culprit on that one too.
Ben, please make sure that this gets into 3.9.
---
arch/powerpc/kernel/prom_init.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/arch/powerpc/kernel/prom_init.c b/arch/powerpc/kernel/prom_init.c
index 7f7fb7f..2bf7cc3 100644
--- a/arch/powerpc/kernel/prom_init.c
+++ b/arch/powerpc/kernel/prom_init.c
@@ -2851,7 +2851,7 @@ static void reloc_toc(void)
(__prom_init_toc_end - __prom_init_toc_start) / sizeof(long);
/* Need to add offset to get at __prom_init_toc_start */
- __reloc_toc(__prom_init_toc_start + offset, offset, nr_entries);
+ __reloc_toc(__prom_init_toc_start, offset, nr_entries);
mb();
}
--
1.6.0.2
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] powerpc: Fix dynamic relocation
2013-03-09 1:02 [PATCH] powerpc: Fix dynamic relocation Alexander Graf
@ 2013-03-09 7:29 ` Benjamin Herrenschmidt
2013-03-09 10:12 ` Alexander Graf
[not found] ` <1362814152.6977.32.camel__2059.78525705195$1362814216$gmane$org@pasglop>
1 sibling, 1 reply; 4+ messages in thread
From: Benjamin Herrenschmidt @ 2013-03-09 7:29 UTC (permalink / raw)
To: Alexander Graf; +Cc: linuxppc-dev, Anton Blanchard
On Sat, 2013-03-09 at 02:02 +0100, Alexander Graf wrote:
> Commit 5ac47f7a introduced dynamic relocation of code by manually
> relocating TOC entries. However, we need to access the TOC using
> the physical address that we have for it, not the virtual address
> that we can't even access yet.
>
> Drop the offset from the TOC accessing pointer.
>
> This fixes Linux 3.9 booting on OpenBIOS for me.
>
> Signed-off-by: Alexander Graf <agraf@suse.de>
>
> ---
>
> I've also encountered breakage on a G5 Mac, not sure if it's related.
> I'll have to test whether this is the culprit on that one too.
That might fix the mac too.. Anton's patch assumed OF ran in real mode
in which case the top bits of the address are ignored, meaning we could
use kernel virtual addresses but that isn't the case with Apple OF which
has MMU enabled and maps memory 1:1. I suppose OpenBIOS has the same
problem ? Or is this a 32-bit issue as well ?
> Ben, please make sure that this gets into 3.9.
> ---
> arch/powerpc/kernel/prom_init.c | 2 +-
> 1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/arch/powerpc/kernel/prom_init.c b/arch/powerpc/kernel/prom_init.c
> index 7f7fb7f..2bf7cc3 100644
> --- a/arch/powerpc/kernel/prom_init.c
> +++ b/arch/powerpc/kernel/prom_init.c
> @@ -2851,7 +2851,7 @@ static void reloc_toc(void)
> (__prom_init_toc_end - __prom_init_toc_start) / sizeof(long);
>
> /* Need to add offset to get at __prom_init_toc_start */
> - __reloc_toc(__prom_init_toc_start + offset, offset, nr_entries);
> + __reloc_toc(__prom_init_toc_start, offset, nr_entries);
>
> mb();
> }
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] powerpc: Fix dynamic relocation
[not found] ` <1362814152.6977.32.camel__2059.78525705195$1362814216$gmane$org@pasglop>
@ 2013-03-09 9:30 ` Andreas Schwab
0 siblings, 0 replies; 4+ messages in thread
From: Andreas Schwab @ 2013-03-09 9:30 UTC (permalink / raw)
To: Benjamin Herrenschmidt; +Cc: linuxppc-dev, Alexander Graf, Anton Blanchard
Benjamin Herrenschmidt <benh@kernel.crashing.org> writes:
> That might fix the mac too..
It does.
Andreas.
--
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5
"And now for something completely different."
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] powerpc: Fix dynamic relocation
2013-03-09 7:29 ` Benjamin Herrenschmidt
@ 2013-03-09 10:12 ` Alexander Graf
0 siblings, 0 replies; 4+ messages in thread
From: Alexander Graf @ 2013-03-09 10:12 UTC (permalink / raw)
To: Benjamin Herrenschmidt; +Cc: linuxppc-dev@lists.ozlabs.org, Anton Blanchard
Am 09.03.2013 um 08:29 schrieb Benjamin Herrenschmidt <benh@kernel.crashing.=
org>:
> On Sat, 2013-03-09 at 02:02 +0100, Alexander Graf wrote:
>> Commit 5ac47f7a introduced dynamic relocation of code by manually
>> relocating TOC entries. However, we need to access the TOC using
>> the physical address that we have for it, not the virtual address
>> that we can't even access yet.
>>=20
>> Drop the offset from the TOC accessing pointer.
>>=20
>> This fixes Linux 3.9 booting on OpenBIOS for me.
>>=20
>> Signed-off-by: Alexander Graf <agraf@suse.de>
>>=20
>> ---
>>=20
>> I've also encountered breakage on a G5 Mac, not sure if it's related.
>> I'll have to test whether this is the culprit on that one too.
>=20
> That might fix the mac too.. Anton's patch assumed OF ran in real mode
> in which case the top bits of the address are ignored, meaning we could
> use kernel virtual addresses but that isn't the case with Apple OF which
> has MMU enabled and maps memory 1:1. I suppose OpenBIOS has the same
> problem ? Or is this a 32-bit issue as well ?
That's exactly what OpenBIOS does, yes :).
Alex
>=20
>> Ben, please make sure that this gets into 3.9.
>> ---
>> arch/powerpc/kernel/prom_init.c | 2 +-
>> 1 files changed, 1 insertions(+), 1 deletions(-)
>>=20
>> diff --git a/arch/powerpc/kernel/prom_init.c b/arch/powerpc/kernel/prom_i=
nit.c
>> index 7f7fb7f..2bf7cc3 100644
>> --- a/arch/powerpc/kernel/prom_init.c
>> +++ b/arch/powerpc/kernel/prom_init.c
>> @@ -2851,7 +2851,7 @@ static void reloc_toc(void)
>> (__prom_init_toc_end - __prom_init_toc_start) / sizeof(long);
>>=20
>> /* Need to add offset to get at __prom_init_toc_start */
>> - __reloc_toc(__prom_init_toc_start + offset, offset, nr_entries);
>> + __reloc_toc(__prom_init_toc_start, offset, nr_entries);
>>=20
>> mb();
>> }
>=20
>=20
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2013-03-09 10:12 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-03-09 1:02 [PATCH] powerpc: Fix dynamic relocation Alexander Graf
2013-03-09 7:29 ` Benjamin Herrenschmidt
2013-03-09 10:12 ` Alexander Graf
[not found] ` <1362814152.6977.32.camel__2059.78525705195$1362814216$gmane$org@pasglop>
2013-03-09 9:30 ` Andreas Schwab
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).