vfio-pci: Mask cap zero
authorAlex Williamson <alex.williamson@redhat.com>
Wed, 8 Apr 2020 17:45:28 +0000 (11:45 -0600)
committerAlex Williamson <alex.williamson@redhat.com>
Mon, 18 May 2020 15:55:35 +0000 (09:55 -0600)
commitbc138db1b96264b9c1779cf18d5a3b186aa90066
treec7b6a789a66931a2ed9bb6324de08f76df769935
parentb9bbe6ed63b2b9f2c9ee5cbd0f2c946a2723f4ce
vfio-pci: Mask cap zero

The PCI Code and ID Assignment Specification changed capability ID 0
from reserved to a NULL capability in the v1.1 revision.  The NULL
capability is defined to include only the 16-bit capability header,
ie. only the ID and next pointer.  Unfortunately vfio-pci creates a
map of config space, where ID 0 is used to reserve the standard type
0 header.  Finding an actual capability with this ID therefore results
in a bogus range marked in that map and conflicts with subsequent
capabilities.  As this seems to be a dummy capability anyway and we
already support dropping capabilities, let's hide this one rather than
delving into the potentially subtle dependencies within our map.

Seen on an NVIDIA Tesla T4.

Reviewed-by: Cornelia Huck <cohuck@redhat.com>
Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
drivers/vfio/pci/vfio_pci_config.c