Re: [PATCH] vfio: vfio_pci_nvlink2: use a vma helper function

2019-07-02 Thread Alex Williamson
On Thu, 16 May 2019 20:38:26 +0800 "richard.p...@oppo.com" wrote: > Use a vma helper function to simply code. > > Signed-off-by: Peng Hao > --- >  drivers/vfio/pci/vfio_pci_nvlink2.c | 3 +-- >  1 file changed, 1 insertion(+), 2 deletions(-) > > diff --git a/drivers/vfio/pci/vfio_pci_nvlink2.c

Re: [PATCH] vfio-mdev/samples: make some symbols static

2019-07-02 Thread Alex Williamson
> samples/vfio-mdev/mtty.c:1281:6: warning: symbol 'mtty_close' was not > declared. Should it be static? > samples/vfio-mdev/mtty.c:1305:30: warning: symbol 'mtty_dev_groups' was not > declared. Should it be static? > > Cc: Andy Shevchenko > Cc: Alex Williamson > Cc: Kirti W

Re: [PATCH v2] mdev: Send uevents around parent device registration

2019-07-02 Thread Alex Williamson
On Tue, 2 Jul 2019 19:10:17 +0530 Kirti Wankhede wrote: > On 7/2/2019 6:38 PM, Alex Williamson wrote: > > On Tue, 2 Jul 2019 18:17:41 +0530 > > Kirti Wankhede wrote: > > > >> On 7/2/2019 12:43 PM, Parav Pandit wrote: > >>> > >>>

Re: [PATCH v2] mdev: Send uevents around parent device registration

2019-07-02 Thread Alex Williamson
On Tue, 2 Jul 2019 18:17:41 +0530 Kirti Wankhede wrote: > On 7/2/2019 12:43 PM, Parav Pandit wrote: > > > > > >> -Original Message- > >> From: linux-kernel-ow...@vger.kernel.org >> ow...@vger.kernel.org> On Behalf Of Alex Williamson

Re: [PATCH v2] mdev: Send uevents around parent device registration

2019-07-01 Thread Alex Williamson
On Tue, 2 Jul 2019 10:25:04 +0530 Kirti Wankhede wrote: > On 7/2/2019 1:34 AM, Alex Williamson wrote: > > On Mon, 1 Jul 2019 23:20:35 +0530 > > Kirti Wankhede wrote: > > > >> On 7/1/2019 10:54 PM, Alex Williamson wrote: > >>> On Mon, 1 Jul 2019

Re: [PATCH v2] mdev: Send uevents around parent device registration

2019-07-01 Thread Alex Williamson
On Mon, 1 Jul 2019 23:20:35 +0530 Kirti Wankhede wrote: > On 7/1/2019 10:54 PM, Alex Williamson wrote: > > On Mon, 1 Jul 2019 22:43:10 +0530 > > Kirti Wankhede wrote: > > > >> On 7/1/2019 8:24 PM, Alex Williamson wrote: > >>> This allows

Re: [PATCH v2] mdev: Send uevents around parent device registration

2019-07-01 Thread Alex Williamson
On Mon, 1 Jul 2019 22:43:10 +0530 Kirti Wankhede wrote: > On 7/1/2019 8:24 PM, Alex Williamson wrote: > > This allows udev to trigger rules when a parent device is registered > > or unregistered from mdev. > > > > Signed-off-by: Alex Williamson > > --- >

[PATCH v2] mdev: Send uevents around parent device registration

2019-07-01 Thread Alex Williamson
This allows udev to trigger rules when a parent device is registered or unregistered from mdev. Signed-off-by: Alex Williamson --- v2: Don't remove the dev_info(), Kirti requested they stay and removing them is only tangential to the goal of this change. drivers/vfio/mdev/mdev_core.c

Re: [PATCH] mdev: Send uevents around parent device registration

2019-06-28 Thread Alex Williamson
On Thu, 27 Jun 2019 10:19:14 +0200 Cornelia Huck wrote: > On Wed, 26 Jun 2019 08:27:58 -0600 > Alex Williamson wrote: > > > This allows udev to trigger rules when a parent device is registered > > or unregistered from mdev. > > > > Signed-off-by: Alex Will

Re: [PATCH v1 9/9] smaples: add vfio-mdev-pci driver

2019-06-28 Thread Alex Williamson
On Mon, 24 Jun 2019 08:20:38 + "Liu, Yi L" wrote: > Hi Alex, > > > From: Alex Williamson [mailto:alex.william...@redhat.com] > > Sent: Friday, June 21, 2019 11:58 PM > > To: Liu, Yi L > > Subject: Re: [PATCH v1 9/9] smaples: add vfio-mdev-pci driv

Re: [RFC PATCH v3 1/4] vfio: Define device specific irq type capability

2019-06-26 Thread Alex Williamson
On Thu, 27 Jun 2019 11:37:59 +0800 Tina Zhang wrote: > Cap the number of irqs with fixed indexes and use capability chains > to chain device specific irqs. > > Signed-off-by: Tina Zhang > --- > include/uapi/linux/vfio.h | 19 ++- > 1 file changed, 18 insertions(+), 1

Re: [PATCH] mdev: Send uevents around parent device registration

2019-06-26 Thread Alex Williamson
On Wed, 26 Jun 2019 23:23:00 +0530 Kirti Wankhede wrote: > On 6/26/2019 7:57 PM, Alex Williamson wrote: > > This allows udev to trigger rules when a parent device is registered > > or unregistered from mdev. > > > > Signed-off-by: Alex Williamson > > --- &

[PATCH] mdev: Send uevents around parent device registration

2019-06-26 Thread Alex Williamson
This allows udev to trigger rules when a parent device is registered or unregistered from mdev. Signed-off-by: Alex Williamson --- drivers/vfio/mdev/mdev_core.c | 10 -- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/drivers/vfio/mdev/mdev_core.c b/drivers/vfio/mdev

