linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] powerpc/64: Fix build failure with allyesconfig in book3s_64_entry.S
@ 2022-03-27  7:32 Christophe Leroy
  2022-03-29  8:22 ` Nicholas Piggin
  2022-04-10 12:27 ` Michael Ellerman
  0 siblings, 2 replies; 3+ messages in thread
From: Christophe Leroy @ 2022-03-27  7:32 UTC (permalink / raw)
  To: Benjamin Herrenschmidt, Paul Mackerras, Michael Ellerman
  Cc: Christophe Leroy, linux-kernel, linuxppc-dev, Nicholas Piggin

Using conditional branches between two files is hasardous,
they may get linked to far from each other.

	arch/powerpc/kvm/book3s_64_entry.o:(.text+0x3ec): relocation truncated
	to fit: R_PPC64_REL14 (stub) against symbol `system_reset_common'
	defined in .text section in arch/powerpc/kernel/head_64.o

Reorganise the code to use non conditional branches.

Cc: Nicholas Piggin <npiggin@gmail.com>
Fixes: 89d35b239101 ("KVM: PPC: Book3S HV P9: Implement the rest of the P9 path in C")
Signed-off-by: Christophe Leroy <christophe.leroy@csgroup.eu>
---
 arch/powerpc/kvm/book3s_64_entry.S | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/arch/powerpc/kvm/book3s_64_entry.S b/arch/powerpc/kvm/book3s_64_entry.S
index 05e003eb5d90..99fa36df36fa 100644
--- a/arch/powerpc/kvm/book3s_64_entry.S
+++ b/arch/powerpc/kvm/book3s_64_entry.S
@@ -414,10 +414,11 @@ END_FTR_SECTION_IFSET(CPU_FTR_DAWR1)
 	 */
 	ld	r10,HSTATE_SCRATCH0(r13)
 	cmpwi	r10,BOOK3S_INTERRUPT_MACHINE_CHECK
-	beq	machine_check_common
+	beq	1f
 
 	cmpwi	r10,BOOK3S_INTERRUPT_SYSTEM_RESET
-	beq	system_reset_common
+	bne	.
 
-	b	.
+	b	system_reset_common
+1:	b	machine_check_common
 #endif
-- 
2.35.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] powerpc/64: Fix build failure with allyesconfig in book3s_64_entry.S
  2022-03-27  7:32 [PATCH] powerpc/64: Fix build failure with allyesconfig in book3s_64_entry.S Christophe Leroy
@ 2022-03-29  8:22 ` Nicholas Piggin
  2022-04-10 12:27 ` Michael Ellerman
  1 sibling, 0 replies; 3+ messages in thread
From: Nicholas Piggin @ 2022-03-29  8:22 UTC (permalink / raw)
  To: Benjamin Herrenschmidt, Christophe Leroy, Michael Ellerman,
	Paul Mackerras
  Cc: linux-kernel, linuxppc-dev

Excerpts from Christophe Leroy's message of March 27, 2022 5:32 pm:
> Using conditional branches between two files is hasardous,
> they may get linked to far from each other.
> 
> 	arch/powerpc/kvm/book3s_64_entry.o:(.text+0x3ec): relocation truncated
> 	to fit: R_PPC64_REL14 (stub) against symbol `system_reset_common'
> 	defined in .text section in arch/powerpc/kernel/head_64.o
> 
> Reorganise the code to use non conditional branches.

Thanks for the fix, I agree this is better.

Reviewed-by: Nicholas Piggin <npiggin@gmail.com>

> 
> Cc: Nicholas Piggin <npiggin@gmail.com>
> Fixes: 89d35b239101 ("KVM: PPC: Book3S HV P9: Implement the rest of the P9 path in C")
> Signed-off-by: Christophe Leroy <christophe.leroy@csgroup.eu>
> ---
>  arch/powerpc/kvm/book3s_64_entry.S | 7 ++++---
>  1 file changed, 4 insertions(+), 3 deletions(-)
> 
> diff --git a/arch/powerpc/kvm/book3s_64_entry.S b/arch/powerpc/kvm/book3s_64_entry.S
> index 05e003eb5d90..99fa36df36fa 100644
> --- a/arch/powerpc/kvm/book3s_64_entry.S
> +++ b/arch/powerpc/kvm/book3s_64_entry.S
> @@ -414,10 +414,11 @@ END_FTR_SECTION_IFSET(CPU_FTR_DAWR1)
>  	 */
>  	ld	r10,HSTATE_SCRATCH0(r13)
>  	cmpwi	r10,BOOK3S_INTERRUPT_MACHINE_CHECK
> -	beq	machine_check_common
> +	beq	1f
>  
>  	cmpwi	r10,BOOK3S_INTERRUPT_SYSTEM_RESET
> -	beq	system_reset_common
> +	bne	.
>  
> -	b	.
> +	b	system_reset_common
> +1:	b	machine_check_common
>  #endif
> -- 
> 2.35.1
> 
> 

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] powerpc/64: Fix build failure with allyesconfig in book3s_64_entry.S
  2022-03-27  7:32 [PATCH] powerpc/64: Fix build failure with allyesconfig in book3s_64_entry.S Christophe Leroy
  2022-03-29  8:22 ` Nicholas Piggin
@ 2022-04-10 12:27 ` Michael Ellerman
  1 sibling, 0 replies; 3+ messages in thread
From: Michael Ellerman @ 2022-04-10 12:27 UTC (permalink / raw)
  To: Michael Ellerman, Benjamin Herrenschmidt, Christophe Leroy,
	Paul Mackerras
  Cc: linuxppc-dev, Nicholas Piggin, linux-kernel

On Sun, 27 Mar 2022 09:32:26 +0200, Christophe Leroy wrote:
> Using conditional branches between two files is hasardous,
> they may get linked to far from each other.
> 
> 	arch/powerpc/kvm/book3s_64_entry.o:(.text+0x3ec): relocation truncated
> 	to fit: R_PPC64_REL14 (stub) against symbol `system_reset_common'
> 	defined in .text section in arch/powerpc/kernel/head_64.o
> 
> [...]

Applied to powerpc/fixes.

[1/1] powerpc/64: Fix build failure with allyesconfig in book3s_64_entry.S
      https://git.kernel.org/powerpc/c/af41d2866f7d75bbb38d487f6ec7770425d70e45

cheers

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-04-10 12:28 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-03-27  7:32 [PATCH] powerpc/64: Fix build failure with allyesconfig in book3s_64_entry.S Christophe Leroy
2022-03-29  8:22 ` Nicholas Piggin
2022-04-10 12:27 ` 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).