[Skiboot] [PATCH v6 0/7] Enable VAS
sukadev at linux.vnet.ibm.com
Thu May 25 15:02:07 AEST 2017
Power9 introduces a hardware subsystem referred to as the Virtual
Accelerator Switchboard (VAS). VAS allows kernel subsystems and user
space processes to directly access the Nest Accelerator (NX) engines
which implement compression and encryption algorithms in the hardware.
NX has been in Power processors since Power7+, but access to the NX
engines was through the 'icswx' instruction which is only available
to the kernel/hypervisor. Starting with Power9, access to the NX
engines is provided to both kernel and user space processes through
The switchboard (i.e VAS) multiplexes accesses between "receivers" and
"senders", where the "receivers" are typically the NX engines and
"senders" are the kernel subsystems and user processors that wish to
access the receivers (NX engines). Once a sender is "connected" to
a receiver through the switchboard, the sender can submit compression/
encryption requests to the hardware using the new (in PowerISA 3.0)
"copy" and "paste" instructions.
In the initial OPAL and PowerNV kernel patchsets, the "senders" can
only be kernel subsystems (i.e NX-842 driver). A follow-on patch set
will allow senders to be user-space processes.
This OPAL patch set initializes the VAS registers and makes the VAS
hardware available to the NX-842 driver in the kernel. It also provides
some interfaces that the NX-842 subsystem in OPAL needs to initialize
the NX hardware in Power9.
This patchset has been tested in Simics and P9 hardware environments
- the corresponding VAS kernel patchset 
- modified NX-842 OPAL 
- modified NX-842 kernel drivers  and
- a compression self-test module from Power8.
On the hardware the compression requests (CRBs) are submitted to the
coprocessors using the paste instruction. Verifying actual compression
needs additional work.
A newer version of the VAS kernel patchset, as well as the OPAL and
kernel patchsets for NX-842 driver will be posted separately. All four
are needed to effectively use VAS/NX in Power9.
Thanks to Haren Myneni for the NX-842 modifications and help with
testing, Ben Herrenschmidt, Michael Ellerman and Michael Neuling for
input on working with the hardware and Oliver O'Halloran and Balbir
Singh for review comments.
 Previous version of VAS kernel patch set:
 NX Skiboot patches (from Haren Myneni)
 NX Kernel patches (from Haren Myneni)
- [Ben Herrenschmidt] Have the hdata create an xscom node for VAS
and use that to detect and export VAS parameters to the OS using
device tree nodes in the root of device-tree; Export the window-id
shift mask as a reg property (i.e as bitfield with start-bit and
- [Michael Neuling] Use the new phys_map_get() interface to get the
Hypervisor and OS/User Window context mapping info
- Fix RMA register configuration (should include node-id/chip-id)
- Move VAS related fields in proc_chip into a 'struct vas' object
- Create device tree entries for HVWC, UWC and Paste address; drop
the vas-#windows entries as number of windows are constant
- Assign an unique vas-id to each instance and export it in DT.
- Drop the patch to read FIR. Will include it in a follow-on patchset.
- Comments from Balbir: Made some functions inline; added some device
- Dropped the patch to allocate/return IRQ ports for now. Will
repost the patch later.
- [Oliver O'Halloran] Fold changes to vas.c and Makefile.inc from
patch 1 into current patch; use constant 'true' for the
(unnecessary) macros that were removed by earlier patch;
free wcbs memory if any chip fails initialization;use
prolog()/prerror() instead of printf; Use out_be64() to
write to the MMIO address
- [Oliver O'Halloran, Alistair Popple] Use proc_gen to check for P9
- Drop BenH's patch (interface to retrieve IPI trigger port) from
this set since it has been merged into skiboot.
- Minor code reorg to address Alistair Popple's comment (Patch 5).
Sukadev Bhattiprolu (9):
Define helpers to extract P9 node/chip ids
vas: Create xscom DT node in hdata
vas: Define macros of constants and register fields
vas: Initialize VAS registers
vas: Define helpers to compute window paste address
vas: Create MMIO device tree node
vas: Define vas_get_hvwc_mmio_bar interface
vas: Define vas_get_wcbs_bar interface
nx: Add device tree node for Power9
core/Makefile.inc | 2 +-
core/init.c | 4 +
core/vas.c | 452 ++++++++++++++++++++++++++++++++++++++++++++++++
doc/device-tree/vas.rst | 28 +++
hdata/spira.c | 18 ++
include/chip.h | 7 +
include/vas.h | 144 +++++++++++++++
7 files changed, 654 insertions(+), 1 deletion(-)
create mode 100644 core/vas.c
create mode 100644 doc/device-tree/vas.rst
create mode 100644 include/vas.h
More information about the Skiboot