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


Groups > linux.kernel > #1359758

Re: [RFC PATCH v4 7/7] powerpc/powernv/pci-ioda: Add IOMMU_CAP_INTR_REMAP for IODA host bridge

From Yongji Xie <xyjxie@linux.vnet.ibm.com>
Newsgroups linux.kernel
Subject Re: [RFC PATCH v4 7/7] powerpc/powernv/pci-ioda: Add IOMMU_CAP_INTR_REMAP for IODA host bridge
Date 2016-03-17 12:40 +0100
Message-ID <rdErv-6Pk-17@gated-at.bofh.it> (permalink)
References <r9Y5r-8lu-9@gated-at.bofh.it> <r9Yfa-8p8-39@gated-at.bofh.it> <rdmEi-2Zu-11@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On 2016/3/17 0:32, Alex Williamson wrote:
> On Mon,  7 Mar 2016 15:48:38 +0800
> Yongji Xie <xyjxie@linux.vnet.ibm.com> wrote:
>
>> This patch adds IOMMU_CAP_INTR_REMAP for IODA host bridge so that
>> we can mmap MSI-X table in vfio driver.
>>
>> Signed-off-by: Yongji Xie <xyjxie@linux.vnet.ibm.com>
>> ---
>>   arch/powerpc/platforms/powernv/pci-ioda.c |   17 +++++++++++++++++
>>   1 file changed, 17 insertions(+)
>>
>> diff --git a/arch/powerpc/platforms/powernv/pci-ioda.c b/arch/powerpc/platforms/powernv/pci-ioda.c
>> index f90dc04..f01b9ab 100644
>> --- a/arch/powerpc/platforms/powernv/pci-ioda.c
>> +++ b/arch/powerpc/platforms/powernv/pci-ioda.c
>> @@ -1955,6 +1955,20 @@ static struct iommu_table_ops pnv_ioda2_iommu_ops = {
>>   	.free = pnv_ioda2_table_free,
>>   };
>>   
>> +static bool pnv_ioda_iommu_capable(enum iommu_cap cap)
>> +{
>> +	switch (cap) {
>> +	case IOMMU_CAP_INTR_REMAP:
>> +		return true;
>> +	default:
>> +		return false;
>> +	}
>> +}
>> +
>> +static struct iommu_ops pnv_ioda_iommu_ops = {
>> +	.capable = pnv_ioda_iommu_capable,
>> +};
>> +
>>   static void pnv_pci_ioda_setup_dma_pe(struct pnv_phb *phb,
>>   				      struct pnv_ioda_pe *pe, unsigned int base,
>>   				      unsigned int segs)
>> @@ -3078,6 +3092,9 @@ static void pnv_pci_ioda_fixup(void)
>>   
>>   	/* Link NPU IODA tables to their PCI devices. */
>>   	pnv_npu_ioda_fixup();
>> +
>> +	/* Add IOMMU_CAP_INTR_REMAP */
>> +	bus_set_iommu(&pci_bus_type, &pnv_ioda_iommu_ops);
>>   }
>>   
>>   /*
>
> Doesn't this set you up for a world of hurt?  bus_set_iommu() calls
> iommu_bus_init() which sets up notifiers, which maybe you don't care
> about, but it also means that iommu_domain_alloc(&pci_bus_type) will
> segfault because you're not providing a domain_alloc callback here.

It seems to be hard to add IOMMU_CAP_INTR_REMAP on
PPC64 platform.

And can we add a new ioctl in vfio_iommu_driver to check
if interrupt remapping is supported so that we can use our
own way to determine that on PPC64 platform?

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