qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Eric Auger <eric.auger@redhat.com>
To: Shameer Kolothum <shameerali.kolothum.thodi@huawei.com>,
	qemu-arm@nongnu.org, qemu-devel@nongnu.org
Cc: peter.maydell@linaro.org, nicolinc@nvidia.com,
	ddutile@redhat.com, linuxarm@huawei.com
Subject: Re: [PATCH] hw/arm/virt: Check bypass iommu is not set for iommu-map DT property
Date: Tue, 3 Jun 2025 11:50:21 +0200	[thread overview]
Message-ID: <ba4ac9e4-f8ca-4885-b2ab-6acdca51175b@redhat.com> (raw)
In-Reply-To: <20250602114655.42920-1-shameerali.kolothum.thodi@huawei.com>

Hi Shameer,

On 6/2/25 1:46 PM, Shameer Kolothum wrote:
> default_bus_bypass_iommu tells us whether the bypass_iommu is set
> for the default PCIe root bus. Make sure we check that before adding
> the "iommu-map" DT property.
>
> Fixes: 6d7a85483a06 ("hw/arm/virt: Add default_bus_bypass_iommu machine option")
> Suggested-by: Eric Auger <eric.auger@redhat.com>
> Signed-off-by: Shameer Kolothum <shameerali.kolothum.thodi@huawei.com>
Reviewed-by: Eric Auger <eric.auger@redhat.com>

Thanks!

Eric
> ---
>  hw/arm/virt.c | 15 ++++++++++-----
>  1 file changed, 10 insertions(+), 5 deletions(-)
>
> diff --git a/hw/arm/virt.c b/hw/arm/virt.c
> index 9a6cd085a3..99fde5836c 100644
> --- a/hw/arm/virt.c
> +++ b/hw/arm/virt.c
> @@ -1487,9 +1487,12 @@ static void create_virtio_iommu_dt_bindings(VirtMachineState *vms)
>      qemu_fdt_setprop_cell(ms->fdt, node, "phandle", vms->iommu_phandle);
>      g_free(node);
>  
> -    qemu_fdt_setprop_cells(ms->fdt, vms->pciehb_nodename, "iommu-map",
> -                           0x0, vms->iommu_phandle, 0x0, bdf,
> -                           bdf + 1, vms->iommu_phandle, bdf + 1, 0xffff - bdf);
> +    if (!vms->default_bus_bypass_iommu) {
> +        qemu_fdt_setprop_cells(ms->fdt, vms->pciehb_nodename, "iommu-map",
> +                               0x0, vms->iommu_phandle, 0x0, bdf,
> +                               bdf + 1, vms->iommu_phandle, bdf + 1,
> +                               0xffff - bdf);
> +    }
>  }
>  
>  static void create_pcie(VirtMachineState *vms)
> @@ -1612,8 +1615,10 @@ static void create_pcie(VirtMachineState *vms)
>          switch (vms->iommu) {
>          case VIRT_IOMMU_SMMUV3:
>              create_smmu(vms, vms->bus);
> -            qemu_fdt_setprop_cells(ms->fdt, nodename, "iommu-map",
> -                                   0x0, vms->iommu_phandle, 0x0, 0x10000);
> +            if (!vms->default_bus_bypass_iommu) {
> +                qemu_fdt_setprop_cells(ms->fdt, nodename, "iommu-map",
> +                                       0x0, vms->iommu_phandle, 0x0, 0x10000);
> +            }
>              break;
>          default:
>              g_assert_not_reached();



  parent reply	other threads:[~2025-06-03  9:51 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-06-02 11:46 [PATCH] hw/arm/virt: Check bypass iommu is not set for iommu-map DT property Shameer Kolothum via
2025-06-02 21:05 ` Donald Dutile
2025-06-03  9:50 ` Eric Auger [this message]
2025-06-09 13:47   ` Peter Maydell

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=ba4ac9e4-f8ca-4885-b2ab-6acdca51175b@redhat.com \
    --to=eric.auger@redhat.com \
    --cc=ddutile@redhat.com \
    --cc=linuxarm@huawei.com \
    --cc=nicolinc@nvidia.com \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-arm@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    --cc=shameerali.kolothum.thodi@huawei.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).