Re: [PATCH v1 9/9] smaples: add vfio-mdev-pci driver

2019-06-21 Thread Alex Williamson
On Fri, 21 Jun 2019 10:23:10 + "Liu, Yi L" wrote: > Hi Alex, > > > From: Alex Williamson [mailto:alex.william...@redhat.com] > > Sent: Friday, June 21, 2019 5:08 AM > > To: Liu, Yi L > > Subject: Re: [PATCH v1 9/9] smaples: add vfio-mdev-pci driv

Re: [PATCH v1 9/9] smaples: add vfio-mdev-pci driver

2019-06-20 Thread Alex Williamson
On Thu, 20 Jun 2019 13:00:34 + "Liu, Yi L" wrote: > Hi Alex, > > > From: Alex Williamson [mailto:alex.william...@redhat.com] > > Sent: Thursday, June 20, 2019 12:27 PM > > To: Liu, Yi L > > Subject: Re: [PATCH v1 9/9] smaples: add vfio-mdev-pci driv

Re: [PATCH v1 9/9] smaples: add vfio-mdev-pci driver

2019-06-19 Thread Alex Williamson
On Sat, 8 Jun 2019 21:21:11 +0800 Liu Yi L wrote: > This patch adds sample driver named vfio-mdev-pci. It is to wrap > a PCI device as a mediated device. For a pci device, once bound > to vfio-mdev-pci driver, user space access of this device will > go through vfio mdev framework. The usage of

[PATCH 2/2] PCI/IOV: Assume SR-IOV VFs support extended config space.

2019-06-13 Thread Alex Williamson
) to speed up probing of VFs. Cc: KarimAllah Ahmed Cc: Kuppuswamy Sathyanarayanan Cc: Hao Zheng Signed-off-by: Alex Williamson --- drivers/pci/probe.c | 15 +++ 1 file changed, 15 insertions(+) diff --git a/drivers/pci/probe.c b/drivers/pci/probe.c index a3a3c6b28343..439244ff8

[PATCH 1/2] Revert: PCI/IOV: Use VF0 cached config space size for other VFs

2019-06-13 Thread Alex Williamson
other VFs") Cc: KarimAllah Ahmed Cc: Kuppuswamy Sathyanarayanan Cc: Hao Zheng Signed-off-by: Alex Williamson --- drivers/pci/iov.c |2 -- drivers/pci/pci.h |1 - drivers/pci/probe.c | 17 - 3 files changed, 20 deletions(-) diff --git a/drivers/pci/iov.c b/dri

[PATCH 0/2] PCI/IOV: Resolve regression in SR-IOV VF cfg_size

2019-06-13 Thread Alex Williamson
spec requiring a PCIe capability and reachability of the PF extended config space already being proven by the existence of the VF. Thanks, Alex --- Alex Williamson (2): Revert: PCI/IOV: Use VF0 cached config space size for other VFs PCI/IOV: Assume SR-IOV VFs support extended config

Re: [PATCH] PCI/IOV: Fix VF cfg_size

