From: Jean-Philippe Brucker <jean-philippe@linaro.org>
To: Bharat Bhushan <bharatb.linux@gmail.com>
Cc: peter.maydell@linaro.org, kevin.tian@intel.com,
tnowicki@marvell.com, mst@redhat.com, drjones@redhat.com,
peterx@redhat.com, qemu-devel@nongnu.org,
Auger Eric <eric.auger@redhat.com>,
alex.williamson@redhat.com, qemu-arm@nongnu.org,
Bharat Bhushan <bbhushan2@marvell.com>,
linuc.decode@gmail.com, eric.auger.pro@gmail.com
Subject: Re: [PATCH v7 3/5] virtio-iommu: Call iommu notifier for attach/detach
Date: Mon, 16 Mar 2020 11:11:24 +0100 [thread overview]
Message-ID: <20200316101124.GA304669@myrica> (raw)
In-Reply-To: <CAAeCc_mSobL4oGcK-J3WJJq8BCS6M_oyPTrzJ9bk8yFgsUDBUw@mail.gmail.com>
Hi Bharat,
Could you Cc me on your next posting? Unfortunately I don't have much
hardware for testing this at the moment, but I might be able to help a
little on the review.
On Mon, Mar 16, 2020 at 02:40:00PM +0530, Bharat Bhushan wrote:
> > >>> First issue is: your guest can use 4K page and your host can use 64KB
> > >>> pages. In that case VFIO_DMA_MAP will fail with -EINVAL. We must devise
> > >>> a way to pass the host settings to the VIRTIO-IOMMU device.
> > >>>
> > >>> Even with 64KB pages, it did not work for me. I have obviously not the
> > >>> storm of VFIO_DMA_MAP failures but I have some, most probably due to
> > >>> some wrong notifications somewhere. I will try to investigate on my side.
> > >>>
> > >>> Did you test with VFIO on your side?
> > >>
> > >> I did not tried with different page sizes, only tested with 4K page size.
> > >>
> > >> Yes it works, I tested with two n/w device assigned to VM, both interfaces works
> > >>
> > >> First I will try with 64k page size.
> > >
> > > 64K page size does not work for me as well,
> > >
> > > I think we are not passing correct page_size_mask here
> > > (config.page_size_mask is set to TARGET_PAGE_MASK ( which is
> > > 0xfffffffffffff000))
> > I guess you mean with guest using 4K and host using 64K.
> > >
> > > We need to set this correctly as per host page size, correct?
> > Yes that's correct. We need to put in place a control path to retrieve
> > the page settings on host through VFIO to inform the virtio-iommu device.
> >
> > Besides this issue, did you try with 64kB on host and guest?
>
> I tried Followings
> - 4k host and 4k guest - it works with v7 version
> - 64k host and 64k guest - it does not work with v7
> hard-coded config.page_size_mask to 0xffffffffffff0000 and it works
You might get this from the iova_pgsize bitmap returned by
VFIO_IOMMU_GET_INFO. The virtio config.page_size_mask is global so there
is the usual problem of aggregating consistent properties, but I'm
guessing using the host page size as a granule here is safe enough.
If it is a problem, we can add a PROBE property for page size mask,
allowing to define per-endpoint page masks. I have kernel patches
somewhere to do just that.
Thanks,
Jean
next prev parent reply other threads:[~2020-03-16 11:44 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-03-13 7:48 [PATCH v7 0/5] virtio-iommu: VFIO integration Bharat Bhushan
2020-03-13 7:48 ` [PATCH v7 1/5] hw/vfio/common: Remove error print on mmio region translation by viommu Bharat Bhushan
2020-03-13 7:48 ` [PATCH v7 2/5] virtio-iommu: Add iommu notifier for map/unmap Bharat Bhushan
2020-03-13 14:25 ` Auger Eric
2020-03-16 6:36 ` Bharat Bhushan
2020-03-16 7:32 ` Auger Eric
2020-03-13 7:48 ` [PATCH v7 3/5] virtio-iommu: Call iommu notifier for attach/detach Bharat Bhushan
2020-03-13 14:41 ` Auger Eric
2020-03-16 6:41 ` Bharat Bhushan
2020-03-16 7:32 ` Auger Eric
2020-03-16 7:45 ` Bharat Bhushan
2020-03-16 8:58 ` Bharat Bhushan
2020-03-16 9:04 ` Auger Eric
2020-03-16 9:10 ` Bharat Bhushan
2020-03-16 10:11 ` Jean-Philippe Brucker [this message]
2020-03-17 7:10 ` Bharat Bhushan
2020-03-17 8:25 ` Auger Eric
2020-03-17 8:53 ` Jean-Philippe Brucker
2020-03-17 9:16 ` Bharat Bhushan
2020-03-17 15:59 ` Jean-Philippe Brucker
2020-03-18 10:17 ` Bharat Bhushan
2020-03-18 11:17 ` Jean-Philippe Brucker
2020-03-18 11:20 ` [EXT] " Bharat Bhushan
2020-03-18 11:42 ` Auger Eric
2020-03-18 12:00 ` Jean-Philippe Brucker
2020-03-13 7:48 ` [PATCH v7 4/5] virtio-iommu: add iommu replay Bharat Bhushan
2020-03-13 7:48 ` [PATCH v7 5/5] virtio-iommu: add iommu notifier memory-region Bharat Bhushan
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=20200316101124.GA304669@myrica \
--to=jean-philippe@linaro.org \
--cc=alex.williamson@redhat.com \
--cc=bbhushan2@marvell.com \
--cc=bharatb.linux@gmail.com \
--cc=drjones@redhat.com \
--cc=eric.auger.pro@gmail.com \
--cc=eric.auger@redhat.com \
--cc=kevin.tian@intel.com \
--cc=linuc.decode@gmail.com \
--cc=mst@redhat.com \
--cc=peter.maydell@linaro.org \
--cc=peterx@redhat.com \
--cc=qemu-arm@nongnu.org \
--cc=qemu-devel@nongnu.org \
--cc=tnowicki@marvell.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).