qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Jean-Philippe Brucker <jean-philippe@linaro.org>
To: Eric Auger <eric.auger@redhat.com>
Cc: peter.maydell@linaro.org, mst@redhat.com, qemu-devel@nongnu.org,
	peterx@redhat.com, armbru@redhat.com, qemu-arm@nongnu.org,
	bbhushan2@marvell.com, eric.auger.pro@gmail.com
Subject: Re: [PATCH 5/5] hw/arm/virt: Let the virtio-iommu bypass MSIs
Date: Fri, 8 May 2020 10:21:26 +0200	[thread overview]
Message-ID: <20200508082126.GA1770804@myrica> (raw)
In-Reply-To: <20200507143201.31080-6-eric.auger@redhat.com>

On Thu, May 07, 2020 at 04:32:01PM +0200, Eric Auger wrote:
> At the moment the virtio-iommu translates MSI transactions.
> This behavior is inherited from ARM SMMU. The virt machine
> code knows where the guest MSI doorbells are so we can easily
> declare those regions as VIRTIO_IOMMU_RESV_MEM_T_MSI. With that
> setting the guest will not map MSIs through the IOMMU and those
> transactions will be simply bypassed. The ITS does MSI translation
> anyway.

Makes sense. I think we have to check that the ITS is used before
declaring the resv region, though. When using gicv2m, the guest will see
this MSI region and deduce that it doesn't need to create a SW mapping for
MSIs (might be wrong, I haven't tested it yet).

> Signed-off-by: Eric Auger <eric.auger@redhat.com>
> ---
>  hw/arm/virt.c | 5 +++++
>  1 file changed, 5 insertions(+)
> 
> diff --git a/hw/arm/virt.c b/hw/arm/virt.c
> index 171e6908ec..6a041e97a5 100644
> --- a/hw/arm/virt.c
> +++ b/hw/arm/virt.c
> @@ -2138,6 +2138,11 @@ static void virt_machine_device_pre_plug_cb(HotplugHandler *hotplug_dev,
>  {
>      if (object_dynamic_cast(OBJECT(dev), TYPE_PC_DIMM)) {
>          virt_memory_pre_plug(hotplug_dev, dev, errp);
> +    } else if (object_dynamic_cast(OBJECT(dev), TYPE_VIRTIO_IOMMU_PCI)) {
> +        /* we declare a VIRTIO_IOMMU_RESV_MEM_T_MSI region */
> +        qdev_prop_set_uint32(dev, "len-reserved-regions", 1);
> +        qdev_prop_set_string(dev, "reserved-regions[0]",
> +                             "0x8090000, 0x809FFFF, 1");

Maybe worth adding a comment saying this is the GITS_TRANSLATER page?

Thanks,
Jean


  reply	other threads:[~2020-05-08  8:22 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-07 14:31 [PATCH 0/5] VIRTIO-IOMMU probe request support and MSI bypass on ARM Eric Auger
2020-05-07 14:31 ` [PATCH 1/5] qdev: Introduce DEFINE_PROP_RESERVED_REGION Eric Auger
2020-05-07 14:31 ` [PATCH 2/5] virtio-iommu: Implement RESV_MEM probe request Eric Auger
2020-05-07 19:40   ` Peter Xu
2020-05-08  6:23     ` Auger Eric
2020-05-08  9:26   ` Jean-Philippe Brucker
2020-05-08 14:02     ` Auger Eric
2020-05-07 14:31 ` [PATCH 3/5] virtio-iommu: Handle reserved regions in the translation process Eric Auger
2020-05-07 19:47   ` Peter Xu
2020-05-08  6:34     ` Auger Eric
2020-05-07 14:32 ` [PATCH 4/5] virtio-iommu-pci: Add array of Interval properties Eric Auger
2020-05-07 14:32 ` [PATCH 5/5] hw/arm/virt: Let the virtio-iommu bypass MSIs Eric Auger
2020-05-08  8:21   ` Jean-Philippe Brucker [this message]
2020-05-08  8:40     ` Auger Eric

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=20200508082126.GA1770804@myrica \
    --to=jean-philippe@linaro.org \
    --cc=armbru@redhat.com \
    --cc=bbhushan2@marvell.com \
    --cc=eric.auger.pro@gmail.com \
    --cc=eric.auger@redhat.com \
    --cc=mst@redhat.com \
    --cc=peter.maydell@linaro.org \
    --cc=peterx@redhat.com \
    --cc=qemu-arm@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    /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).