* [PATCH] powerpc/32s: Use relocation offset when setting early hash table
@ 2020-11-07 9:07 Christophe Leroy
2020-11-07 9:53 ` Serge Belyshev
2020-11-08 10:29 ` Michael Ellerman
0 siblings, 2 replies; 4+ messages in thread
From: Christophe Leroy @ 2020-11-07 9:07 UTC (permalink / raw)
To: Benjamin Herrenschmidt, Paul Mackerras, Michael Ellerman,
erhard_f, schwab
Cc: linuxppc-dev, linux-kernel
When calling early_hash_table(), the kernel hasn't been yet
relocated to its linking address, so data must be addressed
with relocation offset.
Add relocation offset to write into Hash in early_hash_table().
Reported-by: Erhard Furtner <erhard_f@mailbox.org>
Reported-by: Andreas Schwab <schwab@linux-m68k.org>
Fixes: 69a1593abdbc ("powerpc/32s: Setup the early hash table at all time.")
Signed-off-by: Christophe Leroy <christophe.leroy@csgroup.eu>
---
arch/powerpc/kernel/head_book3s_32.S | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/arch/powerpc/kernel/head_book3s_32.S b/arch/powerpc/kernel/head_book3s_32.S
index 5eb9eedac920..8aa7eb11754e 100644
--- a/arch/powerpc/kernel/head_book3s_32.S
+++ b/arch/powerpc/kernel/head_book3s_32.S
@@ -156,6 +156,7 @@ __after_mmu_off:
bl initial_bats
bl load_segment_registers
BEGIN_MMU_FTR_SECTION
+ bl reloc_offset
bl early_hash_table
END_MMU_FTR_SECTION_IFSET(MMU_FTR_HPTE_TABLE)
#if defined(CONFIG_BOOTX_TEXT)
@@ -932,7 +933,7 @@ early_hash_table:
ori r6, r6, 3 /* 256kB table */
mtspr SPRN_SDR1, r6
lis r6, early_hash@h
- lis r3, Hash@ha
+ addis r3, r3, Hash@ha
stw r6, Hash@l(r3)
blr
--
2.25.0
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] powerpc/32s: Use relocation offset when setting early hash table
2020-11-07 9:07 [PATCH] powerpc/32s: Use relocation offset when setting early hash table Christophe Leroy
@ 2020-11-07 9:53 ` Serge Belyshev
2020-11-07 13:24 ` Andreas Schwab
2020-11-08 10:29 ` Michael Ellerman
1 sibling, 1 reply; 4+ messages in thread
From: Serge Belyshev @ 2020-11-07 9:53 UTC (permalink / raw)
To: Christophe Leroy
Cc: erhard_f, linux-kernel, schwab, Paul Mackerras, linuxppc-dev
Christophe Leroy <christophe.leroy@csgroup.eu> writes:
> When calling early_hash_table(), the kernel hasn't been yet
> relocated to its linking address, so data must be addressed
> with relocation offset.
>
> Add relocation offset to write into Hash in early_hash_table().
>
> Reported-by: Erhard Furtner <erhard_f@mailbox.org>
> Reported-by: Andreas Schwab <schwab@linux-m68k.org>
> Fixes: 69a1593abdbc ("powerpc/32s: Setup the early hash table at all time.")
> Signed-off-by: Christophe Leroy <christophe.leroy@csgroup.eu>
Tested-by: Serge Belyshev <belyshev@depni.sinp.msu.ru>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] powerpc/32s: Use relocation offset when setting early hash table
2020-11-07 9:53 ` Serge Belyshev
@ 2020-11-07 13:24 ` Andreas Schwab
0 siblings, 0 replies; 4+ messages in thread
From: Andreas Schwab @ 2020-11-07 13:24 UTC (permalink / raw)
To: Serge Belyshev; +Cc: erhard_f, linux-kernel, Paul Mackerras, linuxppc-dev
On Nov 07 2020, Serge Belyshev wrote:
> Christophe Leroy <christophe.leroy@csgroup.eu> writes:
>
>> When calling early_hash_table(), the kernel hasn't been yet
>> relocated to its linking address, so data must be addressed
>> with relocation offset.
>>
>> Add relocation offset to write into Hash in early_hash_table().
>>
>> Reported-by: Erhard Furtner <erhard_f@mailbox.org>
>> Reported-by: Andreas Schwab <schwab@linux-m68k.org>
>> Fixes: 69a1593abdbc ("powerpc/32s: Setup the early hash table at all time.")
>> Signed-off-by: Christophe Leroy <christophe.leroy@csgroup.eu>
>
> Tested-by: Serge Belyshev <belyshev@depni.sinp.msu.ru>
Works here as well.
Thanks, Andreas.
--
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510 2552 DF73 E780 A9DA AEC1
"And now for something completely different."
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] powerpc/32s: Use relocation offset when setting early hash table
2020-11-07 9:07 [PATCH] powerpc/32s: Use relocation offset when setting early hash table Christophe Leroy
2020-11-07 9:53 ` Serge Belyshev
@ 2020-11-08 10:29 ` Michael Ellerman
1 sibling, 0 replies; 4+ messages in thread
From: Michael Ellerman @ 2020-11-08 10:29 UTC (permalink / raw)
To: Paul Mackerras, schwab, Benjamin Herrenschmidt, Christophe Leroy,
erhard_f, Michael Ellerman
Cc: linuxppc-dev, linux-kernel
On Sat, 7 Nov 2020 09:07:40 +0000 (UTC), Christophe Leroy wrote:
> When calling early_hash_table(), the kernel hasn't been yet
> relocated to its linking address, so data must be addressed
> with relocation offset.
>
> Add relocation offset to write into Hash in early_hash_table().
Applied to powerpc/fixes.
[1/1] powerpc/32s: Use relocation offset when setting early hash table
https://git.kernel.org/powerpc/c/01776f070ffcbf336be3bf1672bd3c589548d6c4
cheers
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2020-11-08 10:34 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-11-07 9:07 [PATCH] powerpc/32s: Use relocation offset when setting early hash table Christophe Leroy
2020-11-07 9:53 ` Serge Belyshev
2020-11-07 13:24 ` Andreas Schwab
2020-11-08 10:29 ` Michael Ellerman
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).