pc: stubify x86 iommu
authorPaolo Bonzini <pbonzini@redhat.com>
Thu, 12 Dec 2019 17:10:35 +0000 (18:10 +0100)
committerPaolo Bonzini <pbonzini@redhat.com>
Tue, 17 Dec 2019 18:33:50 +0000 (19:33 +0100)
Allow building microvm without x86-iommu.c.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
hw/i386/Kconfig
hw/i386/Makefile.objs
hw/i386/x86-iommu-stub.c [new file with mode: 0644]

index 5a494342eaa0ca004bb20aa0503389699f2b92a3..91cf5843b4505b9222c946c351e9f9fb04b736b0 100644 (file)
@@ -103,11 +103,17 @@ config MICROVM
     select MC146818RTC
     select VIRTIO_MMIO
 
+config X86_IOMMU
+    bool
+    depends on PC
+
 config VTD
     bool
+    select X86_IOMMU
 
 config AMD_IOMMU
     bool
+    select X86_IOMMU
 
 config VMPORT
     bool
index 01ae2028e2d73092fb253f779fc500c6805f3599..1236c3b95cc7b44e265ca1b2e99a6fbbbf2c30f8 100644 (file)
@@ -6,7 +6,8 @@ obj-$(CONFIG_I440FX) += pc_piix.o
 obj-$(CONFIG_Q35) += pc_q35.o
 obj-$(CONFIG_MICROVM) += microvm.o
 obj-y += fw_cfg.o
-obj-y += x86-iommu.o
+obj-$(CONFIG_X86_IOMMU) += x86-iommu.o
+obj-$(call lnot,$(CONFIG_X86_IOMMU)) += x86-iommu-stub.o
 obj-$(CONFIG_VTD) += intel_iommu.o
 obj-$(CONFIG_AMD_IOMMU) += amd_iommu.o
 obj-$(CONFIG_XEN) += ../xenpv/ xen/
diff --git a/hw/i386/x86-iommu-stub.c b/hw/i386/x86-iommu-stub.c
new file mode 100644 (file)
index 0000000..03576cd
--- /dev/null
@@ -0,0 +1,34 @@
+/*
+ * Stubs for X86 IOMMU emulation
+ *
+ * Copyright (C) 2019 Red Hat, Inc.
+ *
+ * Author: Paolo Bonzini <pbonzini@redhat.com>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, see <http://www.gnu.org/licenses/>.
+ */
+
+#include "qemu/osdep.h"
+#include "hw/i386/x86-iommu.h"
+
+void x86_iommu_iec_register_notifier(X86IOMMUState *iommu,
+                                     iec_notify_fn fn, void *data)
+{
+}
+
+X86IOMMUState *x86_iommu_get_default(void)
+{
+    return NULL;
+}
+
This page took 0.031364 seconds and 4 git commands to generate.