From: Alex Williamson <alex.williamson@redhat.com>
To: qemu-devel@nongnu.org
Subject: [Qemu-devel] [PULL 11/11] ppc/spapr, vfio: Turn off MSIX emulation for VFIO devices
Date: Tue, 13 Mar 2018 14:19:09 -0600 [thread overview]
Message-ID: <20180313201909.2327.86152.stgit@gimli.home> (raw)
In-Reply-To: <20180313201415.2327.62402.stgit@gimli.home>
From: Alexey Kardashevskiy <aik@ozlabs.ru>
This adds a possibility for the platform to tell VFIO not to emulate MSIX
so MMIO memory regions do not get split into chunks in flatview and
the entire page can be registered as a KVM memory slot and make direct
MMIO access possible for the guest.
This enables the entire MSIX BAR mapping to the guest for the pseries
platform in order to achieve the maximum MMIO preformance for certain
devices.
Tested on:
LSI Logic / Symbios Logic SAS3008 PCI-Express Fusion-MPT SAS-3 (rev 02)
Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
Reviewed-by: David Gibson <david@gibson.dropbear.id.au>
Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
---
hw/ppc/spapr.c | 7 +++++++
hw/vfio/pci.c | 13 +++++++++++++
2 files changed, 20 insertions(+)
diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c
index 7e1c85856622..032d03423f97 100644
--- a/hw/ppc/spapr.c
+++ b/hw/ppc/spapr.c
@@ -2855,6 +2855,11 @@ static void spapr_set_modern_hotplug_events(Object *obj, bool value,
spapr->use_hotplug_event_source = value;
}
+static bool spapr_get_msix_emulation(Object *obj, Error **errp)
+{
+ return true;
+}
+
static char *spapr_get_resize_hpt(Object *obj, Error **errp)
{
sPAPRMachineState *spapr = SPAPR_MACHINE(obj);
@@ -2936,6 +2941,8 @@ static void spapr_instance_init(Object *obj)
object_property_set_description(obj, "vsmt",
"Virtual SMT: KVM behaves as if this were"
" the host's SMT mode", &error_abort);
+ object_property_add_bool(obj, "vfio-no-msix-emulation",
+ spapr_get_msix_emulation, NULL, NULL);
}
static void spapr_machine_finalizefn(Object *obj)
diff --git a/hw/vfio/pci.c b/hw/vfio/pci.c
index 02974f4eb976..b9bc6cd31084 100644
--- a/hw/vfio/pci.c
+++ b/hw/vfio/pci.c
@@ -1581,6 +1581,19 @@ static int vfio_msix_setup(VFIOPCIDevice *vdev, int pos, Error **errp)
*/
memory_region_set_enabled(&vdev->pdev.msix_pba_mmio, false);
+ /*
+ * The emulated machine may provide a paravirt interface for MSIX setup
+ * so it is not strictly necessary to emulate MSIX here. This becomes
+ * helpful when frequently accessed MMIO registers are located in
+ * subpages adjacent to the MSIX table but the MSIX data containing page
+ * cannot be mapped because of a host page size bigger than the MSIX table
+ * alignment.
+ */
+ if (object_property_get_bool(OBJECT(qdev_get_machine()),
+ "vfio-no-msix-emulation", NULL)) {
+ memory_region_set_enabled(&vdev->pdev.msix_table_mmio, false);
+ }
+
return 0;
}
next prev parent reply other threads:[~2018-03-13 20:19 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-03-13 20:17 [Qemu-devel] [PULL 00/11] vfio updates for QEMU-2.12 soft freeze Alex Williamson
2018-03-13 20:17 ` [Qemu-devel] [PULL 01/11] standard-headers: add drm/drm_fourcc.h Alex Williamson
2018-03-13 20:17 ` [Qemu-devel] [PULL 02/11] ui/pixman: add qemu_drm_format_to_pixman() Alex Williamson
2018-03-13 20:18 ` [Qemu-devel] [PULL 03/11] console: minimal hotplug suport Alex Williamson
2018-03-13 20:18 ` [Qemu-devel] [PULL 04/11] secondary-vga: properly close QemuConsole on unplug Alex Williamson
2018-03-13 20:18 ` [Qemu-devel] [PULL 05/11] vfio/common: cleanup in vfio_region_finalize Alex Williamson
2018-03-13 20:18 ` [Qemu-devel] [PULL 06/11] vfio/display: core & wireup Alex Williamson
2018-03-13 20:18 ` [Qemu-devel] [PULL 07/11] vfio/display: adding region support Alex Williamson
2018-03-13 20:18 ` [Qemu-devel] [PULL 08/11] vfio/display: adding dmabuf support Alex Williamson
2018-03-13 20:18 ` [Qemu-devel] [PULL 09/11] vfio/pci: Relax DMA map errors for MMIO regions Alex Williamson
2018-03-13 20:19 ` [Qemu-devel] [PULL 10/11] vfio-pci: Allow mmap of MSIX BAR Alex Williamson
2018-03-13 20:19 ` Alex Williamson [this message]
2018-03-16 11:03 ` [Qemu-devel] [PULL 00/11] vfio updates for QEMU-2.12 soft freeze Peter Maydell
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=20180313201909.2327.86152.stgit@gimli.home \
--to=alex.williamson@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).