public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] riscv: remove redundant mv instructions
@ 2023-07-25  5:38 Nam Cao
  2023-07-25  8:01 ` Alexandre Ghiti
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Nam Cao @ 2023-07-25  5:38 UTC (permalink / raw)
  To: Paul Walmsley, Palmer Dabbelt, Albert Ou, linux-riscv,
	linux-kernel; +Cc: Nam Cao

Some mv instructions were useful when first introduced to preserve a0 and
a1 before function calls. However the code has changed and they are now
redundant. Remove them.

Signed-off-by: Nam Cao <namcaov@gmail.com>
---
 arch/riscv/kernel/head.S | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)

diff --git a/arch/riscv/kernel/head.S b/arch/riscv/kernel/head.S
index 11c3b94c4534..3710ea5d160f 100644
--- a/arch/riscv/kernel/head.S
+++ b/arch/riscv/kernel/head.S
@@ -289,10 +289,6 @@ clear_bss:
 	blt a3, a4, clear_bss
 clear_bss_done:
 #endif
-	/* Save hart ID and DTB physical address */
-	mv s0, a0
-	mv s1, a1
-
 	la a2, boot_cpu_hartid
 	XIP_FIXUP_OFFSET a2
 	REG_S a0, (a2)
@@ -306,7 +302,7 @@ clear_bss_done:
 	la a0, __dtb_start
 	XIP_FIXUP_OFFSET a0
 #else
-	mv a0, s1
+	mv a0, a1
 #endif /* CONFIG_BUILTIN_DTB */
 	call setup_vm
 #ifdef CONFIG_MMU
-- 
2.34.1


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

* Re: [PATCH] riscv: remove redundant mv instructions
  2023-07-25  5:38 [PATCH] riscv: remove redundant mv instructions Nam Cao
@ 2023-07-25  8:01 ` Alexandre Ghiti
  2023-08-30 13:20 ` patchwork-bot+linux-riscv
  2023-08-30 13:24 ` Palmer Dabbelt
  2 siblings, 0 replies; 4+ messages in thread
From: Alexandre Ghiti @ 2023-07-25  8:01 UTC (permalink / raw)
  To: Nam Cao, Paul Walmsley, Palmer Dabbelt, Albert Ou, linux-riscv,
	linux-kernel

Hi Nam,


On 25/07/2023 07:38, Nam Cao wrote:
> Some mv instructions were useful when first introduced to preserve a0 and
> a1 before function calls. However the code has changed and they are now
> redundant. Remove them.
>
> Signed-off-by: Nam Cao <namcaov@gmail.com>
> ---
>   arch/riscv/kernel/head.S | 6 +-----
>   1 file changed, 1 insertion(+), 5 deletions(-)
>
> diff --git a/arch/riscv/kernel/head.S b/arch/riscv/kernel/head.S
> index 11c3b94c4534..3710ea5d160f 100644
> --- a/arch/riscv/kernel/head.S
> +++ b/arch/riscv/kernel/head.S
> @@ -289,10 +289,6 @@ clear_bss:
>   	blt a3, a4, clear_bss
>   clear_bss_done:
>   #endif
> -	/* Save hart ID and DTB physical address */
> -	mv s0, a0
> -	mv s1, a1
> -
>   	la a2, boot_cpu_hartid
>   	XIP_FIXUP_OFFSET a2
>   	REG_S a0, (a2)
> @@ -306,7 +302,7 @@ clear_bss_done:
>   	la a0, __dtb_start
>   	XIP_FIXUP_OFFSET a0
>   #else
> -	mv a0, s1
> +	mv a0, a1
>   #endif /* CONFIG_BUILTIN_DTB */
>   	call setup_vm
>   #ifdef CONFIG_MMU


You can add:

Reviewed-by: Alexandre Ghiti <alexghiti@rivosinc.com>

Thanks,

Alex


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

* Re: [PATCH] riscv: remove redundant mv instructions
  2023-07-25  5:38 [PATCH] riscv: remove redundant mv instructions Nam Cao
  2023-07-25  8:01 ` Alexandre Ghiti
@ 2023-08-30 13:20 ` patchwork-bot+linux-riscv
  2023-08-30 13:24 ` Palmer Dabbelt
  2 siblings, 0 replies; 4+ messages in thread
From: patchwork-bot+linux-riscv @ 2023-08-30 13:20 UTC (permalink / raw)
  To: Nam Cao; +Cc: linux-riscv, paul.walmsley, palmer, aou, linux-kernel

Hello:

This patch was applied to riscv/linux.git (for-next)
by Palmer Dabbelt <palmer@rivosinc.com>:

On Tue, 25 Jul 2023 07:38:35 +0200 you wrote:
> Some mv instructions were useful when first introduced to preserve a0 and
> a1 before function calls. However the code has changed and they are now
> redundant. Remove them.
> 
> Signed-off-by: Nam Cao <namcaov@gmail.com>
> ---
>  arch/riscv/kernel/head.S | 6 +-----
>  1 file changed, 1 insertion(+), 5 deletions(-)

Here is the summary with links:
  - riscv: remove redundant mv instructions
    https://git.kernel.org/riscv/c/10f763532d58

You are awesome, thank you!
-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



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

* Re: [PATCH] riscv: remove redundant mv instructions
  2023-07-25  5:38 [PATCH] riscv: remove redundant mv instructions Nam Cao
  2023-07-25  8:01 ` Alexandre Ghiti
  2023-08-30 13:20 ` patchwork-bot+linux-riscv
@ 2023-08-30 13:24 ` Palmer Dabbelt
  2 siblings, 0 replies; 4+ messages in thread
From: Palmer Dabbelt @ 2023-08-30 13:24 UTC (permalink / raw)
  To: Paul Walmsley, Palmer Dabbelt, Albert Ou, linux-riscv,
	linux-kernel, Nam Cao


On Tue, 25 Jul 2023 07:38:35 +0200, Nam Cao wrote:
> Some mv instructions were useful when first introduced to preserve a0 and
> a1 before function calls. However the code has changed and they are now
> redundant. Remove them.
> 
> 

Applied, thanks!

[1/1] riscv: remove redundant mv instructions
      https://git.kernel.org/palmer/c/10f763532d58

Best regards,
-- 
Palmer Dabbelt <palmer@rivosinc.com>


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

end of thread, other threads:[~2023-08-30 19:14 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-07-25  5:38 [PATCH] riscv: remove redundant mv instructions Nam Cao
2023-07-25  8:01 ` Alexandre Ghiti
2023-08-30 13:20 ` patchwork-bot+linux-riscv
2023-08-30 13:24 ` Palmer Dabbelt

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox