Commit 508d1aa602ef0679a9cfc181ce918fbc4a2b3a45

Authored by Bjorn Helgaas
1 parent 2366d06eb1

vfio-pci: Use PCI_MSIX_TABLE_BIR, not PCI_MSIX_FLAGS_BIRMASK

PCI_MSIX_FLAGS_BIRMASK is mis-named because the BIR mask is in the
Table Offset register, not the flags ("Message Control" per spec)
register.

Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Acked-by: Alex Williamson <alex.williamson@redhat.com>

Showing 1 changed file with 2 additions and 2 deletions Side-by-side Diff

drivers/vfio/pci/vfio_pci.c
... ... @@ -78,8 +78,8 @@
78 78 pci_read_config_word(pdev, msix_pos + PCI_MSIX_FLAGS, &flags);
79 79 pci_read_config_dword(pdev, msix_pos + PCI_MSIX_TABLE, &table);
80 80  
81   - vdev->msix_bar = table & PCI_MSIX_FLAGS_BIRMASK;
82   - vdev->msix_offset = table & ~PCI_MSIX_FLAGS_BIRMASK;
  81 + vdev->msix_bar = table & PCI_MSIX_TABLE_BIR;
  82 + vdev->msix_offset = table & PCI_MSIX_TABLE_OFFSET;
83 83 vdev->msix_size = ((flags & PCI_MSIX_FLAGS_QSIZE) + 1) * 16;
84 84 } else
85 85 vdev->msix_bar = 0xFF;