From: Alex Williamson <alex.williamson@redhat.com>
To: Kirti Wankhede <kwankhede@nvidia.com>
Cc: <pbonzini@redhat.com>, <kraxel@redhat.com>, <cjia@nvidia.com>,
<qemu-devel@nongnu.org>, <kvm@vger.kernel.org>,
<kevin.tian@intel.com>, <jike.song@intel.com>,
<bjsdjshi@linux.vnet.ibm.com>
Subject: Re: [PATCH v6 2/4] vfio: VFIO driver for mediated PCI device
Date: Fri, 12 Aug 2016 15:25:13 -0600 [thread overview]
Message-ID: <20160812152513.311eecb4@t450s.home> (raw)
In-Reply-To: <8acef86b-0375-d42e-e60d-93a24296f64f@nvidia.com>
On Fri, 12 Aug 2016 23:27:01 +0530
Kirti Wankhede <kwankhede@nvidia.com> wrote:
> On 8/12/2016 12:13 AM, Alex Williamson wrote:
>
> >
> > TBH, I don't see how providing a default implementation of
> > validate_map_request() is useful. How many mediated devices are going
> > to want to identity map resources from the parent? Even if they do, it
> > seems we can only support a single mediated device per parent device
> > since each will map the same parent resource offset. Let's not even try
> > to define a default. If we get a fault and the vendor driver hasn't
> > provided a handler, send a SIGBUS. I expect we should also allow
> > vendor drivers to fill the mapping at mmap() time rather than expecting
> > this map on fault scheme. Maybe the mid-level driver should not even be
> > interacting with mmap() and should let the vendor driver entirely
> > determine the handling.
> >
>
> Should we go ahead with pass through mmap() call to vendor driver and
> let vendor driver decide what to do in mmap() call, either
> remap_pfn_range in mmap() or do fault on access and handle the fault in
> their driver. In that case we don't need to track mappings in mdev core.
> Let vendor driver do that on their own, right?
This sounds right to me, I don't think we want to impose either model
on the vendor driver. The vendor driver owns the vfio device file
descriptor and is responsible for managing it should they expose mmap
support for regions on the file descriptor. They either need to insert
mappings at the point where mmap() is called or setup fault handlers to
insert them on demand. If we can provide helper functions so that each
vendor driver doesn't need to re-invent either of those, that would be
a bonus. Thanks,
Alex
next prev parent reply other threads:[~2016-08-12 21:25 UTC|newest]
Thread overview: 53+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-08-03 19:03 [PATCH v6 0/4] Add Mediated device support Kirti Wankhede
2016-08-03 19:03 ` [PATCH v6 1/4] vfio: Mediated device Core driver Kirti Wankhede
2016-08-04 7:21 ` Tian, Kevin
2016-08-05 6:13 ` Kirti Wankhede
2016-08-15 9:15 ` Tian, Kevin
2016-08-09 19:00 ` Alex Williamson
2016-08-12 18:44 ` Kirti Wankhede
2016-08-12 21:16 ` Alex Williamson
2016-08-13 0:37 ` Kirti Wankhede
2016-08-15 9:38 ` Tian, Kevin
2016-08-15 15:59 ` Alex Williamson
2016-08-15 22:09 ` Neo Jia
2016-08-15 22:52 ` Alex Williamson
2016-08-15 23:23 ` Neo Jia
2016-08-16 0:49 ` Tian, Kevin
2016-08-15 19:59 ` Neo Jia
2016-08-15 22:47 ` [Qemu-devel] " Alex Williamson
2016-08-15 23:54 ` Neo Jia
2016-08-16 0:18 ` Tian, Kevin
2016-08-16 20:30 ` [Qemu-devel] " Neo Jia
2016-08-16 20:51 ` Alex Williamson
2016-08-16 21:17 ` Neo Jia
2016-08-16 0:30 ` Tian, Kevin
2016-08-16 3:45 ` Neo Jia
2016-08-16 3:50 ` Tian, Kevin
2016-08-16 4:16 ` Neo Jia
2016-08-16 4:52 ` Tian, Kevin
2016-08-16 5:43 ` Neo Jia
2016-08-16 5:58 ` Tian, Kevin
2016-08-16 6:13 ` Neo Jia
2016-08-16 21:03 ` Alex Williamson
2016-08-16 12:49 ` [Qemu-devel] " Alex Williamson
2016-08-03 19:03 ` [PATCH v6 2/4] vfio: VFIO driver for mediated PCI device Kirti Wankhede
2016-08-03 21:03 ` kbuild test robot
2016-08-04 0:19 ` kbuild test robot
2016-08-09 19:00 ` Alex Williamson
2016-08-10 21:23 ` Kirti Wankhede
2016-08-10 23:00 ` Alex Williamson
2016-08-11 15:59 ` Kirti Wankhede
2016-08-11 16:24 ` Alex Williamson
2016-08-11 17:46 ` Kirti Wankhede
2016-08-11 18:43 ` Alex Williamson
2016-08-12 17:57 ` Kirti Wankhede
2016-08-12 21:25 ` Alex Williamson [this message]
2016-08-13 0:42 ` Kirti Wankhede
2016-08-03 19:03 ` [PATCH v6 3/4] vfio iommu: Add support for mediated devices Kirti Wankhede
2016-08-09 19:00 ` Alex Williamson
2016-08-11 14:22 ` Kirti Wankhede
2016-08-11 16:28 ` Alex Williamson
2016-08-03 19:03 ` [PATCH v6 4/4] docs: Add Documentation for Mediated devices Kirti Wankhede
2016-08-04 7:31 ` Tian, Kevin
2016-08-05 7:45 ` Kirti Wankhede
2016-08-24 22:36 ` [Qemu-devel] " Daniel P. Berrange
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=20160812152513.311eecb4@t450s.home \
--to=alex.williamson@redhat.com \
--cc=bjsdjshi@linux.vnet.ibm.com \
--cc=cjia@nvidia.com \
--cc=jike.song@intel.com \
--cc=kevin.tian@intel.com \
--cc=kraxel@redhat.com \
--cc=kvm@vger.kernel.org \
--cc=kwankhede@nvidia.com \
--cc=pbonzini@redhat.com \
--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).