[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <dce1cc8330469cca3f3e451885b7d230be57b143.1750294482.git.thehajime@gmail.com>
Date: Thu, 19 Jun 2025 10:04:14 +0900
From: Hajime Tazaki <thehajime@...il.com>
To: linux-um@...ts.infradead.org
Cc: thehajime@...il.com,
ricarkol@...gle.com,
Liam.Howlett@...cle.com,
linux-kernel@...r.kernel.org
Subject: [PATCH v9 10/13] um: nommu: a work around for MMU dependency to PCI driver
The commit 8fe743b5eba0 ("PCI: Add CONFIG_MMU dependency") restricts the
PCI base driver to depend on MMU. While nommu UML _can_ implement PCI
drivers over PCI devices (e.g., virtio-pci), the current nommu UML
doesn't implement it.
But without PCI drivers kunit complains as config for kunit
(arch_uml.config) defines the dependency to PCI drivers.
This commit fixes the issue of this compile failures when building PCI
drivers with nommu UML. In particular, the fix is to undefine the
constant PCI_IOBASE to be able to bypass pci_unmap_iospace() call.
When we will support PCI drivers for nommu UML, we will refactor this
code.
Signed-off-by: Hajime Tazaki <thehajime@...il.com>
---
arch/um/include/asm/dma.h | 13 +++++++++++++
1 file changed, 13 insertions(+)
diff --git a/arch/um/include/asm/dma.h b/arch/um/include/asm/dma.h
index fdc53642c718..643d74555671 100644
--- a/arch/um/include/asm/dma.h
+++ b/arch/um/include/asm/dma.h
@@ -4,6 +4,19 @@
#include <asm/io.h>
+/**
+ * now the PCI core driver depends on CONFIG_MMU in linus tree, nommu
+ * UML cannot build with PCI but without PCI kunit doesn't build due
+ * to the dependency to the CONFIG_VIRTIO_UML.
+ *
+ * This is a workaround to silence build failures on kunit, which is
+ * valid until nommu UML supports PCI drivers (e.g., virtio-pci) in a
+ * future.
+ */
+#ifndef CONFIG_MMU
+#undef PCI_IOBASE
+#endif
+
extern unsigned long uml_physmem;
#define MAX_DMA_ADDRESS (uml_physmem)
--
2.43.0
Powered by blists - more mailing lists