2019-06-13 Thread Alex Williamson
On Thu, 13 Jun 2019 16:20:39 -0500 Bjorn Helgaas wrote: > On Tue, Jun 04, 2019 at 02:36:17PM -0600, Alex Williamson wrote: > > On Tue, 04 Jun 2019 11:26:42 -0600 > > Alex Williamson wrote: > > > > > Commit 975bb8b4dc93 ("PCI/IOV: Use VF0 cached co

Re: [PATCH v2 1/1] PCI/IOV: Fix incorrect cfg_size for VF > 0

2019-06-12 Thread Alex Williamson
On Wed, 12 Jun 2019 12:03:03 -0700 "Raj, Ashok" wrote: > On Wed, Jun 12, 2019 at 12:58:17PM -0600, Alex Williamson wrote: > > On Wed, 12 Jun 2019 11:41:36 -0700 > > sathyanarayanan kuppuswamy > > wrote: > > > > > On 6/12/19 11:19 AM, Alex William

Re: [PATCH v2 1/1] PCI/IOV: Fix incorrect cfg_size for VF > 0

2019-06-12 Thread Alex Williamson
On Wed, 12 Jun 2019 11:41:36 -0700 sathyanarayanan kuppuswamy wrote: > On 6/12/19 11:19 AM, Alex Williamson wrote: > > On Wed, 12 Jun 2019 10:06:47 -0700 > > sathyanarayanan.kuppusw...@linux.intel.com wrote: > > > >> From: Kuppuswamy Sathyanarayanan > >&g

Re: [PATCH v2 1/1] PCI/IOV: Fix incorrect cfg_size for VF > 0

2019-06-12 Thread Alex Williamson
On Wed, 12 Jun 2019 10:06:47 -0700 sathyanarayanan.kuppusw...@linux.intel.com wrote: > From: Kuppuswamy Sathyanarayanan > > Commit 975bb8b4dc93 ("PCI/IOV: Use VF0 cached config space size for > other VFs") calculates and caches the cfg_size for VF0 device before > initializing the pcie_cap of

Re: [PATCHv6 3/3] vfio/mdev: Synchronize device create/remove with parent removal

2019-06-11 Thread Alex Williamson
On Tue, 11 Jun 2019 03:22:37 + Parav Pandit wrote: > Hi Alex, > [snip] > Now that we have all 3 patches reviewed and comments addressed, if > there are no more comments, can you please take it forward? Yep, I put it in a branch rolled into linux-next for upstream testing last week and

[GIT PULL] VFIO fixes for v5.2-rc5

2019-06-11 Thread Alex Williamson
Hi Linus, The following changes since commit f2c7c76c5d0a443053e94adb9f0918fa2fb85c3a: Linux 5.2-rc3 (2019-06-02 13:55:33 -0700) are available in the Git repository at: git://github.com/awilliam/linux-vfio.git tags/vfio-v5.2-rc5 for you to fetch changes up to

Re: [PATCH v8 25/29] vfio-pci: Add a new VFIO_REGION_TYPE_NESTED region type

2019-06-07 Thread Alex Williamson
On Fri, 7 Jun 2019 10:28:06 +0200 Auger Eric wrote: > Hi Alex, > > On 6/4/19 12:31 AM, Alex Williamson wrote: > > On Sun, 26 May 2019 18:10:00 +0200 > > Eric Auger wrote: > > > >> This patch adds two new regions aiming to handle nested mode > >

Re: [RFC PATCH v2 1/3] vfio: Use capability chains to handle device specific irq

2019-06-06 Thread Alex Williamson
On Thu, 6 Jun 2019 10:17:51 + "Zhang, Tina" wrote: > > -Original Message- > > From: intel-gvt-dev [mailto:intel-gvt-dev-boun...@lists.freedesktop.org] On > > Behalf Of kra...@redhat.com > > Sent: Wednesday, June 5, 2019 6:10 PM > > To: Zhang, Tina > > Cc: Tian, Kevin ;

Re: [PATCH] PCI/IOV: Fix VF cfg_size

2019-06-04 Thread Alex Williamson
On Tue, 04 Jun 2019 11:26:42 -0600 Alex Williamson wrote: > Commit 975bb8b4dc93 ("PCI/IOV: Use VF0 cached config space size for > other VFs") attempts to cache the config space size of VF0 to re-use > for all other VFs, but the cache is setup before the call to > pci_setup_

Re: [PATCH 1/1] PCI/IOV: Fix VF0 cached config space size for other VFs

2019-06-04 Thread Alex Williamson
On Mon, 20 May 2019 21:17:24 +0800 Hao Zheng wrote: > Set the pcie_cap field before getting the config space size for > other VFs. Otherwise, the config space size of other VFs are error > set to 256, while the size of VF0 is 4096. > > Signed-off-by: Hao Zheng > Signed-off-by: Quan Xu > --- >

[PATCH] PCI/IOV: Fix VF cfg_size

2019-06-04 Thread Alex Williamson
fig_common() until after pci_setup_device(). Fixes: 975bb8b4dc93 ("PCI/IOV: Use VF0 cached config space size for other VFs") Link: https://bugzilla.redhat.com/show_bug.cgi?id=1714978 Cc: KarimAllah Ahmed Signed-off-by: Alex Williamson --- drivers/pci/iov.c |6 +++--- 1 file changed

Re: [PATCH v3] mm: add account_locked_vm utility function

2019-06-03 Thread Alex Williamson
same, so user-visible behavior does too. The one > exception is that the -EPERM case in tce_account_locked_vm is removed > because Alexey has never seen it triggered. > > Signed-off-by: Daniel Jordan > Tested-by: Alexey Kardashevskiy > Cc: Alan Tull > Cc: Alex Williamson > Cc

Re: [PATCH] PCI: Return error if cannot probe VF

2019-05-30 Thread Alex Williamson
On Thu, 30 May 2019 08:47:27 -0500 Bjorn Helgaas wrote: > On Wed, May 01, 2019 at 11:00:16AM -0600, Alex Williamson wrote: > > Commit 0e7df22401a3 ("PCI: Add sysfs sriov_drivers_autoprobe to control > > VF driver binding") allows the user to specify that drivers f

Re: [PATCH] vfio-pci/nvlink2: Use vma_pages function instead of explicit computation

2019-05-29 Thread Alex Williamson
On Wed, 29 May 2019 22:11:06 +0200 "Thomas Meyer" wrote: > Use vma_pages function on vma object instead of explicit computation. > > Signed-off-by: Thomas Meyer > --- > > diff -u -p a/drivers/vfio/pci/vfio_pci_nvlink2.c > b/drivers/vfio/pci/vfio_pci_nvlink2.c > ---

Re:

2019-05-29 Thread Alex Williamson
On Sun, 26 May 2019 13:44:04 +0200 "Thomas Meyer" wrote: > From tho...@m3y3r.de Sun May 26 00:13:26 2019 > Subject: [PATCH] vfio-pci/nvlink2: Use vma_pages function instead of explicit > computation > To: alex.william...@redhat.com, k...@vger.kernel.org, > linux-kernel@vger.kernel.org >

Re: [PATCH v2] mm: add account_locked_vm utility function

2019-05-29 Thread Alex Williamson
On Tue, 28 May 2019 11:04:24 -0400 Daniel Jordan wrote: > On Sat, May 25, 2019 at 02:51:18PM -0700, Andrew Morton wrote: > > On Fri, 24 May 2019 13:50:45 -0400 Daniel Jordan > > wrote: > > > > > locked_vm accounting is done roughly the same way in five places, so > > > unify them in a

Re: [PATCHv4 3/3] vfio/mdev: Synchronize device create/remove with parent removal

2019-05-29 Thread Alex Williamson
On Fri, 24 May 2019 08:57:38 -0500 Parav Pandit wrote: > In following sequences, child devices created while removing mdev parent > device can be left out, or it may lead to race of removing half > initialized child mdev devices. > > issue-1: > >cpu-0

Re: [PATCH 1/2] vfio: ABI for setting mdev display flip eventfd

2019-05-27 Thread Alex Williamson
On Tue, 28 May 2019 01:42:57 + "Zhang, Tina" wrote: > > -Original Message- > > From: intel-gvt-dev [mailto:intel-gvt-dev-boun...@lists.freedesktop.org] On > > Behalf Of Alex Williamson > > Sent: Monday, May 27, 2019 10:05 PM > > To: Zhang, T

Re: [PATCH 1/2] vfio: ABI for setting mdev display flip eventfd

2019-05-27 Thread Alex Williamson
On Mon, 27 May 2019 16:43:11 +0800 Tina Zhang wrote: > Add VFIO_DEVICE_SET_GFX_FLIP_EVENTFD ioctl command to set eventfd > based signaling mechanism to deliver vGPU framebuffer page flip > event to userspace. > > Signed-off-by: Tina Zhang > --- > include/uapi/linux/vfio.h | 12 >

Re: [PATCH v2 4/4] vfio: vfio_iommu_type1: implement VFIO_IOMMU_INFO_CAPABILITIES

2019-05-21 Thread Alex Williamson
On Tue, 21 May 2019 11:14:38 +0200 Pierre Morel wrote: > On 20/05/2019 20:23, Alex Williamson wrote: > > On Mon, 20 May 2019 18:31:08 +0200 > > Pierre Morel wrote: > > > >> On 20/05/2019 16:27, Cornelia Huck wrote: > >>> On Mon, 20 May 201

Re: [PATCHv3 3/3] vfio/mdev: Synchronize device create/remove with parent removal

2019-05-20 Thread Alex Williamson
On Mon, 20 May 2019 19:15:15 + Parav Pandit wrote: > > -Original Message- > > From: Cornelia Huck > > Sent: Monday, May 20, 2019 6:29 AM > > To: Parav Pandit > > Cc: k...@vger.kernel.org; linux-kernel@vger.kernel.org; > > kwankh...@nvidia.com; alex.william...@redhat.com;

Re: [PATCH 4/4] vfio: vfio_iommu_type1: implement VFIO_IOMMU_INFO_CAPABILITIES

2019-05-16 Thread Alex Williamson
On Fri, 10 May 2019 10:22:35 +0200 Pierre Morel wrote: > We implement a capability intercafe for VFIO_IOMMU_GET_INFO and add the > first capability: VFIO_IOMMU_INFO_CAPABILITIES. > > When calling the ioctl, the user must specify > VFIO_IOMMU_INFO_CAPABILITIES to retrieve the capabilities and

Re: [PATCH] vfio: vfio_pci_nvlink2: use a vma helper function

2019-05-16 Thread Alex Williamson
[Cc Alexey + kvm] On Thu, 16 May 2019 20:38:26 +0800 "richard.p...@oppo.com" wrote: > Use a vma helper function to simply code. > > Signed-off-by: Peng Hao > --- >  drivers/vfio/pci/vfio_pci_nvlink2.c | 3 +-- >  1 file changed, 1 insertion(+), 2 deletions(-) > > diff --git

Re: [PATCHv2 08/10] vfio/mdev: Improve the create/remove sequence

2019-05-14 Thread Alex Williamson
On Tue, 14 May 2019 20:34:12 + Parav Pandit wrote: > Hi Alex, Cornelia, > > > > -Original Message- > > From: linux-kernel-ow...@vger.kernel.org > ow...@vger.kernel.org> On Behalf Of Parav Pandit > > Sent: Thursday, May 9, 2019 2:20 PM > > To: Cornelia Huck > > Cc:

[GIT PULL] VFIO updates for v5.2-rc1

2019-05-10 Thread Alex Williamson
Hi Linus, The following changes since commit 085b7755808aa11f78ab9377257e1dad2e6fa4bb: Linux 5.1-rc6 (2019-04-21 10:45:57 -0700) are available in the Git repository at: git://github.com/awilliam/linux-vfio.git tags/vfio-v5.2-rc1 for you to fetch changes up to

[PATCH] PCI: Always allow probing with driver_override

2019-05-09 Thread Alex Williamson
;PCI: Add sysfs sriov_drivers_autoprobe to control VF driver binding") Link: https://lore.kernel.org/linux-pci/155672991496.20698.4279330795743262888.st...@gimli.home/T/#u Signed-off-by: Alex Williamson --- drivers/pci/pci-driver.c |3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)

Re: [PATCHv2 10/10] vfio/mdev: Synchronize device create/remove with parent removal

2019-05-08 Thread Alex Williamson
On Tue, 30 Apr 2019 17:49:37 -0500 Parav Pandit wrote: > In following sequences, child devices created while removing mdev parent > device can be left out, or it may lead to race of removing half > initialized child mdev devices. > > issue-1: > >cpu-0

Re: [PATCH v2 1/2] vfio/mdev: add version attribute for mdev device

2019-05-08 Thread Alex Williamson
On Wed, 8 May 2019 07:27:40 -0400 Yan Zhao wrote: > On Wed, May 08, 2019 at 05:18:26AM +0800, Alex Williamson wrote: > > On Sun, 5 May 2019 21:49:04 -0400 > > Yan Zhao wrote: > > > > > version attribute is used to check two mdev devices' compatibili

Re: [PATCH] vfio: add myself as reviewer

2019-05-08 Thread Alex Williamson
AINERS > index 920a0a1545b7..9c0cd7a49309 100644 > --- a/MAINTAINERS > +++ b/MAINTAINERS > @@ -16454,6 +16454,7 @@ F:fs/fat/ > > VFIO DRIVER > M: Alex Williamson > +R: Cornelia Huck > L: k...@vger.kernel.org > T: git git://github.com/awilliam/linux-vf

Re: [PATCH v2 1/2] vfio/mdev: add version attribute for mdev device

2019-05-07 Thread Alex Williamson
. > > v2: > 1. added detailed intent and usage > 2. made definition of version string completely private to vendor driver >(Alex Williamson) > 3. abandoned changes to sample mdev drivers (Alex Williamson) > 4. mandatory --> optional (Cornelia Huck) > 5. added descriptio

Re: [PATCHv2 00/10] vfio/mdev: Improve vfio/mdev core module

2019-05-06 Thread Alex Williamson
On Tue, 30 Apr 2019 17:49:27 -0500 Parav Pandit wrote: > As we would like to use mdev subsystem for wider use case as > discussed in [1], [2] apart from an offline discussion. > This use case is also discussed with wider forum in [4] in track > 'Lightweight NIC HW functions for container offload

[PATCH] PCI: Return error if cannot probe VF

2019-05-01 Thread Alex Williamson
up remains in place and we even hold a device reference. Instead, abort with errno before any setup or references are taken when pci_device_can_probe() prevents us from trying to probe the device. Fixes: 0e7df22401a3 ("PCI: Add sysfs sriov_drivers_autoprobe to control VF driver binding")

Re: [PATCH] Revert "PCI/LINK: Report degraded links via link bandwidth notification"

2019-04-29 Thread Alex Williamson
742062.st...@gimli.home > Link: > https://lore.kernel.org/lkml/155605909349.3575.13433421148215616375.st...@gimli.home > Signed-off-by: Bjorn Helgaas > CC: Alexandru Gagniuc > CC: Lukas Wunner > CC: Alex Williamson Unfortunate, but a good choice for 5.1 and hopefully

Re: [PATCH] PCI: Add link_change error handler and vfio-pci user

2019-04-29 Thread Alex Williamson
On Mon, 29 Apr 2019 09:45:28 -0700 Sinan Kaya wrote: > On 4/29/2019 10:51 AM, Alex Williamson wrote: > > So where do we go from here? I agree that dmesg is not necessarily a > > great choice for these sorts of events and if they went somewhere else, > > maybe I wouldn't h

Re: [PATCH] PCI: Add link_change error handler and vfio-pci user

2019-04-29 Thread Alex Williamson
On Wed, 24 Apr 2019 12:57:58 -0500 Bjorn Helgaas wrote: > On Tue, Apr 23, 2019 at 04:42:28PM -0600, Alex Williamson wrote: > > The PCIe bandwidth notification service generates logging any time a > > link changes speed or width to a state that is considered downgraded. &g

Re: [PATCHv1 7/7] vfio/mdev: Fix race conditions with mdev device life cycle APIs

2019-04-26 Thread Alex Williamson
On Fri, 26 Apr 2019 19:02:40 + Parav Pandit wrote: > Hi Alex, > > > > -Original Message- > > From: Alex Williamson > > Sent: Friday, April 26, 2019 11:09 AM > > To: Parav Pandit > > Cc: k...@vger.kernel.org; linux-kernel@vger.kernel.org; &g

Re: [PATCHv1 7/7] vfio/mdev: Fix race conditions with mdev device life cycle APIs

2019-04-26 Thread Alex Williamson
On Fri, 26 Apr 2019 15:55:32 + Parav Pandit wrote: > > -Original Message- > > From: Alex Williamson > > Sent: Friday, April 26, 2019 10:34 AM > > To: Parav Pandit > > Cc: k...@vger.kernel.org; linux-kernel@vger.kernel.org; > > kwankh...@nvidia.

Re: [PATCHv1 7/7] vfio/mdev: Fix race conditions with mdev device life cycle APIs

2019-04-26 Thread Alex Williamson
On Thu, 25 Apr 2019 23:29:26 + Parav Pandit wrote: > Hi Alex, > > First, sorry for my late reply. > > > -Original Message----- > > From: Alex Williamson > > Sent: Tuesday, April 23, 2019 2:22 PM > > To: Parav Pandit > > Cc: k...@vge

Re: [PATCH] PCI: Add link_change error handler and vfio-pci user

2019-04-24 Thread Alex Williamson
On Wed, 24 Apr 2019 16:45:45 + wrote: > On 4/23/2019 5:42 PM, Alex Williamson wrote: > > The PCIe bandwidth notification service generates logging any time a > > link changes speed or width to a state that is considered downgraded. > > Unfortunately, it cannot different

[PATCH] PCI: Add link_change error handler and vfio-pci user

2019-04-23 Thread Alex Williamson
/155597243666.19387.1205950870601742062.st...@gimli.home/T/#u Signed-off-by: Alex Williamson --- Changing to pci_dbg() logging is not super usable, so let's try the previous idea of letting the driver handle link change events as they see fit. Ideally this might be two patches, but for easier handling

Re: [PATCHv1 7/7] vfio/mdev: Fix race conditions with mdev device life cycle APIs

2019-04-23 Thread Alex Williamson
On Thu, 4 Apr 2019 23:05:43 + Parav Pandit wrote: > > -Original Message- > > From: Alex Williamson > > Sent: Thursday, April 4, 2019 3:44 PM > > To: Parav Pandit > > Cc: k...@vger.kernel.org; linux-kernel@vger.kernel.org; > > kwankh...@nvidia.

Re: [PATCH] PCI/LINK: Account for BW notification in vector calculation

2019-04-23 Thread Alex Williamson
On Tue, 23 Apr 2019 12:53:07 -0500 Alex G wrote: > On 4/23/19 12:10 PM, Bjorn Helgaas wrote: > > On Tue, Apr 23, 2019 at 09:33:53AM -0500, Alex G wrote: > >> On 4/22/19 7:33 PM, Alex Williamson wrote: > >>> There is nothing wrong happening here that needs to fil

Re: [PATCH 1/1] vfio: Use dev_printk() when possible

2019-04-23 Thread Alex Williamson
On Sat, 30 Mar 2019 09:41:35 -0500 Bjorn Helgaas wrote: > From: Bjorn Helgaas > > Use dev_printk() when possible to make messages consistent with other > device-related messages. > > Signed-off-by: Bjorn Helgaas > --- > drivers/vfio/pci/vfio_pci.c | 26 +++-- >

Re: [PATCH] PCI/LINK: Account for BW notification in vector calculation

2019-04-23 Thread Alex Williamson
On Tue, 23 Apr 2019 11:27:39 -0500 Alex G wrote: > On 4/23/19 11:22 AM, Alex Williamson wrote: > > Nor should pci-core decide what link speed changes are intended or > > errors. Minimally we should be enabling drivers to receive this > > feedback. Thanks, > > N

Re: [PATCH] PCI/LINK: Account for BW notification in vector calculation

2019-04-23 Thread Alex Williamson
On Tue, 23 Apr 2019 11:03:04 -0500 Alex G wrote: > On 4/23/19 10:34 AM, Alex Williamson wrote: > > On Tue, 23 Apr 2019 09:33:53 -0500 > > Alex G wrote: > > > >> On 4/22/19 7:33 PM, Alex Williamson wrote: > >>> On Mon, 22 Apr 2019 19:05:57 -0500

Re: [PATCH] PCI/LINK: Account for BW notification in vector calculation

2019-04-23 Thread Alex Williamson
On Tue, 23 Apr 2019 09:33:53 -0500 Alex G wrote: > On 4/22/19 7:33 PM, Alex Williamson wrote: > > On Mon, 22 Apr 2019 19:05:57 -0500 > > Alex G wrote: > >> echo :07:00.0:pcie010 | > >> sudo tee /sys/bus/pci_express/drivers/pcie_bw_notification/unbind

Re: [PATCH] PCI/LINK: Account for BW notification in vector calculation

2019-04-22 Thread Alex Williamson
On Mon, 22 Apr 2019 19:05:57 -0500 Alex G wrote: > On 4/22/19 5:43 PM, Alex Williamson wrote: > > [ 329.725607] vfio-pci :07:00.0: 32.000 Gb/s available PCIe bandwidth, > > limited by 2.5 GT/s x16 link at :00:02.0 (capable of 64.000 Gb/s with 5 > > GT/s x16 link) &g

[PATCH] PCI/LINK: Account for BW notification in vector calculation

2019-04-22 Thread Alex Williamson
notification service. This can resolve spurious interrupt faults due to this service on some systems. Fixes: e8303bb7a75c ("PCI/LINK: Report degraded links via link bandwidth notification") Signed-off-by: Alex Williamson --- However, the system is still susceptible to random spe

Re: [PATCH v2] PCI/LINK: bw_notification: Do not leave interrupt handler NULL

2019-04-22 Thread Alex Williamson
On Fri, 19 Apr 2019 15:08:27 -0600 Alex Williamson wrote: > On Mon, 25 Mar 2019 17:25:02 -0500 > Bjorn Helgaas wrote: > > > On Fri, Mar 22, 2019 at 07:36:51PM -0500, Alexandru Gagniuc wrote: > > > A threaded IRQ with a NULL handler does not work with level-tr

Re: [PATCH v2] PCI/LINK: bw_notification: Do not leave interrupt handler NULL

2019-04-19 Thread Alex Williamson
On Mon, 25 Mar 2019 17:25:02 -0500 Bjorn Helgaas wrote: > On Fri, Mar 22, 2019 at 07:36:51PM -0500, Alexandru Gagniuc wrote: > > A threaded IRQ with a NULL handler does not work with level-triggered > > interrupts. request_threaded_irq() will return an error: > > > > genirq: Threaded irq

Re: [PATCH 02/18] ioasid: Add custom IOASID allocator

2019-04-15 Thread Alex Williamson
On Mon, 8 Apr 2019 16:59:17 -0700 Jacob Pan wrote: > Sometimes, IOASID allocation must be handled by platform specific > code. The use cases are guest vIOMMU and pvIOMMU where IOASIDs need > to be allocated by the host via enlightened or paravirt interfaces. > > This patch adds an extension to

[GIT PULL] VFIO fixes for v5.1-rc4

2019-04-05 Thread Alex Williamson
user DMA mappings per container (CVE-2019-3882) (Alex Williamson) Alex Williamson (1): vfio/type1: Limit DMA mappings per container Louis Taylor (1): vfio/pci: use correct format characters Wang Hai (1): vfio

Re: [PATCHv1 7/7] vfio/mdev: Fix race conditions with mdev device life cycle APIs

2019-04-04 Thread Alex Williamson
On Thu, 4 Apr 2019 00:02:22 + Parav Pandit wrote: > > -Original Message- > > From: Alex Williamson > > Sent: Wednesday, April 3, 2019 4:27 PM > > To: Parav Pandit > > Cc: k...@vger.kernel.org; linux-kernel@vger.kernel.org; > > kwankh...@nvidia.

Re: [PATCHv1 7/7] vfio/mdev: Fix race conditions with mdev device life cycle APIs

2019-04-03 Thread Alex Williamson
On Tue, 26 Mar 2019 22:45:45 -0500 Parav Pandit wrote: > Below race condition and call trace exist with current device life cycle > sequence. > > 1. In following sequence, child devices created while removing mdev parent > device can be left out, or it may lead to race of removing half >

Re: [PATCH v2] vfio/type1: Limit DMA mappings per container

2019-04-03 Thread Alex Williamson
On Wed, 3 Apr 2019 15:24:26 -0400 Jerome Glisse wrote: > On Tue, Apr 02, 2019 at 10:15:38AM -0600, Alex Williamson wrote: > > Memory backed DMA mappings are accounted against a user's locked > > memory limit, including multiple mappings of the same memory. This > > account

Re: [PATCH] vfio/spapr_tce: Make symbol 'tce_iommu_driver_ops' static

2019-04-03 Thread Alex Williamson
On Wed, 20 Mar 2019 02:47:23 -0400 Wang Hai wrote: > Fixes the following sparse warning: > > drivers/vfio/vfio_iommu_spapr_tce.c:1401:36: warning: > symbol 'tce_iommu_driver_ops' was not declared. Should it be static? > > Fixes: 5ffd229c0273 ("powerpc/vfio: Implement IOMMU driver for VFIO") >

Re: [PATCH] vfio/pci: use correct format characters

2019-04-03 Thread Alex Williamson
On Thu, 28 Feb 2019 19:48:12 + Louis Taylor wrote: > When compiling with -Wformat, clang emits the following warnings: > > drivers/vfio/pci/vfio_pci.c:1601:5: warning: format specifies type > 'unsigned short' but the argument has type 'unsigned int' [-Wformat] >

Re: [PATCHv1 6/7] vfio/mdev: Fix aborting mdev child device removal if one fails

2019-04-02 Thread Alex Williamson
On Tue, 2 Apr 2019 19:59:58 + Parav Pandit wrote: > > -Original Message- > > From: Cornelia Huck > > Sent: Monday, April 1, 2019 12:39 PM > > To: Parav Pandit > > Cc: k...@vger.kernel.org; linux-kernel@vger.kernel.org; > > kwankh...@nvidia.com; alex.william...@redhat.com;

[PATCH v2] vfio/type1: Limit DMA mappings per container

2019-04-02 Thread Alex Williamson
mappings). This fixes CVE-2019-3882. Signed-off-by: Alex Williamson --- v2: Remove unnecessary atomic, all runtime access occurs while holding vfio_iommu.lock. Change to unsigned int since we're no longer bound by the atomic_t. drivers/vfio/vfio_iommu_type1.c | 14 ++ 1

