summaryrefslogtreecommitdiffstats
path: root/drivers/vfio/pci/vfio_pci.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2014-12-17 19:44:22 +0100
committerLinus Torvalds <torvalds@linux-foundation.org>2014-12-17 19:44:22 +0100
commitcc669743a39e3f61c9ca5e786e959bf478ccd197 (patch)
tree99b1e239b6dea761435a5199c994371f01f500bf /drivers/vfio/pci/vfio_pci.c
parentMerge tag 'virtio-next-for-linus' of git://git.kernel.org/pub/scm/linux/kerne... (diff)
parentdrivers/vfio: allow type-1 IOMMU instantiation on top of an ARM SMMU (diff)
downloadlinux-cc669743a39e3f61c9ca5e786e959bf478ccd197.tar.xz
linux-cc669743a39e3f61c9ca5e786e959bf478ccd197.zip
Merge tag 'vfio-v3.19-rc1' of git://github.com/awilliam/linux-vfio
Pull VFIO updates from Alex Williamson: - s390 support (Frank Blaschka) - Enable iommu-type1 for ARM SMMU (Will Deacon) * tag 'vfio-v3.19-rc1' of git://github.com/awilliam/linux-vfio: drivers/vfio: allow type-1 IOMMU instantiation on top of an ARM SMMU vfio: make vfio run on s390
Diffstat (limited to 'drivers/vfio/pci/vfio_pci.c')
-rw-r--r--drivers/vfio/pci/vfio_pci.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/vfio/pci/vfio_pci.c b/drivers/vfio/pci/vfio_pci.c
index 9558da3f06a0..255201f22126 100644
--- a/drivers/vfio/pci/vfio_pci.c
+++ b/drivers/vfio/pci/vfio_pci.c
@@ -215,7 +215,7 @@ static int vfio_pci_get_irq_count(struct vfio_pci_device *vdev, int irq_type)
if (irq_type == VFIO_PCI_INTX_IRQ_INDEX) {
u8 pin;
pci_read_config_byte(vdev->pdev, PCI_INTERRUPT_PIN, &pin);
- if (pin)
+ if (IS_ENABLED(CONFIG_VFIO_PCI_INTX) && pin)
return 1;
} else if (irq_type == VFIO_PCI_MSI_IRQ_INDEX) {
@@ -406,7 +406,8 @@ static long vfio_pci_ioctl(void *device_data,
info.flags = VFIO_REGION_INFO_FLAG_READ |
VFIO_REGION_INFO_FLAG_WRITE;
- if (pci_resource_flags(pdev, info.index) &
+ if (IS_ENABLED(CONFIG_VFIO_PCI_MMAP) &&
+ pci_resource_flags(pdev, info.index) &
IORESOURCE_MEM && info.size >= PAGE_SIZE)
info.flags |= VFIO_REGION_INFO_FLAG_MMAP;
break;