From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:54662) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aWfzN-0007cJ-3X for qemu-devel@nongnu.org; Fri, 19 Feb 2016 03:00:37 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aWfzM-0001y4-6D for qemu-devel@nongnu.org; Fri, 19 Feb 2016 03:00:33 -0500 Received: from mx1.redhat.com ([209.132.183.28]:42576) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aWfzM-0001xu-0P for qemu-devel@nongnu.org; Fri, 19 Feb 2016 03:00:32 -0500 Date: Fri, 19 Feb 2016 10:00:28 +0200 From: "Michael S. Tsirkin" Message-ID: <1455868726-26350-8-git-send-email-mst@redhat.com> References: <1455868726-26350-1-git-send-email-mst@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1455868726-26350-1-git-send-email-mst@redhat.com> Subject: [Qemu-devel] [PULL 07/13] msix: fix msix_vector_masked List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Peter Maydell , Stefano Stabellini 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 --- hw/pci/msix.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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] & -- MST