mvadkert / rpms / qemu

Forked from rpms/qemu 6 years ago
Clone
5544c1b
From 89df4609568433f67999c27f9b9cd12e91a7d0b5 Mon Sep 17 00:00:00 2001
5544c1b
From: Jason Baron <jbaron@redhat.com>
5544c1b
Date: Tue, 4 Sep 2012 16:22:46 -0400
5544c1b
Subject: [PATCH] pcie_aer: clear cmask for Advanced Error Interrupt Message
5544c1b
 Number
5544c1b
5544c1b
The Advanced Error Interrupt Message Number (bits 31:27 of the Root
5544c1b
Error Status Register) is updated when the number of msi messages assigned to a
5544c1b
device changes. Migration of windows 7 on q35 chipset failed because the check
5544c1b
in get_pci_config_device() fails due to cmask being set on these bits. Its valid
5544c1b
to update these bits and we must restore this state across migration.
5544c1b
5544c1b
Signed-off-by: Jason Baron <jbaron@redhat.com>
5544c1b
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
5544c1b
(cherry picked from commit 0e180d9c8a7429c55d23d2e7855f1e490a063aaa)
5544c1b
5544c1b
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
5544c1b
---
5544c1b
 hw/pcie_aer.c | 5 +++++
5544c1b
 1 file changed, 5 insertions(+)
5544c1b
5544c1b
diff --git a/hw/pcie_aer.c b/hw/pcie_aer.c
5544c1b
index 3b6981c..b04c164 100644
5544c1b
--- a/hw/pcie_aer.c
5544c1b
+++ b/hw/pcie_aer.c
5544c1b
@@ -738,6 +738,11 @@ void pcie_aer_root_init(PCIDevice *dev)
5544c1b
                  PCI_ERR_ROOT_CMD_EN_MASK);
5544c1b
     pci_set_long(dev->w1cmask + pos + PCI_ERR_ROOT_STATUS,
5544c1b
                  PCI_ERR_ROOT_STATUS_REPORT_MASK);
5544c1b
+    /* PCI_ERR_ROOT_IRQ is RO but devices change it using a
5544c1b
+     * device-specific method.
5544c1b
+     */
5544c1b
+    pci_set_long(dev->cmask + pos + PCI_ERR_ROOT_STATUS,
5544c1b
+                 ~PCI_ERR_ROOT_IRQ);
5544c1b
 }
5544c1b
 
5544c1b
 void pcie_aer_root_reset(PCIDevice *dev)
5544c1b
-- 
5544c1b
1.7.12.1
5544c1b