Skip to contentSkip to conversation

RISC-V: Add futex support.

PATCH New Jim Wilson 3 participants 3 messages Oct 16, 2018 – Oct 17, 2018 RISC-V

lore
Share & tools
lore

Jim Wilson

author
#0 lore raw

PATCH v2 1/1 RISC-V: Add futex support.

Updated as per sugestions from Christoph Hellwig. As before, tested on a HiFive Unleashed running fedora core 29 with a 4.15 based kernel against the glibc testsuite and the futex wake_op testcase from

    https://lwn.net/Articles/148830/

14 glibc testcase failures are fixed by the patch, and the wake_op testcase works with the patch.

This is a patch based off of a 4.19 tree. The 4.15 patch is trivially different as arch/riscv/Kconfig changed. This patch was tested on qemu with the glibc nptl/tst-cond-except testcase, and the wake_op testcase from above.

---
 arch/riscv/Kconfig             |   1 +
 arch/riscv/include/asm/Kbuild  |   1 -
 arch/riscv/include/asm/futex.h | 127 +++++++++++++++++++++++++++++++++
 3 files changed, 128 insertions(+), 1 deletion(-)
 create mode 100644 arch/riscv/include/asm/futex.h
arch/riscv/Kconfig +1 -0
index a344980287a5..093361e2298c 100644
@@ -31,6 +31,7 @@ config RISCV
 	select HAVE_MEMBLOCK
 	select HAVE_MEMBLOCK_NODE_MAP
 	select HAVE_DMA_CONTIGUOUS
+	select HAVE_FUTEX_CMPXCHG if FUTEX
 	select HAVE_GENERIC_DMA_COHERENT
 	select HAVE_PERF_EVENTS
 	select IRQ_DOMAIN
arch/riscv/include/asm/Kbuild +0 -1
index efdbe311e936..6a646d9ea780 100644
@@ -13,7 +13,6 @@ generic-y += errno.h
 generic-y += exec.h
 generic-y += fb.h
 generic-y += fcntl.h
-generic-y += futex.h
 generic-y += hardirq.h
 generic-y += hash.h
 generic-y += hw_irq.h
arch/riscv/include/asm/futex.h new file +127 -0

127 lines not on this page · raw message

Signature · 1 line
2.19.0.rc0
#1 lore raw

PATCH v2 1/1 RISC-V: Add futex support.

Quoted 1 line · Jim Wilson

Updated as per sugestions from Christoph Hellwig.

This tends to go under the ---, but I guess Palmer can just snip it when applying.

Quoted 3 lines

+/* Copyright (c) 2006 Ralf Baechle (ralf at linux-mips.org)
+ * Copyright (c) 2018 Jim Wilson (jimw at sifive.com)
+ */

Nipick: the /* should be on a line of its own.

Except for that this looks fine to me:

#2 lore raw

PATCH v2 1/1 RISC-V: Add futex support.

Quoted 10 lines · Christoph Hellwig
Quoted 1 line · Jim Wilson

Updated as per sugestions from Christoph Hellwig.

This tends to go under the ---, but I guess Palmer can just snip it when applying.

Quoted 3 lines

+/* Copyright (c) 2006 Ralf Baechle (ralf at linux-mips.org)
+ * Copyright (c) 2018 Jim Wilson (jimw at sifive.com)
+ */

Quoted 5 lines

Nipick: the /* should be on a line of its own.

Except for that this looks fine to me:

I fixed the comment, cleaned up the commit message a bit, and added this to for-next.