• Harald Freudenberger's avatar
    s390/pkey: Introduce pkey base with handler registry and handler modules · 8fcc231c
    Harald Freudenberger authored
    Introduce pkey base kernel code with a simple pkey handler registry.
    Regroup the pkey code into these kernel modules:
    - pkey is the pkey api supporting the ioctls, sysfs and in-kernel api.
      Also the pkey base code which offers the handler registry and
      handler wrapping invocation functions is integrated there. This
      module is automatically loaded in via CPU feature if the MSA feature
      is available.
    - pkey-cca is the CCA related handler code kernel module a offering
      CCA specific implementation for pkey. This module is loaded in
      via MODULE_DEVICE_TABLE when a CEX[4-8] card becomes available.
    - pkey-ep11 is the EP11 related handler code kernel module offering an
      EP11 specific implementation for pkey. This module is loaded in via
      MODULE_DEVICE_TABLE when a CEX[4-8] card becomes available.
    - pkey-pckmo is the PCKMO related handler code kernel module. This
      module is loaded in via CPU feature if the MSA feature is available,
      but on init a check for availability of the pckmo instruction is
      performed.
    
    The handler modules register via a pkey_handler struct at the pkey
    base code and the pkey customer (that is currently the pkey api code
    fetches a handler via pkey handler registry functions and calls the
    unified handler functions via the pkey base handler functions.
    
    As a result the pkey-cca, pkey-ep11 and pkey-pckmo modules get
    independent from each other and it becomes possible to write new
    handlers which offer another kind of implementation without implicit
    dependencies to other handler implementations and/or kernel device
    drivers.
    
    For each of these 4 kernel modules there is an individual Kconfig
    entry: CONFIG_PKEY for the base and api, CONFIG_PKEY_CCA for the PKEY
    CCA support handler, CONFIG_PKEY_EP11 for the EP11 support handler and
    CONFIG_PKEY_PCKMO for the pckmo support. The both CEX related handler
    modules (PKEY CCA and PKEY EP11) have a dependency to the zcrypt api
    of the zcrypt device driver.
    Signed-off-by: default avatarHarald Freudenberger <freude@linux.ibm.com>
    Reviewed-by: default avatarHolger Dengler <dengler@linux.ibm.com>
    Signed-off-by: default avatarVasily Gorbik <gor@linux.ibm.com>
    8fcc231c
Kconfig 25.8 KB