All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jason Baron <jbaron@redhat.com>
To: mst@redhat.com, quintela@redhat.com
Cc: yamahata@valinux.co.jp, alex.williamson@redhat.com,
	qemu-devel@nongnu.org, jan.kiszka@siemens.com
Subject: [Qemu-devel] [PATCH 2/2] pcie_aer: clear cmask for Advanced Error Interrupt Message Number
Date: Thu, 30 Aug 2012 13:51:15 -0400	[thread overview]
Message-ID: <bc0da7d123650f7d5caca74591c9ab875835b12c.1346347994.git.jbaron@redhat.com> (raw)
In-Reply-To: <cover.1346347994.git.jbaron@redhat.com>

The Advanced Error Interrupt Message Number (bits 31:27 of the Root
Error Status Register) is updated when the number of msi messages assigned to a
device changes. Migration of windows 7 on q35 chipset failed because the check
in get_pci_config_device() fails due to wmask being set on these bits. Its valid
to update these bits and we must restore this state across migration.

Signed-off-by: Jason Baron <jbaron@redhat.com>
---
 hw/pcie_aer.c |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/hw/pcie_aer.c b/hw/pcie_aer.c
index 3b6981c..6edcd79 100644
--- a/hw/pcie_aer.c
+++ b/hw/pcie_aer.c
@@ -738,6 +738,12 @@ void pcie_aer_root_init(PCIDevice *dev)
                  PCI_ERR_ROOT_CMD_EN_MASK);
     pci_set_long(dev->w1cmask + pos + PCI_ERR_ROOT_STATUS,
                  PCI_ERR_ROOT_STATUS_REPORT_MASK);
+    /* Bits 31:27 - Advanced Error Interrupt Message Number
+     * These bits are updated when the number of MSI messages changes.
+     * By clearing the cmask, pcie devices can be migrated.
+     */
+    pci_set_long(dev->cmask + pos + PCI_ERR_ROOT_STATUS,
+                 (1 << PCI_ERR_ROOT_IRQ_SHIFT) - 1);
 }
 
 void pcie_aer_root_reset(PCIDevice *dev)
-- 
1.7.1

  parent reply	other threads:[~2012-08-30 17:51 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-08-30 17:51 [Qemu-devel] [PATCH 0/2] pcie migration fixes Jason Baron
2012-08-30 17:51 ` [Qemu-devel] [PATCH 1/2] pcie: drop version_id field for live migration Jason Baron
2012-08-31  8:44   ` Michael S. Tsirkin
2012-08-31 14:46     ` Jason Baron
2012-08-31 15:42       ` Michael S. Tsirkin
2012-08-31  8:51   ` Juan Quintela
2012-08-30 17:51 ` Jason Baron [this message]
2012-08-31  8:42   ` [Qemu-devel] [PATCH 2/2] pcie_aer: clear cmask for Advanced Error Interrupt Message Number Michael S. Tsirkin
2012-08-31 14:45     ` Jason Baron
2012-08-31 15:35       ` Michael S. Tsirkin
2012-08-31 15:43         ` Jason Baron
2012-09-04 20:22           ` [Qemu-devel] [PATCH 2/2 v2] " Jason Baron
2012-09-07  6:01             ` Michael S. Tsirkin

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=bc0da7d123650f7d5caca74591c9ab875835b12c.1346347994.git.jbaron@redhat.com \
    --to=jbaron@redhat.com \
    --cc=alex.williamson@redhat.com \
    --cc=jan.kiszka@siemens.com \
    --cc=mst@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=quintela@redhat.com \
    --cc=yamahata@valinux.co.jp \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.