All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH v2] hw/i386: make IOMMUs configurable via default-configs/
@ 2018-03-12  9:43 Paolo Bonzini
  2018-03-12  9:48 ` Thomas Huth
  2018-03-12 10:54 ` Philippe Mathieu-Daudé
  0 siblings, 2 replies; 5+ messages in thread
From: Paolo Bonzini @ 2018-03-12  9:43 UTC (permalink / raw)
  To: qemu-devel; +Cc: thuth

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

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
        v1->v2: don't include x86-iommu.o unconditionally

 default-configs/i386-softmmu.mak   | 2 ++
 default-configs/x86_64-softmmu.mak | 2 ++
 hw/i386/Makefile.objs              | 4 ++--
 3 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/default-configs/i386-softmmu.mak b/default-configs/i386-softmmu.mak
index 3326e3e0bb..9e5a29fa4a 100644
--- a/default-configs/i386-softmmu.mak
+++ b/default-configs/i386-softmmu.mak
@@ -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
diff --git a/default-configs/x86_64-softmmu.mak b/default-configs/x86_64-softmmu.mak
index 1c6cda1d9a..7baf91b921 100644
--- a/default-configs/x86_64-softmmu.mak
+++ b/default-configs/x86_64-softmmu.mak
@@ -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
diff --git a/hw/i386/Makefile.objs b/hw/i386/Makefile.objs
index fd279e7584..fa87a14152 100644
--- a/hw/i386/Makefile.objs
+++ b/hw/i386/Makefile.objs
@@ -2,8 +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 += amd_iommu.o
+obj-$(CONFIG_VTD) += x86-iommu.o intel_iommu.o
+obj-$(CONFIG_AMD_IOMMU) += x86-iommu.o amd_iommu.o
 obj-$(CONFIG_XEN) += ../xenpv/ xen/
 obj-$(CONFIG_VMPORT) += vmport.o
 obj-$(CONFIG_VMMOUSE) += vmmouse.o
-- 
2.14.3

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [Qemu-devel] [PATCH v2] hw/i386: make IOMMUs configurable via default-configs/
  2018-03-12  9:43 [Qemu-devel] [PATCH v2] hw/i386: make IOMMUs configurable via default-configs/ Paolo Bonzini
@ 2018-03-12  9:48 ` Thomas Huth
  2018-03-12  9:53   ` Paolo Bonzini
  2018-03-12 10:54 ` Philippe Mathieu-Daudé
  1 sibling, 1 reply; 5+ messages in thread
From: Thomas Huth @ 2018-03-12  9:48 UTC (permalink / raw)
  To: Paolo Bonzini, qemu-devel

On 12.03.2018 10:43, Paolo Bonzini wrote:
> Allow distributions to disable the Intel and/or AMD IOMMU devices.
> 
> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
> ---
>         v1->v2: don't include x86-iommu.o unconditionally
> 
>  default-configs/i386-softmmu.mak   | 2 ++
>  default-configs/x86_64-softmmu.mak | 2 ++
>  hw/i386/Makefile.objs              | 4 ++--
>  3 files changed, 6 insertions(+), 2 deletions(-)
> 
> diff --git a/default-configs/i386-softmmu.mak b/default-configs/i386-softmmu.mak
> index 3326e3e0bb..9e5a29fa4a 100644
> --- a/default-configs/i386-softmmu.mak
> +++ b/default-configs/i386-softmmu.mak
> @@ -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
> diff --git a/default-configs/x86_64-softmmu.mak b/default-configs/x86_64-softmmu.mak
> index 1c6cda1d9a..7baf91b921 100644
> --- a/default-configs/x86_64-softmmu.mak
> +++ b/default-configs/x86_64-softmmu.mak
> @@ -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
> diff --git a/hw/i386/Makefile.objs b/hw/i386/Makefile.objs
> index fd279e7584..fa87a14152 100644
> --- a/hw/i386/Makefile.objs
> +++ b/hw/i386/Makefile.objs
> @@ -2,8 +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 += amd_iommu.o
> +obj-$(CONFIG_VTD) += x86-iommu.o intel_iommu.o
> +obj-$(CONFIG_AMD_IOMMU) += x86-iommu.o amd_iommu.o

The linker likely does not care if x86-iommu.o is included twice, but
wouldn't it be clearer to use this instead:

obj-$(call lor,$(CONFIG_VTD),$(CONFIG_AMD_IOMMU)) += x86-iommu.o

?

 Thomas

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [Qemu-devel] [PATCH v2] hw/i386: make IOMMUs configurable via default-configs/
  2018-03-12  9:48 ` Thomas Huth
@ 2018-03-12  9:53   ` Paolo Bonzini
  2018-03-12 10:05     ` Thomas Huth
  0 siblings, 1 reply; 5+ messages in thread
From: Paolo Bonzini @ 2018-03-12  9:53 UTC (permalink / raw)
  To: Thomas Huth, qemu-devel

On 12/03/2018 10:48, Thomas Huth wrote:
>> +obj-$(CONFIG_VTD) += x86-iommu.o intel_iommu.o
>> +obj-$(CONFIG_AMD_IOMMU) += x86-iommu.o amd_iommu.o
> The linker likely does not care if x86-iommu.o is included twice

