qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Paolo Bonzini <pbonzini@redhat.com>
To: Thomas Huth <thuth@redhat.com>, qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH v2] hw/i386: make IOMMUs configurable via default-configs/
Date: Mon, 12 Mar 2018 10:53:01 +0100	[thread overview]
Message-ID: <3bd96555-ac06-f66a-6c0f-a84c3987c9ca@redhat.com> (raw)
In-Reply-To: <68ce30df-0acd-d50e-5af4-0ca23e3a6ca5@redhat.com>

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

  reply	other threads:[~2018-03-12  9:53 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
2018-03-12 10:05     ` Thomas Huth
2018-03-12 10:54 ` Philippe Mathieu-Daudé

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3bd96555-ac06-f66a-6c0f-a84c3987c9ca@redhat.com \
    --to=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=thuth@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).