From: Michael S. Tsirkin Date: Sat, 13 Feb 2016 18:50:50 +0000 (+0200) Subject: msix: fix msix_vector_masked X-Git-Tag: TizenStudio_2.0_p2.4~27^2~6^2~8^2~179^2~6 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=e1e4bf225236a2aea99bedee5a5f7e764841616a;p=sdk%2Femulator%2Fqemu.git msix: fix msix_vector_masked commit 428c3ece97179557f2753071fb0ca97a03437267 ("fix MSI injection on Xen") inadvertently enabled the xen-specific logic unconditionally. Limit it to only when xen is enabled. Additionally, msix data should be read with pci_get_log since the format is pci little-endian. Reported-by: "Daniel P. Berrange" Cc: Stefano Stabellini Signed-off-by: Michael S. Tsirkin --- diff --git a/hw/pci/msix.c b/hw/pci/msix.c index eb4ef11..537fdba 100644 --- a/hw/pci/msix.c +++ b/hw/pci/msix.c @@ -80,10 +80,10 @@ static void msix_clr_pending(PCIDevice *dev, int vector) static bool msix_vector_masked(PCIDevice *dev, unsigned int vector, bool fmask) { unsigned offset = vector * PCI_MSIX_ENTRY_SIZE; - uint32_t *data = (uint32_t *)&dev->msix_table[offset + PCI_MSIX_ENTRY_DATA]; + uint8_t *data = &dev->msix_table[offset + PCI_MSIX_ENTRY_DATA]; /* MSIs on Xen can be remapped into pirqs. In those cases, masking * and unmasking go through the PV evtchn path. */ - if (xen_is_pirq_msi(*data)) { + if (xen_enabled() && xen_is_pirq_msi(pci_get_long(data))) { return false; } return fmask || dev->msix_table[offset + PCI_MSIX_ENTRY_VECTOR_CTRL] &