Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1359756

Re: [RFC PATCH v4 5/7] vfio-pci: Allow to mmap sub-page MMIO BARs if the mmio page is exclusive

From Yongji Xie <xyjxie@linux.vnet.ibm.com>
Newsgroups linux.kernel
Subject Re: [RFC PATCH v4 5/7] vfio-pci: Allow to mmap sub-page MMIO BARs if the mmio page is exclusive
Date 2016-03-17 12:40 +0100
Message-ID <rdErv-6Pk-13@gated-at.bofh.it> (permalink)
References <r9Y5r-8lu-9@gated-at.bofh.it> <r9Yf8-8p8-3@gated-at.bofh.it> <rdmEk-2Zu-53@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On 2016/3/17 0:30, Alex Williamson wrote:
> On Mon,  7 Mar 2016 15:48:36 +0800
> Yongji Xie <xyjxie@linux.vnet.ibm.com> wrote:
>
>> Current vfio-pci implementation disallows to mmap
>> sub-page(size < PAGE_SIZE) MMIO BARs because these BARs' mmio
>> page may be shared with other BARs.
>>
>> But we should allow to mmap these sub-page MMIO BARs if PCI
>> resource allocator can make sure these BARs' mmio page will
>> not be shared with other BARs.
>>
>> Signed-off-by: Yongji Xie <xyjxie@linux.vnet.ibm.com>
>> ---
>>   drivers/vfio/pci/vfio_pci.c |    7 ++++++-
>>   1 file changed, 6 insertions(+), 1 deletion(-)
>>
>> diff --git a/drivers/vfio/pci/vfio_pci.c b/drivers/vfio/pci/vfio_pci.c
>> index 1ce1d36..49d7a69 100644
>> --- a/drivers/vfio/pci/vfio_pci.c
>> +++ b/drivers/vfio/pci/vfio_pci.c
>> @@ -589,7 +589,8 @@ static long vfio_pci_ioctl(void *device_data,
>>   				     VFIO_REGION_INFO_FLAG_WRITE;
>>   			if (IS_ENABLED(CONFIG_VFIO_PCI_MMAP) &&
>>   			    pci_resource_flags(pdev, info.index) &
>> -			    IORESOURCE_MEM && info.size >= PAGE_SIZE) {
>> +			    IORESOURCE_MEM && !pci_resources_share_page(pdev,
>> +			    info.index)) {
> this would be a preferable line wrap:
>
>                              IORESOURCE_MEM &&
>                              !pci_resources_share_page(pdev, info.index)) {

OK. I'll fix it.

Thanks,
Yongji Xie

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[RFC PATCH v4 0/7] vfio-pci: Allow to mmap sub-page MMIO BARs and MSI-X table Yongji Xie <xyjxie@linux.vnet.ibm.com> - 2016-03-07 08:50 +0100
  [RFC PATCH v4 6/7] vfio-pci: Allow to mmap MSI-X table if IOMMU_CAP_INTR_REMAP was set Yongji Xie <xyjxie@linux.vnet.ibm.com> - 2016-03-07 09:00 +0100
    Re: [RFC PATCH v4 6/7] vfio-pci: Allow to mmap MSI-X table if  IOMMU_CAP_INTR_REMAP was set Alex Williamson <alex.williamson@redhat.com> - 2016-03-16 17:40 +0100
      Re: [RFC PATCH v4 6/7] vfio-pci: Allow to mmap MSI-X table if  IOMMU_CAP_INTR_REMAP was set Yongji Xie <xyjxie@linux.vnet.ibm.com> - 2016-03-17 12:40 +0100
  [RFC PATCH v4 5/7] vfio-pci: Allow to mmap sub-page MMIO BARs if the mmio page is exclusive Yongji Xie <xyjxie@linux.vnet.ibm.com> - 2016-03-07 09:00 +0100
    Re: [RFC PATCH v4 5/7] vfio-pci: Allow to mmap sub-page MMIO BARs  if the mmio page is exclusive Alex Williamson <alex.williamson@redhat.com> - 2016-03-16 17:40 +0100
      Re: [RFC PATCH v4 5/7] vfio-pci: Allow to mmap sub-page MMIO BARs if  the mmio page is exclusive Yongji Xie <xyjxie@linux.vnet.ibm.com> - 2016-03-17 12:40 +0100
  [RFC PATCH v4 4/7] PCI: Modify resource_alignment to support multiple devices Yongji Xie <xyjxie@linux.vnet.ibm.com> - 2016-03-07 09:00 +0100
    Re: [RFC PATCH v4 4/7] PCI: Modify resource_alignment to support  multiple devices Alex Williamson <alex.williamson@redhat.com> - 2016-03-16 17:40 +0100
      Re: [RFC PATCH v4 4/7] PCI: Modify resource_alignment to support  multiple devices Yongji Xie <xyjxie@linux.vnet.ibm.com> - 2016-03-17 12:30 +0100
        Re: [RFC PATCH v4 4/7] PCI: Modify resource_alignment to support  multiple devices Alex Williamson <alex.williamson@redhat.com> - 2016-03-17 13:50 +0100
          Re: [RFC PATCH v4 4/7] PCI: Modify resource_alignment to support  multiple devices Yongji Xie <xyjxie@linux.vnet.ibm.com> - 2016-03-18 16:10 +0100
  [RFC PATCH v4 3/7] PCI: Ignore resource_alignment if PCI_PROBE_ONLY was set Yongji Xie <xyjxie@linux.vnet.ibm.com> - 2016-03-07 09:00 +0100
    Re: [RFC PATCH v4 3/7] PCI: Ignore resource_alignment if  PCI_PROBE_ONLY was set Alex Williamson <alex.williamson@redhat.com> - 2016-03-16 17:40 +0100
      Re: [RFC PATCH v4 3/7] PCI: Ignore resource_alignment if  PCI_PROBE_ONLY was set Yongji Xie <xyjxie@linux.vnet.ibm.com> - 2016-03-17 12:40 +0100
  [RFC PATCH v4 7/7] powerpc/powernv/pci-ioda: Add IOMMU_CAP_INTR_REMAP for IODA host bridge Yongji Xie <xyjxie@linux.vnet.ibm.com> - 2016-03-07 09:00 +0100
    Re: [RFC PATCH v4 7/7] powerpc/powernv/pci-ioda: Add  IOMMU_CAP_INTR_REMAP for IODA host bridge Alex Williamson <alex.williamson@redhat.com> - 2016-03-16 17:40 +0100
      Re: [RFC PATCH v4 7/7] powerpc/powernv/pci-ioda: Add  IOMMU_CAP_INTR_REMAP for IODA host bridge Yongji Xie <xyjxie@linux.vnet.ibm.com> - 2016-03-17 12:40 +0100
        Re: [RFC PATCH v4 7/7] powerpc/powernv/pci-ioda: Add  IOMMU_CAP_INTR_REMAP for IODA host bridge Alex Williamson <alex.williamson@redhat.com> - 2016-03-17 13:50 +0100
          Re: [RFC PATCH v4 7/7] powerpc/powernv/pci-ioda: Add  IOMMU_CAP_INTR_REMAP for IODA host bridge Yongji Xie <xyjxie@linux.vnet.ibm.com> - 2016-03-18 13:00 +0100
  Re: [RFC PATCH v4 0/7] vfio-pci: Allow to mmap sub-page MMIO BARs and  MSI-X table Yongji Xie <xyjxie@linux.vnet.ibm.com> - 2016-03-16 12:00 +0100
    Re: [RFC PATCH v4 0/7] vfio-pci: Allow to mmap sub-page MMIO BARs  and MSI-X table Bjorn Helgaas <helgaas@kernel.org> - 2016-03-16 15:20 +0100
      Re: [RFC PATCH v4 0/7] vfio-pci: Allow to mmap sub-page MMIO BARs and  MSI-X table Yongji Xie <xyjxie@linux.vnet.ibm.com> - 2016-03-17 11:50 +0100

csiph-web