Skip to content

Commit 24ffa71

Browse files
btw616jmberg-intel
authored andcommitted
um: virt-pci: Refactor virtio_pcidev into its own module
Decouple virt-pci and virtio_pcidev, refactoring virtio_pcidev into its own module. Define a set of APIs for virt-pci. This allows for future addition of more PCI emulation implementations. Signed-off-by: Tiwei Bie <tiwei.btw@antgroup.com> Link: https://patch.msgid.link/20250315161910.4082396-3-tiwei.btw@antgroup.com Signed-off-by: Johannes Berg <johannes.berg@intel.com>
1 parent 887c5c1 commit 24ffa71

File tree

5 files changed

+794
-589
lines changed

5 files changed

+794
-589
lines changed

arch/um/drivers/Kconfig

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -345,16 +345,20 @@ config UML_RTC
345345
by providing a fake RTC clock that causes a wakeup at the right
346346
time.
347347

348-
config UML_PCI_OVER_VIRTIO
349-
bool "Enable PCI over VIRTIO device simulation"
350-
# in theory, just VIRTIO is enough, but that causes recursion
351-
depends on VIRTIO_UML
348+
config UML_PCI
349+
bool
352350
select FORCE_PCI
353351
select UML_IOMEM_EMULATION
354352
select UML_DMA_EMULATION
355353
select PCI_MSI
356354
select PCI_LOCKLESS_CONFIG
357355

356+
config UML_PCI_OVER_VIRTIO
357+
bool "Enable PCI over VIRTIO device simulation"
358+
# in theory, just VIRTIO is enough, but that causes recursion
359+
depends on VIRTIO_UML
360+
select UML_PCI
361+
358362
config UML_PCI_OVER_VIRTIO_DEVICE_ID
359363
int "set the virtio device ID for PCI emulation"
360364
default -1

arch/um/drivers/Makefile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,8 @@ obj-$(CONFIG_BLK_DEV_COW_COMMON) += cow_user.o
6060
obj-$(CONFIG_UML_RANDOM) += random.o
6161
obj-$(CONFIG_VIRTIO_UML) += virtio_uml.o
6262
obj-$(CONFIG_UML_RTC) += rtc.o
63-
obj-$(CONFIG_UML_PCI_OVER_VIRTIO) += virt-pci.o
63+
obj-$(CONFIG_UML_PCI) += virt-pci.o
64+
obj-$(CONFIG_UML_PCI_OVER_VIRTIO) += virtio_pcidev.o
6465

6566
# pcap_user.o must be added explicitly.
6667
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)