qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Zhi Wang <zhi.a.wang@intel.com>
To: qemu-devel@nongnu.org
Cc: chuanxiao.dong@intel.com, daniel.vetter@ffwll.ch,
	xiong.y.zhang@intel.com, joonas.lahtinen@linux.intel.com,
	zhiyuan.lv@intel.com, zhenyuw@linux.intel.com,
	kevin.tian@intel.com, Zhi Wang <zhi.a.wang@intel.com>
Subject: [Qemu-devel] [RFC 6/6] vfio: Setup IGD stolen memory under secondary mode
Date: Tue, 30 May 2017 01:30:43 +0800	[thread overview]
Message-ID: <1496079043-26694-14-git-send-email-zhi.a.wang@intel.com> (raw)
In-Reply-To: <1496079043-26694-1-git-send-email-zhi.a.wang@intel.com>

Also setup IGD stolen memory under secondary mode as some HW functions
might need the stolen memory anyway.

Suggested-by: Xiong Zhang <xiong.y.zhang@intel.com>
Signed-off-by: Zhi Wang <zhi.a.wang@intel.com>
---
 hw/vfio/pci-quirks.c | 18 +++++++++++-------
 1 file changed, 11 insertions(+), 7 deletions(-)

diff --git a/hw/vfio/pci-quirks.c b/hw/vfio/pci-quirks.c
index abfcec6..6ddb59a 100644
--- a/hw/vfio/pci-quirks.c
+++ b/hw/vfio/pci-quirks.c
@@ -1196,16 +1196,11 @@ static void vfio_probe_igd_bar4_quirk(VFIOPCIDevice *vdev, int nr)
     Error *err = NULL;
 
     /*
-     * This must be an Intel VGA device at address 00:02.0 for us to even
-     * consider enabling legacy mode.  The vBIOS has dependencies on the
-     * PCI bus address.
+     * This must be an Intel VGA device.
      */
     if (!vfio_pci_is(vdev, PCI_VENDOR_ID_INTEL, PCI_ANY_ID) ||
-        !vfio_is_vga(vdev) || nr != 4 ||
-        &vdev->pdev != pci_find_device(pci_device_root_bus(&vdev->pdev),
-                                       0, PCI_DEVFN(0x2, 0))) {
+        !vfio_is_vga(vdev) || nr != 4)
         return;
-    }
 
     /*
      * IGD is not a standard, they like to change their specs often.  We
@@ -1251,6 +1246,15 @@ static void vfio_probe_igd_bar4_quirk(VFIOPCIDevice *vdev, int nr)
     pci_set_long(vdev->emulated_config_bits + IGD_BDSM, ~0);
 
     /*
+     * This must be an Intel VGA device at address 00:02.0 for us to even
+     * consider enabling legacy mode.  The vBIOS has dependencies on the
+     * PCI bus address.
+     */
+    if (&vdev->pdev != pci_find_device(pci_device_root_bus(&vdev->pdev),
+                0, PCI_DEVFN(0x2, 0)))
+        return;
+
+    /*
      * We need to create an LPC/ISA bridge at PCI bus address 00:1f.0 that we
      * can stuff host values into, so if there's already one there and it's not
      * one we can hack on, legacy mode is no-go.  Sorry Q35.
-- 
2.7.4

      parent reply	other threads:[~2017-05-29  8:33 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-05-29 17:30 [Qemu-devel] [RFC 0/6] Refine IGD stolen memory support in VFIO Zhi Wang
2017-05-29  8:29 ` Zhi Wang
2017-05-31 22:13   ` Wang, Zhi A
2017-05-29  8:43 ` no-reply
2017-05-29  8:45 ` no-reply
2017-05-29  8:50 ` no-reply
2017-05-29 17:30 ` [Qemu-devel] [RFC 1/6] vfio: Add Intel platform definitions Zhi Wang
2017-05-29 17:30 ` [Qemu-devel] [RFC 2/6] vfio: Setup IGD quirks earlier Zhi Wang
2017-06-01 20:34   ` Alex Williamson
2017-05-29 17:30 ` [Qemu-devel] [RFC 3/6] vfio: Setup IGD stolen memory Zhi Wang
2017-06-01 21:10   ` Alex Williamson
2017-05-29 17:30 ` [Qemu-devel] [RFC 4/6] vfio: Refine GGTT clearing Zhi Wang
2017-05-29 17:30 ` [Qemu-devel] [RFC 5/6] vfio: Remove extra quirks and old definitions Zhi Wang
2017-05-29 17:30 ` [Qemu-devel] [RFC 6/6] vfio: Setup IGD stolen memory under secondary mode Zhi Wang
2017-05-29 17:30 ` [Qemu-devel] [RFC 0/6] Refine IGD stolen memory support in VFIO Zhi Wang
2017-06-01  2:52   ` Tian, Kevin
2017-05-29 17:30 ` [Qemu-devel] [RFC 1/6] vfio: Add Intel platform definitions Zhi Wang
2017-06-01 20:22   ` Alex Williamson
2017-05-29 17:30 ` [Qemu-devel] [RFC 2/6] vfio: Setup IGD quirks earlier Zhi Wang
2017-05-29 17:30 ` [Qemu-devel] [RFC 3/6] vfio: Setup IGD stolen memory Zhi Wang
2017-05-29 17:30 ` [Qemu-devel] [RFC 4/6] vfio: Refine GGTT clearing Zhi Wang
2017-05-29 17:30 ` [Qemu-devel] [RFC 5/6] vfio: Remove extra quirks and old definitions Zhi Wang
2017-05-29 17:30 ` Zhi Wang [this message]

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=1496079043-26694-14-git-send-email-zhi.a.wang@intel.com \
    --to=zhi.a.wang@intel.com \
    --cc=chuanxiao.dong@intel.com \
    --cc=daniel.vetter@ffwll.ch \
    --cc=joonas.lahtinen@linux.intel.com \
    --cc=kevin.tian@intel.com \
    --cc=qemu-devel@nongnu.org \
    --cc=xiong.y.zhang@intel.com \
    --cc=zhenyuw@linux.intel.com \
    --cc=zhiyuan.lv@intel.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).