[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 42/52] spapr_pci: Fix config space corruption
From: |
Alexander Graf |
Subject: |
[Qemu-devel] [PULL 42/52] spapr_pci: Fix config space corruption |
Date: |
Thu, 4 Sep 2014 19:20:30 +0200 |
From: Alexey Kardashevskiy <address@hidden>
When disabling MSI/MSIX via "ibm,change-msi" RTAS call, no check was made
if MSI or MSIX is actually supported and the MSI message was reset
unconditionally. If this happened on a device which does not support MSI
(but does support MSIX, otherwise "ibm,change-msi" would not be called),
this device would have PCIDevice::msi_cap field (MSI capability offset)
set to zero and writing a vector would actually clear PCI status.
This clears MSI message only if MSI or MSIX is present on a device.
Signed-off-by: Alexey Kardashevskiy <address@hidden>
Signed-off-by: Alexander Graf <address@hidden>
---
hw/ppc/spapr_pci.c | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/hw/ppc/spapr_pci.c b/hw/ppc/spapr_pci.c
index 9ed39a9..e894f07 100644
--- a/hw/ppc/spapr_pci.c
+++ b/hw/ppc/spapr_pci.c
@@ -262,7 +262,6 @@ static void rtas_ibm_change_msi(PowerPCCPU *cpu,
sPAPREnvironment *spapr,
unsigned int irq, max_irqs = 0, num = 0;
sPAPRPHBState *phb = NULL;
PCIDevice *pdev = NULL;
- bool msix = false;
spapr_pci_msi *msi;
int *config_addr_key;
@@ -300,7 +299,12 @@ static void rtas_ibm_change_msi(PowerPCCPU *cpu,
sPAPREnvironment *spapr,
}
xics_free(spapr->icp, msi->first_irq, msi->num);
- spapr_msi_setmsg(pdev, 0, msix, 0, num);
+ if (msi_present(pdev)) {
+ spapr_msi_setmsg(pdev, 0, false, 0, num);
+ }
+ if (msix_present(pdev)) {
+ spapr_msi_setmsg(pdev, 0, true, 0, num);
+ }
g_hash_table_remove(phb->msi, &config_addr);
trace_spapr_pci_msi("Released MSIs", config_addr);
--
1.8.1.4
- [Qemu-devel] [PULL 28/52] target-ppc: Bug Fix: rlwimi, (continued)
- [Qemu-devel] [PULL 28/52] target-ppc: Bug Fix: rlwimi, Alexander Graf, 2014/09/04
- [Qemu-devel] [PULL 30/52] target-ppc: Bug Fix: mullw, Alexander Graf, 2014/09/04
- [Qemu-devel] [PULL 37/52] PPC: mac_nvram: Remove unused functions, Alexander Graf, 2014/09/04
- [Qemu-devel] [PULL 29/52] target-ppc: Bug Fix: mullwo, Alexander Graf, 2014/09/04
- [Qemu-devel] [PULL 36/52] PPC: mac99: Fix core99 timer frequency, Alexander Graf, 2014/09/04
- [Qemu-devel] [PULL 31/52] target-ppc: Bug Fix: mulldo OV Detection, Alexander Graf, 2014/09/04
- [Qemu-devel] [PULL 34/52] KVM: Add helper to run KVM_CHECK_EXTENSION on vm fd, Alexander Graf, 2014/09/04
- [Qemu-devel] [PULL 32/52] target-ppc: Bug Fix: srawi, Alexander Graf, 2014/09/04
- [Qemu-devel] [PULL 39/52] PPC: mac_nvram: Split NVRAM into OF and OSX parts, Alexander Graf, 2014/09/04
- [Qemu-devel] [PULL 44/52] target-ppc: Special Case of rlwimi Should Use Deposit, Alexander Graf, 2014/09/04
- [Qemu-devel] [PULL 42/52] spapr_pci: Fix config space corruption,
Alexander Graf <=
- [Qemu-devel] [PULL 45/52] target-ppc: Optimize rlwinm MB=0 ME=31, Alexander Graf, 2014/09/04
- [Qemu-devel] [PULL 38/52] PPC: mac_nvram: Allow 2 and 4 byte accesses, Alexander Graf, 2014/09/04
- [Qemu-devel] [PULL 46/52] target-ppc: Optimize rlwnm MB=0 ME=31, Alexander Graf, 2014/09/04
- [Qemu-devel] [PULL 48/52] target-ppc: Clean up mullwo, Alexander Graf, 2014/09/04
- [Qemu-devel] [PULL 49/52] target-ppc: Implement mulldo with TCG, Alexander Graf, 2014/09/04
- [Qemu-devel] [PULL 43/52] spapr-vlan: Don't touch last entry in buffer list, Alexander Graf, 2014/09/04
- [Qemu-devel] [PULL 47/52] target-ppc: Clean Up mullw, Alexander Graf, 2014/09/04
- [Qemu-devel] [PULL 52/52] hypervisor property clashes with hypervisor node, Alexander Graf, 2014/09/04
- [Qemu-devel] [PULL 41/52] PPC: Cuda: Use cuda timer to expose tbfreq to guest, Alexander Graf, 2014/09/04
- [Qemu-devel] [PULL 51/52] PPC: Fix default config ordering and add eTSEC for ppc64, Alexander Graf, 2014/09/04