diff mbox

[1/9] powerpc/64s: Remove unnecessary relocation branch from idle handler

Message ID 20170419130551.32378-2-npiggin@gmail.com (mailing list archive)
State Accepted
Commit 2563a70c3b2acc4f60083e2aaf1102f8dba73649
Headers show

Commit Message

Nicholas Piggin April 19, 2017, 1:05 p.m. UTC
The system reset idle handler system_reset_idle_common is relocated, so
relocation is not required to branch to kvm_start_guest. The superfluous
relocation does not result in incorrect code, but it does not compile
outside of exception-64s.S (with fixed section definitions).

Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
---
 arch/powerpc/include/asm/exception-64s.h | 8 --------
 arch/powerpc/kernel/exceptions-64s.S     | 2 +-
 2 files changed, 1 insertion(+), 9 deletions(-)

Comments

Michael Ellerman April 23, 2017, 11:53 a.m. UTC | #1
On Wed, 2017-04-19 at 13:05:43 UTC, Nicholas Piggin wrote:
> The system reset idle handler system_reset_idle_common is relocated, so
> relocation is not required to branch to kvm_start_guest. The superfluous
> relocation does not result in incorrect code, but it does not compile
> outside of exception-64s.S (with fixed section definitions).
> 
> Signed-off-by: Nicholas Piggin <npiggin@gmail.com>

Series applied to powerpc next, thanks.

https://git.kernel.org/powerpc/c/2563a70c3b2acc4f60083e2aaf1102

cheers
diff mbox

Patch

diff --git a/arch/powerpc/include/asm/exception-64s.h b/arch/powerpc/include/asm/exception-64s.h
index 14752eee3d0c..ee21457e23d4 100644
--- a/arch/powerpc/include/asm/exception-64s.h
+++ b/arch/powerpc/include/asm/exception-64s.h
@@ -256,11 +256,6 @@  END_FTR_SECTION_NESTED(ftr,ftr,943)
 	ld	r9,area+EX_R9(r13);					\
 	bctr
 
-#define BRANCH_TO_KVM(reg, label)					\
-	__LOAD_FAR_HANDLER(reg, label);					\
-	mtctr	reg;							\
-	bctr
-
 #else
 #define BRANCH_TO_COMMON(reg, label)					\
 	b	label
@@ -268,9 +263,6 @@  END_FTR_SECTION_NESTED(ftr,ftr,943)
 #define BRANCH_LINK_TO_FAR(reg, label)					\
 	bl	label
 
-#define BRANCH_TO_KVM(reg, label)					\
-	b	label
-
 #define __BRANCH_TO_KVM_EXIT(area, label)				\
 	ld	r9,area+EX_R9(r13);					\
 	b	label
diff --git a/arch/powerpc/kernel/exceptions-64s.S b/arch/powerpc/kernel/exceptions-64s.S
index 857bf7c5b946..7d496ee984fe 100644
--- a/arch/powerpc/kernel/exceptions-64s.S
+++ b/arch/powerpc/kernel/exceptions-64s.S
@@ -142,7 +142,7 @@  END_FTR_SECTION_IFCLR(CPU_FTR_ARCH_300)
 	lbz	r0,HSTATE_HWTHREAD_REQ(r13)
 	cmpwi	r0,0
 	beq	1f
-	BRANCH_TO_KVM(r10, kvm_start_guest)
+	b	kvm_start_guest
 1:
 #endif