kernel: Add iommu_v2 driver for AMD/Intel

This commit is contained in:
coolsnowwolf 2023-05-22 12:01:49 +08:00
parent 79cd677bce
commit 016d1d231f

View File

@ -73,6 +73,80 @@ endef
$(eval $(call KernelPackage,kvm-amd))
define KernelPackage/vfio
SUBMENU:=Virtualization
TITLE:=VFIO Non-Privileged userspace driver framework
DEPENDS:=@TARGET_x86_64
KCONFIG:= \
CONFIG_VFIO \
CONFIG_VFIO_NOIOMMU=n \
CONFIG_VFIO_MDEV=n
MODPARAMS.vfio:=\
enable_unsafe_noiommu_mode=n
FILES:= \
$(LINUX_DIR)/drivers/vfio/vfio.ko \
$(LINUX_DIR)/drivers/vfio/vfio_virqfd.ko \
$(LINUX_DIR)/drivers/vfio/vfio_iommu_type1.ko
AUTOLOAD:=$(call AutoProbe,vfio vfio_iommu_type1 vfio_virqfd)
endef
define KernelPackage/vfio/description
VFIO provides a framework for secure userspace device drivers.
endef
$(eval $(call KernelPackage,vfio))
define KernelPackage/vfio-pci
SUBMENU:=Virtualization
TITLE:=Generic VFIO support for any PCI device
DEPENDS:=@TARGET_x86_64 @PCI_SUPPORT +kmod-vfio +kmod-irqbypass
KCONFIG:= \
CONFIG_VFIO_PCI \
CONFIG_VFIO_PCI_IGD=n
FILES:= \
$(LINUX_DIR)/drivers/vfio/pci/vfio-pci-core.ko \
$(LINUX_DIR)/drivers/vfio/pci/vfio-pci.ko
AUTOLOAD:=$(call AutoProbe,vfio-pci)
endef
define KernelPackage/vfio-pci/description
Support for the generic PCI VFIO bus driver which can connect any PCI
device to the VFIO framework.
endef
$(eval $(call KernelPackage,vfio-pci))
define KernelPackage/iommu_v2
SUBMENU:=Virtualization
TITLE:=IOMMU Version 2 driver
KCONFIG:=\
CONFIG_UACCE=n \
CONFIG_IOMMU_DEBUGFS=n \
CONFIG_INTEL_IOMMU=y \
CONFIG_INTEL_IOMMU_SVM=n \
CONFIG_INTEL_IOMMU_DEFAULT_ON=n \
CONFIG_INTEL_IOMMU_SCALABLE_MODE_DEFAULT_ON=n \
CONFIG_INTEL_TXT=n \
CONFIG_HYPERV_IOMMU=n \
CONFIG_IOMMU_SUPPORT=y \
CONFIG_IOMMU_DEFAULT_PASSTHROUGH=y \
CONFIG_AMD_IOMMU=y \
CONFIG_IRQ_REMAP=y \
CONFIG_AMD_IOMMU_V2=m
DEPENDS:= @PCI_SUPPORT @TARGET_x86_64
FILES:= $(LINUX_DIR)/drivers/iommu/amd/iommu_v2.ko
AUTOLOAD:=$(call AutoProbe,iommu_v2)
endef
define KernelPackage/iommu_v2/description
This option enables support for the AMD/INTEL IOMMUv2 features
of the IOMMU hardware. Select this option if you want
to use devices that support the PCI PRI and PASID interface.
endef
$(eval $(call KernelPackage,iommu_v2))
define KernelPackage/vfio-mdev
SUBMENU:=Virtualization
TITLE:=VFIO driver support to to virtualize devices