TencentOS-kernel/arch
Nathan Huckleberry ef65ee90eb riscv/atomic: Fix sign extension for RV64I
[ Upstream commit 6c58f25e6938c073198af8b1e1832f83f8f0df33 ]

The argument passed to cmpxchg is not guaranteed to be sign
extended, but lr.w sign extends on RV64I. This makes cmpxchg
fail on clang built kernels when __old is negative.

To fix this, we just cast __old to long which sign extends on
RV64I. With this fix, clang built RISC-V kernels now boot.

Link: https://github.com/ClangBuiltLinux/linux/issues/867
Signed-off-by: Nathan Huckleberry <nhuck@google.com>
Signed-off-by: Palmer Dabbelt <palmerdabbelt@google.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2021-03-16 16:31:04 +08:00
..
alpha alpha: fix memory barriers so that they conform to the specification 2021-03-16 16:29:48 +08:00
arc ARC: [plat-eznps]: Restrict to CONFIG_ISA_ARCOMPACT 2021-03-16 16:28:46 +08:00
arm ARM: imx5: add missing put_device() call in imx_suspend_alloc_ocram() 2021-03-16 16:31:01 +08:00
arm64 arm64: hw_breakpoint: Don't invoke overflow handler on uaccess watchpoints 2021-03-16 16:30:39 +08:00
c6x Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
csky csky: Fixup abiv2 syscall_trace break a4 & a5 2021-03-16 16:28:56 +08:00
h8300 Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
hexagon hexagon: define ioremap_uc 2021-03-16 16:27:29 +08:00
ia64 Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
m68k m68k/PCI: Fix a memory leak in an error handling path 2021-03-16 16:30:02 +08:00
microblaze Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
mips MIPS: Fix IRQ tracing when call handle_fpe() and handle_msa_fpe() 2021-03-16 16:29:35 +08:00
nds32 Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
nios2 Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
openrisc openrisc: Fix issue with argument clobbering for clone/fork 2021-03-16 16:30:27 +08:00
parisc parisc: Fix kernel panic in mem_init() 2021-03-16 16:28:37 +08:00
powerpc powerpc: Fix kernel crash in show_instructions() w/DEBUG_VIRTUAL 2021-03-16 16:30:37 +08:00
riscv riscv/atomic: Fix sign extension for RV64I 2021-03-16 16:31:04 +08:00
s390 s390: fix syscall_get_error for compat processes 2021-03-16 16:30:42 +08:00
sh Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
sparc fix a braino in "sparc32: fix register window handling in genregs32_[gs]et()" 2021-03-16 16:30:50 +08:00
um um: ensure `make ARCH=um mrproper` removes arch/$(SUBARCH)/include/generated/ 2021-03-16 16:27:11 +08:00
unicore32 Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
x86 x86/resctrl: Fix a NULL vs IS_ERR() static checker warning in rdt_cdp_peer_get() 2021-03-16 16:30:57 +08:00
xtensa Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
.gitignore Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
Kconfig Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00