From: Alex Williamson <alex.williamson@redhat.com>
To: David Gibson <david@gibson.dropbear.id.au>
Cc: Alexey Kardashevskiy <aik@ozlabs.ru>,
qemu-devel@nongnu.org, qemu-ppc@nongnu.org
Subject: Re: [Qemu-devel] [PATCH qemu] RFC: vfio-pci: Allow mmap of MSIX BAR
Date: Fri, 15 Dec 2017 09:04:28 -0700 [thread overview]
Message-ID: <20171215090428.214cc474@w520.home> (raw)
In-Reply-To: <20171215040731.GD7753@umbus.fritz.box>
On Fri, 15 Dec 2017 15:07:31 +1100
David Gibson <david@gibson.dropbear.id.au> wrote:
> On Tue, Dec 12, 2017 at 04:21:31PM +1100, Alexey Kardashevskiy wrote:
> > This makes use of a new VFIO_REGION_INFO_CAP_MSIX_MAPPABLE capability
> > which tells that a region with MSIX data can be mapped entirely, i.e.
> > the VFIO PCI driver won't prevent MSIX vectors area from being mapped.
> >
> > This adds a "msix-no-mmap" property to the vfio-pci device, it is "true"
> > by default and "false" for pseries-2.12+ machines.
> >
> > This requites kernel's "vfio-pci: Allow mapping MSIX BAR"
> > https://www.spinics.net/lists/kvm/msg160282.html
> >
> > Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
> > ---
> >
> > This is an RFC as it requires kernel headers update which is not there yet.
> >
> > I'd like to make it "msix-mmap" (without "no") but could not find a way
> > of enabling a device property for machine versions newer than some value.
> >
> > I changed 2.11 machine just for the demonstration purpose.
>
> As Alex says, the mmap()ability of the MSI-X BAR isn't really the
> point. The point is whether we need to intercept guest MMIOs to the
> MSI-X region. Still, the logic's basically right, just rename your
> property to, say, "intercept_msix_mmio". It would be true by default,
> set to false by the pseries machine type.
>
> I don't think you actually need to make it vary depending on the
> version of the pseries machine type: whether the BAR is mmap()ed or
> qemu emulated shouldn't be a guest visible change. No PAPR guest
> should have been directly poking the MSI-X region (ever), so we
> shouldn't need to intercept the region even for old versions.
I have to ask, is the vfio-pci driver really the right point in the VM
to be understanding whether the platform requires MSI-X MMIO
emulation? vfio-pci is only unique here in that enabling that
emulation harms performance, but AIUI it's unused on any device and
there may eventually be other devices affected in the same way as
vfio-pci. So should there be some post-realize platform code that
disables MSI-X MemoryRegions or should the MSI-X code call out to some
platform hook to determine whether to enable emulation? Seems like a
case where the impact might be unique to vfio, but the root of the
problem is not. Thanks,
Alex
next prev parent reply other threads:[~2017-12-15 16:04 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-12-12 5:21 [Qemu-devel] [PATCH qemu] RFC: vfio-pci: Allow mmap of MSIX BAR Alexey Kardashevskiy
2017-12-12 5:45 ` Alexey Kardashevskiy
2017-12-12 5:54 ` Alex Williamson
2017-12-12 6:06 ` Alexey Kardashevskiy
2017-12-12 7:01 ` Alexey Kardashevskiy
2017-12-12 16:05 ` Alex Williamson
2017-12-15 4:09 ` David Gibson
2017-12-15 4:07 ` David Gibson
2017-12-15 16:04 ` Alex Williamson [this message]
2017-12-18 3:58 ` David Gibson
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=20171215090428.214cc474@w520.home \
--to=alex.williamson@redhat.com \
--cc=aik@ozlabs.ru \
--cc=david@gibson.dropbear.id.au \
--cc=qemu-devel@nongnu.org \
--cc=qemu-ppc@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).