Lines Matching full:bar
208 int vfio_pci_core_setup_barmap(struct vfio_pci_core_device *vdev, int bar) in vfio_pci_core_setup_barmap() argument
214 if (vdev->barmap[bar]) in vfio_pci_core_setup_barmap()
217 ret = pci_request_selected_regions(pdev, 1 << bar, "vfio"); in vfio_pci_core_setup_barmap()
221 io = pci_iomap(pdev, bar, 0); in vfio_pci_core_setup_barmap()
223 pci_release_selected_regions(pdev, 1 << bar); in vfio_pci_core_setup_barmap()
227 vdev->barmap[bar] = io; in vfio_pci_core_setup_barmap()
238 int bar = VFIO_PCI_OFFSET_TO_INDEX(*ppos); in vfio_pci_bar_rw() local
242 struct resource *res = &vdev->pdev->resource[bar]; in vfio_pci_bar_rw()
245 if (pci_resource_start(pdev, bar)) in vfio_pci_bar_rw()
246 end = pci_resource_len(pdev, bar); in vfio_pci_bar_rw()
247 else if (bar == PCI_ROM_RESOURCE && in vfio_pci_bar_rw()
248 pdev->resource[bar].flags & IORESOURCE_ROM_SHADOW) in vfio_pci_bar_rw()
258 if (bar == PCI_ROM_RESOURCE) { in vfio_pci_bar_rw()
260 * The ROM can fill less space than the BAR, so we start the in vfio_pci_bar_rw()
271 int ret = vfio_pci_core_setup_barmap(vdev, bar); in vfio_pci_bar_rw()
277 io = vdev->barmap[bar]; in vfio_pci_bar_rw()
280 if (bar == vdev->msix_bar) { in vfio_pci_bar_rw()
291 if (bar == PCI_ROM_RESOURCE) in vfio_pci_bar_rw()
350 * VGA MMIO is a legacy, non-BAR resource that hopefully allows in vfio_pci_vga_rw()
427 int ret, bar = VFIO_PCI_OFFSET_TO_INDEX(offset); in vfio_pci_ioeventfd() local
431 if (bar > VFIO_PCI_BAR5_REGION_INDEX) in vfio_pci_ioeventfd()
434 if (pos + count > pci_resource_len(pdev, bar)) in vfio_pci_ioeventfd()
438 if (bar == vdev->msix_bar && in vfio_pci_ioeventfd()
448 ret = vfio_pci_core_setup_barmap(vdev, bar); in vfio_pci_ioeventfd()
455 if (ioeventfd->pos == pos && ioeventfd->bar == bar && in vfio_pci_ioeventfd()
487 ioeventfd->addr = vdev->barmap[bar] + pos; in vfio_pci_ioeventfd()
490 ioeventfd->bar = bar; in vfio_pci_ioeventfd()
492 ioeventfd->test_mem = vdev->pdev->resource[bar].flags & IORESOURCE_MEM; in vfio_pci_ioeventfd()