• Pierre Morel's avatar
    s390: ap: implement PAPQ AQIC interception in kernel · ec89b55e
    Pierre Morel authored
    We register a AP PQAP instruction hook during the open
    of the mediated device. And unregister it on release.
    
    During the probe of the AP device, we allocate a vfio_ap_queue
    structure to keep track of the information we need for the
    PQAP/AQIC instruction interception.
    
    In the AP PQAP instruction hook, if we receive a demand to
    enable IRQs,
    - we retrieve the vfio_ap_queue based on the APQN we receive
      in REG1,
    - we retrieve the page of the guest address, (NIB), from
      register REG2
    - we retrieve the mediated device to use the VFIO pinning
      infrastructure to pin the page of the guest address,
    - we retrieve the pointer to KVM to register the guest ISC
      and retrieve the host ISC
    - finaly we activate GISA
    
    If we receive a demand to disable IRQs,
    - we deactivate GISA
    - unregister from the GIB
    - unpin the NIB
    
    When removing the AP device from the driver the device is
    reseted and this process unregisters the GISA from the GIB,
    and unpins the NIB address then we free the vfio_ap_queue
    structure.
    Signed-off-by: default avatarPierre Morel <pmorel@linux.ibm.com>
    Acked-by: default avatarTony Krowiak <akrowiak@linux.ibm.com>
    Acked-by: default avatarHarald Freudenberger <freude@linux.ibm.com>
    Signed-off-by: default avatarHalil Pasic <pasic@linux.ibm.com>
    Signed-off-by: default avatarVasily Gorbik <gor@linux.ibm.com>
    ec89b55e
vfio_ap_drv.c 4.82 KB