Skip to content

Commit a0e2cb6

Browse files
btw616jmberg-intel
authored andcommitted
um: Add VFIO-based virtual PCI driver
Implement a new virtual PCI driver based on the VFIO framework. This driver allows users to pass through PCI devices to UML via VFIO. Currently, only MSI-X capable devices are supported, and it is assumed that drivers will use MSI-X. Signed-off-by: Tiwei Bie <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Johannes Berg <[email protected]>
1 parent 6767e87 commit a0e2cb6

File tree

5 files changed

+1023
-0
lines changed

5 files changed

+1023
-0
lines changed

arch/um/drivers/Kconfig

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -367,3 +367,11 @@ config UML_PCI_OVER_VIRTIO_DEVICE_ID
367367
There's no official device ID assigned (yet), set the one you
368368
wish to use for experimentation here. The default of -1 is
369369
not valid and will cause the driver to fail at probe.
370+
371+
config UML_PCI_OVER_VFIO
372+
bool "Enable VFIO-based PCI passthrough"
373+
select UML_PCI
374+
help
375+
This driver provides support for VFIO-based PCI passthrough.
376+
Currently, only MSI-X capable devices are supported, and it
377+
is assumed that drivers will use MSI-X.

arch/um/drivers/Makefile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ port-objs := port_kern.o port_user.o
1919
harddog-objs := harddog_kern.o
2020
harddog-builtin-$(CONFIG_UML_WATCHDOG) := harddog_user.o harddog_user_exp.o
2121
rtc-objs := rtc_kern.o rtc_user.o
22+
vfio_uml-objs := vfio_kern.o vfio_user.o
2223

2324
LDFLAGS_vde.o = $(shell $(CC) $(CFLAGS) -print-file-name=libvdeplug.a)
2425

@@ -62,6 +63,7 @@ obj-$(CONFIG_VIRTIO_UML) += virtio_uml.o
6263
obj-$(CONFIG_UML_RTC) += rtc.o
6364
obj-$(CONFIG_UML_PCI) += virt-pci.o
6465
obj-$(CONFIG_UML_PCI_OVER_VIRTIO) += virtio_pcidev.o
66+
obj-$(CONFIG_UML_PCI_OVER_VFIO) += vfio_uml.o
6567

6668
# pcap_user.o must be added explicitly.
6769
USER_OBJS := fd.o null.o pty.o tty.o xterm.o slip_common.o vde_user.o vector_user.o

0 commit comments

Comments
 (0)