Re: [PATCH] vfio/type1: Limit DMA mappings per container

2019-04-02 Thread Alex Williamson
On Tue, 2 Apr 2019 13:18:02 +0800 Peter Xu wrote: > On Mon, Apr 01, 2019 at 10:34:13PM -0600, Alex Williamson wrote: > > On Tue, 2 Apr 2019 10:41:15 +0800 > > Peter Xu wrote: > > > > > On Mon, Apr 01, 2019 at 02:16:52P

Re: [PATCH] vfio/type1: Limit DMA mappings per container

2019-04-01 Thread Alex Williamson
On Tue, 2 Apr 2019 10:41:15 +0800 Peter Xu wrote: > On Mon, Apr 01, 2019 at 02:16:52PM -0600, Alex Williamson wrote: > > [...] > > > @@ -1081,8 +1088,14 @@ static int vfio_dma_do_map(struct vfio_iommu *iommu, > > goto out_unlock; > > } > &

[PATCH] vfio/type1: Limit DMA mappings per container

2019-04-01 Thread Alex Williamson
mappings). This fixes CVE-2019-3882. Signed-off-by: Alex Williamson --- drivers/vfio/vfio_iommu_type1.c | 14 ++ 1 file changed, 14 insertions(+) diff --git a/drivers/vfio/vfio_iommu_type1.c b/drivers/vfio/vfio_iommu_type1.c index 73652e21efec..7fc8fd7d4dc7 100644 --- a/drivers

