Merge tag 'riscv-for-linus-6.19-rc8' of git://git.kernel.org/pub/scm/linux/kernel/git/riscv/linux

Pull RISC-V fixes from Paul Walmsley:

- Correct the RISC-V compat.h COMPAT_UTS_MACHINE architecture name

- Avoid printing a false warning message on kernels with the SiFive and
MIPS errata compiled in

- Address a few warnings generated by sparse in the signal handling
code

- Fix a comment typo

* tag 'riscv-for-linus-6.19-rc8' of git://git.kernel.org/pub/scm/linux/kernel/git/riscv/linux:
riscv: compat: fix COMPAT_UTS_MACHINE definition
errata/sifive: remove unreliable warn_miss_errata
riscv: fix minor typo in syscall.h comment
riscv: signal: fix some warnings reported by sparse

+5 -23
-18
arch/riscv/errata/sifive/errata.c
··· 75 return cpu_req_errata; 76 } 77 78 - static void __init_or_module warn_miss_errata(u32 miss_errata) 79 - { 80 - int i; 81 - 82 - pr_warn("----------------------------------------------------------------\n"); 83 - pr_warn("WARNING: Missing the following errata may cause potential issues\n"); 84 - for (i = 0; i < ERRATA_SIFIVE_NUMBER; i++) 85 - if (miss_errata & 0x1 << i) 86 - pr_warn("\tSiFive Errata[%d]:%s\n", i, errata_list[i].name); 87 - pr_warn("Please enable the corresponding Kconfig to apply them\n"); 88 - pr_warn("----------------------------------------------------------------\n"); 89 - } 90 - 91 void sifive_errata_patch_func(struct alt_entry *begin, struct alt_entry *end, 92 unsigned long archid, unsigned long impid, 93 unsigned int stage) 94 { 95 struct alt_entry *alt; 96 u32 cpu_req_errata; 97 - u32 cpu_apply_errata = 0; 98 u32 tmp; 99 100 BUILD_BUG_ON(ERRATA_SIFIVE_NUMBER >= RISCV_VENDOR_EXT_ALTERNATIVES_BASE); ··· 104 patch_text_nosync(ALT_OLD_PTR(alt), ALT_ALT_PTR(alt), 105 alt->alt_len); 106 mutex_unlock(&text_mutex); 107 - cpu_apply_errata |= tmp; 108 } 109 } 110 - if (stage != RISCV_ALTERNATIVES_MODULE && 111 - cpu_apply_errata != cpu_req_errata) 112 - warn_miss_errata(cpu_req_errata - cpu_apply_errata); 113 }
··· 75 return cpu_req_errata; 76 } 77 78 void sifive_errata_patch_func(struct alt_entry *begin, struct alt_entry *end, 79 unsigned long archid, unsigned long impid, 80 unsigned int stage) 81 { 82 struct alt_entry *alt; 83 u32 cpu_req_errata; 84 u32 tmp; 85 86 BUILD_BUG_ON(ERRATA_SIFIVE_NUMBER >= RISCV_VENDOR_EXT_ALTERNATIVES_BASE); ··· 118 patch_text_nosync(ALT_OLD_PTR(alt), ALT_ALT_PTR(alt), 119 alt->alt_len); 120 mutex_unlock(&text_mutex); 121 } 122 } 123 }
+1 -1
arch/riscv/include/asm/compat.h
··· 2 #ifndef __ASM_COMPAT_H 3 #define __ASM_COMPAT_H 4 5 - #define COMPAT_UTS_MACHINE "riscv\0\0" 6 7 /* 8 * Architecture specific compatibility types
··· 2 #ifndef __ASM_COMPAT_H 3 #define __ASM_COMPAT_H 4 5 + #define COMPAT_UTS_MACHINE "riscv32\0\0" 6 7 /* 8 * Architecture specific compatibility types
+1 -1
arch/riscv/include/asm/syscall.h
··· 20 extern void * const compat_sys_call_table[]; 21 22 /* 23 - * Only the low 32 bits of orig_r0 are meaningful, so we return int. 24 * This importantly ignores the high bits on 64-bit, so comparisons 25 * sign-extend the low 32 bits. 26 */
··· 20 extern void * const compat_sys_call_table[]; 21 22 /* 23 + * Only the low 32 bits of orig_a0 are meaningful, so we return int. 24 * This importantly ignores the high bits on 64-bit, so comparisons 25 * sign-extend the low 32 bits. 26 */
+3 -3
arch/riscv/kernel/signal.c
··· 145 long (*save)(struct pt_regs *regs, void __user *sc_vec); 146 }; 147 148 - struct arch_ext_priv arch_ext_list[] = { 149 { 150 .magic = RISCV_V_MAGIC, 151 .save = &save_v_state, 152 }, 153 }; 154 155 - const size_t nr_arch_exts = ARRAY_SIZE(arch_ext_list); 156 157 static long restore_sigcontext(struct pt_regs *regs, 158 struct sigcontext __user *sc) ··· 297 } else { 298 err |= __put_user(arch_ext->magic, &sc_ext_ptr->magic); 299 err |= __put_user(ext_size, &sc_ext_ptr->size); 300 - sc_ext_ptr = (void *)sc_ext_ptr + ext_size; 301 } 302 } 303 /* Write zero to fp-reserved space and check it on restore_sigcontext */
··· 145 long (*save)(struct pt_regs *regs, void __user *sc_vec); 146 }; 147 148 + static struct arch_ext_priv arch_ext_list[] = { 149 { 150 .magic = RISCV_V_MAGIC, 151 .save = &save_v_state, 152 }, 153 }; 154 155 + static const size_t nr_arch_exts = ARRAY_SIZE(arch_ext_list); 156 157 static long restore_sigcontext(struct pt_regs *regs, 158 struct sigcontext __user *sc) ··· 297 } else { 298 err |= __put_user(arch_ext->magic, &sc_ext_ptr->magic); 299 err |= __put_user(ext_size, &sc_ext_ptr->size); 300 + sc_ext_ptr = (void __user *)sc_ext_ptr + ext_size; 301 } 302 } 303 /* Write zero to fp-reserved space and check it on restore_sigcontext */