Merge tag 's390-6.12-2' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux

Pull more s390 updates from Vasily Gorbik:

- Clean up and improve vdso code: use SYM_* macros for function and
data annotations, add CFI annotations to fix GDB unwinding, optimize
the chacha20 implementation

- Add vfio-ap driver feature advertisement for use by libvirt and
mdevctl

* tag 's390-6.12-2' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux:
s390/vfio-ap: Driver feature advertisement
s390/vdso: Use one large alternative instead of an alternative branch
s390/vdso: Use SYM_DATA_START_LOCAL()/SYM_DATA_END() for data objects
tools: Add additional SYM_*() stubs to linkage.h
s390/vdso: Use macros for annotation of asm functions
s390/vdso: Add CFI annotations to __arch_chacha20_blocks_nostack()
s390/vdso: Fix comment within __arch_chacha20_blocks_nostack()
s390/vdso: Get rid of permutation constants

+86 -51
+30
Documentation/arch/s390/vfio-ap.rst
··· 999 999 resulting from plugging it in references a queue device bound to the vfio_ap 1000 1000 device driver. 1001 1001 1002 + Driver Features 1003 + =============== 1004 + The vfio_ap driver exposes a sysfs file containing supported features. 1005 + This exists so third party tools (like Libvirt and mdevctl) can query the 1006 + availability of specific features. 1007 + 1008 + The features list can be found here: /sys/bus/matrix/devices/matrix/features 1009 + 1010 + Entries are space delimited. Each entry consists of a combination of 1011 + alphanumeric and underscore characters. 1012 + 1013 + Example: 1014 + cat /sys/bus/matrix/devices/matrix/features 1015 + guest_matrix dyn ap_config 1016 + 1017 + the following features are advertised: 1018 + 1019 + ---------------+---------------------------------------------------------------+ 1020 + | Flag | Description | 1021 + +==============+===============================================================+ 1022 + | guest_matrix | guest_matrix attribute exists. It reports the matrix of | 1023 + | | adapters and domains that are or will be passed through to a | 1024 + | | guest when the mdev is attached to it. | 1025 + +--------------+---------------------------------------------------------------+ 1026 + | dyn | Indicates hot plug/unplug of AP adapters, domains and control | 1027 + | | domains for a guest to which the mdev is attached. | 1028 + +------------+-----------------------------------------------------------------+ 1029 + | ap_config | ap_config interface for one-shot modifications to mdev config | 1030 + +--------------+---------------------------------------------------------------+ 1031 + 1002 1032 Limitations 1003 1033 =========== 1004 1034 Live guest migration is not supported for guests using AP devices without
+4 -10
arch/s390/kernel/vdso64/vdso_user_wrapper.S
··· 13 13 * for details. 14 14 */ 15 15 .macro vdso_func func 16 - .globl __kernel_\func 17 - .type __kernel_\func,@function 18 - __ALIGN 19 - __kernel_\func: 16 + SYM_FUNC_START(__kernel_\func) 20 17 CFI_STARTPROC 21 18 aghi %r15,-STACK_FRAME_VDSO_OVERHEAD 22 19 CFI_DEF_CFA_OFFSET (STACK_FRAME_USER_OVERHEAD + STACK_FRAME_VDSO_OVERHEAD) ··· 29 32 CFI_RESTORE 15 30 33 br %r14 31 34 CFI_ENDPROC 32 - .size __kernel_\func,.-__kernel_\func 35 + SYM_FUNC_END(__kernel_\func) 33 36 .endm 34 37 35 38 vdso_func gettimeofday ··· 38 41 vdso_func getcpu 39 42 40 43 .macro vdso_syscall func,syscall 41 - .globl __kernel_\func 42 - .type __kernel_\func,@function 43 - __ALIGN 44 - __kernel_\func: 44 + SYM_FUNC_START(__kernel_\func) 45 45 CFI_STARTPROC 46 46 svc \syscall 47 47 /* Make sure we notice when a syscall returns, which shouldn't happen */ 48 48 .word 0 49 49 CFI_ENDPROC 50 - .size __kernel_\func,.-__kernel_\func 50 + SYM_FUNC_END(__kernel_\func) 51 51 .endm 52 52 53 53 vdso_syscall restart_syscall,__NR_restart_syscall
+36 -40
arch/s390/kernel/vdso64/vgetrandom-chacha.S
··· 1 1 /* SPDX-License-Identifier: GPL-2.0 */ 2 2 3 + #include <linux/stringify.h> 3 4 #include <linux/linkage.h> 4 5 #include <asm/alternative.h> 6 + #include <asm/dwarf.h> 5 7 #include <asm/fpu-insn.h> 6 8 7 9 #define STATE0 %v0 ··· 14 12 #define COPY1 %v5 15 13 #define COPY2 %v6 16 14 #define COPY3 %v7 17 - #define PERM4 %v16 18 - #define PERM8 %v17 19 - #define PERM12 %v18 20 15 #define BEPERM %v19 21 16 #define TMP0 %v20 22 17 #define TMP1 %v21 ··· 22 23 23 24 .section .rodata 24 25 25 - .balign 128 26 - .Lconstants: 26 + .balign 32 27 + SYM_DATA_START_LOCAL(chacha20_constants) 27 28 .long 0x61707865,0x3320646e,0x79622d32,0x6b206574 # endian-neutral 28 - .long 0x04050607,0x08090a0b,0x0c0d0e0f,0x00010203 # rotl 4 bytes 29 - .long 0x08090a0b,0x0c0d0e0f,0x00010203,0x04050607 # rotl 8 bytes 30 - .long 0x0c0d0e0f,0x00010203,0x04050607,0x08090a0b # rotl 12 bytes 31 29 .long 0x03020100,0x07060504,0x0b0a0908,0x0f0e0d0c # byte swap 30 + SYM_DATA_END(chacha20_constants) 32 31 33 32 .text 34 33 /* ··· 40 43 * size_t nblocks) 41 44 */ 42 45 SYM_FUNC_START(__arch_chacha20_blocks_nostack) 43 - larl %r1,.Lconstants 46 + CFI_STARTPROC 47 + larl %r1,chacha20_constants 44 48 45 49 /* COPY0 = "expand 32-byte k" */ 46 50 VL COPY0,0,,%r1 47 51 48 - /* PERM4-PERM12,BEPERM = byte selectors for VPERM */ 49 - VLM PERM4,BEPERM,16,%r1 52 + /* BEPERM = byte selectors for VPERM */ 53 + ALTERNATIVE __stringify(VL BEPERM,16,,%r1), "brcl 0,0", ALT_FACILITY(148) 50 54 51 55 /* COPY1,COPY2 = key */ 52 56 VLM COPY1,COPY2,0,%r3 ··· 87 89 VERLLF STATE1,STATE1,7 88 90 89 91 /* STATE1[0,1,2,3] = STATE1[1,2,3,0] */ 90 - VPERM STATE1,STATE1,STATE1,PERM4 92 + VSLDB STATE1,STATE1,STATE1,4 91 93 /* STATE2[0,1,2,3] = STATE2[2,3,0,1] */ 92 - VPERM STATE2,STATE2,STATE2,PERM8 94 + VSLDB STATE2,STATE2,STATE2,8 93 95 /* STATE3[0,1,2,3] = STATE3[3,0,1,2] */ 94 - VPERM STATE3,STATE3,STATE3,PERM12 96 + VSLDB STATE3,STATE3,STATE3,12 95 97 96 98 /* STATE0 += STATE1, STATE3 = rotl32(STATE3 ^ STATE0, 16) */ 97 99 VAF STATE0,STATE0,STATE1 ··· 114 116 VERLLF STATE1,STATE1,7 115 117 116 118 /* STATE1[0,1,2,3] = STATE1[3,0,1,2] */ 117 - VPERM STATE1,STATE1,STATE1,PERM12 119 + VSLDB STATE1,STATE1,STATE1,12 118 120 /* STATE2[0,1,2,3] = STATE2[2,3,0,1] */ 119 - VPERM STATE2,STATE2,STATE2,PERM8 121 + VSLDB STATE2,STATE2,STATE2,8 120 122 /* STATE3[0,1,2,3] = STATE3[1,2,3,0] */ 121 - VPERM STATE3,STATE3,STATE3,PERM4 123 + VSLDB STATE3,STATE3,STATE3,4 122 124 brctg %r0,.Ldoubleround 123 125 124 - /* OUTPUT0 = STATE0 + STATE0 */ 126 + /* OUTPUT0 = STATE0 + COPY0 */ 125 127 VAF STATE0,STATE0,COPY0 126 - /* OUTPUT1 = STATE1 + STATE1 */ 128 + /* OUTPUT1 = STATE1 + COPY1 */ 127 129 VAF STATE1,STATE1,COPY1 128 - /* OUTPUT2 = STATE2 + STATE2 */ 130 + /* OUTPUT2 = STATE2 + COPY2 */ 129 131 VAF STATE2,STATE2,COPY2 130 - /* OUTPUT2 = STATE3 + STATE3 */ 132 + /* OUTPUT3 = STATE3 + COPY3 */ 131 133 VAF STATE3,STATE3,COPY3 132 134 133 - /* 134 - * 32 bit wise little endian store to OUTPUT. If the vector 135 - * enhancement facility 2 is not installed use the slow path. 136 - */ 137 - ALTERNATIVE "brc 0xf,.Lstoreslow", "nop", ALT_FACILITY(148) 138 - VSTBRF STATE0,0,,%r2 139 - VSTBRF STATE1,16,,%r2 140 - VSTBRF STATE2,32,,%r2 141 - VSTBRF STATE3,48,,%r2 142 - .Lstoredone: 135 + ALTERNATIVE \ 136 + __stringify( \ 137 + /* Convert STATE to little endian and store to OUTPUT */\ 138 + VPERM TMP0,STATE0,STATE0,BEPERM; \ 139 + VPERM TMP1,STATE1,STATE1,BEPERM; \ 140 + VPERM TMP2,STATE2,STATE2,BEPERM; \ 141 + VPERM TMP3,STATE3,STATE3,BEPERM; \ 142 + VSTM TMP0,TMP3,0,%r2), \ 143 + __stringify( \ 144 + /* 32 bit wise little endian store to OUTPUT */ \ 145 + VSTBRF STATE0,0,,%r2; \ 146 + VSTBRF STATE1,16,,%r2; \ 147 + VSTBRF STATE2,32,,%r2; \ 148 + VSTBRF STATE3,48,,%r2; \ 149 + brcl 0,0), \ 150 + ALT_FACILITY(148) 143 151 144 152 /* ++COPY3.COUNTER */ 145 153 /* alsih %r3,1 */ ··· 177 173 VZERO TMP3 178 174 179 175 br %r14 180 - 181 - .Lstoreslow: 182 - /* Convert STATE to little endian format and store to OUTPUT */ 183 - VPERM TMP0,STATE0,STATE0,BEPERM 184 - VPERM TMP1,STATE1,STATE1,BEPERM 185 - VPERM TMP2,STATE2,STATE2,BEPERM 186 - VPERM TMP3,STATE3,STATE3,BEPERM 187 - VSTM TMP0,TMP3,0,%r2 188 - j .Lstoredone 176 + CFI_ENDPROC 189 177 SYM_FUNC_END(__arch_chacha20_blocks_nostack)
+13
drivers/s390/crypto/vfio_ap_drv.c
··· 26 26 struct ap_matrix_dev *matrix_dev; 27 27 debug_info_t *vfio_ap_dbf_info; 28 28 29 + static ssize_t features_show(struct device *dev, struct device_attribute *attr, char *buf) 30 + { 31 + return sysfs_emit(buf, "guest_matrix hotplug ap_config\n"); 32 + } 33 + static DEVICE_ATTR_RO(features); 34 + 35 + static struct attribute *matrix_dev_attrs[] = { 36 + &dev_attr_features.attr, 37 + NULL, 38 + }; 39 + ATTRIBUTE_GROUPS(matrix_dev); 40 + 29 41 /* Only type 10 adapters (CEX4 and later) are supported 30 42 * by the AP matrix device driver 31 43 */ ··· 80 68 .name = "vfio_ap", 81 69 .bus = &matrix_bus, 82 70 .suppress_bind_attrs = true, 71 + .dev_groups = matrix_dev_groups, 83 72 }; 84 73 85 74 static int vfio_ap_matrix_dev_create(void)
+3 -1
tools/include/linux/linkage.h
··· 4 4 #include <linux/export.h> 5 5 6 6 #define SYM_FUNC_START(x) .globl x; x: 7 - 8 7 #define SYM_FUNC_END(x) 8 + #define SYM_DATA_START(x) .globl x; x: 9 + #define SYM_DATA_START_LOCAL(x) x: 10 + #define SYM_DATA_END(x) 9 11 10 12 #endif /* _TOOLS_INCLUDE_LINUX_LINKAGE_H */