From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752688AbdHNJpU (ORCPT ); Mon, 14 Aug 2017 05:45:20 -0400 Received: from mail-io0-f196.google.com ([209.85.223.196]:36063 "EHLO mail-io0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752521AbdHNJpR (ORCPT ); Mon, 14 Aug 2017 05:45:17 -0400 Subject: Re: [RFC PATCH v5 0/5] vfio-pci: Add support for mmapping MSI-X table To: linuxppc-dev@lists.ozlabs.org Cc: David Gibson , kvm-ppc@vger.kernel.org, kvm@vger.kernel.org, Yongji Xie , Eric Auger , Kyle Mahlkuch , Alex Williamson , Jike Song , Bjorn Helgaas , Robin Murphy , Joerg Roedel , Arvind Yadav , Benjamin Herrenschmidt , David Woodhouse , Kirti Wankhede , Mauricio Faria de Oliveira , Neo Jia , Paul Mackerras , Vlad Tsyrklevich , iommu@lists.linux-foundation.org, linux-kernel@vger.kernel.org References: <20170807072548.3023-1-aik@ozlabs.ru> From: Alexey Kardashevskiy Message-ID: <8f5f7b82-3c10-7f39-b587-db4c4424f04c@ozlabs.ru> Date: Mon, 14 Aug 2017 19:45:05 +1000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.2.1 MIME-Version: 1.0 In-Reply-To: <20170807072548.3023-1-aik@ozlabs.ru> Content-Type: text/plain; charset=utf-8 Content-Language: en-AU Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Folks, Is there anything to change besides those compiler errors and David's comment in 5/5? Or the while patchset is too bad? Thanks. On 07/08/17 17:25, Alexey Kardashevskiy wrote: > This is a followup for "[PATCH kernel v4 0/6] vfio-pci: Add support for mmapping MSI-X table" > http://www.spinics.net/lists/kvm/msg152232.html > > This time it is using "caps" in IOMMU groups. The main question is if PCI > bus flags or IOMMU domains are still better (and which one). > > > > Here is some background: > > Current vfio-pci implementation disallows to mmap the page > containing MSI-X table in case that users can write directly > to MSI-X table and generate an incorrect MSIs. > > However, this will cause some performance issue when there > are some critical device registers in the same page as the > MSI-X table. We have to handle the mmio access to these > registers in QEMU emulation rather than in guest. > > To solve this issue, this series allows to expose MSI-X table > to userspace when hardware enables the capability of interrupt > remapping which can ensure that a given PCI device can only > shoot the MSIs assigned for it. And we introduce a new bus_flags > PCI_BUS_FLAGS_MSI_REMAP to test this capability on PCI side > for different archs. > > > This is based on sha1 > 26c5cebfdb6c "Merge branch 'parisc-4.13-4' of git://git.kernel.org/pub/scm/linux/kernel/git/deller/parisc-linux" > > Please comment. Thanks. > > Changelog: > > v5: > * redid the whole thing via so-called IOMMU group capabilities > > v4: > * rebased on recent upstream > * got all 6 patches from v2 (v3 was missing some) > > > > > Alexey Kardashevskiy (5): > iommu: Add capabilities to a group > iommu: Set IOMMU_GROUP_CAP_ISOLATE_MSIX if MSI controller enables IRQ > remapping > iommu/intel/amd: Set IOMMU_GROUP_CAP_ISOLATE_MSIX if IRQ remapping is > enabled > powerpc/iommu: Set IOMMU_GROUP_CAP_ISOLATE_MSIX > vfio-pci: Allow to expose MSI-X table to userspace when safe > > include/linux/iommu.h | 20 ++++++++++++++++++++ > include/linux/vfio.h | 1 + > arch/powerpc/kernel/iommu.c | 1 + > drivers/iommu/amd_iommu.c | 3 +++ > drivers/iommu/intel-iommu.c | 3 +++ > drivers/iommu/iommu.c | 35 +++++++++++++++++++++++++++++++++++ > drivers/vfio/pci/vfio_pci.c | 20 +++++++++++++++++--- > drivers/vfio/pci/vfio_pci_rdwr.c | 5 ++++- > drivers/vfio/vfio.c | 15 +++++++++++++++ > 9 files changed, 99 insertions(+), 4 deletions(-) > -- Alexey From mboxrd@z Thu Jan 1 00:00:00 1970 From: Alexey Kardashevskiy Subject: Re: [RFC PATCH v5 0/5] vfio-pci: Add support for mmapping MSI-X table Date: Mon, 14 Aug 2017 19:45:05 +1000 Message-ID: <8f5f7b82-3c10-7f39-b587-db4c4424f04c@ozlabs.ru> References: <20170807072548.3023-1-aik@ozlabs.ru> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Cc: Vlad Tsyrklevich , kvm-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, Benjamin Herrenschmidt , Kyle Mahlkuch , Kirti Wankhede , kvm-ppc-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org, Yongji Xie , Mauricio Faria de Oliveira , Paul Mackerras , Bjorn Helgaas , Arvind Yadav , David Woodhouse , linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, David Gibson To: linuxppc-dev-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org Return-path: In-Reply-To: <20170807072548.3023-1-aik-sLpHqDYs0B2HXe+LvDLADg@public.gmane.org> Content-Language: en-AU List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: iommu-bounces-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org Errors-To: iommu-bounces-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org List-Id: kvm.vger.kernel.org Folks, Is there anything to change besides those compiler errors and David's comment in 5/5? Or the while patchset is too bad? Thanks. On 07/08/17 17:25, Alexey Kardashevskiy wrote: > This is a followup for "[PATCH kernel v4 0/6] vfio-pci: Add support for mmapping MSI-X table" > http://www.spinics.net/lists/kvm/msg152232.html > > This time it is using "caps" in IOMMU groups. The main question is if PCI > bus flags or IOMMU domains are still better (and which one). > > > > Here is some background: > > Current vfio-pci implementation disallows to mmap the page > containing MSI-X table in case that users can write directly > to MSI-X table and generate an incorrect MSIs. > > However, this will cause some performance issue when there > are some critical device registers in the same page as the > MSI-X table. We have to handle the mmio access to these > registers in QEMU emulation rather than in guest. > > To solve this issue, this series allows to expose MSI-X table > to userspace when hardware enables the capability of interrupt > remapping which can ensure that a given PCI device can only > shoot the MSIs assigned for it. And we introduce a new bus_flags > PCI_BUS_FLAGS_MSI_REMAP to test this capability on PCI side > for different archs. > > > This is based on sha1 > 26c5cebfdb6c "Merge branch 'parisc-4.13-4' of git://git.kernel.org/pub/scm/linux/kernel/git/deller/parisc-linux" > > Please comment. Thanks. > > Changelog: > > v5: > * redid the whole thing via so-called IOMMU group capabilities > > v4: > * rebased on recent upstream > * got all 6 patches from v2 (v3 was missing some) > > > > > Alexey Kardashevskiy (5): > iommu: Add capabilities to a group > iommu: Set IOMMU_GROUP_CAP_ISOLATE_MSIX if MSI controller enables IRQ > remapping > iommu/intel/amd: Set IOMMU_GROUP_CAP_ISOLATE_MSIX if IRQ remapping is > enabled > powerpc/iommu: Set IOMMU_GROUP_CAP_ISOLATE_MSIX > vfio-pci: Allow to expose MSI-X table to userspace when safe > > include/linux/iommu.h | 20 ++++++++++++++++++++ > include/linux/vfio.h | 1 + > arch/powerpc/kernel/iommu.c | 1 + > drivers/iommu/amd_iommu.c | 3 +++ > drivers/iommu/intel-iommu.c | 3 +++ > drivers/iommu/iommu.c | 35 +++++++++++++++++++++++++++++++++++ > drivers/vfio/pci/vfio_pci.c | 20 +++++++++++++++++--- > drivers/vfio/pci/vfio_pci_rdwr.c | 5 ++++- > drivers/vfio/vfio.c | 15 +++++++++++++++ > 9 files changed, 99 insertions(+), 4 deletions(-) > -- Alexey From mboxrd@z Thu Jan 1 00:00:00 1970 From: Alexey Kardashevskiy Date: Mon, 14 Aug 2017 09:45:05 +0000 Subject: Re: [RFC PATCH v5 0/5] vfio-pci: Add support for mmapping MSI-X table Message-Id: <8f5f7b82-3c10-7f39-b587-db4c4424f04c@ozlabs.ru> List-Id: References: <20170807072548.3023-1-aik@ozlabs.ru> In-Reply-To: <20170807072548.3023-1-aik@ozlabs.ru> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: linuxppc-dev@lists.ozlabs.org Cc: David Gibson , kvm-ppc@vger.kernel.org, kvm@vger.kernel.org, Yongji Xie , Eric Auger , Kyle Mahlkuch , Alex Williamson , Jike Song , Bjorn Helgaas , Robin Murphy , Joerg Roedel , Arvind Yadav , Benjamin Herrenschmidt , David Woodhouse , Kirti Wankhede , Mauricio Faria de Oliveira , Neo Jia , Paul Mackerras , Vlad Tsyrklevich , iommu@lists.linux-foundation.org, linux-kernel@vger.kernel.org Folks, Is there anything to change besides those compiler errors and David's comment in 5/5? Or the while patchset is too bad? Thanks. On 07/08/17 17:25, Alexey Kardashevskiy wrote: > This is a followup for "[PATCH kernel v4 0/6] vfio-pci: Add support for mmapping MSI-X table" > http://www.spinics.net/lists/kvm/msg152232.html > > This time it is using "caps" in IOMMU groups. The main question is if PCI > bus flags or IOMMU domains are still better (and which one). > > > > Here is some background: > > Current vfio-pci implementation disallows to mmap the page > containing MSI-X table in case that users can write directly > to MSI-X table and generate an incorrect MSIs. > > However, this will cause some performance issue when there > are some critical device registers in the same page as the > MSI-X table. We have to handle the mmio access to these > registers in QEMU emulation rather than in guest. > > To solve this issue, this series allows to expose MSI-X table > to userspace when hardware enables the capability of interrupt > remapping which can ensure that a given PCI device can only > shoot the MSIs assigned for it. And we introduce a new bus_flags > PCI_BUS_FLAGS_MSI_REMAP to test this capability on PCI side > for different archs. > > > This is based on sha1 > 26c5cebfdb6c "Merge branch 'parisc-4.13-4' of git://git.kernel.org/pub/scm/linux/kernel/git/deller/parisc-linux" > > Please comment. Thanks. > > Changelog: > > v5: > * redid the whole thing via so-called IOMMU group capabilities > > v4: > * rebased on recent upstream > * got all 6 patches from v2 (v3 was missing some) > > > > > Alexey Kardashevskiy (5): > iommu: Add capabilities to a group > iommu: Set IOMMU_GROUP_CAP_ISOLATE_MSIX if MSI controller enables IRQ > remapping > iommu/intel/amd: Set IOMMU_GROUP_CAP_ISOLATE_MSIX if IRQ remapping is > enabled > powerpc/iommu: Set IOMMU_GROUP_CAP_ISOLATE_MSIX > vfio-pci: Allow to expose MSI-X table to userspace when safe > > include/linux/iommu.h | 20 ++++++++++++++++++++ > include/linux/vfio.h | 1 + > arch/powerpc/kernel/iommu.c | 1 + > drivers/iommu/amd_iommu.c | 3 +++ > drivers/iommu/intel-iommu.c | 3 +++ > drivers/iommu/iommu.c | 35 +++++++++++++++++++++++++++++++++++ > drivers/vfio/pci/vfio_pci.c | 20 +++++++++++++++++--- > drivers/vfio/pci/vfio_pci_rdwr.c | 5 ++++- > drivers/vfio/vfio.c | 15 +++++++++++++++ > 9 files changed, 99 insertions(+), 4 deletions(-) > -- Alexey