Skip to contentSkip to conversation

hw/i386: make IOMMUs configurable via default-configs/

PATCH Superseded Paolo Bonzini 2 participants 3 messages Feb 28, 2018 – Mar 12, 2018

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 hw/i386: make IOMMUs configurable via default-configs/

Allow distributions to disable the Intel and/or AMD IOMMU devices.

---
 default-configs/i386-softmmu.mak   | 2 ++
 default-configs/x86_64-softmmu.mak | 2 ++
 hw/i386/Makefile.objs              | 5 +++--
 3 files changed, 7 insertions(+), 2 deletions(-)
default-configs/i386-softmmu.mak +2 -0
index 3326e3e0bb..9e5a29fa4a 100644
@@ -63,3 +63,5 @@ CONFIG_PXB=y
 CONFIG_ACPI_VMGENID=y
 CONFIG_FW_CFG_DMA=y
 CONFIG_I2C=y
+CONFIG_VTD=y
+CONFIG_AMD_IOMMU=y
default-configs/x86_64-softmmu.mak +2 -0
index 1c6cda1d9a..7baf91b921 100644
@@ -63,3 +63,5 @@ CONFIG_PXB=y
 CONFIG_ACPI_VMGENID=y
 CONFIG_FW_CFG_DMA=y
 CONFIG_I2C=y
+CONFIG_VTD=y
+CONFIG_AMD_IOMMU=y
hw/i386/Makefile.objs +3 -2
index fd279e7584..528b8dc431 100644
@@ -2,8 +2,9 @@ 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 += amd_iommu.o
+obj-y += x86-iommu.o
+obj-$(CONFIG_VTD) += x86-iommu.o intel_iommu.o
+obj-$(CONFIG_AMD_IOMMU) += amd_iommu.o
 obj-$(CONFIG_XEN) += ../xenpv/ xen/
 obj-$(CONFIG_VMPORT) += vmport.o
 obj-$(CONFIG_VMMOUSE) += vmmouse.o
Signature · 1 line
2.14.3
Reviewed-by on v1 1/1
#1 lore raw
Quoted 34 lines · Paolo Bonzini

Allow distributions to disable the Intel and/or AMD IOMMU devices.

---
 default-configs/i386-softmmu.mak   | 2 ++
 default-configs/x86_64-softmmu.mak | 2 ++
 hw/i386/Makefile.objs              | 5 +++--
 3 files changed, 7 insertions(+), 2 deletions(-)
default-configs/i386-softmmu.mak +2 -0
index 3326e3e0bb..9e5a29fa4a 100644
@@ -63,3 +63,5 @@ CONFIG_PXB=y
 CONFIG_ACPI_VMGENID=y
 CONFIG_FW_CFG_DMA=y
 CONFIG_I2C=y
+CONFIG_VTD=y
+CONFIG_AMD_IOMMU=y
default-configs/x86_64-softmmu.mak +2 -0
index 1c6cda1d9a..7baf91b921 100644
@@ -63,3 +63,5 @@ CONFIG_PXB=y
 CONFIG_ACPI_VMGENID=y
 CONFIG_FW_CFG_DMA=y
 CONFIG_I2C=y
+CONFIG_VTD=y
+CONFIG_AMD_IOMMU=y
hw/i386/Makefile.objs +0 -0
index fd279e7584..528b8dc431 100644

hw/i386/Makefile.objs obj-$(CONFIG_KVM) += kvm/ · line 6

Quoted 7 lines
hw/i386/Makefile.objs +2 -2
@@ -2,8 +2,9 @@ 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 += amd_iommu.o
+obj-y += x86-iommu.o
+obj-$(CONFIG_VTD) += x86-iommu.o intel_iommu.o

I think you have to remove x86-iommu.o in the above line, since it is included already one line earlier.

With that modification:

#2 lore raw
Quoted 37 lines · Thomas Huth
Quoted 36 lines · Paolo Bonzini

Allow distributions to disable the Intel and/or AMD IOMMU devices.

---
 default-configs/i386-softmmu.mak   | 2 ++
 default-configs/x86_64-softmmu.mak | 2 ++
 hw/i386/Makefile.objs              | 5 +++--
 3 files changed, 7 insertions(+), 2 deletions(-)
default-configs/i386-softmmu.mak +2 -0
index 3326e3e0bb..9e5a29fa4a 100644
@@ -63,3 +63,5 @@ CONFIG_PXB=y
 CONFIG_ACPI_VMGENID=y
 CONFIG_FW_CFG_DMA=y
 CONFIG_I2C=y
+CONFIG_VTD=y
+CONFIG_AMD_IOMMU=y
default-configs/x86_64-softmmu.mak +2 -0
index 1c6cda1d9a..7baf91b921 100644
@@ -63,3 +63,5 @@ CONFIG_PXB=y
 CONFIG_ACPI_VMGENID=y
 CONFIG_FW_CFG_DMA=y
 CONFIG_I2C=y
+CONFIG_VTD=y
+CONFIG_AMD_IOMMU=y
hw/i386/Makefile.objs +0 -0
index fd279e7584..528b8dc431 100644
@@ -2,8 +2,9 @@ obj-$(CONFIG_KVM) += kvm/
 obj-y += multiboot.o
 obj-y += pc.o pc_piix.o pc_q35.o
Quoted 8 lines

hw/i386/Makefile.objs obj-$(CONFIG_KVM) += kvm/ · line 6

Quoted 5 lines
hw/i386/Makefile.objs +2 -2
 obj-y += pc_sysfw.o
-obj-y += x86-iommu.o intel_iommu.o
-obj-y += amd_iommu.o
+obj-y += x86-iommu.o
+obj-$(CONFIG_VTD) += x86-iommu.o intel_iommu.o

I think you have to remove x86-iommu.o in the above line, since it is included already one line earlier.

... or add it to both lines (Intel and AMD IOMMU). Thanks for the review!

Paolo

Quoted 4 lines

With that modification: