aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJan Beulich <jbeulich@suse.com>2012-09-11 12:33:31 +0200
committerJan Beulich <jbeulich@suse.com>2012-09-11 12:33:31 +0200
commit1868a0c5c083a53f7473067ceb871bd096c72386 (patch)
treeb7e0064ab56e367752f577f3b0ddfd7d5196a63d
parent3c46b3a51a97a0380d0f226678cd656858295b5a (diff)
downloadxen-1868a0c5c083a53f7473067ceb871bd096c72386.tar.gz
xen-1868a0c5c083a53f7473067ceb871bd096c72386.tar.bz2
xen-1868a0c5c083a53f7473067ceb871bd096c72386.zip
x86/MSI: fix 2nd S3 resume with interrupt remapping enabled
The first resume from S3 was corrupting internal data structures (in that pci_restore_msi_state() updated the globally stored MSI message from traditional to interrupt remapped format, which would then be translated a second time during the second resume, breaking interrupt delivery). Signed-off-by: Jan Beulich <jbeulich@suse.com> Acked-by: Keir Fraser <keir@xen.org> xen-unstable changeset: 25834:0376c85caaf3 xen-unstable date: Fri Sep 7 15:57:10 UTC 2012
-rw-r--r--xen/arch/x86/msi.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/xen/arch/x86/msi.c b/xen/arch/x86/msi.c
index 782b84b0fd..f982c45df8 100644
--- a/xen/arch/x86/msi.c
+++ b/xen/arch/x86/msi.c
@@ -210,7 +210,10 @@ static void write_msi_msg(struct msi_desc *entry, struct msi_msg *msg)
entry->msg = *msg;
if ( iommu_enabled )
+ {
+ ASSERT(msg != &entry->msg);
iommu_update_ire_from_msi(entry, msg);
+ }
switch ( entry->msi_attrib.type )
{
@@ -996,6 +999,7 @@ int pci_restore_msi_state(struct pci_dev *pdev)
int ret;
struct msi_desc *entry, *tmp;
struct irq_desc *desc;
+ struct msi_msg msg;
ASSERT(spin_is_locked(&pcidevs_lock));
@@ -1030,7 +1034,8 @@ int pci_restore_msi_state(struct pci_dev *pdev)
else if ( entry->msi_attrib.type == PCI_CAP_ID_MSIX )
msix_set_enable(pdev, 0);
- write_msi_msg(entry, &entry->msg);
+ msg = entry->msg;
+ write_msi_msg(entry, &msg);
msi_set_mask_bit(desc, entry->msi_attrib.masked);