Building a kernel with VFIO pass-through support

6.18 LPAR mode KVM guest

You must select multiple options across the kernel configuration menu to include the VFIO framework and support for specific pass-through devices.

Kernel builders: This information is intended for those who want to build their own kernel. Be aware that both compiling your own kernel or recompiling an existing distribution usually means that you have to maintain your kernel yourself.
The following figure summarizes the kernel configuration menu options that are relevant to VFIO pass-through support:
Figure 1. Kernel configuration menu options for the VFIO framework

 I/O subsystem  --->
    ...
    Support for VFIO-CCW subchannels                              (CONFIG_VFIO_CCW)
    VFIO support for AP devices                                   (CONFIG_VFIO_AP)
    ...
 Device Drivers  --->                                             
    ...
    VFIO Non-Privileged userspace driver framework  --->          (CONFIG_VFIO)
       ...
       VFIO support for PCI devices                               (CONFIG_VFIO_PCI)
       Mediated device driver framework                           (CONFIG_VFIO_MDEV)
       └─ VFIO driver for Mediated devices                        (CONFIG_VFIO_MDEV_DEVICE)
       ...
    IOMMU Hardware Support  --->                                  (CONFIG_IOMMU_SUPPORT)
       ...
       S390 CCW IOMMU Support                                     (CONFIG_S390_CCW_IOMMU) 
       S390 AP IOMMU Support                                      (CONFIG_S390_AP_IOMMU)      
The following common code options are required for the VFIO framework:
CONFIG_VFIO
includes the VFIO framework. You can compile the VFIO framework into the kernel or as a separate module, vfio.
CONFIG_IOMMU_SUPPORT
includes device drivers for IO Memory Management Units. These device drivers are always compiled into the kernel.
For pass-through PCI devices, you also need the following common code option:
CONFIG_VFIO_PCI
supports pass-through PCI devices. You can compile this support into the kernel or as a separate module, vfio_pci.
For pass-through CCW devices, you also need the following options:
CONFIG_VFIO_CCW
supports pass-through CCW devices. You can compile the CCW pass-through support into the kernel or as a separate module, vfio_ccw.
CONFIG_VFIO_MDEV
includes the VFIO mediated device framework. You can compile the framework into the kernel or as a separate module, vfio_mdev.
CONFIG_S390_CCW_IOMMU
includes support for VFIO CCW pass-through in IOMMU.
CONFIG_VFIO_MDEV is common code. The other options are specific to z/Architecture®.
For AP queue pass-through devices, you also need the following options:
CONFIG_VFIO_AP
to support pass-through AP queues. You can compile this support into the kernel or as a separate module, vfio_ap.
CONFIG_VFIO_MDEV
to include the VFIO mediated device framework. You can compile the framework into the kernel or as a separate module, vfio_mdev.
CONFIG_VFIO_MDEV_DEVICE
to support the VFIO mediated devices. You can compile this support into the kernel or as a separate module, vfio_mdev_device.
CONFIG_S390_AP_IOMMU
includes support for VFIO AP pass-through in IOMMU.
CONFIG_VFIO_AP and CONFIG_S390_AP_IOMMU are specific to z/Architecture. The other options are common code.