riscv: misc clean up
Subsystems (2)
cover riscv: misc clean up
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(-)
Signature · 1 line
2.34.0
PATCH 1/5 riscv: remove cpu_stop()
Except arch_cpu_idle_dead(), no users of this function. So remove cpu_stop() and fold its code into arch_cpu_idle_dead().
--- arch/riscv/include/asm/smp.h | 2 -- arch/riscv/kernel/cpu-hotplug.c | 8 +------- 2 files changed, 1 insertion(+), 9 deletions(-)
arch/riscv/include/asm/smp.h +0 -2
@@ -63,8 +63,6 @@ asmlinkage void smp_callin(void);#if definedCONFIG_HOTPLUG_CPU int __cpu_disable (void );void __cpu_die (unsigned int cpu); -void cpu_stop (void ); -#else #endif /* CONFIG_HOTPLUG_CPU */ #else
arch/riscv/kernel/cpu-hotplug.c +1 -7
@@ -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 ();
Signature · 1 line
2.34.0
PATCH 2/5 riscv: head: make secondary_start_common() static
In reply to Jisheng ZhangThere are no users outside head.S so make secondary_start_common() static.
--- arch/riscv/kernel/head.S | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-)
arch/riscv/kernel/head.S +2 -3
@@ -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)
Signature · 1 line
2.34.0
PATCH 3/5 riscv: kvm: make kvm_riscv_vcpu_fp_clean() static
In reply to Jisheng ZhangThere are no users outside vcpu_fp.c so make kvm_riscv_vcpu_fp_clean() static.
--- arch/riscv/kvm/vcpu_fp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/riscv/kvm/vcpu_fp.c +1 -1
@@ -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 ;
Signature · 1 line
2.34.0
PATCH 4/5 riscv: errata: alternative: mark vendor_patch_func __initdata
In reply to Jisheng ZhangThe function pointer vendor_patch_func is only used during init, so mark it as __initdata.
--- arch/riscv/errata/alternative.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
arch/riscv/errata/alternative.c +2 -1
@@ -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 ) {
Signature · 1 line
2.34.0
PATCH 5/5 riscv: head: remove useless __PAGE_ALIGNED_BSS and .balign
In reply to Jisheng ZhangAfter 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.
--- arch/riscv/kernel/head.S | 4 ---- 1 file changed, 4 deletions(-)
arch/riscv/kernel/head.S +0 -4
@@ -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
Signature · 1 line
2.34.0
Anup Patel
maintainerRe: [PATCH 3/5] riscv: kvm: make kvm_riscv_vcpu_fp_clean() static
In reply to Jisheng ZhangQuoted 5 lines · Jisheng Zhang
There are no users outside
vcpu_fp.cso makekvm_riscv_vcpu_fp_clean()static.Signed-off-by Jisheng Zhang <[email protected]>
I have queued this patch for 5.17
Thanks,
Anup
Quoted 25 lines
--- arch/riscv/kvm/vcpu_fp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)arch/riscv/kvm/vcpu_fp.c +1
-2@@ -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 at lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kvm-riscv
Palmer Dabbelt
maintainerQuoted 8 lines · jszhang at kernel.org
This series is a misc clean up: clean up useless LoCs, or make some functions static, or mark function pointer as
__initdata, or remove onefunction().Jisheng Zhang (5):
riscv: removecpu_stop()
riscv: head: makesecondary_start_common()static
riscv: kvm: makekvm_riscv_vcpu_fp_clean()static
Probably best to split out the KVM patches, as they go in via a different tree.
Quoted 9 lines
riscv: errata: alternative: mark
vendor_patch_func__initdata
riscv: head: remove useless__PAGE_ALIGNED_BSSand .balignarch/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!