linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/5] riscv: misc clean up
@ 2021-11-28 16:07 Jisheng Zhang
  2021-11-28 16:07 ` [PATCH 1/5] riscv: remove cpu_stop() Jisheng Zhang
                   ` (5 more replies)
  0 siblings, 6 replies; 8+ messages in thread
From: Jisheng Zhang @ 2021-11-28 16:07 UTC (permalink / raw)
  To: Paul Walmsley, Palmer Dabbelt, Albert Ou, Anup Patel, Atish Patra
  Cc: linux-riscv, linux-kernel, kvm-riscv

This series is a misc clean up: clean up useless LoCs, or make some
functions static, or mark function pointer as __initdata, or remove
one function().

Jisheng Zhang (5):
  riscv: remove cpu_stop()
  riscv: head: make secondary_start_common() static
  riscv: kvm: make kvm_riscv_vcpu_fp_clean() static
  riscv: errata: alternative: mark vendor_patch_func __initdata
  riscv: head: remove useless __PAGE_ALIGNED_BSS and .balign

 arch/riscv/errata/alternative.c | 3 ++-
 arch/riscv/include/asm/smp.h    | 2 --
 arch/riscv/kernel/cpu-hotplug.c | 8 +-------
 arch/riscv/kernel/head.S        | 9 ++-------
 arch/riscv/kvm/vcpu_fp.c        | 2 +-
 5 files changed, 6 insertions(+), 18 deletions(-)

-- 
2.34.0


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

* [PATCH 1/5] riscv: remove cpu_stop()
  2021-11-28 16:07 [PATCH 0/5] riscv: misc clean up Jisheng Zhang
@ 2021-11-28 16:07 ` Jisheng Zhang
  2021-11-28 16:07 ` [PATCH 2/5] riscv: head: make secondary_start_common() static Jisheng Zhang
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 8+ messages in thread
From: Jisheng Zhang @ 2021-11-28 16:07 UTC (permalink / raw)
  To: Paul Walmsley, Palmer Dabbelt, Albert Ou, Anup Patel, Atish Patra
  Cc: linux-riscv, linux-kernel, kvm-riscv

Except arch_cpu_idle_dead(), no users of this function. So remove
cpu_stop() and fold its code into arch_cpu_idle_dead().

Signed-off-by: Jisheng Zhang <jszhang@kernel.org>
---
 arch/riscv/include/asm/smp.h    | 2 --
 arch/riscv/kernel/cpu-hotplug.c | 8 +-------
 2 files changed, 1 insertion(+), 9 deletions(-)

diff --git a/arch/riscv/include/asm/smp.h b/arch/riscv/include/asm/smp.h
index a7d2811f3536..e2b0d6c40a6c 100644
--- a/arch/riscv/include/asm/smp.h
+++ b/arch/riscv/include/asm/smp.h
@@ -63,8 +63,6 @@ asmlinkage void smp_callin(void);
 #if defined CONFIG_HOTPLUG_CPU
 int __cpu_disable(void);
 void __cpu_die(unsigned int cpu);
-void cpu_stop(void);
-#else
 #endif /* CONFIG_HOTPLUG_CPU */
 
 #else
diff --git a/arch/riscv/kernel/cpu-hotplug.c b/arch/riscv/kernel/cpu-hotplug.c
index df84e0c13db1..be7f05b542bb 100644
--- a/arch/riscv/kernel/cpu-hotplug.c
+++ b/arch/riscv/kernel/cpu-hotplug.c
@@ -14,12 +14,6 @@
 #include <asm/cpu_ops.h>
 #include <asm/sbi.h>
 
