qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Thomas Huth <thuth@redhat.com>
To: Matthew Rosato <mjrosato@linux.ibm.com>, qemu-s390x@nongnu.org
Cc: farman@linux.ibm.com, schnelle@linux.ibm.com,
	pasic@linux.ibm.com, borntraeger@linux.ibm.com,
	richard.henderson@linaro.org, david@redhat.com,
	iii@linux.ibm.com, clg@redhat.com, qemu-devel@nongnu.org
Subject: Re: [PATCH v5 0/2] s390x/pci: relax I/O address translation requirement
Date: Thu, 6 Mar 2025 08:08:25 +0100	[thread overview]
Message-ID: <ad51f681-98d1-4347-bbfe-5ffb8366af8d@redhat.com> (raw)
In-Reply-To: <20250226210013.238349-1-mjrosato@linux.ibm.com>

On 26/02/2025 22.00, Matthew Rosato wrote:
> This series introduces the concept of the relaxed translation requirement
> for s390x guests in order to allow bypass of the guest IOMMU for more
> efficient PCI passthrough.
> 
> With this series, QEMU can indicate to the guest that an IOMMU is not
> strictly required for a zPCI device.  This would subsequently allow a
> guest linux to use iommu.passthrough=1 and bypass their guest IOMMU for
> PCI devices.
> 
> When this occurs, QEMU will note the behavior via an intercepted MPCIFC
> instruction and will fill the host iommu with mappings of the entire
> guest address space in response.
> 
> The kernel series [1] that adds the relevant behavior needed to
> exploit this new feature from within a s390x linux guest is available
> in linux-next via iommu-next.
> 
> [1]: https://lore.kernel.org/linux-s390/20250212213418.182902-1-mjrosato@linux.ibm.com/
> 
> Changes for v5:
> - Add some review/test tags (had to drop some due to code changes)
> - Dynamically allocate iommu->dm_mr, remove direct_map bool
> 
> Changes for v4:
> - use get_system_memory() instead of ms->ram
> - rename rtr_allowed to rtr_avail
> - turn off rtr_avail for emulated devices so MPCFIC fence properly
>    rejects an attempt at direct mapping (we only advertise via CLP
>    for passthrough devices)
> - turn off rtr_avail for passthrough ISM devices
> - various minor changes
> 
> Changes for v3:
> - use s390_get_memory_limit
> - advertise full aperture for relaxed-translation-capable devices
> 
> Changes for v2:
> - Add relax-translation property, fence for older machines
> - Add a new MPCIFC failure case when direct-mapping requested but
>    the relax-translation property is set to off.
> - For direct mapping, use a memory alias to handle the SMDA offset and
>    then just let vfio handle the pinning of memory.
> 
> Matthew Rosato (2):
>    s390x/pci: add support for guests that request direct mapping
>    s390x/pci: indicate QEMU supports relaxed translation for passthrough
> 
>   hw/s390x/s390-pci-bus.c         | 39 +++++++++++++++++++++++++++++++--
>   hw/s390x/s390-pci-inst.c        | 13 +++++++++--
>   hw/s390x/s390-pci-vfio.c        | 28 ++++++++++++++++++-----
>   hw/s390x/s390-virtio-ccw.c      |  5 +++++
>   include/hw/s390x/s390-pci-bus.h |  3 +++
>   include/hw/s390x/s390-pci-clp.h |  1 +
>   6 files changed, 80 insertions(+), 9 deletions(-)
> 

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

I'll queue it for my next pull request.

  Thomas



      parent reply	other threads:[~2025-03-06  7:09 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-02-26 21:00 [PATCH v5 0/2] s390x/pci: relax I/O address translation requirement Matthew Rosato
2025-02-26 21:00 ` [PATCH v5 1/2] s390x/pci: add support for guests that request direct mapping Matthew Rosato
2025-02-27 12:02   ` David Hildenbrand
2025-02-26 21:00 ` [PATCH v5 2/2] s390x/pci: indicate QEMU supports relaxed translation for passthrough Matthew Rosato
2025-03-06  7:08 ` Thomas Huth [this message]

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=ad51f681-98d1-4347-bbfe-5ffb8366af8d@redhat.com \
    --to=thuth@redhat.com \
    --cc=borntraeger@linux.ibm.com \
    --cc=clg@redhat.com \
    --cc=david@redhat.com \
    --cc=farman@linux.ibm.com \
    --cc=iii@linux.ibm.com \
    --cc=mjrosato@linux.ibm.com \
    --cc=pasic@linux.ibm.com \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-s390x@nongnu.org \
    --cc=richard.henderson@linaro.org \
    --cc=schnelle@linux.ibm.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).