qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v2] hw/i386: Allow building machines without IOMMU


From: Michael S. Tsirkin
Subject: Re: [PATCH v2] hw/i386: Allow building machines without IOMMU
Date: Mon, 6 Jan 2020 05:00:18 -0500

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é <address@hidden>

Acked-by: Michael S. Tsirkin <address@hidden>

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 <address@hidden>
> - *
> - * 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




reply via email to

[Prev in Thread] Current Thread [Next in Thread]