Re: [PATCH] vfio: Use dev_printk() when possible

2019-03-29 Thread Alex Williamson
On Fri, 29 Mar 2019 12:03:11 -0500 Bjorn Helgaas wrote: > On Mon, Mar 25, 2019 at 3:49 PM Joe Perches wrote: > > > > On Mon, 2019-03-25 at 14:42 -0500, Bjorn Helgaas wrote: > > > Use dev_printk() when possible to make messages consistent with other > > > device-related messages. > > > >

Re: [PATCH 8/8] vfio/mdev: Improve the create/remove sequence

2019-03-29 Thread Alex Williamson
On Thu, 28 Mar 2019 22:50:38 +0530 Kirti Wankhede wrote: > On 3/26/2019 9:00 PM, Parav Pandit wrote: > > > > > >> -Original Message- > >> From: Kirti Wankhede > >> Sent: Tuesday, March 26, 2019 2:06 AM > >> To: Parav Pandit ; k...@vger.kernel.org; linux- > >> ker...@vger.kernel.org;

Re: [PATCH V31 10/25] PCI: Lock down BAR access when the kernel is locked down

2019-03-26 Thread Alex Williamson
On Tue, 26 Mar 2019 13:55:39 -0700 Andy Lutomirski wrote: > On Tue, Mar 26, 2019 at 11:28 AM Matthew Garrett > wrote: > > > > From: Matthew Garrett > > > > Any hardware that can potentially generate DMA has to be locked down in > > order to avoid it being possible for an attacker to modify

