Skip to contentSkip to conversation

hw/i386/x86-iommu: Add missing stubs

PATCH In review Philippe Mathieu-Daudé 3 participants 4 messages Dec 20, 2019 – Dec 27, 2019

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 hw/i386/x86-iommu: Add missing stubs

In commit 6c730e4af9 we introduced a stub to build the MicroVM machine without Intel IOMMU. This stub is incomplete for the other PC machines. Add the missing stubs.

Fixes 6c730e4af9
Reported-by Travis-CI
---
 hw/i386/x86-iommu-stub.c | 9 +++++++++
 1 file changed, 9 insertions(+)
hw/i386/x86-iommu-stub.c +9 -0
index 03576cdccb..c5ba077f9d 100644
@@ -32,3 +32,12 @@ X86IOMMUState *x86_iommu_get_default(void)
     return NULL;
 }
 
+bool x86_iommu_ir_supported(X86IOMMUState *s)
+{
+    return false;
+}
+
+IommuType x86_iommu_get_type(void)
+{
+    abort();
+}
Signature · 1 line
2.21.0
#1 lore raw
Quoted 3 lines · Philippe Mathieu-Daudé

In commit 6c730e4af9 we introduced a stub to build the MicroVM machine without Intel IOMMU. This stub is incomplete for the other PC machines. Add the missing stubs.

In other words, without this patch you cannot build without Q35 (which brings in the IOMMU, at least unless building --without-default-devices). Is this correct?

Paolo

Quoted 26 lines
Fixes 6c730e4af9
Reported-by Travis-CI
---
 hw/i386/x86-iommu-stub.c | 9 +++++++++
 1 file changed, 9 insertions(+)
hw/i386/x86-iommu-stub.c +9 -0
index 03576cdccb..c5ba077f9d 100644
@@ -32,3 +32,12 @@ X86IOMMUState *x86_iommu_get_default(void)
     return NULL;
 }
 
+bool x86_iommu_ir_supported(X86IOMMUState *s)
+{
+    return false;
+}
+
+IommuType x86_iommu_get_type(void)
+{
+    abort();
+}
#2 lore raw
Quoted 8 lines · Paolo Bonzini
Quoted 3 lines · Philippe Mathieu-Daudé

In commit 6c730e4af9 we introduced a stub to build the MicroVM machine without Intel IOMMU. This stub is incomplete for the other PC machines. Add the missing stubs.

In other words, without this patch you cannot build without Q35 (which brings in the IOMMU, at least unless building --without-default-devices). Is this correct?

No, this is the same, selecting either CONFIG_I440FX or CONFIG_Q35:

LINK x86_64-softmmu/qemu-system-x86_64
/usr/bin/ld: hw/i386/pc.o: in function `pc_machine_done':
hw/i386/pc.c:869: undefined reference to x86_iommu_ir_supported' /usr/bin/ld: hw/i386/acpi-build.o: in function acpi_build':
hw/i386/acpi-build.c:2844: undefined reference to x86_iommu_get_type' /usr/bin/ld: hw/i386/acpi-build.o: in function build_dmar_q35':
hw/i386/acpi-build.c:2478: undefined reference to x86_iommu_ir_supported' /usr/bin/ld: hw/i386/acpi-build.o: in function build_amd_iommu':
hw/i386/acpi-build.c:2665: undefined reference to x86_iommu_ir_supported' /usr/bin/ld: hw/i386/acpi-build.c:2700: undefined reference to x86_iommu_ir_supported'
collect2: error: ld returned 1 exit status
make[1]: *** [Makefile:206: qemu-system-x86_64] Error 1
make: *** [Makefile:483: x86_64-softmmu/all] Error 2

Quoted 29 lines

Paolo

Quoted 26 lines
Fixes 6c730e4af9
Reported-by Travis-CI
---
  hw/i386/x86-iommu-stub.c | 9 +++++++++
  1 file changed, 9 insertions(+)
hw/i386/x86-iommu-stub.c +9 -0
index 03576cdccb..c5ba077f9d 100644
@@ -32,3 +32,12 @@ X86IOMMUState *x86_iommu_get_default(void)
      return NULL;
  }
 
+bool x86_iommu_ir_supported(X86IOMMUState *s)
+{
+    return false;
+}
+
+IommuType x86_iommu_get_type(void)
+{
+    abort();
+}
Tested-by on v1 1/1
#3 lore raw
In reply to Philippe Mathieu-Daudé
Quoted 18 lines · Philippe Mathieu-Daudé

In commit 6c730e4af9 we introduced a stub to build the MicroVM machine without Intel IOMMU. This stub is incomplete for the other PC machines. Add the missing stubs.

Fixes 6c730e4af9
Reported-by Travis-CI
---
  hw/i386/x86-iommu-stub.c | 9 +++++++++
  1 file changed, 9 insertions(+)
hw/i386/x86-iommu-stub.c +0 -0
index 03576cdccb..c5ba077f9d 100644
@@ -32,3 +32,12 @@ X86IOMMUState *x86_iommu_get_default(void)
      return NULL;
  }

hw/i386/x86-iommu-stub.c X86IOMMUState *x86_iommu_get_default(void) · line 43

Quoted 10 lines
hw/i386/x86-iommu-stub.c +9 -0
 
+bool x86_iommu_ir_supported(X86IOMMUState *s)
+{
+    return false;
+}
+
+IommuType x86_iommu_get_type(void)
+{
+    abort();
+}

I cannot say the fix is correct, but I can attest - with it - I no longer see the build fail when --without-default-devices --disable-user.