cryptospore / rpms / qemu-kvm

Forked from rpms/qemu-kvm 2 years ago
Clone
0a122b
From d07bebfe0f9a1e1cf3f25449d9c20d4c21c6e2a0 Mon Sep 17 00:00:00 2001
0a122b
Message-Id: <d07bebfe0f9a1e1cf3f25449d9c20d4c21c6e2a0.1387298827.git.minovotn@redhat.com>
0a122b
In-Reply-To: <3ed0fb61a3dc912ef036d7ef450bed192090709e.1387298827.git.minovotn@redhat.com>
0a122b
References: <3ed0fb61a3dc912ef036d7ef450bed192090709e.1387298827.git.minovotn@redhat.com>
0a122b
From: "Michael S. Tsirkin" <mst@redhat.com>
0a122b
Date: Tue, 17 Dec 2013 15:17:37 +0100
0a122b
Subject: [PATCH 19/56] q35: make pci window address/size match guest cfg
0a122b
0a122b
RH-Author: Michael S. Tsirkin <mst@redhat.com>
0a122b
Message-id: <1387293161-4085-20-git-send-email-mst@redhat.com>
0a122b
Patchwork-id: 56325
0a122b
O-Subject: [PATCH qemu-kvm RHEL7.0 v2 19/57] q35: make pci window address/size match guest cfg
0a122b
Bugzilla: 1034876
0a122b
RH-Acked-by: Igor Mammedov <imammedo@redhat.com>
0a122b
RH-Acked-by: Marcel Apfelbaum <marcel.a@redhat.com>
0a122b
RH-Acked-by: Laszlo Ersek <lersek@redhat.com>
0a122b
0a122b
For Q35, MMCFG address and size are guest configurable.
0a122b
Update w32 property to make it behave accordingly.
0a122b
0a122b
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
0a122b
(cherry picked from commit 636228a887c4d5c0dc313bbf936de969b420a91a)
0a122b
0a122b
Conflicts:
0a122b
	hw/pci-host/q35.c
0a122b
---
0a122b
 hw/pci-host/q35.c | 10 ++++++++++
0a122b
 1 file changed, 10 insertions(+)
0a122b
0a122b
Signed-off-by: Michal Novotny <minovotn@redhat.com>
0a122b
---
0a122b
 hw/pci-host/q35.c | 10 ++++++++++
0a122b
 1 file changed, 10 insertions(+)
0a122b
0a122b
diff --git a/hw/pci-host/q35.c b/hw/pci-host/q35.c
0a122b
index be12eee..70ad01f 100644
0a122b
--- a/hw/pci-host/q35.c
0a122b
+++ b/hw/pci-host/q35.c
0a122b
@@ -207,6 +207,16 @@ static void mch_update_pciexbar(MCHPCIState *mch)
0a122b
     }
0a122b
     addr = pciexbar & addr_mask;
0a122b
     pcie_host_mmcfg_update(&s->host, enable, addr, length);
0a122b
+    /* Leave enough space for the MCFG BAR */
0a122b
+    /*
0a122b
+     * TODO: this matches current bios behaviour, but it's not a power of two,
0a122b
+     * which means an MTRR can't cover it exactly.
0a122b
+     */
0a122b
+    if (enable) {
0a122b
+        mch->pci_info.w32.begin = addr + length;
0a122b
+    } else {
0a122b
+        mch->pci_info.w32.begin = MCH_HOST_BRIDGE_PCIEXBAR_DEFAULT;
0a122b
+    }
0a122b
 }
0a122b
 
0a122b
 /* PAM */
0a122b
-- 
0a122b
1.7.11.7
0a122b