• Harald Freudenberger's avatar
    s390/ap: uevent on apmask/aqpmask change · d9b38e9d
    Harald Freudenberger authored
    This patch introduces user space notifications for changes
    on the apmask or aqmask attributes. So it could be possible
    to write a udev rule to load/unload the vfio_ap kernel module
    based on changes of these masks.
    
    On chance of the apmask or aqmask an AP change event will
    be produced with an uevent environment variable showing
    the new APMASK or AQMASK mask.
    
    So a change on the apmask triggers an uvevent like this:
    
      KERNEL[490.160396] change   /devices/ap (ap)
      ACTION=change
      DEVPATH=/devices/ap
      SUBSYSTEM=ap
      APMASK=0xffffffdfffffffffffffffffffffffffffffffffffffffffffffffffffffffff
      SEQNUM=13367
    
    and a change on the aqmask looks like this:
    
      KERNEL[283.217642] change   /devices/ap (ap)
      ACTION=change
      DEVPATH=/devices/ap
      SUBSYSTEM=ap
      AQMASK=0xfbffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
      SEQNUM=13348
    
    Only real changes to the masks are processed - the old and
    new masks are compared and no action is done if the values
    are equal (and thus no uevent). The emit of the uevent is
    the very last action done when a mask change is processed.
    However, there is no guarantee that all unbind/bind actions
    caused by the apmask/aqmask changes are completed when the
    apmask/aqmask change uevent is received in userspace.
    Signed-off-by: default avatarHarald Freudenberger <freude@linux.ibm.com>
    Tested-by: default avatarThomas Huth <thuth@redhat.com>
    Reviewed-by: default avatarJürgen Christ <jchrist@linux.ibm.com>
    Signed-off-by: default avatarHeiko Carstens <hca@linux.ibm.com>
    d9b38e9d
ap_bus.c 56.5 KB