All of lore.kernel.org
 help / color / mirror / Atom feed
From: Nicolin Chen <nicolinc@nvidia.com>
To: Eric Auger <eric.auger@redhat.com>
Cc: <eric.auger.pro@gmail.com>, <qemu-devel@nongnu.org>,
	<qemu-arm@nongnu.org>, <peter.maydell@linaro.org>,
	<mst@redhat.com>, <skolothumtho@nvidia.com>, <nathanc@nvidia.com>
Subject: Re: [PATCH] hw/pci/pci: Enforce pci_setup_iommu_per_bus() is called only once per bus
Date: Mon, 30 Mar 2026 02:06:24 -0700	[thread overview]
Message-ID: <aco9ECUbZ1+QvbOR@nvidia.com> (raw)
In-Reply-To: <20260323183024.4069032-1-eric.auger@redhat.com>

On Mon, Mar 23, 2026 at 07:30:20PM +0100, Eric Auger wrote:
> @@ -3307,11 +3307,16 @@ void pci_setup_iommu(PCIBus *bus, const PCIIOMMUOps *ops, void *opaque)
>   * IOMMU ops are returned, avoiding the use of the parent’s IOMMU when
>   * it's not appropriate.
>   */
> -void pci_setup_iommu_per_bus(PCIBus *bus, const PCIIOMMUOps *ops,
> -                             void *opaque)
> +bool pci_setup_iommu_per_bus(PCIBus *bus, const PCIIOMMUOps *ops,
> +                             void *opaque, Error **errp)
>  {
> +    if (bus->iommu_per_bus) {
> +        error_setg(errp, "An iommu is already attached to this bus");
> +        return false;
> +    }
>      pci_setup_iommu(bus, ops, opaque);
>      bus->iommu_per_bus = true;
> +    return true;

Do we need the same check in pci_setup_iommu()?

Apart from this question,

Reviewed-by: Nicolin Chen <nicolinc@nvidia.com>


  parent reply	other threads:[~2026-03-30  9:07 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-03-23 18:30 [PATCH] hw/pci/pci: Enforce pci_setup_iommu_per_bus() is called only once per bus Eric Auger
2026-03-24 17:25 ` Nathan Chen
2026-03-30  8:59 ` Shameer Kolothum Thodi
2026-03-30  9:06 ` Nicolin Chen [this message]
2026-03-31 15:06   ` Eric Auger
2026-06-03 12:40     ` Eric Auger
2026-03-31 17:59 ` 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=aco9ECUbZ1+QvbOR@nvidia.com \
    --to=nicolinc@nvidia.com \
    --cc=eric.auger.pro@gmail.com \
    --cc=eric.auger@redhat.com \
    --cc=mst@redhat.com \
    --cc=nathanc@nvidia.com \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-arm@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    --cc=skolothumtho@nvidia.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 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.