All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v4 00/16] Enable VAS and NX-GZIP support on powerVM
@ 2021-05-21  9:25 ` Haren Myneni
  0 siblings, 0 replies; 86+ messages in thread
From: Haren Myneni @ 2021-05-21  9:25 UTC (permalink / raw)
  To: linuxppc-dev, linux-crypto, mpe, herbert, npiggin; +Cc: hbabu, haren


Virtual Accelerator Switchboard (VAS) allows kernel subsystems
and user space processes to directly access the Nest Accelerator
(NX) engines which provides HW compression. The true user mode
VAS/NX support on PowerNV is already included in Linux. Whereas
PowerVM support is available from P10 onwards.

This patch series enables VAS / NX-GZIP on powerVM which allows
the user space to do copy/paste with the same existing interface
that is available on powerNV.

VAS Enablement:
- Get all VAS capabilities using H_QUERY_VAS_CAPABILITIES that are
  available in the hypervisor. These capabilities tells OS which
  type of features (credit types such as Default and Quality of
  Service (QoS)). Also gives specific capabilities for each credit
  type: Maximum window credits, Maximum LPAR credits, Target credits
  in that parition (varies from max LPAR credits based DLPAR
  operation), whether supports user mode COPY/PASTE and etc.
- Register LPAR VAS operations such as open window. get paste
  address and close window with the current VAS user space API.
- Open window operation - Use H_ALLOCATE_VAS_WINDOW HCALL to open
  window and H_MODIFY_VAS_WINDOW HCALL to setup the window with LPAR
  PID and etc.
- mmap to paste address returned in H_ALLOCATE_VAS_WINDOW HCALL
- To close window, H_DEALLOCATE_VAS_WINDOW HCALL is used to close in
  the hypervisor.

NX Enablement:
- Get NX capabilities from the the hypervisor which provides Maximum
  buffer length in a single GZIP request, recommended minimum
  compression / decompression lengths.
- Register to VAS to enable user space VAS API

Main feature differences with powerNV implementation:
- Each VAS window will be configured with a number of credits which
  means that many requests can be issues simultaniously on that
  window. On powerNV, 1K credits are configured per window.
  Whereas on powerVM, the hypervisor allows 1 credit per window
  at present.
- The hypervisor introduced 2 different types of credits: Default -
  Uses normal priority FIFO and Quality of Service (QoS) - Uses high
  priority FIFO. On powerVM, VAS/NX HW resources are shared across
  LPARs. The total number of credits available on a system depends
  on cores configured. We may see more credits are assigned across
  the system than the NX HW resources can handle. So to avoid NX HW
  contention, the hypervisor introduced QoS credits which can be
  configured by system administration with HMC API. Then the total
  number of available default credits on LPAR varies based on QoS
  credits configured.
- On powerNV, windows are allocated on a specific VAS instance
  and the user space can select VAS instance with the open window
  ioctl. Since VAS instances can be shared across partitions on
  powerVM, the hypervisor manages window allocations on different
  VAS instances. So H_ALLOCATE_VAS_WINDOW allows to select by domain
  indentifiers (H_HOME_NODE_ASSOCIATIVITY values by cpu). By default
  the hypervisor selects VAS instance closer to CPU resources that the
  parition uses. So vas_id in ioctl interface is ignored on powerVM
  except vas_id=-1 which is used to allocate window based on CPU that
  the process is executing. This option is needed for process affinity
  to NUMA node.

  The existing applications that linked with libnxz should work as
  long as the job request length is restricted to
  req_max_processed_len.

  Tested the following patches on P10 successfully with test cases
  given: https://github.com/libnxz/power-gzip

  Note: The hypervisor supports user mode NX from p10 onwards. Linux
        supports user mode VAS/NX on P10 only with radix page tables.

Patches 1- 5:   Move the code that is needed for both powerNV and
                powerVM to powerpc book3s platform directory
Patch 6:        Modify vas-window struct to support both and the
                related changes.
Patch 7:        Define HCALL and the related VAS/NXGZIP specific
                structs.
Patch 8:        Define QoS credit flag in window open ioctl
Patch 9:        Implement Allocate, Modify and Deallocate HCALLs
Patch 10:        Retrieve VAS capabilities from the hypervisor
Patch 11;       Implement window operations and integrate with API
Patch 12:       Setup IRQ and NX fault handling
Patch 13 - 14:  Make the code common to add NX-GZIP enablement
Patch 15:       Get NX capabilities from the hypervisor
patch 16;       Add sysfs interface to expose NX capabilities

Changes in V2:
  - Rebase on 5.12-rc6
  - Moved VAS Kconfig changes to arch/powerpc/platform as suggested
    by Christophe Leroy
  - build fix with allyesconfig (reported by kernel test build)

Changes in V3:
  - Rebase on 5.12-rc7
  - Moved vas-api.c and VAS Kconfig changes to
    arch/powerpc/platform/book3s as Michael Ellerman suggested

Changes in V4:
  - Rebase on 5.13-rc2
  - Changes based on review comments from Nicholas Piggin
    - Add seperate patch to define user window operations
    - Drop "sysfs interface to export VAS capabilities" patch
      This interface is mainly needed for DLPAR operations
      and this patch will be included when DLPAR/LPM support
      is added.
    - Other cleanup changes

Haren Myneni (16):
  powerpc/vas: Move VAS API to book3s common platform
  powerpc/powernv/vas: Rename register/unregister functions
  powerpc/vas: Add platform specific user window operations
  powerpc/vas: Create take/drop pid and mm reference functions
  powerpc/vas: Move update_csb/dump_crb to common book3s platform
  powerpc/vas:  Define and use common vas_window struct
  powerpc/pseries/vas: Define VAS/NXGZIP HCALLs and structs
  powerpc/vas: Define QoS credit flag to allocate window
  powerpc/pseries/vas: Add HCALL wrappers for VAS handling
  powerpc/pseries/vas: Implement getting capabilities from hypervisor
  powerpc/pseries/vas: Integrate API with open/close windows
  powerpc/pseries/vas: Setup IRQ and fault handling
  crypto/nx: Rename nx-842-pseries file name to nx-common-pseries
  crypto/nx: Register and unregister VAS interface
  crypto/nx: Get NX capabilities for GZIP coprocessor type
  crypto/nx: Add sysfs interface to export NX capabilities

 arch/powerpc/include/asm/hvcall.h             |   7 +
 arch/powerpc/include/asm/vas.h                | 135 +++-
 arch/powerpc/include/uapi/asm/vas-api.h       |   6 +-
 arch/powerpc/platforms/Kconfig                |   1 +
 arch/powerpc/platforms/Makefile               |   1 +
 arch/powerpc/platforms/book3s/Kconfig         |  15 +
 arch/powerpc/platforms/book3s/Makefile        |   2 +
 arch/powerpc/platforms/book3s/vas-api.c       | 484 +++++++++++++
 arch/powerpc/platforms/powernv/Kconfig        |  14 -
 arch/powerpc/platforms/powernv/Makefile       |   2 +-
 arch/powerpc/platforms/powernv/vas-api.c      | 278 --------
 arch/powerpc/platforms/powernv/vas-debug.c    |  12 +-
 arch/powerpc/platforms/powernv/vas-fault.c    | 155 +---
 arch/powerpc/platforms/powernv/vas-trace.h    |   6 +-
 arch/powerpc/platforms/powernv/vas-window.c   | 246 ++++---
 arch/powerpc/platforms/powernv/vas.h          |  42 +-
 arch/powerpc/platforms/pseries/Makefile       |   1 +
 arch/powerpc/platforms/pseries/vas.c          | 672 ++++++++++++++++++
 arch/powerpc/platforms/pseries/vas.h          | 110 +++
 drivers/crypto/nx/Kconfig                     |   1 +
 drivers/crypto/nx/Makefile                    |   2 +-
 drivers/crypto/nx/nx-common-powernv.c         |   6 +-
 .../{nx-842-pseries.c => nx-common-pseries.c} | 141 ++++
 23 files changed, 1738 insertions(+), 601 deletions(-)
 create mode 100644 arch/powerpc/platforms/book3s/Kconfig
 create mode 100644 arch/powerpc/platforms/book3s/Makefile
 create mode 100644 arch/powerpc/platforms/book3s/vas-api.c
 delete mode 100644 arch/powerpc/platforms/powernv/vas-api.c
 create mode 100644 arch/powerpc/platforms/pseries/vas.c
 create mode 100644 arch/powerpc/platforms/pseries/vas.h
 rename drivers/crypto/nx/{nx-842-pseries.c => nx-common-pseries.c} (90%)

-- 
2.18.2



^ permalink raw reply	[flat|nested] 86+ messages in thread

end of thread, other threads:[~2021-06-05  3:04 UTC | newest]

Thread overview: 86+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-21  9:25 [PATCH v4 00/16] Enable VAS and NX-GZIP support on powerVM Haren Myneni
2021-05-21  9:25 ` Haren Myneni
2021-05-21  9:28 ` [PATCH v4 01/16] powerpc/vas: Move VAS API to book3s common platform Haren Myneni
2021-05-21  9:28   ` Haren Myneni
2021-06-03  3:32   ` Nicholas Piggin
2021-06-03  3:32     ` Nicholas Piggin
2021-06-03 20:23     ` Haren Myneni
2021-06-03 20:23       ` Haren Myneni
2021-05-21  9:29 ` [PATCH v4 02/16] powerpc/powernv/vas: Rename register/unregister functions Haren Myneni
2021-05-21  9:29   ` Haren Myneni
2021-05-21  9:30 ` [PATCH v4 03/16] powerpc/vas: Add platform specific user window operations Haren Myneni
2021-05-21  9:30   ` Haren Myneni
2021-06-03  4:05   ` Nicholas Piggin
2021-06-03  4:05     ` Nicholas Piggin
2021-06-03 20:25     ` Haren Myneni
2021-06-03 20:25       ` Haren Myneni
2021-05-21  9:31 ` [PATCH v4 04/16] powerpc/vas: Create take/drop pid and mm references Haren Myneni
2021-05-21  9:31   ` Haren Myneni
2021-06-03  4:21   ` Nicholas Piggin
2021-06-03  4:21     ` Nicholas Piggin
2021-06-04  4:08     ` Haren Myneni
2021-06-04  4:08       ` Haren Myneni
2021-06-05  0:31       ` Nicholas Piggin
2021-06-05  0:31         ` Nicholas Piggin
2021-06-05  3:03         ` Nicholas Piggin
2021-06-05  3:03           ` Nicholas Piggin
2021-05-21  9:32 ` [PATCH v4 05/16] powerpc/vas: Move update_csb/dump_crb to common book3s platform Haren Myneni
2021-05-21  9:32   ` Haren Myneni
2021-06-03  4:26   ` Nicholas Piggin
2021-06-03  4:26     ` Nicholas Piggin
2021-05-21  9:33 ` [PATCH v4 06/16] powerpc/vas: Define and use common vas_window struct Haren Myneni
2021-05-21  9:33   ` Haren Myneni
2021-06-03  4:38   ` Nicholas Piggin
2021-06-03  4:38     ` Nicholas Piggin
2021-06-04  4:35     ` Haren Myneni
2021-06-04  4:35       ` Haren Myneni
2021-06-04 11:52       ` Michael Ellerman
2021-06-04 11:52         ` Michael Ellerman
2021-06-04 21:19         ` Haren Myneni
2021-06-04 21:19           ` Haren Myneni
2021-05-21  9:34 ` [PATCH v4 07/16] powerpc/pseries/vas: Define VAS/NXGZIP HCALLs and structs Haren Myneni
2021-05-21  9:34   ` Haren Myneni
2021-06-03  4:47   ` Nicholas Piggin
2021-06-03  4:47     ` Nicholas Piggin
2021-06-04  1:30     ` Haren Myneni
2021-06-04  1:30       ` Haren Myneni
2021-06-05  0:37       ` Nicholas Piggin
2021-06-05  0:37         ` Nicholas Piggin
2021-05-21  9:34 ` [PATCH v4 08/16] powerpc/vas: Define QoS credit flag to allocate window Haren Myneni
2021-05-21  9:34   ` Haren Myneni
2021-05-21  9:35 ` [PATCH v4 09/16] powerpc/pseries/vas: Add HCALL wrappers for VAS handling Haren Myneni
2021-05-21  9:35   ` Haren Myneni
2021-06-04 11:52   ` Michael Ellerman
2021-06-04 11:52     ` Michael Ellerman
2021-06-04 21:53     ` Haren Myneni
2021-06-04 21:53       ` Haren Myneni
2021-05-21  9:38 ` [PATCH v4 10/16] powerpc/pseries/vas: Implement getting capabilities from hypervisor Haren Myneni
2021-05-21  9:38   ` Haren Myneni
2021-05-21  9:39 ` [PATCH v4 11/16] powerpc/pseries/vas: Integrate API with open/close windows Haren Myneni
2021-05-21  9:39   ` Haren Myneni
2021-05-21  9:39 ` [PATCH v4 12/16] powerpc/pseries/vas: Setup IRQ and fault handling Haren Myneni
2021-05-21  9:39   ` Haren Myneni
2021-06-03  5:48   ` Nicholas Piggin
2021-06-03  5:48     ` Nicholas Piggin
2021-06-04  1:19     ` Haren Myneni
2021-06-04  1:19       ` Haren Myneni
2021-06-05  0:43       ` Nicholas Piggin
2021-06-05  0:43         ` Nicholas Piggin
2021-05-21  9:40 ` [PATCH v4 13/16] crypto/nx: Rename nx-842-pseries file name to nx-common-pseries Haren Myneni
2021-05-21  9:40   ` Haren Myneni
2021-05-21  9:41 ` [PATCH v4 14/16] crypto/nx: Register and unregister VAS interface Haren Myneni
2021-05-21  9:41   ` Haren Myneni
2021-06-03  4:59   ` Nicholas Piggin
2021-06-03  4:59     ` Nicholas Piggin
2021-05-21  9:41 ` [PATCH v4 15/16] crypto/nx: Get NX capabilities for GZIP coprocessor type Haren Myneni
2021-05-21  9:41   ` Haren Myneni
2021-05-21  9:42 ` [PATCH v4 16/16] crypto/nx: Add sysfs interface to export NX capabilities Haren Myneni
2021-05-21  9:42   ` Haren Myneni
2021-06-03  4:57   ` Nicholas Piggin
2021-06-03  4:57     ` Nicholas Piggin
2021-06-04  1:02     ` Haren Myneni
2021-06-04  1:02       ` Haren Myneni
2021-06-04 11:52       ` Michael Ellerman
2021-06-04 11:52         ` Michael Ellerman
2021-06-04 17:23         ` Haren Myneni
2021-06-04 17:23           ` Haren Myneni

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.