Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

powerpc/vas: Move VAS API to book3s common platform

The pseries platform will share vas and nx code and interfaces
with the PowerNV platform, so create the
arch/powerpc/platforms/book3s/ directory and move VAS API code
there. Functionality is not changed.

Signed-off-by: Haren Myneni <haren@linux.ibm.com>
Reviewed-by: Nicholas Piggin <npiggin@gmail.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/e05c8db17b9eabe3545b902d034238e4c6c08180.camel@linux.ibm.com

authored by

Haren Myneni and committed by
Michael Ellerman
413d6ed3 91cdbb95

+24 -18
+3
arch/powerpc/include/asm/vas.h
··· 162 162 */ 163 163 int vas_paste_crb(struct vas_window *win, int offset, bool re); 164 164 165 + void vas_win_paste_addr(struct vas_window *window, u64 *addr, 166 + int *len); 167 + 165 168 /* 166 169 * Register / unregister coprocessor type to VAS API which will be exported 167 170 * to user space. Applications can use this API to open / close window
+1
arch/powerpc/platforms/Kconfig
··· 20 20 source "arch/powerpc/platforms/44x/Kconfig" 21 21 source "arch/powerpc/platforms/40x/Kconfig" 22 22 source "arch/powerpc/platforms/amigaone/Kconfig" 23 + source "arch/powerpc/platforms/book3s/Kconfig" 23 24 24 25 config KVM_GUEST 25 26 bool "KVM Guest support"
+1
arch/powerpc/platforms/Makefile
··· 22 22 obj-$(CONFIG_PPC_PS3) += ps3/ 23 23 obj-$(CONFIG_EMBEDDED6xx) += embedded6xx/ 24 24 obj-$(CONFIG_AMIGAONE) += amigaone/ 25 + obj-$(CONFIG_PPC_BOOK3S) += book3s/
+15
arch/powerpc/platforms/book3s/Kconfig
··· 1 + # SPDX-License-Identifier: GPL-2.0 2 + config PPC_VAS 3 + bool "IBM Virtual Accelerator Switchboard (VAS)" 4 + depends on (PPC_POWERNV || PPC_PSERIES) && PPC_64K_PAGES 5 + default y 6 + help 7 + This enables support for IBM Virtual Accelerator Switchboard (VAS). 8 + 9 + VAS devices are found in POWER9-based and later systems, they 10 + provide access to accelerator coprocessors such as NX-GZIP and 11 + NX-842. This config allows the kernel to use NX-842 accelerators, 12 + and user-mode APIs for the NX-GZIP accelerator on POWER9 PowerNV 13 + and POWER10 PowerVM platforms. 14 + 15 + If unsure, say "N".
+2
arch/powerpc/platforms/book3s/Makefile
··· 1 + # SPDX-License-Identifier: GPL-2.0-only 2 + obj-$(CONFIG_PPC_VAS) += vas-api.o
-14
arch/powerpc/platforms/powernv/Kconfig
··· 33 33 Enabling this option allows for runtime allocation of memory (RAM) 34 34 for hardware tracing. 35 35 36 - config PPC_VAS 37 - bool "IBM Virtual Accelerator Switchboard (VAS)" 38 - depends on PPC_POWERNV && PPC_64K_PAGES 39 - default y 40 - help 41 - This enables support for IBM Virtual Accelerator Switchboard (VAS). 42 - 43 - VAS allows accelerators in co-processors like NX-GZIP and NX-842 44 - to be accessible to kernel subsystems and user processes. 45 - 46 - VAS adapters are found in POWER9 based systems. 47 - 48 - If unsure, say N. 49 - 50 36 config SCOM_DEBUGFS 51 37 bool "Expose SCOM controllers via debugfs" 52 38 depends on DEBUG_FS
+1 -1
arch/powerpc/platforms/powernv/Makefile
··· 18 18 obj-$(CONFIG_OPAL_PRD) += opal-prd.o 19 19 obj-$(CONFIG_PERF_EVENTS) += opal-imc.o 20 20 obj-$(CONFIG_PPC_MEMTRACE) += memtrace.o 21 - obj-$(CONFIG_PPC_VAS) += vas.o vas-window.o vas-debug.o vas-fault.o vas-api.o 21 + obj-$(CONFIG_PPC_VAS) += vas.o vas-window.o vas-debug.o vas-fault.o 22 22 obj-$(CONFIG_OCXL_BASE) += ocxl.o 23 23 obj-$(CONFIG_SCOM_DEBUGFS) += opal-xscom.o 24 24 obj-$(CONFIG_PPC_SECURE_BOOT) += opal-secvar.o
+1 -1
arch/powerpc/platforms/powernv/vas-api.c arch/powerpc/platforms/book3s/vas-api.c
··· 10 10 #include <linux/fs.h> 11 11 #include <linux/slab.h> 12 12 #include <linux/uaccess.h> 13 + #include <linux/io.h> 13 14 #include <asm/vas.h> 14 15 #include <uapi/asm/vas-api.h> 15 - #include "vas.h" 16 16 17 17 /* 18 18 * The driver creates the device node that can be used as follows:
-2
arch/powerpc/platforms/powernv/vas.h
··· 438 438 extern void vas_return_credit(struct vas_window *window, bool tx); 439 439 extern struct vas_window *vas_pswid_to_window(struct vas_instance *vinst, 440 440 uint32_t pswid); 441 - extern void vas_win_paste_addr(struct vas_window *window, u64 *addr, 442 - int *len); 443 441 444 442 static inline int vas_window_pid(struct vas_window *window) 445 443 {