diff options
Diffstat (limited to 'arch/s390/kernel/vdso64')
| -rw-r--r-- | arch/s390/kernel/vdso64/.gitignore | 2 | ||||
| -rw-r--r-- | arch/s390/kernel/vdso64/Makefile | 79 | ||||
| -rwxr-xr-x | arch/s390/kernel/vdso64/gen_vdso_offsets.sh | 15 | ||||
| -rw-r--r-- | arch/s390/kernel/vdso64/getcpu.c | 21 | ||||
| -rw-r--r-- | arch/s390/kernel/vdso64/note.S | 13 | ||||
| -rw-r--r-- | arch/s390/kernel/vdso64/vdso.h | 15 | ||||
| -rw-r--r-- | arch/s390/kernel/vdso64/vdso64.lds.S | 150 | ||||
| -rw-r--r-- | arch/s390/kernel/vdso64/vdso64_generic.c | 19 | ||||
| -rw-r--r-- | arch/s390/kernel/vdso64/vdso64_wrapper.S | 15 | ||||
| -rw-r--r-- | arch/s390/kernel/vdso64/vdso_user_wrapper.S | 52 | ||||
| -rw-r--r-- | arch/s390/kernel/vdso64/vgetrandom-chacha.S | 181 | ||||
| -rw-r--r-- | arch/s390/kernel/vdso64/vgetrandom.c | 14 |
12 files changed, 0 insertions, 576 deletions
diff --git a/arch/s390/kernel/vdso64/.gitignore b/arch/s390/kernel/vdso64/.gitignore deleted file mode 100644 index 4ec80685fecc..000000000000 --- a/arch/s390/kernel/vdso64/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -# SPDX-License-Identifier: GPL-2.0-only -vdso64.lds diff --git a/arch/s390/kernel/vdso64/Makefile b/arch/s390/kernel/vdso64/Makefile deleted file mode 100644 index d8f0df742809..000000000000 --- a/arch/s390/kernel/vdso64/Makefile +++ /dev/null @@ -1,79 +0,0 @@ -# SPDX-License-Identifier: GPL-2.0 -# List of files in the vdso - -# Include the generic Makefile to check the built vdso. -include $(srctree)/lib/vdso/Makefile.include -obj-vdso64 = vdso_user_wrapper.o note.o vgetrandom-chacha.o -obj-cvdso64 = vdso64_generic.o getcpu.o vgetrandom.o -VDSO_CFLAGS_REMOVE := -pg $(CC_FLAGS_FTRACE) $(CC_FLAGS_EXPOLINE) -CFLAGS_REMOVE_getcpu.o = $(VDSO_CFLAGS_REMOVE) -CFLAGS_REMOVE_vgetrandom.o = $(VDSO_CFLAGS_REMOVE) -CFLAGS_REMOVE_vdso64_generic.o = $(VDSO_CFLAGS_REMOVE) - -ifneq ($(c-getrandom-y),) - CFLAGS_vgetrandom.o += -include $(c-getrandom-y) -endif - -# Build rules - -targets := $(obj-vdso64) $(obj-cvdso64) vdso64.so vdso64.so.dbg -obj-vdso64 := $(addprefix $(obj)/, $(obj-vdso64)) -obj-cvdso64 := $(addprefix $(obj)/, $(obj-cvdso64)) - -KBUILD_AFLAGS += -DBUILD_VDSO -KBUILD_CFLAGS += -DBUILD_VDSO -DDISABLE_BRANCH_PROFILING - -KBUILD_AFLAGS_64 := $(filter-out -m64,$(KBUILD_AFLAGS)) -KBUILD_AFLAGS_64 += -m64 - -KBUILD_CFLAGS_64 := $(filter-out -m64,$(KBUILD_CFLAGS)) -KBUILD_CFLAGS_64 := $(filter-out -mpacked-stack,$(KBUILD_CFLAGS_64)) -KBUILD_CFLAGS_64 := $(filter-out -mno-pic-data-is-text-relative,$(KBUILD_CFLAGS_64)) -KBUILD_CFLAGS_64 := $(filter-out -munaligned-symbols,$(KBUILD_CFLAGS_64)) -KBUILD_CFLAGS_64 := $(filter-out -fno-asynchronous-unwind-tables,$(KBUILD_CFLAGS_64)) -KBUILD_CFLAGS_64 += -m64 -fPIC -fno-common -fno-builtin -fasynchronous-unwind-tables -ldflags-y := -shared -soname=linux-vdso64.so.1 \ - --hash-style=both --build-id=sha1 -T - -$(targets:%=$(obj)/%.dbg): KBUILD_CFLAGS = $(KBUILD_CFLAGS_64) -$(targets:%=$(obj)/%.dbg): KBUILD_AFLAGS = $(KBUILD_AFLAGS_64) - -obj-y += vdso64_wrapper.o -targets += vdso64.lds -CPPFLAGS_vdso64.lds += -P -C -U$(ARCH) - -# Force dependency (incbin is bad) -$(obj)/vdso64_wrapper.o : $(obj)/vdso64.so - -quiet_cmd_vdso_and_check = VDSO $@ - cmd_vdso_and_check = $(cmd_ld); $(cmd_vdso_check) - -# link rule for the .so file, .lds has to be first -$(obj)/vdso64.so.dbg: $(obj)/vdso64.lds $(obj-vdso64) $(obj-cvdso64) FORCE - $(call if_changed,vdso_and_check) - -# strip rule for the .so file -$(obj)/%.so: OBJCOPYFLAGS := -S -$(obj)/%.so: $(obj)/%.so.dbg FORCE - $(call if_changed,objcopy) - -# assembly rules for the .S files -$(obj-vdso64): %.o: %.S FORCE - $(call if_changed_dep,vdso64as) - -$(obj-cvdso64): %.o: %.c FORCE - $(call if_changed_dep,vdso64cc) - -# actual build commands -quiet_cmd_vdso64as = VDSO64A $@ - cmd_vdso64as = $(CC) $(a_flags) -c -o $@ $< -quiet_cmd_vdso64cc = VDSO64C $@ - cmd_vdso64cc = $(CC) $(c_flags) -c -o $@ $< - -# Generate VDSO offsets using helper script -gen-vdsosym := $(src)/gen_vdso_offsets.sh -quiet_cmd_vdsosym = VDSOSYM $@ - cmd_vdsosym = $(NM) $< | $(gen-vdsosym) | LC_ALL=C sort > $@ - -include/generated/vdso64-offsets.h: $(obj)/vdso64.so.dbg FORCE - $(call if_changed,vdsosym) diff --git a/arch/s390/kernel/vdso64/gen_vdso_offsets.sh b/arch/s390/kernel/vdso64/gen_vdso_offsets.sh deleted file mode 100755 index 37f05cb38dad..000000000000 --- a/arch/s390/kernel/vdso64/gen_vdso_offsets.sh +++ /dev/null @@ -1,15 +0,0 @@ -#!/bin/sh -# SPDX-License-Identifier: GPL-2.0 - -# -# Match symbols in the DSO that look like VDSO_*; produce a header file -# of constant offsets into the shared object. -# -# Doing this inside the Makefile will break the $(filter-out) function, -# causing Kbuild to rebuild the vdso-offsets header file every time. -# -# Inspired by arm64 version. -# - -LC_ALL=C -sed -n 's/\([0-9a-f]*\) . __kernel_\(.*\)/\#define vdso64_offset_\2\t0x\1/p' diff --git a/arch/s390/kernel/vdso64/getcpu.c b/arch/s390/kernel/vdso64/getcpu.c deleted file mode 100644 index 5c5d4a848b76..000000000000 --- a/arch/s390/kernel/vdso64/getcpu.c +++ /dev/null @@ -1,21 +0,0 @@ -// SPDX-License-Identifier: GPL-2.0 -/* Copyright IBM Corp. 2020 */ - -#include <linux/compiler.h> -#include <linux/getcpu.h> -#include <asm/timex.h> -#include "vdso.h" - -int __s390_vdso_getcpu(unsigned *cpu, unsigned *node, struct getcpu_cache *unused) -{ - union tod_clock clk; - - /* CPU number is stored in the programmable field of the TOD clock */ - store_tod_clock_ext(&clk); - if (cpu) - *cpu = clk.pf; - /* NUMA node is always zero */ - if (node) - *node = 0; - return 0; -} diff --git a/arch/s390/kernel/vdso64/note.S b/arch/s390/kernel/vdso64/note.S deleted file mode 100644 index db19d0680a0a..000000000000 --- a/arch/s390/kernel/vdso64/note.S +++ /dev/null @@ -1,13 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0 */ -/* - * This supplies .note.* sections to go into the PT_NOTE inside the vDSO text. - * Here we can supply some information useful to userland. - */ - -#include <linux/uts.h> -#include <linux/version.h> -#include <linux/elfnote.h> - -ELFNOTE_START(Linux, 0, "a") - .long LINUX_VERSION_CODE -ELFNOTE_END diff --git a/arch/s390/kernel/vdso64/vdso.h b/arch/s390/kernel/vdso64/vdso.h deleted file mode 100644 index 9e5397e7b590..000000000000 --- a/arch/s390/kernel/vdso64/vdso.h +++ /dev/null @@ -1,15 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0 */ -#ifndef __ARCH_S390_KERNEL_VDSO64_VDSO_H -#define __ARCH_S390_KERNEL_VDSO64_VDSO_H - -#include <vdso/datapage.h> - -struct getcpu_cache; - -int __s390_vdso_getcpu(unsigned *cpu, unsigned *node, struct getcpu_cache *unused); -int __s390_vdso_gettimeofday(struct __kernel_old_timeval *tv, struct timezone *tz); -int __s390_vdso_clock_gettime(clockid_t clock, struct __kernel_timespec *ts); -int __s390_vdso_clock_getres(clockid_t clock, struct __kernel_timespec *ts); -ssize_t __kernel_getrandom(void *buffer, size_t len, unsigned int flags, void *opaque_state, size_t opaque_len); - -#endif /* __ARCH_S390_KERNEL_VDSO64_VDSO_H */ diff --git a/arch/s390/kernel/vdso64/vdso64.lds.S b/arch/s390/kernel/vdso64/vdso64.lds.S deleted file mode 100644 index e4f6551ae898..000000000000 --- a/arch/s390/kernel/vdso64/vdso64.lds.S +++ /dev/null @@ -1,150 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0 */ -/* - * This is the infamous ld script for the 64 bits vdso - * library - */ - -#include <asm/vdso/vsyscall.h> -#include <asm/page.h> -#include <asm/vdso.h> -#include <vdso/datapage.h> - -OUTPUT_FORMAT("elf64-s390", "elf64-s390", "elf64-s390") -OUTPUT_ARCH(s390:64-bit) - -SECTIONS -{ - VDSO_VVAR_SYMS - - . = SIZEOF_HEADERS; - - .hash : { *(.hash) } :text - .gnu.hash : { *(.gnu.hash) } - .dynsym : { *(.dynsym) } - .dynstr : { *(.dynstr) } - .gnu.version : { *(.gnu.version) } - .gnu.version_d : { *(.gnu.version_d) } - .gnu.version_r : { *(.gnu.version_r) } - - .note : { *(.note.*) } :text :note - - . = ALIGN(16); - .text : { - *(.text .stub .text.* .gnu.linkonce.t.*) - } :text - PROVIDE(__etext = .); - PROVIDE(_etext = .); - PROVIDE(etext = .); - - /* - * Other stuff is appended to the text segment: - */ - .rodata : { *(.rodata .rodata.* .gnu.linkonce.r.*) } - .rodata1 : { *(.rodata1) } - - . = ALIGN(8); - .altinstructions : { *(.altinstructions) } - .altinstr_replacement : { *(.altinstr_replacement) } - - .dynamic : { *(.dynamic) } :text :dynamic - - .eh_frame_hdr : { *(.eh_frame_hdr) } :text :eh_frame_hdr - .eh_frame : { KEEP (*(.eh_frame)) } :text - .gcc_except_table : { *(.gcc_except_table .gcc_except_table.*) } - - .rela.dyn ALIGN(8) : { *(.rela.dyn) } - .got ALIGN(8) : { *(.got .toc) } - .got.plt ALIGN(8) : { *(.got.plt) } - - _end = .; - PROVIDE(end = .); - - /* - * Stabs debugging sections are here too. - */ - .stab 0 : { *(.stab) } - .stabstr 0 : { *(.stabstr) } - .stab.excl 0 : { *(.stab.excl) } - .stab.exclstr 0 : { *(.stab.exclstr) } - .stab.index 0 : { *(.stab.index) } - .stab.indexstr 0 : { *(.stab.indexstr) } - .comment 0 : { *(.comment) } - - /* - * DWARF debug sections. - * Symbols in the DWARF debugging sections are relative to the - * beginning of the section so we begin them at 0. - */ - /* DWARF 1 */ - .debug 0 : { *(.debug) } - .line 0 : { *(.line) } - /* GNU DWARF 1 extensions */ - .debug_srcinfo 0 : { *(.debug_srcinfo) } - .debug_sfnames 0 : { *(.debug_sfnames) } - /* DWARF 1.1 and DWARF 2 */ - .debug_aranges 0 : { *(.debug_aranges) } - .debug_pubnames 0 : { *(.debug_pubnames) } - /* DWARF 2 */ - .debug_info 0 : { *(.debug_info .gnu.linkonce.wi.*) } - .debug_abbrev 0 : { *(.debug_abbrev) } - .debug_line 0 : { *(.debug_line) } - .debug_frame 0 : { *(.debug_frame) } - .debug_str 0 : { *(.debug_str) } - .debug_loc 0 : { *(.debug_loc) } - .debug_macinfo 0 : { *(.debug_macinfo) } - /* SGI/MIPS DWARF 2 extensions */ - .debug_weaknames 0 : { *(.debug_weaknames) } - .debug_funcnames 0 : { *(.debug_funcnames) } - .debug_typenames 0 : { *(.debug_typenames) } - .debug_varnames 0 : { *(.debug_varnames) } - /* DWARF 3 */ - .debug_pubtypes 0 : { *(.debug_pubtypes) } - .debug_ranges 0 : { *(.debug_ranges) } - .gnu.attributes 0 : { KEEP (*(.gnu.attributes)) } - - /DISCARD/ : { - *(.note.GNU-stack) - *(.branch_lt) - *(.data .data.* .gnu.linkonce.d.* .sdata*) - *(.bss .sbss .dynbss .dynsbss) - } -} - -/* - * Very old versions of ld do not recognize this name token; use the constant. - */ -#define PT_GNU_EH_FRAME 0x6474e550 - -/* - * We must supply the ELF program headers explicitly to get just one - * PT_LOAD segment, and set the flags explicitly to make segments read-only. - */ -PHDRS -{ - text PT_LOAD FILEHDR PHDRS FLAGS(5); /* PF_R|PF_X */ - dynamic PT_DYNAMIC FLAGS(4); /* PF_R */ - note PT_NOTE FLAGS(4); /* PF_R */ - eh_frame_hdr PT_GNU_EH_FRAME; -} - -/* - * This controls what symbols we export from the DSO. - */ -VERSION -{ - VDSO_VERSION_STRING { - global: - /* - * Has to be there for the kernel to find - */ - __kernel_gettimeofday; - __kernel_clock_gettime; - __kernel_clock_getres; - __kernel_getcpu; - __kernel_restart_syscall; - __kernel_rt_sigreturn; - __kernel_sigreturn; - __kernel_getrandom; - local: *; - }; -} diff --git a/arch/s390/kernel/vdso64/vdso64_generic.c b/arch/s390/kernel/vdso64/vdso64_generic.c deleted file mode 100644 index a9aa75643c08..000000000000 --- a/arch/s390/kernel/vdso64/vdso64_generic.c +++ /dev/null @@ -1,19 +0,0 @@ -// SPDX-License-Identifier: GPL-2.0 -#include "../../../../lib/vdso/gettimeofday.c" -#include "vdso.h" - -int __s390_vdso_gettimeofday(struct __kernel_old_timeval *tv, - struct timezone *tz) -{ - return __cvdso_gettimeofday(tv, tz); -} - -int __s390_vdso_clock_gettime(clockid_t clock, struct __kernel_timespec *ts) -{ - return __cvdso_clock_gettime(clock, ts); -} - -int __s390_vdso_clock_getres(clockid_t clock, struct __kernel_timespec *ts) -{ - return __cvdso_clock_getres(clock, ts); -} diff --git a/arch/s390/kernel/vdso64/vdso64_wrapper.S b/arch/s390/kernel/vdso64/vdso64_wrapper.S deleted file mode 100644 index 672184998623..000000000000 --- a/arch/s390/kernel/vdso64/vdso64_wrapper.S +++ /dev/null @@ -1,15 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0 */ -#include <linux/init.h> -#include <linux/linkage.h> -#include <asm/page.h> - - __PAGE_ALIGNED_DATA - - .globl vdso64_start, vdso64_end - .balign PAGE_SIZE -vdso64_start: - .incbin "arch/s390/kernel/vdso64/vdso64.so" - .balign PAGE_SIZE -vdso64_end: - - .previous diff --git a/arch/s390/kernel/vdso64/vdso_user_wrapper.S b/arch/s390/kernel/vdso64/vdso_user_wrapper.S deleted file mode 100644 index aa06c85bcbd3..000000000000 --- a/arch/s390/kernel/vdso64/vdso_user_wrapper.S +++ /dev/null @@ -1,52 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0 */ -#include <linux/linkage.h> -#include <asm/vdso.h> -#include <asm/unistd.h> -#include <asm/asm-offsets.h> -#include <asm/dwarf.h> -#include <asm/ptrace.h> - -/* - * Older glibc version called vdso without allocating a stackframe. This wrapper - * is just used to allocate a stackframe. See - * https://sourceware.org/git/?p=glibc.git;a=commit;h=478593e6374f3818da39332260dc453cb19cfa1e - * for details. - */ -.macro vdso_func func -SYM_FUNC_START(__kernel_\func) - CFI_STARTPROC - aghi %r15,-STACK_FRAME_VDSO_OVERHEAD - CFI_DEF_CFA_OFFSET (STACK_FRAME_USER_OVERHEAD + STACK_FRAME_VDSO_OVERHEAD) - CFI_VAL_OFFSET 15,-STACK_FRAME_USER_OVERHEAD - stg %r14,__SFVDSO_RETURN_ADDRESS(%r15) - CFI_REL_OFFSET 14,__SFVDSO_RETURN_ADDRESS - xc __SFUSER_BACKCHAIN(8,%r15),__SFUSER_BACKCHAIN(%r15) - brasl %r14,__s390_vdso_\func - lg %r14,__SFVDSO_RETURN_ADDRESS(%r15) - CFI_RESTORE 14 - aghi %r15,STACK_FRAME_VDSO_OVERHEAD - CFI_DEF_CFA_OFFSET STACK_FRAME_USER_OVERHEAD - CFI_RESTORE 15 - br %r14 - CFI_ENDPROC -SYM_FUNC_END(__kernel_\func) -.endm - -vdso_func gettimeofday -vdso_func clock_getres -vdso_func clock_gettime -vdso_func getcpu - -.macro vdso_syscall func,syscall -SYM_FUNC_START(__kernel_\func) - CFI_STARTPROC - svc \syscall - /* Make sure we notice when a syscall returns, which shouldn't happen */ - .word 0 - CFI_ENDPROC -SYM_FUNC_END(__kernel_\func) -.endm - -vdso_syscall restart_syscall,__NR_restart_syscall -vdso_syscall sigreturn,__NR_sigreturn -vdso_syscall rt_sigreturn,__NR_rt_sigreturn diff --git a/arch/s390/kernel/vdso64/vgetrandom-chacha.S b/arch/s390/kernel/vdso64/vgetrandom-chacha.S deleted file mode 100644 index 09c034c2f853..000000000000 --- a/arch/s390/kernel/vdso64/vgetrandom-chacha.S +++ /dev/null @@ -1,181 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0 */ - -#include <linux/stringify.h> -#include <linux/linkage.h> -#include <asm/alternative.h> -#include <asm/dwarf.h> -#include <asm/fpu-insn.h> - -#define STATE0 %v0 -#define STATE1 %v1 -#define STATE2 %v2 -#define STATE3 %v3 -#define COPY0 %v4 -#define COPY1 %v5 -#define COPY2 %v6 -#define COPY3 %v7 -#define BEPERM %v19 -#define TMP0 %v20 -#define TMP1 %v21 -#define TMP2 %v22 -#define TMP3 %v23 - - .section .rodata - - .balign 32 -SYM_DATA_START_LOCAL(chacha20_constants) - .long 0x61707865,0x3320646e,0x79622d32,0x6b206574 # endian-neutral - .long 0x03020100,0x07060504,0x0b0a0908,0x0f0e0d0c # byte swap -SYM_DATA_END(chacha20_constants) - - .text -/* - * s390 ChaCha20 implementation meant for vDSO. Produces a given positive - * number of blocks of output with nonce 0, taking an input key and 8-bytes - * counter. Does not spill to the stack. - * - * void __arch_chacha20_blocks_nostack(uint8_t *dst_bytes, - * const uint8_t *key, - * uint32_t *counter, - * size_t nblocks) - */ -SYM_FUNC_START(__arch_chacha20_blocks_nostack) - CFI_STARTPROC - larl %r1,chacha20_constants - - /* COPY0 = "expand 32-byte k" */ - VL COPY0,0,,%r1 - - /* BEPERM = byte selectors for VPERM */ - ALTERNATIVE __stringify(VL BEPERM,16,,%r1), "brcl 0,0", ALT_FACILITY(148) - - /* COPY1,COPY2 = key */ - VLM COPY1,COPY2,0,%r3 - - /* COPY3 = counter || zero nonce */ - lg %r3,0(%r4) - VZERO COPY3 - VLVGG COPY3,%r3,0 - - lghi %r1,0 -.Lblock: - VLR STATE0,COPY0 - VLR STATE1,COPY1 - VLR STATE2,COPY2 - VLR STATE3,COPY3 - - lghi %r0,10 -.Ldoubleround: - /* STATE0 += STATE1, STATE3 = rotl32(STATE3 ^ STATE0, 16) */ - VAF STATE0,STATE0,STATE1 - VX STATE3,STATE3,STATE0 - VERLLF STATE3,STATE3,16 - - /* STATE2 += STATE3, STATE1 = rotl32(STATE1 ^ STATE2, 12) */ - VAF STATE2,STATE2,STATE3 - VX STATE1,STATE1,STATE2 - VERLLF STATE1,STATE1,12 - - /* STATE0 += STATE1, STATE3 = rotl32(STATE3 ^ STATE0, 8) */ - VAF STATE0,STATE0,STATE1 - VX STATE3,STATE3,STATE0 - VERLLF STATE3,STATE3,8 - - /* STATE2 += STATE3, STATE1 = rotl32(STATE1 ^ STATE2, 7) */ - VAF STATE2,STATE2,STATE3 - VX STATE1,STATE1,STATE2 - VERLLF STATE1,STATE1,7 - - /* STATE1[0,1,2,3] = STATE1[1,2,3,0] */ - VSLDB STATE1,STATE1,STATE1,4 - /* STATE2[0,1,2,3] = STATE2[2,3,0,1] */ - VSLDB STATE2,STATE2,STATE2,8 - /* STATE3[0,1,2,3] = STATE3[3,0,1,2] */ - VSLDB STATE3,STATE3,STATE3,12 - - /* STATE0 += STATE1, STATE3 = rotl32(STATE3 ^ STATE0, 16) */ - VAF STATE0,STATE0,STATE1 - VX STATE3,STATE3,STATE0 - VERLLF STATE3,STATE3,16 - - /* STATE2 += STATE3, STATE1 = rotl32(STATE1 ^ STATE2, 12) */ - VAF STATE2,STATE2,STATE3 - VX STATE1,STATE1,STATE2 - VERLLF STATE1,STATE1,12 - - /* STATE0 += STATE1, STATE3 = rotl32(STATE3 ^ STATE0, 8) */ - VAF STATE0,STATE0,STATE1 - VX STATE3,STATE3,STATE0 - VERLLF STATE3,STATE3,8 - - /* STATE2 += STATE3, STATE1 = rotl32(STATE1 ^ STATE2, 7) */ - VAF STATE2,STATE2,STATE3 - VX STATE1,STATE1,STATE2 - VERLLF STATE1,STATE1,7 - - /* STATE1[0,1,2,3] = STATE1[3,0,1,2] */ - VSLDB STATE1,STATE1,STATE1,12 - /* STATE2[0,1,2,3] = STATE2[2,3,0,1] */ - VSLDB STATE2,STATE2,STATE2,8 - /* STATE3[0,1,2,3] = STATE3[1,2,3,0] */ - VSLDB STATE3,STATE3,STATE3,4 - brctg %r0,.Ldoubleround - - /* OUTPUT0 = STATE0 + COPY0 */ - VAF STATE0,STATE0,COPY0 - /* OUTPUT1 = STATE1 + COPY1 */ - VAF STATE1,STATE1,COPY1 - /* OUTPUT2 = STATE2 + COPY2 */ - VAF STATE2,STATE2,COPY2 - /* OUTPUT3 = STATE3 + COPY3 */ - VAF STATE3,STATE3,COPY3 - - ALTERNATIVE \ - __stringify( \ - /* Convert STATE to little endian and store to OUTPUT */\ - VPERM TMP0,STATE0,STATE0,BEPERM; \ - VPERM TMP1,STATE1,STATE1,BEPERM; \ - VPERM TMP2,STATE2,STATE2,BEPERM; \ - VPERM TMP3,STATE3,STATE3,BEPERM; \ - VSTM TMP0,TMP3,0,%r2), \ - __stringify( \ - /* 32 bit wise little endian store to OUTPUT */ \ - VSTBRF STATE0,0,,%r2; \ - VSTBRF STATE1,16,,%r2; \ - VSTBRF STATE2,32,,%r2; \ - VSTBRF STATE3,48,,%r2; \ - brcl 0,0), \ - ALT_FACILITY(148) - - /* ++COPY3.COUNTER */ - /* alsih %r3,1 */ - .insn rilu,0xcc0a00000000,%r3,1 - alcr %r3,%r1 - VLVGG COPY3,%r3,0 - - /* OUTPUT += 64, --NBLOCKS */ - aghi %r2,64 - brctg %r5,.Lblock - - /* COUNTER = COPY3.COUNTER */ - stg %r3,0(%r4) - - /* Zero out potentially sensitive regs */ - VZERO STATE0 - VZERO STATE1 - VZERO STATE2 - VZERO STATE3 - VZERO COPY1 - VZERO COPY2 - - /* Early exit if TMP0-TMP3 have not been used */ - ALTERNATIVE "nopr", "br %r14", ALT_FACILITY(148) - - VZERO TMP0 - VZERO TMP1 - VZERO TMP2 - VZERO TMP3 - - br %r14 - CFI_ENDPROC -SYM_FUNC_END(__arch_chacha20_blocks_nostack) diff --git a/arch/s390/kernel/vdso64/vgetrandom.c b/arch/s390/kernel/vdso64/vgetrandom.c deleted file mode 100644 index b5268b507fb5..000000000000 --- a/arch/s390/kernel/vdso64/vgetrandom.c +++ /dev/null @@ -1,14 +0,0 @@ -// SPDX-License-Identifier: GPL-2.0 - -#include <asm/facility.h> -#include <uapi/asm-generic/errno.h> -#include "vdso.h" - -ssize_t __kernel_getrandom(void *buffer, size_t len, unsigned int flags, void *opaque_state, size_t opaque_len) -{ - if (test_facility(129)) - return __cvdso_getrandom(buffer, len, flags, opaque_state, opaque_len); - if (unlikely(opaque_len == ~0UL && !buffer && !len && !flags)) - return -ENOSYS; - return getrandom_syscall(buffer, len, flags); -} |
