Files
s390-tools/zdev/udev/81-dpm.rules
Peter Oberparleiter 3949c62f6f zdev: Add auto-config for PCI and crypto devices
PCI and crypto devices defined using the IBM Z Dynamic Partition Manager
(DPM) will start in an offline/unconfigured state that requires manual
intervention before the associated Linux function can be used. This
results for example in PCI networking interfaces being unavailable in a
distribution installer system.

Fix this by providing a udev rule and initial RAM-disk logic that
automatically enables PCI and crypto devices either during boot, or when
they are defined at run-time. This processing can be suppressed by
specifying the "rd.zdev=no-auto" parameter on the kernel command line.

Auto-configuration is limited to Linux running in DPM LPARs because
PCI-functions and crypto devices defined by DPM are always intended for
use by a single LPAR only.

For Linux running in classic-mode LPARs or virtual machines, leaving PCI
and crypto devices in an offline state may be useful to allow defining a
device as available to multiple systems, where only the system that
intends to make use of the device should enable it.

Signed-off-by: Peter Oberparleiter <oberpar@linux.ibm.com>
Reviewed-by: Jan Höppner <hoeppner@linux.ibm.com>
Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
2021-10-01 14:59:56 +02:00

41 lines
1.1 KiB
Plaintext

# Automatically activate certain s390-specific device types that are attached
# in offline state when running in an LPAR managed by the Dynamic Partition
# Manager (DPM).
#
# Note that processing is restricted to DPM as there may be use cases for
# not enabling these device types in non-DPM mode.
#
# To deactivate this processing, specify the following on the kernel command
# line:
#
# rd.zdev=no-auto
ACTION!="add", GOTO="end_dpm"
# Handle newly added PCI devices in offline state
SUBSYSTEM=="slots", ATTR{power}=="0", GOTO="check_dpm"
# Handle newly added crypto devices in offline state
SUBSYSTEM=="ap", ENV{DEVTYPE}=="ap_card", ATTR{config}=="0", GOTO="check_dpm"
GOTO="end_dpm"
LABEL="check_dpm"
IMPORT{program}="/lib/s390-tools/zdev_id"
# Check for off-switch
ENV{ZDEV_NO_AUTO}=="1", GOTO="end_dpm"
# Check for DPM LPAR
ENV{ZDEV_IS_DPM}!="1", GOTO="end_dpm"
ENV{ZDEV_NEST_LEVEL}!="1", GOTO="end_dpm"
ENV{ZDEV_HYPERVISOR_0}!="LPAR", GOTO="end_dpm"
# Enable PCI device
SUBSYSTEM=="slots", ATTR{power}="1"
# Enable crypto device
SUBSYSTEM=="ap", ATTR{config}="1"
# End of rule
LABEL="end_dpm"