Skip to content

Commit 2830737

Browse files
committed
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
2 parents 367b81e + 0ea05c4 commit 2830737

4 files changed

Lines changed: 5 additions & 23 deletions

File tree

arch/riscv/errata/sifive/errata.c

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -75,26 +75,12 @@ static u32 __init_or_module sifive_errata_probe(unsigned long archid,
7575
return cpu_req_errata;
7676
}
7777

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-
9178
void sifive_errata_patch_func(struct alt_entry *begin, struct alt_entry *end,
9279
unsigned long archid, unsigned long impid,
9380
unsigned int stage)
9481
{
9582
struct alt_entry *alt;
9683
u32 cpu_req_errata;
97-
u32 cpu_apply_errata = 0;
9884
u32 tmp;
9985

10086
BUILD_BUG_ON(ERRATA_SIFIVE_NUMBER >= RISCV_VENDOR_EXT_ALTERNATIVES_BASE);
@@ -118,10 +104,6 @@ void sifive_errata_patch_func(struct alt_entry *begin, struct alt_entry *end,
118104
patch_text_nosync(ALT_OLD_PTR(alt), ALT_ALT_PTR(alt),
119105
alt->alt_len);
120106
mutex_unlock(&text_mutex);
121-
cpu_apply_errata |= tmp;
122107
}
123108
}
124-
if (stage != RISCV_ALTERNATIVES_MODULE &&
125-
cpu_apply_errata != cpu_req_errata)
126-
warn_miss_errata(cpu_req_errata - cpu_apply_errata);
127109
}

arch/riscv/include/asm/compat.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
#ifndef __ASM_COMPAT_H
33
#define __ASM_COMPAT_H
44

5-
#define COMPAT_UTS_MACHINE "riscv\0\0"
5+
#define COMPAT_UTS_MACHINE "riscv32\0\0"
66

77
/*
88
* Architecture specific compatibility types

arch/riscv/include/asm/syscall.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ extern void * const sys_call_table[];
2020
extern void * const compat_sys_call_table[];
2121

2222
/*
23-
* Only the low 32 bits of orig_r0 are meaningful, so we return int.
23+
* Only the low 32 bits of orig_a0 are meaningful, so we return int.
2424
* This importantly ignores the high bits on 64-bit, so comparisons
2525
* sign-extend the low 32 bits.
2626
*/

arch/riscv/kernel/signal.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -145,14 +145,14 @@ struct arch_ext_priv {
145145
long (*save)(struct pt_regs *regs, void __user *sc_vec);
146146
};
147147

148-
struct arch_ext_priv arch_ext_list[] = {
148+
static struct arch_ext_priv arch_ext_list[] = {
149149
{
150150
.magic = RISCV_V_MAGIC,
151151
.save = &save_v_state,
152152
},
153153
};
154154

155-
const size_t nr_arch_exts = ARRAY_SIZE(arch_ext_list);
155+
static const size_t nr_arch_exts = ARRAY_SIZE(arch_ext_list);
156156

157157
static long restore_sigcontext(struct pt_regs *regs,
158158
struct sigcontext __user *sc)
@@ -297,7 +297,7 @@ static long setup_sigcontext(struct rt_sigframe __user *frame,
297297
} else {
298298
err |= __put_user(arch_ext->magic, &sc_ext_ptr->magic);
299299
err |= __put_user(ext_size, &sc_ext_ptr->size);
300-
sc_ext_ptr = (void *)sc_ext_ptr + ext_size;
300+
sc_ext_ptr = (void __user *)sc_ext_ptr + ext_size;
301301
}
302302
}
303303
/* Write zero to fp-reserved space and check it on restore_sigcontext */

0 commit comments

Comments
 (0)