* [PATCH v2] hw/i386: Allow building machines without IOMMU
@ 2019-12-27 21:39 Philippe Mathieu-Daudé
2020-01-06 10:00 ` Michael S. Tsirkin
0 siblings, 1 reply; 2+ messages in thread
From: Philippe Mathieu-Daudé @ 2019-12-27 21:39 UTC (permalink / raw)
To: qemu-devel
Cc: Eduardo Habkost, Michael S. Tsirkin, Wainer dos Santos Moschetta,
Paolo Bonzini, Philippe Mathieu-Daudé,
Richard Henderson
Commit 6c730e4af9 introduced a stub to build the MicroVM machine
without Intel IOMMU suppport. However when configure with
--without-default-devices, the build fails:
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
Since currently all PC machines can not be built without IOMMU,
select X86_IOMMU in the PC config, and remove the stubs.
Fixes: 6c730e4af9
Reported-by: Travis-CI
Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
---
v2: simplify, remove the stub.
---
hw/i386/x86-iommu-stub.c | 34 ----------------------------------
hw/i386/Kconfig | 2 +-
hw/i386/Makefile.objs | 1 -
3 files changed, 1 insertion(+), 36 deletions(-)
delete mode 100644 hw/i386/x86-iommu-stub.c
diff --git a/hw/i386/x86-iommu-stub.c b/hw/i386/x86-iommu-stub.c
deleted file mode 100644
index 03576cdccb..0000000000
--- a/hw/i386/x86-iommu-stub.c
+++ /dev/null
@@ -1,34 +0,0 @@
-/*
- * 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;
-}
-
diff --git a/hw/i386/Kconfig b/hw/i386/Kconfig
index 91cf5843b4..e428322a2c 100644
--- a/hw/i386/Kconfig
+++ b/hw/i386/Kconfig
@@ -35,6 +35,7 @@ config PC
select ACPI_PCI
select ACPI_VMGENID
select VIRTIO_PMEM_SUPPORTED
+ select X86_IOMMU
config PC_PCI
bool
@@ -105,7 +106,6 @@ config MICROVM
config X86_IOMMU
bool
- depends on PC
config VTD
bool
diff --git a/hw/i386/Makefile.objs b/hw/i386/Makefile.objs
index 8ce1b26533..6ebb6d0cf0 100644
--- a/hw/i386/Makefile.objs
+++ b/hw/i386/Makefile.objs
@@ -7,7 +7,6 @@ obj-$(CONFIG_Q35) += pc_q35.o
obj-$(CONFIG_MICROVM) += microvm.o
obj-y += fw_cfg.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/
--
2.21.0
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH v2] hw/i386: Allow building machines without IOMMU
2019-12-27 21:39 [PATCH v2] hw/i386: Allow building machines without IOMMU Philippe Mathieu-Daudé
@ 2020-01-06 10:00 ` Michael S. Tsirkin
0 siblings, 0 replies; 2+ messages in thread
From: Michael S. Tsirkin @ 2020-01-06 10:00 UTC (permalink / raw)
To: Philippe Mathieu-Daudé
Cc: Eduardo Habkost, qemu-devel, Wainer dos Santos Moschetta,
Paolo Bonzini, Richard Henderson
On Fri, Dec 27, 2019 at 10:39:31PM +0100, Philippe Mathieu-Daudé wrote:
> Commit 6c730e4af9 introduced a stub to build the MicroVM machine
> without Intel IOMMU suppport. However when configure with
> --without-default-devices, the build fails:
>
> 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
>
> Since currently all PC machines can not be built without IOMMU,
> select X86_IOMMU in the PC config, and remove the stubs.
>
> Fixes: 6c730e4af9
> Reported-by: Travis-CI
> Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Acked-by: Michael S. Tsirkin <mst@redhat.com>
I'd rather Paolo applied this in his tree.
> ---
> v2: simplify, remove the stub.
> ---
> hw/i386/x86-iommu-stub.c | 34 ----------------------------------
> hw/i386/Kconfig | 2 +-
> hw/i386/Makefile.objs | 1 -
> 3 files changed, 1 insertion(+), 36 deletions(-)
> delete mode 100644 hw/i386/x86-iommu-stub.c
>
> diff --git a/hw/i386/x86-iommu-stub.c b/hw/i386/x86-iommu-stub.c
> deleted file mode 100644
> index 03576cdccb..0000000000
> --- a/hw/i386/x86-iommu-stub.c
> +++ /dev/null
> @@ -1,34 +0,0 @@
> -/*
> - * 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;
> -}
> -
> diff --git a/hw/i386/Kconfig b/hw/i386/Kconfig
> index 91cf5843b4..e428322a2c 100644
> --- a/hw/i386/Kconfig
> +++ b/hw/i386/Kconfig
> @@ -35,6 +35,7 @@ config PC
> select ACPI_PCI
> select ACPI_VMGENID
> select VIRTIO_PMEM_SUPPORTED
> + select X86_IOMMU
>
> config PC_PCI
> bool
> @@ -105,7 +106,6 @@ config MICROVM
>
> config X86_IOMMU
> bool
> - depends on PC
>
> config VTD
> bool
> diff --git a/hw/i386/Makefile.objs b/hw/i386/Makefile.objs
> index 8ce1b26533..6ebb6d0cf0 100644
> --- a/hw/i386/Makefile.objs
> +++ b/hw/i386/Makefile.objs
> @@ -7,7 +7,6 @@ obj-$(CONFIG_Q35) += pc_q35.o
> obj-$(CONFIG_MICROVM) += microvm.o
> obj-y += fw_cfg.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/
> --
> 2.21.0
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2020-01-06 10:02 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-12-27 21:39 [PATCH v2] hw/i386: Allow building machines without IOMMU Philippe Mathieu-Daudé
2020-01-06 10:00 ` Michael S. Tsirkin
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.