The linker actually cares, but rules.mak drops the duplicate:

    commit e2a99ad3e174ab4c9d2320dcecd779230409829f
    Author: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
    Date:   Thu Aug 25 09:18:52 2011 +0100

    build: sort objects to remove duplicates for link

    Avoid duplicate object files during the link.  There are legitimate
    cases where a link command-line would include duplicate object files
    because two independent subsystems both depend on common
    infrastructure.

    Use GNU make's $(sort) function to remove duplicate object files
    from the link command-line.

    Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
    Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>

> , but wouldn't it be clearer to use this instead:
> 
> obj-$(call lor,$(CONFIG_VTD),$(CONFIG_AMD_IOMMU)) += x86-iommu.o

Possibly, but it doesn't scale too well when we add a third IOMMU.  The
right solution would be something like "select" in Kconfig.  Let me know
what you prefer for x86-iommu.c between obj-y and specifying the file
twice, and I'll do it.

Paolo

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [Qemu-devel] [PATCH v2] hw/i386: make IOMMUs configurable via default-configs/
  2018-03-12  9:53   ` Paolo Bonzini
@ 2018-03-12 10:05     ` Thomas Huth
  0 siblings, 0 replies; 5+ messages in thread
From: Thomas Huth @ 2018-03-12 10:05 UTC (permalink / raw)
  To: Paolo Bonzini, qemu-devel

On 12.03.2018 10:53, Paolo Bonzini wrote:
> On 12/03/2018 10:48, Thomas Huth wrote:
>>> +obj-$(CONFIG_VTD) += x86-iommu.o intel_iommu.o
>>> +obj-$(CONFIG_AMD_IOMMU) += x86-iommu.o amd_iommu.o
>> The linker likely does not care if x86-iommu.o is included twice
> 
> The linker actually cares, but rules.mak drops the duplicate:
> 
>     commit e2a99ad3e174ab4c9d2320dcecd779230409829f
>     Author: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
>     Date:   Thu Aug 25 09:18:52 2011 +0100
> 
>     build: sort objects to remove duplicates for link

Ah, nice, I wasn't aware of that trick. The current patch looks fine to
me in this case:

Reviewed-by: Thomas Huth <thuth@redhat.com>

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [Qemu-devel] [PATCH v2] hw/i386: make IOMMUs configurable via default-configs/
  2018-03-12  9:43 [Qemu-devel] [PATCH v2] hw/i386: make IOMMUs configurable via default-configs/ Paolo Bonzini
  2018-03-12  9:48 ` Thomas Huth
@ 2018-03-12 10:54 ` Philippe Mathieu-Daudé
  1 sibling, 0 replies; 5+ messages in thread
From: Philippe Mathieu-Daudé @ 2018-03-12 10:54 UTC (permalink / raw)
  To: Paolo Bonzini, qemu-devel; +Cc: thuth

On 03/12/2018 10:43 AM, Paolo Bonzini wrote:
> Allow distributions to disable the Intel and/or AMD IOMMU devices.
> 
> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>

Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>

> ---
>         v1->v2: don't include x86-iommu.o unconditionally
> 
>  default-configs/i386-softmmu.mak   | 2 ++
>  default-configs/x86_64-softmmu.mak | 2 ++
>  hw/i386/Makefile.objs              | 4 ++--
>  3 files changed, 6 insertions(+), 2 deletions(-)
> 
> diff --git a/default-configs/i386-softmmu.mak b/default-configs/i386-softmmu.mak
> index 3326e3e0bb..9e5a29fa4a 100644
> --- a/default-configs/i386-softmmu.mak
> +++ b/default-configs/i386-softmmu.mak
> @@ -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
> diff --git a/default-configs/x86_64-softmmu.mak b/default-configs/x86_64-softmmu.mak
> index 1c6cda1d9a..7baf91b921 100644
> --- a/default-configs/x86_64-softmmu.mak
> +++ b/default-configs/x86_64-softmmu.mak
> @@ -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
> diff --git a/hw/i386/Makefile.objs b/hw/i386/Makefile.objs
> index fd279e7584..fa87a14152 100644
> --- a/hw/i386/Makefile.objs
> +++ b/hw/i386/Makefile.objs
> @@ -2,8 +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 += amd_iommu.o
> +obj-$(CONFIG_VTD) += x86-iommu.o intel_iommu.o
> +obj-$(CONFIG_AMD_IOMMU) += x86-iommu.o amd_iommu.o
>  obj-$(CONFIG_XEN) += ../xenpv/ xen/
>  obj-$(CONFIG_VMPORT) += vmport.o
>  obj-$(CONFIG_VMMOUSE) += vmmouse.o
> 

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2018-03-12 10:54 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-03-12  9:43 [Qemu-devel] [PATCH v2] hw/i386: make IOMMUs configurable via default-configs/ Paolo Bonzini
2018-03-12  9:48 ` Thomas Huth
2018-03-12  9:53   ` Paolo Bonzini
2018-03-12 10:05     ` Thomas Huth
2018-03-12 10:54 ` Philippe Mathieu-Daudé

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.