Skip to contentSkip to conversation

Revert "RISC-V: vDSO: Wire up getrandom() vDSO implementation"

PATCH Applied Palmer Dabbelt 2 participants 2 messages Jun 2, 2025

Subsystems (4)
lore
Share & tools
lore

Palmer Dabbelt

author maintainer
#0 lore raw

PATCH 1/1 Revert "RISC-V: vDSO: Wire up getrandom() vDSO implementation"

This has been on -next for a bit, but it's broken and there's already a v2. So I'm reverting it to avoid more rebasing.

This reverts commit 89079520cef65d6da1e864eab4464effe5396e23.

---
 arch/riscv/Kconfig                            |   1 -
 arch/riscv/include/asm/vdso/getrandom.h       |  30 ---
 arch/riscv/kernel/vdso/Makefile               |  12 -
 arch/riscv/kernel/vdso/getrandom.c            |  10 -
 arch/riscv/kernel/vdso/vdso.lds.S             |   1 -
 arch/riscv/kernel/vdso/vgetrandom-chacha.S    | 244 ------------------
 .../selftests/vDSO/vgetrandom-chacha.S        |   2 -
 7 files changed, 300 deletions(-)
 delete mode 100644 arch/riscv/include/asm/vdso/getrandom.h
 delete mode 100644 arch/riscv/kernel/vdso/getrandom.c
 delete mode 100644 arch/riscv/kernel/vdso/vgetrandom-chacha.S
arch/riscv/Kconfig +0 -1
index fbca724302ab..bbec87b79309 100644
@@ -218,7 +218,6 @@ config RISCV
 	select THREAD_INFO_IN_TASK
 	select TRACE_IRQFLAGS_SUPPORT
 	select UACCESS_MEMCPY if !MMU
-	select VDSO_GETRANDOM if HAVE_GENERIC_VDSO
 	select USER_STACKTRACE_SUPPORT
 	select ZONE_DMA32 if 64BIT
 
arch/riscv/include/asm/vdso/getrandom.h deleted +0 -30
deleted file mode 100644
index 8dc92441702a..000000000000
@@ -1,30 +0,0 @@
-/* SPDX-License-Identifier: GPL-2.0-only */
-/*
- * Copyright (C) 2025 Xi Ruoyao <[email protected]>. All Rights Reserved.
- */
-#ifndef __ASM_VDSO_GETRANDOM_H
-#define __ASM_VDSO_GETRANDOM_H
-
-#ifndef __ASSEMBLY__
-
-#include <asm/unistd.h>
-
-static __always_inline ssize_t getrandom_syscall(void *_buffer, size_t _len, unsigned int _flags)
-{
-	register long ret asm("a0");
-	register long nr asm("a7") = __NR_getrandom;
-	register void *buffer asm("a0") = _buffer;
-	register size_t len asm("a1") = _len;
-	register unsigned int flags asm("a2") = _flags;
-
-	asm volatile ("ecall\n"
-		      : "+r" (ret)
-		      : "r" (nr), "r" (buffer), "r" (len), "r" (flags)
-		      : "memory");
-
-	return ret;
-}
-
-#endif /* !__ASSEMBLY__ */
-
-#endif /* __ASM_VDSO_GETRANDOM_H */
arch/riscv/kernel/vdso/Makefile +0 -12
index 8d12f5646eb5..4a5d131506fc 100644
@@ -13,17 +13,9 @@ vdso-syms += flush_icache
 vdso-syms += hwprobe
 vdso-syms += sys_hwprobe
 
-ifdef CONFIG_VDSO_GETRANDOM
-vdso-syms += getrandom
-endif
-
 # Files to link into the vdso
 obj-vdso = $(patsubst %, %.o, $(vdso-syms)) note.o
 
-ifdef CONFIG_VDSO_GETRANDOM
-obj-vdso += vgetrandom-chacha.o
-endif
-
 ccflags-y := -fno-stack-protector
 ccflags-y += -DDISABLE_BRANCH_PROFILING
 ccflags-y += -fno-builtin
@@ -32,10 +24,6 @@ ifneq ($(c-gettimeofday-y),)
   CFLAGS_vgettimeofday.o += -fPIC -include $(c-gettimeofday-y)
 endif
 
-ifneq ($(c-getrandom-y),)
-  CFLAGS_getrandom.o += -fPIC -include $(c-getrandom-y)
-endif
-
 CFLAGS_hwprobe.o += -fPIC
 
 # Build rules
arch/riscv/kernel/vdso/getrandom.c deleted +0 -10
deleted file mode 100644
index f21922e8cebd..000000000000
@@ -1,10 +0,0 @@
-// SPDX-License-Identifier: GPL-2.0-only
-/*
- * Copyright (C) 2025 Xi Ruoyao <[email protected]>. All Rights Reserved.
- */
-#include <linux/types.h>
-
-ssize_t __vdso_getrandom(void *buffer, size_t len, unsigned int flags, void *opaque_state, size_t opaque_len)
-{
-	return __cvdso_getrandom(buffer, len, flags, opaque_state, opaque_len);
-}
arch/riscv/kernel/vdso/vdso.lds.S +0 -1
index abc69cda0445..8e86965a8aae 100644
@@ -80,7 +80,6 @@ VERSION
 #ifndef COMPAT_VDSO
 		__vdso_riscv_hwprobe;
 #endif
-		__vdso_getrandom;
 	local: *;
 	};
 }
arch/riscv/kernel/vdso/vgetrandom-chacha.S deleted +0 -244

244 lines not on this page · raw message

tools/testing/selftests/vDSO/vgetrandom-chacha.S +0 -2
index a4a82e1c28a9..d6e09af7c0a9 100644
@@ -11,8 +11,6 @@
 #include "../../../../arch/loongarch/vdso/vgetrandom-chacha.S"
 #elif defined(__powerpc__) || defined(__powerpc64__)
 #include "../../../../arch/powerpc/kernel/vdso/vgetrandom-chacha.S"
-#elif defined(__riscv) && __riscv_xlen == 64
-#include "../../../../arch/riscv/kernel/vdso/vgetrandom-chacha.S"
 #elif defined(__s390x__)
 #include "../../../../arch/s390/kernel/vdso64/vgetrandom-chacha.S"
 #elif defined(__x86_64__)
Signature · 7 lines
2.39.5 (Apple Git-154)


_______________________________________________
linux-riscv mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-riscv
#1 lore raw
This patch was applied to riscv/linux.git (for-next) by Palmer Dabbelt <[email protected]>:

Hello:

This patch was applied to riscv/linux.git (for-next) by Palmer Dabbelt <[email protected]>:

Quoted 8 lines · On Mon, 2 Jun 2025 10:33:15 -0700 you wrote:

This has been on -next for a bit, but it's broken and there's already a v2. So I'm reverting it to avoid more rebasing.

This reverts commit 89079520cef65d6da1e864eab4464effe5396e23.

[...]

Here is the summary with links:
- Revert "RISC-V: vDSO: Wire up getrandom() vDSO implementation"

    https://git.kernel.org/riscv/c/2f956db8b3b0

You are awesome, thank you!

Signature · 9 lines
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



_______________________________________________
linux-riscv mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-riscv