Re: [RFC v2 1/2] vfio/pci: export common symbols in vfio-pci

2019-03-26 Thread Alex Williamson
On Tue, 26 Mar 2019 12:37:37 + "Liu, Yi L" wrote: > > From: Alex Williamson [mailto:alex.william...@redhat.com] > > Sent: Tuesday, March 26, 2019 2:17 AM > > To: Liu, Yi L > > Subject: Re: [RFC v2 1/2] vfio/pci: export common symbols in vfio-pci > >

Re: [PATCH 8/8] vfio/mdev: Improve the create/remove sequence

2019-03-26 Thread Alex Williamson
On Tue, 26 Mar 2019 12:36:22 +0530 Kirti Wankhede wrote: > On 3/23/2019 4:50 AM, Parav Pandit wrote: > > There are five problems with current code structure. > > 1. mdev device is placed on the mdev bus before it is created in the > > vendor driver. Once a device is placed on the mdev bus

Re: [PATCH 8/8] vfio/mdev: Improve the create/remove sequence

2019-03-26 Thread Alex Williamson
On Tue, 26 Mar 2019 05:53:22 + Parav Pandit wrote: > > -Original Message- > > From: linux-kernel-ow...@vger.kernel.org > ow...@vger.kernel.org> On Behalf Of Parav Pandit > > Sent: Monday, March 25, 2019 10:19 PM > > To: Alex Williamson > > Cc

