acrn-kernel/arch/riscv/kernel
Clément Léger a38c1e766f riscv: fix misaligned access handling of C.SWSP and C.SDSP
[ Upstream commit 22e0eb04837a63af111fae35a92f7577676b9bc8 ]

This is a backport of a fix that was done in OpenSBI: ec0559eb315b
("lib: sbi_misaligned_ldst: Fix handling of C.SWSP and C.SDSP").

Unlike C.LWSP/C.LDSP, these encodings can be used with the zero
register, so checking that the rs2 field is non-zero is unnecessary.

Additionally, the previous check was incorrect since it was checking
the immediate field of the instruction instead of the rs2 field.

Fixes: 956d705dd2 ("riscv: Unaligned load/store handling for M_MODE")
Signed-off-by: Clément Léger <cleger@rivosinc.com>
Link: https://lore.kernel.org/r/20231103090223.702340-1-cleger@rivosinc.com
Signed-off-by: Palmer Dabbelt <palmer@rivosinc.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2023-12-13 18:39:16 +01:00
..
compat_vdso riscv: Handle zicsr/zifencei issue between gcc and binutils 2023-08-30 16:11:08 +02:00
probes riscv: kprobes: allow writing to x0 2023-11-28 17:07:20 +00:00
vdso
.gitignore
Makefile riscv: compat_syscall_table: Fixup compile warning 2023-05-17 11:53:35 +02:00
alternative.c
asm-offsets.c
cacheinfo.c
compat_signal.c
compat_syscall_table.c
cpu-hotplug.c
cpu.c RISC-V: Don't fail in riscv_of_parent_hartid() for disabled HARTs 2023-11-20 11:52:17 +01:00
cpu_ops.c RISC-V: Align SBI probe implementation with spec 2023-05-11 23:03:04 +09:00
cpu_ops_sbi.c
cpu_ops_spinwait.c
cpufeature.c RISC-V: take text_mutex during alternative patching 2023-05-17 11:53:41 +02:00
crash_dump.c
crash_save_regs.S
efi-header.S
efi.c
elf_kexec.c riscv: kexec: Align the kexeced kernel entry 2023-09-23 11:11:09 +02:00
entry.S
fpu.S
ftrace.c RISC-V: Don't check text_mutex during stop_machine 2023-03-17 08:50:29 +01:00
head.S
head.h
image-vars.h
irq.c
jump_label.c
kexec_relocate.S
kgdb.c
machine_kexec.c
machine_kexec_file.c
mcount-dyn.S riscv: ftrace: Reduce the detour code size to half 2023-03-10 09:34:30 +01:00
mcount.S
module-sections.c
module.c
patch.c RISC-V: Don't check text_mutex during stop_machine 2023-03-17 08:50:29 +01:00
perf_callchain.c
perf_regs.c
process.c
ptrace.c
reset.c
riscv_ksyms.c
sbi.c RISC-V: Align SBI probe implementation with spec 2023-05-11 23:03:04 +09:00
setup.c riscv: Do not set initial_boot_params to the linear address of the dtb 2023-05-01 08:26:28 +09:00
signal.c riscv: add icache flush for nommu sigreturn trampoline 2023-04-20 12:35:12 +02:00
smp.c RISC-V: drop error print from riscv_hartid_to_cpuid() 2023-11-28 17:07:23 +00:00
smpboot.c
soc.c
stacktrace.c riscv: Use READ_ONCE_NOCHECK in imprecise unwinding stack mode 2023-03-17 08:50:29 +01:00
suspend.c
suspend_entry.S
sys_riscv.c
syscall_table.c
time.c
trace_irq.c
trace_irq.h
traps.c
traps_misaligned.c riscv: fix misaligned access handling of C.SWSP and C.SDSP 2023-12-13 18:39:16 +01:00
vdso.c
vmlinux-xip.lds.S
vmlinux.lds.S