Skip to contentSkip to conversation

riscv: hibernation: Replace jalr with jr before suspend_restore_regs

PATCH Applied Song Shuai 4 participants 5 messages May 19, 2023 – Jun 20, 2023 RISC-V

lore
Share & tools
lore

Song Shuai

author
#0 lore raw

PATCH 1/1 riscv: hibernation: Replace jalr with jr before suspend_restore_regs

No need to link the x1/ra reg via jalr before suspend_restore_regs So it's better to replace jalr with jr.

---
 arch/riscv/kernel/hibernate-asm.S | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
arch/riscv/kernel/hibernate-asm.S +2 -2
index effaf5ca5da0..5c76671c7e15 100644
@@ -50,7 +50,7 @@ ENTRY(hibernate_restore_image)
 	REG_L	s4, restore_pblist
 	REG_L	a1, relocated_restore_code
 
-	jalr	a1
+	jr	a1
 END(hibernate_restore_image)
 
 /*
@@ -73,5 +73,5 @@ ENTRY(hibernate_core_restore_code)
 	REG_L	s4, HIBERN_PBE_NEXT(s4)
 	bnez	s4, .Lcopy
 
-	jalr	s2
+	jr	s2
 END(hibernate_core_restore_code)
Signature · 1 line
2.20.1
#1 lore raw

looks good to me.

Thanks
Regards
Jee Heng

Quoted 30 lines

-----Original Message-----
From: Song Shuai <[email protected]>
Sent: Friday, May 19, 2023 2:09 PM
To: [email protected]; [email protected]; [email protected]; JeeHeng Sia <[email protected]>; Mason Huo <[email protected]>; [email protected]
Cc: [email protected]; [email protected]; Song Shuai <[email protected]>
Subject: [PATCH] riscv: hibernation: Replace jalr with jr before suspend_restore_regs

No need to link the x1/ra reg via jalr before suspend_restore_regs So it's better to replace jalr with jr.

---
 arch/riscv/kernel/hibernate-asm.S | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
arch/riscv/kernel/hibernate-asm.S +1 -1
index effaf5ca5da0..5c76671c7e15 100644
@@ -50,7 +50,7 @@ ENTRY(hibernate_restore_image)
 	REG_L	s4, restore_pblist
 	REG_L	a1, relocated_restore_code
 
-	jalr	a1
+	jr	a1
 END(hibernate_restore_image)
 
 /*

arch/riscv/kernel/hibernate-asm.S ENTRY(hibernate_core_restore_code) · line 76

Quoted 5 lines
arch/riscv/kernel/hibernate-asm.S +1 -1
@@ -73,5 +73,5 @@ ENTRY(hibernate_core_restore_code)
 	REG_L	s4, HIBERN_PBE_NEXT(s4)
 	bnez	s4, .Lcopy
 
-	jalr	s2
+	jr	s2

I am content with these changes, as they do not involve a return after the jump

Quoted 3 lines
arch/riscv/kernel/hibernate-asm.S +0 -1
 END(hibernate_core_restore_code)
--

2.20.1

Reviewed-by
#2 lore raw
Quoted 44 lines

-----Original Message-----
From: JeeHeng Sia
Sent: Friday, May 19, 2023 6:45 PM
To: 'Song Shuai' <[email protected]>; [email protected]; [email protected]; [email protected]; Mason Huo <[email protected]>; [email protected]
Cc: [email protected]; [email protected]
Subject: RE: [PATCH] riscv: hibernation: Replace jalr with jr before suspend_restore_regs

looks good to me.

Thanks
Regards
Jee Heng

Quoted 4 lines

-----Original Message-----
From: Song Shuai <[email protected]>
Sent: Friday, May 19, 2023 2:09 PM
To: [email protected]; [email protected]; [email protected]; JeeHeng Sia <[email protected]>;

Mason

Quoted 24 lines

Huo <[email protected]>; [email protected]
Cc: [email protected]; [email protected]; Song Shuai <[email protected]>
Subject: [PATCH] riscv: hibernation: Replace jalr with jr before suspend_restore_regs

No need to link the x1/ra reg via jalr before suspend_restore_regs So it's better to replace jalr with jr.

---
 arch/riscv/kernel/hibernate-asm.S | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
arch/riscv/kernel/hibernate-asm.S +1 -1
index effaf5ca5da0..5c76671c7e15 100644
@@ -50,7 +50,7 @@ ENTRY(hibernate_restore_image)
 	REG_L	s4, restore_pblist
 	REG_L	a1, relocated_restore_code
 
-	jalr	a1
+	jr	a1
 END(hibernate_restore_image)
 
Quoted 8 lines

arch/riscv/kernel/hibernate-asm.S ENTRY(hibernate_core_restore_code) · line 76

Quoted 7 lines
arch/riscv/kernel/hibernate-asm.S +1 -1
 /*
@@ -73,5 +73,5 @@ ENTRY(hibernate_core_restore_code)
 	REG_L	s4, HIBERN_PBE_NEXT(s4)
 	bnez	s4, .Lcopy
 
-	jalr	s2
+	jr	s2

I am content with these changes, as they do not involve a return after the jump

Thanks
Regards
Jee Heng

Quoted 3 lines
Quoted 3 lines
arch/riscv/kernel/hibernate-asm.S +0 -1
 END(hibernate_core_restore_code)
--

2.20.1

#4 lore raw
In reply to Song Shuai
This patch was applied to riscv/linux.git (for-next) by Palmer Dabbelt <[email protected]>:

Hello:

This patch was applied to riscv/linux.git (for-next) by Palmer Dabbelt <[email protected]>:

Quoted 7 lines · On Fri, 19 May 2023 14:08:54 +0800 you wrote:

No need to link the x1/ra reg via jalr before suspend_restore_regs So it's better to replace jalr with jr.

---
 arch/riscv/kernel/hibernate-asm.S | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Here is the summary with links:
- riscv: hibernation: Replace jalr with jr before suspend_restore_regs

    https://git.kernel.org/riscv/c/650ea2a1dd96

You are awesome, thank you!

Signature · 2 lines
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html