提交 e1e4bf22 编写于 作者: M Michael S. Tsirkin

msix: fix msix_vector_masked

commit 428c3ece ("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: N"Daniel P. Berrange" <berrange@redhat.com>
Cc: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Signed-off-by: NMichael S. Tsirkin <mst@redhat.com>
上级 e5157e31
...@@ -80,10 +80,10 @@ static void msix_clr_pending(PCIDevice *dev, int vector) ...@@ -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) static bool msix_vector_masked(PCIDevice *dev, unsigned int vector, bool fmask)
{ {
unsigned offset = vector * PCI_MSIX_ENTRY_SIZE; 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 /* MSIs on Xen can be remapped into pirqs. In those cases, masking
* and unmasking go through the PV evtchn path. */ * 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 false;
} }
return fmask || dev->msix_table[offset + PCI_MSIX_ENTRY_VECTOR_CTRL] & return fmask || dev->msix_table[offset + PCI_MSIX_ENTRY_VECTOR_CTRL] &
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册