From: Eric Auger <eric.auger@redhat.com>
To: eric.auger.pro@gmail.com, eric.auger@redhat.com,
qemu-devel@nongnu.org, qemu-arm@nongnu.org, stefanha@redhat.com,
fam@euphon.net, philmd@redhat.com, alex.williamson@redhat.com
Cc: lvivier@redhat.com, kwolf@redhat.com, cohuck@redhat.com,
mreitz@redhat.com
Subject: [RFC 0/3] NVMe passthrough: Take into account host IOVA reserved regions
Date: Fri, 25 Sep 2020 15:48:42 +0200 [thread overview]
Message-ID: <20200925134845.21053-1-eric.auger@redhat.com> (raw)
The current IOVA allocator allocates within the [0x10000, 1ULL << 39]
window, without paying attention to the host IOVA reserved regions.
This prevents NVMe passthtrough from working on ARM as the fixed
IOVAs rapidly grow up to the MSI reserved region [0x8000000, 0x8100000]
causing some VFIO MAP DMA failures. This series collects the usable
IOVA regions using VFIO GET_INFO (this requires the host to support
VFIO_IOMMU_TYPE1_INFO_CAP_IOVA_RANGE) and rework the fixed and
temporary IOVA allocators to avoid those latter. Also the min/max
IOVAs now can be dynamically determined.
Unfortunately the usable host IOVA ranges reported by the kernel
currently do not take into account the dma_mask of devices within
the group. This needs to be fixed, otherwise this series might try
to allocate temporary IOVAs within the range supported by the IOMMU
but beyond the allowed dma_mask. I got the case where the SMMU
supports up to 48 bits but the dma_mask only is 42bits. This kernel
dependency plus the testing limited to one peculiar ARM platform
explains the RFC state.
Best Regards
Eric
This series can be found at:
https://github.com/eauger/qemu/tree/nvme_rfc
This was tested on ARM only.
Eric Auger (3):
util/vfio-helpers: Collect IOVA reserved regions
util/vfio-helpers: Dynamically compute the min/max IOVA
util/vfio-helpers: Rework the IOVA allocator to avoid IOVA reserved
regions
util/vfio-helpers.c | 162 ++++++++++++++++++++++++++++++++++++++------
1 file changed, 143 insertions(+), 19 deletions(-)
--
2.21.3
next reply other threads:[~2020-09-25 13:57 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-09-25 13:48 Eric Auger [this message]
2020-09-25 13:48 ` [RFC 1/3] util/vfio-helpers: Collect IOVA reserved regions Eric Auger
2020-09-25 14:43 ` Fam Zheng
2020-09-25 15:23 ` Auger Eric
2020-09-25 15:44 ` Fam Zheng
2020-09-25 15:53 ` Auger Eric
2020-09-25 13:48 ` [RFC 2/3] util/vfio-helpers: Dynamically compute the min/max IOVA Eric Auger
2020-09-25 13:48 ` [RFC 3/3] util/vfio-helpers: Rework the IOVA allocator to avoid IOVA reserved regions Eric Auger
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=20200925134845.21053-1-eric.auger@redhat.com \
--to=eric.auger@redhat.com \
--cc=alex.williamson@redhat.com \
--cc=cohuck@redhat.com \
--cc=eric.auger.pro@gmail.com \
--cc=fam@euphon.net \
--cc=kwolf@redhat.com \
--cc=lvivier@redhat.com \
--cc=mreitz@redhat.com \
--cc=philmd@redhat.com \
--cc=qemu-arm@nongnu.org \
--cc=qemu-devel@nongnu.org \
--cc=stefanha@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).