Re: [PATCH 8/8] vfio/mdev: Improve the create/remove sequence

2019-03-25 Thread Alex Williamson
On Tue, 26 Mar 2019 01:43:44 + Parav Pandit wrote: > > -Original Message- > > From: Alex Williamson > > Sent: Monday, March 25, 2019 7:06 PM > > To: Parav Pandit > > Cc: k...@vger.kernel.org; linux-kernel@vger.kernel.org; > > kwankh...@nvidia.c

Re: [PATCH 8/8] vfio/mdev: Improve the create/remove sequence

2019-03-25 Thread Alex Williamson
On Mon, 25 Mar 2019 23:34:28 + Parav Pandit wrote: > > -Original Message- > > From: Alex Williamson > > Sent: Monday, March 25, 2019 6:19 PM > > To: Parav Pandit > > Cc: k...@vger.kernel.org; linux-kernel@vger.kernel.org; > > kwankh...@nvidia.c

Re: [PATCH 8/8] vfio/mdev: Improve the create/remove sequence

2019-03-25 Thread Alex Williamson
On Fri, 22 Mar 2019 18:20:35 -0500 Parav Pandit wrote: > There are five problems with current code structure. > 1. mdev device is placed on the mdev bus before it is created in the > vendor driver. Once a device is placed on the mdev bus without creating > its supporting underlying vendor