-void cpu_stop(void);
-void arch_cpu_idle_dead(void)
-{
-	cpu_stop();
-}
-
 bool cpu_has_hotplug(unsigned int cpu)
 {
 	if (cpu_ops[cpu]->cpu_stop)
@@ -75,7 +69,7 @@ void __cpu_die(unsigned int cpu)
 /*
  * Called from the idle thread for the CPU which has been shutdown.
  */
-void cpu_stop(void)
+void arch_cpu_idle_dead(void)
 {
 	idle_task_exit();
 
-- 
2.34.0


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

* [PATCH 2/5] riscv: head: make secondary_start_common() static
  2021-11-28 16:07 [PATCH 0/5] riscv: misc clean up Jisheng Zhang
  2021-11-28 16:07 ` [PATCH 1/5] riscv: remove cpu_stop() Jisheng Zhang
@ 2021-11-28 16:07 ` Jisheng Zhang
  2021-11-28 16:07 ` [PATCH 3/5] riscv: kvm: make kvm_riscv_vcpu_fp_clean() static Jisheng Zhang
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 8+ messages in thread
From: Jisheng Zhang @ 2021-11-28 16:07 UTC (permalink / raw)
  To: Paul Walmsley, Palmer Dabbelt, Albert Ou, Anup Patel, Atish Patra
  Cc: linux-riscv, linux-kernel, kvm-riscv

There are no users outside head.S so make secondary_start_common()
static.

Signed-off-by: Jisheng Zhang <jszhang@kernel.org>
---
 arch/riscv/kernel/head.S | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/arch/riscv/kernel/head.S b/arch/riscv/kernel/head.S
index f52f01ecbeea..3ce95f8783bd 100644
--- a/arch/riscv/kernel/head.S
+++ b/arch/riscv/kernel/head.S
@@ -177,8 +177,7 @@ secondary_start_sbi:
 	REG_L sp, (a4)
 	REG_L tp, (a5)
 
-	.global secondary_start_common
-secondary_start_common:
+.Lsecondary_start_common:
 
 #ifdef CONFIG_MMU
 	/* Enable virtual memory and relocate to virtual address */
@@ -365,7 +364,7 @@ clear_bss_done:
 	beqz tp, .Lwait_for_cpu_up
 	fence
 
-	tail secondary_start_common
+	tail .Lsecondary_start_common
 #endif
 
 END(_start_kernel)
-- 
2.34.0


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

* [PATCH 3/5] riscv: kvm: make kvm_riscv_vcpu_fp_clean() static
  2021-11-28 16:07 [PATCH 0/5] riscv: misc clean up Jisheng Zhang
  2021-11-28 16:07 ` [PATCH 1/5] riscv: remove cpu_stop() Jisheng Zhang
  2021-11-28 16:07 ` [PATCH 2/5] riscv: head: make secondary_start_common() static Jisheng Zhang
@ 2021-11-28 16:07 ` Jisheng Zhang
  2021-12-03 13:23   ` Anup Patel
  2021-11-28 16:07 ` [PATCH 4/5] riscv: errata: alternative: mark vendor_patch_func __initdata Jisheng Zhang
                   ` (2 subsequent siblings)
  5 siblings, 1 reply; 8+ messages in thread
From: Jisheng Zhang @ 2021-11-28 16:07 UTC (permalink / raw)
  To: Paul Walmsley, Palmer Dabbelt, Albert Ou, Anup Patel, Atish Patra
  Cc: linux-riscv, linux-kernel, kvm-riscv

There are no users outside vcpu_fp.c so make kvm_riscv_vcpu_fp_clean()
static.

Signed-off-by: Jisheng Zhang <jszhang@kernel.org>
---
 arch/riscv/kvm/vcpu_fp.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/riscv/kvm/vcpu_fp.c b/arch/riscv/kvm/vcpu_fp.c
index 1b070152578f..4449a976e5a6 100644
--- a/arch/riscv/kvm/vcpu_fp.c
+++ b/arch/riscv/kvm/vcpu_fp.c
@@ -26,7 +26,7 @@ void kvm_riscv_vcpu_fp_reset(struct kvm_vcpu *vcpu)
 		cntx->sstatus |= SR_FS_OFF;
 }
 
-void kvm_riscv_vcpu_fp_clean(struct kvm_cpu_context *cntx)
+static void kvm_riscv_vcpu_fp_clean(struct kvm_cpu_context *cntx)
 {
 	cntx->sstatus &= ~SR_FS;
 	cntx->sstatus |= SR_FS_CLEAN;
-- 
2.34.0


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

* [PATCH 4/5] riscv: errata: alternative: mark vendor_patch_func __initdata
  2021-11-28 16:07 [PATCH 0/5] riscv: misc clean up Jisheng Zhang
                   ` (2 preceding siblings ...)
  2021-11-28 16:07 ` [PATCH 3/5] riscv: kvm: make kvm_riscv_vcpu_fp_clean() static Jisheng Zhang
@ 2021-11-28 16:07 ` Jisheng Zhang
  2021-11-28 16:07 ` [PATCH 5/5] riscv: head: remove useless __PAGE_ALIGNED_BSS and .balign Jisheng Zhang
  2022-01-09 19:48 ` [PATCH 0/5] riscv: misc clean up Palmer Dabbelt
  5 siblings, 0 replies; 8+ messages in thread
From: Jisheng Zhang @ 2021-11-28 16:07 UTC (permalink / raw)
  To: Paul Walmsley, Palmer Dabbelt, Albert Ou, Anup Patel, Atish Patra
  Cc: linux-riscv, linux-kernel, kvm-riscv

The function pointer vendor_patch_func is only used during init, so
mark it as __initdata.

Signed-off-by: Jisheng Zhang <jszhang@kernel.org>
---
 arch/riscv/errata/alternative.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/arch/riscv/errata/alternative.c b/arch/riscv/errata/alternative.c
index 3b15885db70b..e8b4a0fe488c 100644
--- a/arch/riscv/errata/alternative.c
+++ b/arch/riscv/errata/alternative.c
@@ -22,7 +22,8 @@ static struct cpu_manufacturer_info_t {
 } cpu_mfr_info;
 
 static void (*vendor_patch_func)(struct alt_entry *begin, struct alt_entry *end,
-				 unsigned long archid, unsigned long impid);
+				 unsigned long archid,
+				 unsigned long impid) __initdata;
 
 static inline void __init riscv_fill_cpu_mfr_info(void)
 {
-- 
2.34.0


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

* [PATCH 5/5] riscv: head: remove useless __PAGE_ALIGNED_BSS and .balign
  2021-11-28 16:07 [PATCH 0/5] riscv: misc clean up Jisheng Zhang
                   ` (3 preceding siblings ...)
  2021-11-28 16:07 ` [PATCH 4/5] riscv: errata: alternative: mark vendor_patch_func __initdata Jisheng Zhang
@ 2021-11-28 16:07 ` Jisheng Zhang
  2022-01-09 19:48 ` [PATCH 0/5] riscv: misc clean up Palmer Dabbelt
  5 siblings, 0 replies; 8+ messages in thread
From: Jisheng Zhang @ 2021-11-28 16:07 UTC (permalink / raw)
  To: Paul Walmsley, Palmer Dabbelt, Albert Ou, Anup Patel, Atish Patra
  Cc: linux-riscv, linux-kernel, kvm-riscv

After commit 83e7b8769a08 ("RISC-V: move empty_zero_page definition to
C and export it"), the empty_zero_page has been moved outside head.S,
the __PAGE_ALIGNED_BSS and .balign LoCs are useless, clean up them.

Signed-off-by: Jisheng Zhang <jszhang@kernel.org>
---
 arch/riscv/kernel/head.S | 4 ----
 1 file changed, 4 deletions(-)

diff --git a/arch/riscv/kernel/head.S b/arch/riscv/kernel/head.S
index 3ce95f8783bd..c128a32c2ed3 100644
--- a/arch/riscv/kernel/head.S
+++ b/arch/riscv/kernel/head.S
@@ -447,7 +447,3 @@ ENTRY(reset_regs)
 	ret
 END(reset_regs)
 #endif /* CONFIG_RISCV_M_MODE */
-
-__PAGE_ALIGNED_BSS
-	/* Empty zero page */
-	.balign PAGE_SIZE
-- 
2.34.0


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

* Re: [PATCH 3/5] riscv: kvm: make kvm_riscv_vcpu_fp_clean() static
  2021-11-28 16:07 ` [PATCH 3/5] riscv: kvm: make kvm_riscv_vcpu_fp_clean() static Jisheng Zhang
@ 2021-12-03 13:23   ` Anup Patel
  0 siblings, 0 replies; 8+ messages in thread
From: Anup Patel @ 2021-12-03 13:23 UTC (permalink / raw)
  To: Jisheng Zhang
  Cc: Paul Walmsley, Palmer Dabbelt, Albert Ou, Anup Patel,
	Atish Patra, linux-riscv, linux-kernel@vger.kernel.org List,
	kvm-riscv

On Sun, Nov 28, 2021 at 9:45 PM Jisheng Zhang <jszhang@kernel.org> wrote:
>
> There are no users outside vcpu_fp.c so make kvm_riscv_vcpu_fp_clean()
> static.
>
> Signed-off-by: Jisheng Zhang <jszhang@kernel.org>

I have queued this patch for 5.17

Thanks,
Anup

> ---
>  arch/riscv/kvm/vcpu_fp.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/arch/riscv/kvm/vcpu_fp.c b/arch/riscv/kvm/vcpu_fp.c
> index 1b070152578f..4449a976e5a6 100644
> --- a/arch/riscv/kvm/vcpu_fp.c
> +++ b/arch/riscv/kvm/vcpu_fp.c
> @@ -26,7 +26,7 @@ void kvm_riscv_vcpu_fp_reset(struct kvm_vcpu *vcpu)
>                 cntx->sstatus |= SR_FS_OFF;
>  }
>
> -void kvm_riscv_vcpu_fp_clean(struct kvm_cpu_context *cntx)
> +static void kvm_riscv_vcpu_fp_clean(struct kvm_cpu_context *cntx)
>  {
>         cntx->sstatus &= ~SR_FS;
>         cntx->sstatus |= SR_FS_CLEAN;
> --
> 2.34.0
>
>
> --
> kvm-riscv mailing list
> kvm-riscv@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/kvm-riscv

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

* Re: [PATCH 0/5] riscv: misc clean up
  2021-11-28 16:07 [PATCH 0/5] riscv: misc clean up Jisheng Zhang
                   ` (4 preceding siblings ...)
  2021-11-28 16:07 ` [PATCH 5/5] riscv: head: remove useless __PAGE_ALIGNED_BSS and .balign Jisheng Zhang
@ 2022-01-09 19:48 ` Palmer Dabbelt
  5 siblings, 0 replies; 8+ messages in thread
From: Palmer Dabbelt @ 2022-01-09 19:48 UTC (permalink / raw)
  To: jszhang
  Cc: Paul Walmsley, aou, anup, atishp, linux-riscv, linux-kernel, kvm-riscv

On Sun, 28 Nov 2021 08:07:36 PST (-0800), jszhang@kernel.org wrote:
> This series is a misc clean up: clean up useless LoCs, or make some
> functions static, or mark function pointer as __initdata, or remove
> one function().
>
> Jisheng Zhang (5):
>   riscv: remove cpu_stop()
>   riscv: head: make secondary_start_common() static
>   riscv: kvm: make kvm_riscv_vcpu_fp_clean() static

Probably best to split out the KVM patches, as they go in via a 
different tree.

>   riscv: errata: alternative: mark vendor_patch_func __initdata
>   riscv: head: remove useless __PAGE_ALIGNED_BSS and .balign
>
>  arch/riscv/errata/alternative.c | 3 ++-
>  arch/riscv/include/asm/smp.h    | 2 --
>  arch/riscv/kernel/cpu-hotplug.c | 8 +-------
>  arch/riscv/kernel/head.S        | 9 ++-------
>  arch/riscv/kvm/vcpu_fp.c        | 2 +-
>  5 files changed, 6 insertions(+), 18 deletions(-)

These are on for-next (aside from the KVM one, which Anup has already 
picked up).

Thanks!



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

end of thread, other threads:[~2022-01-09 19:48 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-11-28 16:07 [PATCH 0/5] riscv: misc clean up Jisheng Zhang
2021-11-28 16:07 ` [PATCH 1/5] riscv: remove cpu_stop() Jisheng Zhang
2021-11-28 16:07 ` [PATCH 2/5] riscv: head: make secondary_start_common() static Jisheng Zhang
2021-11-28 16:07 ` [PATCH 3/5] riscv: kvm: make kvm_riscv_vcpu_fp_clean() static Jisheng Zhang
2021-12-03 13:23   ` Anup Patel
2021-11-28 16:07 ` [PATCH 4/5] riscv: errata: alternative: mark vendor_patch_func __initdata Jisheng Zhang
2021-11-28 16:07 ` [PATCH 5/5] riscv: head: remove useless __PAGE_ALIGNED_BSS and .balign Jisheng Zhang
2022-01-09 19:48 ` [PATCH 0/5] riscv: misc clean up Palmer Dabbelt

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).