cryptospore / rpms / qemu-kvm

Forked from rpms/qemu-kvm 2 years ago
Clone
Blob Blame History Raw
From f1ec0e873266ddec6eca3f52a1a9d5ee479ae3f5 Mon Sep 17 00:00:00 2001
From: Peter Xu <peterx@redhat.com>
Date: Wed, 19 Jul 2017 07:25:08 +0200
Subject: [PATCH 12/17] configure: allow to disable VT-d emulation

RH-Author: Peter Xu <peterx@redhat.com>
Message-id: <1500449109-20652-2-git-send-email-peterx@redhat.com>
Patchwork-id: 75809
O-Subject: [Pegas-1.0 qemu-kvm PATCH v2 1/2] configure: allow to disable VT-d emulation
Bugzilla: 1465450
RH-Acked-by: Miroslav Rezanina <mrezanin@redhat.com>
RH-Acked-by: Eduardo Habkost <ehabkost@redhat.com>
RH-Acked-by: Jeffrey Cody <jcody@redhat.com>

Provide a way to disable VT-d emulation for x86 guests.

x86-iommu.c is still required since it provides some interfaces that is
used in common codes, like ACPI.

Signed-off-by: Peter Xu <peterx@redhat.com>
Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
---
 configure             | 11 +++++++++++
 hw/i386/Makefile.objs |  3 ++-
 2 files changed, 13 insertions(+), 1 deletion(-)

diff --git a/configure b/configure
index b019b33..a658481 100755
--- a/configure
+++ b/configure
@@ -323,6 +323,7 @@ tcmalloc="no"
 jemalloc="no"
 replication="yes"
 vxhs=""
+vtd="yes"
 
 supported_cpu="no"
 supported_os="no"
@@ -1194,6 +1195,10 @@ for opt do
   ;;
   --enable-vxhs) vxhs="yes"
   ;;
+  --disable-vtd) vtd="no"
+  ;;
+  --enable-vtd) vtd="yes"
+  ;;
   *)
       echo "ERROR: unknown option $opt"
       echo "Try '$0 --help' for more information"
@@ -1440,6 +1445,7 @@ disabled with --disable-FEATURE, default is enabled if available:
   qom-cast-debug  cast debugging support
   tools           build qemu-io, qemu-nbd and qemu-image tools
   vxhs            Veritas HyperScale vDisk backend support
+  vtd             Emulated VT-d support (only affects x86 targets)
 
 NOTE: The object files are built at the place where configure is launched
 EOF
@@ -5162,6 +5168,7 @@ echo "jemalloc support  $jemalloc"
 echo "avx2 optimization $avx2_opt"
 echo "replication support $replication"
 echo "VxHS block device $vxhs"
+echo "VT-d emulation    $vtd"
 
 if test "$sdl_too_old" = "yes"; then
 echo "-> Your SDL version is too old - please upgrade to have SDL support"
@@ -5814,6 +5821,10 @@ if test "$vxhs" = "yes" ; then
   echo "VXHS_LIBS= -lssl" >> $config_host_mak
 fi
 
+if test "$vtd" = "yes" ; then
+  echo "CONFIG_VTD=y" >> $config_host_mak
+fi
+
 if test "$tcg_interpreter" = "yes"; then
   QEMU_INCLUDES="-I\$(SRC_PATH)/tcg/tci $QEMU_INCLUDES"
 elif test "$ARCH" = "sparc64" ; then
diff --git a/hw/i386/Makefile.objs b/hw/i386/Makefile.objs
index a15db94..68a2c3b 100644
--- a/hw/i386/Makefile.objs
+++ b/hw/i386/Makefile.objs
@@ -2,7 +2,8 @@ obj-$(CONFIG_KVM) += kvm/
 obj-y += multiboot.o
 obj-y += pc.o pc_piix.o pc_q35.o
 obj-y += pc_sysfw.o
-obj-y += x86-iommu.o intel_iommu.o
+obj-y += x86-iommu.o
+obj-$(CONFIG_VTD) += intel_iommu.o
 # Disabled in Red Hat Enterprise Linux
 # obj-y += amd_iommu.o
 obj-$(CONFIG_XEN) += ../xenpv/ xen/
-- 
1.8.3.1