Re: [PATCH 7/8] vfio/mdev: Fix aborting mdev child device removal if one fails

2019-03-25 Thread Alex Williamson
On Mon, 25 Mar 2019 21:36:42 + Parav Pandit wrote: > > -Original Message- > > From: Alex Williamson > > Sent: Monday, March 25, 2019 3:50 PM > > To: Kirti Wankhede > > Cc: Parav Pandit ; k...@vger.kernel.org; linux- > > ker...@vger.kernel.org &g

Re: [PATCH 7/8] vfio/mdev: Fix aborting mdev child device removal if one fails

2019-03-25 Thread Alex Williamson
On Tue, 26 Mar 2019 01:05:34 +0530 Kirti Wankhede wrote: > On 3/23/2019 4:50 AM, Parav Pandit wrote: > > device_for_each_child() stops executing callback function for remaining > > child devices, if callback hits an error. > > Each child mdev device is independent of each other. > > While

Re: [PATCH 6/8] vfio/mdev: Follow correct remove sequence

2019-03-25 Thread Alex Williamson
On Fri, 22 Mar 2019 18:20:33 -0500 Parav Pandit wrote: > mdev_remove_sysfs_files() should follow exact mirror sequence of a > create, similar to what is followed in error unwinding path of > mdev_create_sysfs_files(). > > Fixes: 7b96953bc640 ("vfio: Mediated device Core driver") >

Re: [PATCH 4/8] vfio/mdev: Drop redundant extern for exported symbols

2019-03-25 Thread Alex Williamson
On Tue, 26 Mar 2019 00:37:04 +0530 Kirti Wankhede wrote: > On 3/23/2019 4:50 AM, Parav Pandit wrote: > > There is no need use 'extern' for exported functions. > > > > Signed-off-by: Parav Pandit > > --- > > include/linux/mdev.h | 21 ++--- > > 1 file changed, 10 insertions(+),

Re: [PATCH 1/8] vfio/mdev: Fix to not do put_device on device_register failure

2019-03-25 Thread Alex Williamson
On Mon, 25 Mar 2019 23:47:30 +0530 Kirti Wankhede wrote: > On 3/23/2019 4:50 AM, Parav Pandit wrote: > > device_register() performs put_device() if device_add() fails. > > This balances with device_initialize(). > > > > mdev core performing put_device() when device_register() fails, > > is an

Re: [RFC v2 1/2] vfio/pci: export common symbols in vfio-pci

2019-03-25 Thread Alex Williamson
On Sat, 23 Mar 2019 11:06:44 + "Liu, Yi L" wrote: > > From: Alex Williamson [mailto:alex.william...@redhat.com] > > Sent: Thursday, March 21, 2019 3:22 AM > > To: Liu, Yi L > > Subject: Re: [RFC v2 1/2] vfio/pci: export common symbols in vfio-pci > >

Re: [PATCH v6 09/22] vfio: VFIO_IOMMU_BIND/UNBIND_MSI

2019-03-21 Thread Alex Williamson
On Sun, 17 Mar 2019 18:22:19 +0100 Eric Auger wrote: > This patch adds the VFIO_IOMMU_BIND/UNBIND_MSI ioctl which aim > to pass/withdraw the guest MSI binding to/from the host. > > Signed-off-by: Eric Auger > > --- > v3 -> v4: > - add UNBIND > - unwind on BIND error > > v2 -> v3: > - adapt

Re: [RFC v2 1/2] vfio/pci: export common symbols in vfio-pci

2019-03-20 Thread Alex Williamson
On Wed, 20 Mar 2019 11:49:37 + "Liu, Yi L" wrote: > > From: Alex Williamson [mailto:alex.william...@redhat.com] > > Sent: Wednesday, March 20, 2019 2:14 AM > > To: Liu, Yi L > > Subject: Re: [RFC v2 1/2] vfio/pci: export common symbols in vfio-pci > >

Re: [PATCH 0/9] RFC: NVME VFIO mediated device

2019-03-20 Thread Alex Williamson
On Wed, 20 Mar 2019 18:42:02 +0200 Maxim Levitsky wrote: > On Wed, 2019-03-20 at 08:28 -0700, Bart Van Assche wrote: > > On Tue, 2019-03-19 at 16:41 +0200, Maxim Levitsky wrote: > > > * All guest memory is mapped into the physical nvme device > > >but not 1:1 as vfio-pci would do this. >

Re: [RFC v2 1/2] vfio/pci: export common symbols in vfio-pci

2019-03-19 Thread Alex Williamson
On Tue, 12 Mar 2019 16:18:22 +0800 "Liu, Yi L" wrote: > This patch exports the following symbols from vfio-pci driver > for vfio-pci alike driver. e.g. vfio-pci-mdev driver > > *) vfio_pci_set_vga_decode(); > *) vfio_pci_release(); > *) vfio_pci_open(); > *) vfio_pci_register_dev_region(); > *)

<    1   2   3   4   5   6   7   8   9   10   >