qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Paolo Bonzini <pbonzini@redhat.com>
To: qemu-devel@nongnu.org
Cc: philmd@redhat.com, slp@redhat.com
Subject: [PATCH v2 8/8] pc: stubify x86 iommu
Date: Thu, 12 Dec 2019 18:29:14 +0100	[thread overview]
Message-ID: <1576171754-45138-9-git-send-email-pbonzini@redhat.com> (raw)
In-Reply-To: <1576171754-45138-1-git-send-email-pbonzini@redhat.com>

Allow building microvm without x86-iommu.c and in turn hw/i386/pc.h.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 hw/i386/Kconfig          |  6 ++++++
 hw/i386/Makefile.objs    |  3 ++-
 hw/i386/x86-iommu-stub.c | 34 ++++++++++++++++++++++++++++++++++
 3 files changed, 42 insertions(+), 1 deletions(-)
 create mode 100644 hw/i386/x86-iommu-stub.c

diff --git a/hw/i386/Kconfig b/hw/i386/Kconfig
index 5a49434..91cf584 100644
--- a/hw/i386/Kconfig
+++ b/hw/i386/Kconfig
@@ -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
diff --git a/hw/i386/Makefile.objs b/hw/i386/Makefile.objs
index 01ae202..1236c3b 100644
--- a/hw/i386/Makefile.objs
+++ b/hw/i386/Makefile.objs
@@ -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
index 0000000..03576cd
--- /dev/null
+++ b/hw/i386/x86-iommu-stub.c
@@ -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;
+}
+
-- 
1.8.3.1



  parent reply	other threads:[~2019-12-12 18:11 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-12-12 17:29 [PATCH v2 0/8] x86: allow building without PC machine types Paolo Bonzini
2019-12-12 17:29 ` [PATCH v2 1/8] i386: conditionally compile more files Paolo Bonzini
2019-12-12 17:29 ` [PATCH v2 2/8] fw_cfg: allow building without other devices Paolo Bonzini
2019-12-12 17:29 ` [PATCH v2 3/8] hw: replace hw/i386/pc.h with a header just for the i8259 Paolo Bonzini
2019-12-12 19:03   ` Philippe Mathieu-Daudé
2019-12-12 20:05     ` Paolo Bonzini
2019-12-13  9:43       ` Philippe Mathieu-Daudé
2019-12-13 14:56         ` Paolo Bonzini
2019-12-12 17:29 ` [PATCH v2 4/8] pci-stub: add more MSI functions Paolo Bonzini
2019-12-12 19:49   ` Philippe Mathieu-Daudé
2019-12-12 17:29 ` [PATCH v2 5/8] x86: move SMM property to X86MachineState Paolo Bonzini
2019-12-13 14:50   ` Philippe Mathieu-Daudé
2019-12-12 17:29 ` [PATCH v2 6/8] x86: move more x86-generic functions out of PC files Paolo Bonzini
2020-01-08  8:03   ` Gerd Hoffmann
2020-01-08  8:19     ` Paolo Bonzini
2019-12-12 17:29 ` [PATCH v2 7/8] acpi: move PC stubs out of stubs/ Paolo Bonzini
2019-12-12 17:29 ` Paolo Bonzini [this message]
2020-01-07 14:26   ` [PATCH v2 8/8] pc: stubify x86 iommu Thomas Huth
2020-01-07 14:59     ` Thomas Huth

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1576171754-45138-9-git-send-email-pbonzini@redhat.com \
    --to=pbonzini@redhat.com \
    --cc=philmd@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=slp@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).