Re: [PATCH v3 06/14] vfio/type1: Add VFIO_IOMMU_PASID_REQUEST (alloc/free)

2020-07-09 Thread Alex Williamson
> > > > > From: Tian, Kevin > > > > > Sent: Thursday, July 9, 2020 9:57 AM > > > > > > > > > > > From: Liu, Yi L > > > > > > Sent: Thursday, July 9, 2020 8:32 AM > > > > > > > > > > > > Hi Alex, > >

Re: [PATCH v3 06/14] vfio/type1: Add VFIO_IOMMU_PASID_REQUEST (alloc/free)

2020-07-08 Thread Alex Williamson
On Wed, 8 Jul 2020 08:16:16 + "Liu, Yi L" wrote: > Hi Alex, > > > From: Liu, Yi L < yi.l@intel.com> > > Sent: Friday, July 3, 2020 2:28 PM > > > > Hi Alex, > > > > > From: Alex Williamson > > > Sent: Frida

Re: [PATCH v4 04/15] vfio/type1: Report iommu nesting info to userspace

2020-07-08 Thread Alex Williamson
On Wed, 8 Jul 2020 08:08:40 + "Liu, Yi L" wrote: > Hi Alex, > > Eric asked if we will to have data strcut other than struct iommu_nesting_info > type in the struct vfio_iommu_type1_info_cap_nesting @info[] field. I'm not > quit sure on it. I guess the answer may be not as VFIO's nesting

Re: [PATCH v2 1/2] iommu: iommu_aux_at(de)tach_device() extension

2020-07-08 Thread Alex Williamson
On Wed, 8 Jul 2020 10:53:12 +0800 Lu Baolu wrote: > Hi Alex, > > Thanks a lot for your comments. Please check my reply inline. > > On 7/8/20 5:04 AM, Alex Williamson wrote: > > On Tue, 7 Jul 2020 09:39:56 +0800 > > Lu Baolu wrote: > > > >> T

Re: [PATCH v3 1/5] docs: IOMMU user API

2020-07-07 Thread Alex Williamson
On Mon, 29 Jun 2020 16:05:18 -0700 Jacob Pan wrote: > On Fri, 26 Jun 2020 16:19:23 -0600 > Alex Williamson wrote: > > > On Tue, 23 Jun 2020 10:03:53 -0700 > > Jacob Pan wrote: > > > > > IOMMU UAPI is newly introduced to support communications betwee

Re: [PATCH v2 1/2] iommu: iommu_aux_at(de)tach_device() extension

2020-07-07 Thread Alex Williamson
) so that the users could pass > in an optional device pointer (struct device for vfio/mdev for example), > and the necessary check and data link could be done. > > Fixes: a3a195929d40b ("iommu: Add APIs for multiple domains per device") > Cc: Robin Murphy > Cc: Alex

Re: [PATCH v3 01/14] vfio/type1: Refactor vfio_iommu_type1_ioctl()

2020-07-02 Thread Alex Williamson
On Wed, 24 Jun 2020 01:55:14 -0700 Liu Yi L wrote: > This patch refactors the vfio_iommu_type1_ioctl() to use switch instead of > if-else, and each cmd got a helper function. > > Cc: Kevin Tian > CC: Jacob Pan > Cc: Alex Williamson > Cc: Eric Auger > Cc: Jean-Phili

Re: [PATCH v3 10/14] vfio/type1: Allow invalidating first-level/stage IOMMU cache

2020-07-02 Thread Alex Williamson
tup. > > Cc: Kevin Tian > CC: Jacob Pan > Cc: Alex Williamson > Cc: Eric Auger > Cc: Jean-Philippe Brucker > Cc: Joerg Roedel > Cc: Lu Baolu > Signed-off-by: Liu Yi L > Signed-off-by: Eric Auger > Signed-off-by: Jacob Pan > --- > v1 -> v2: &

Re: [PATCH v3 09/14] vfio/type1: Support binding guest page tables to PASID

2020-07-02 Thread Alex Williamson
es > to a PASID. This PASID must have been allocated to user space before the > binding request. > > Cc: Kevin Tian > CC: Jacob Pan > Cc: Alex Williamson > Cc: Eric Auger > Cc: Jean-Philippe Brucker > Cc: Joerg Roedel > Cc: Lu Baolu > Signed-off-by: Jean-Philippe

Re: [PATCH v3 06/14] vfio/type1: Add VFIO_IOMMU_PASID_REQUEST (alloc/free)

2020-07-02 Thread Alex Williamson
exits. > > Cc: Kevin Tian > CC: Jacob Pan > Cc: Alex Williamson > Cc: Eric Auger > Cc: Jean-Philippe Brucker > Cc: Joerg Roedel > Cc: Lu Baolu > Signed-off-by: Liu Yi L > Signed-off-by: Yi Sun > Signed-off-by: Jacob Pan > --- > v1 -> v2: > *) m

Re: [PATCH v3 04/14] vfio: Add PASID allocation/free support

2020-07-02 Thread Alex Williamson
o. > > Cc: Kevin Tian > CC: Jacob Pan > Cc: Eric Auger > Cc: Jean-Philippe Brucker > Cc: Joerg Roedel > Cc: Lu Baolu > Suggested-by: Alex Williamson > Signed-off-by: Liu Yi L > --- > v1 -> v2: > *) added in v2, split from the pasid alloc/free su

Re: [PATCH v3 03/14] vfio/type1: Report iommu nesting info to userspace

2020-07-02 Thread Alex Williamson
context. But for now let's go with this restriction > by requiring singleton container for using nesting iommu features. Below > link has the related discussion about this decision. > > https://lkml.org/lkml/2020/5/15/1028 > > Cc: Kevin Tian > CC: Jacob Pan > Cc: Alex Williamson

Re: [PATCH v3 02/14] iommu: Report domain nesting info

2020-07-02 Thread Alex Williamson
ting info after setting DOMAIN_ATTR_NESTING. > > v2 -> v3: > *) remvoe cap/ecap_mask in iommu_nesting_info. > *) reuse DOMAIN_ATTR_NESTING to get nesting info. > *) return an empty iommu_nesting_info for SMMU drivers per Jean' >suggestion. > > Cc: Kevin Tian > CC:

[PATCH] vfio/pci: Add Intel X550 to hidden INTx devices

2020-07-01 Thread Alex Williamson
andeburg Signed-off-by: Alex Williamson --- drivers/vfio/pci/vfio_pci.c |2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/vfio/pci/vfio_pci.c b/drivers/vfio/pci/vfio_pci.c index f634c81998bb..9968dc0f87a3 100644 --- a/drivers/vfio/pci/vfio_pci.c +++ b/drivers/vfio/pci/vfio_pci.c @@ -20

Re: [PATCH] vfio/pci: Fix SR-IOV VF handling with MMIO blocking

2020-06-27 Thread Alex Williamson
On Sun, 28 Jun 2020 03:12:12 + "Wang, Haiyue" wrote: > > -Original Message- > > From: kvm-ow...@vger.kernel.org On Behalf Of > > Alex Williamson > > Sent: Friday, June 26, 2020 00:57 > > To: alex.william...@redhat.com > > Cc: k...

[GIT PULL] VFIO fixes for v5.8-rc3

2020-06-27 Thread Alex Williamson
to ebfa440ce38b7e2e04c3124aa89c8a9f4094cf21: vfio/pci: Fix SR-IOV VF handling with MMIO blocking (2020-06-25 11:04:23 -0600) VFIO fixes for v5.8-rc3 - Fix double free of eventfd ctx (Alex Williamson) - Fix duplicate use of capability ID (Alex Williamson

Re: [PATCH v3 1/5] docs: IOMMU user API

2020-06-26 Thread Alex Williamson
On Tue, 23 Jun 2020 10:03:53 -0700 Jacob Pan wrote: > IOMMU UAPI is newly introduced to support communications between guest > virtual IOMMU and host IOMMU. There has been lots of discussions on how > it should work with VFIO UAPI and userspace in general. > > This document is indended to

[PATCH] vfio/pci: Fix SR-IOV VF handling with MMIO blocking

2020-06-25 Thread Alex Williamson
o-pci: Invalidate mmaps and block MMIO access on disabled memory") Signed-off-by: Alex Williamson --- drivers/vfio/pci/vfio_pci_config.c | 17 - 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/drivers/vfio/pci/vfio_pci_config.c b/drivers/vfio/pci/vfio_pci_conf

Re: [RFC PATCH v4 07/10] vfio/pci: introduce a new irq type VFIO_IRQ_TYPE_REMAP_BAR_REGION

2020-06-19 Thread Alex Williamson
On Wed, 10 Jun 2020 01:23:14 -0400 Yan Zhao wrote: > On Fri, Jun 05, 2020 at 10:13:01AM -0600, Alex Williamson wrote: > > On Thu, 4 Jun 2020 22:02:31 -0400 > > Yan Zhao wrote: > > > > > On Wed, Jun 03, 2020 at 10:10:58PM -0600, Alex Williamson wrote: >

Re: [PATCH v5 0/4] introduction of migration_version attribute for VFIO live migration

2020-06-19 Thread Alex Williamson
On Tue, 9 Jun 2020 20:37:31 -0400 Yan Zhao wrote: > On Fri, Jun 05, 2020 at 03:39:50PM +0100, Dr. David Alan Gilbert wrote: > > > > > I tried to simplify the problem a bit, but we keep going backwards. > > > > > If > > > > > the requirement is that potentially any source device can migrate to

Re: [PATCH v2 1/3] docs: IOMMU user API

2020-06-19 Thread Alex Williamson
On Fri, 19 Jun 2020 03:30:24 + "Liu, Yi L" wrote: > Hi Alex, > > > From: Alex Williamson > > Sent: Friday, June 19, 2020 10:55 AM > > > > On Fri, 19 Jun 2020 02:15:36 + > > "Liu, Yi L" wrote: > > > > > Hi Ale

[PATCH v2] vfio: Cleanup allowed driver naming

2020-06-19 Thread Alex Williamson
No functional change, avoid non-inclusive naming schemes. Signed-off-by: Alex Williamson --- v2: Wrap vfio_dev_driver_allowed to 80 column for consistency, checkpatch no longer warns about this. drivers/vfio/vfio.c | 13 +++-- 1 file changed, 7 insertions(+), 6 deletions

Re: [PATCH] vfio: Cleanup allowed driver naming

2020-06-19 Thread Alex Williamson
On Fri, 19 Jun 2020 00:18:02 -0700 Christoph Hellwig wrote: > On Thu, Jun 18, 2020 at 01:57:18PM -0600, Alex Williamson wrote: > > No functional change, avoid non-inclusive naming schemes. > > Adding a bunch of overly long lines that don't change anything are > everything

Re: [PATCH v2 1/3] docs: IOMMU user API

2020-06-18 Thread Alex Williamson
On Fri, 19 Jun 2020 02:15:36 + "Liu, Yi L" wrote: > Hi Alex, > > > From: Alex Williamson > > Sent: Friday, June 19, 2020 5:48 AM > > > > On Wed, 17 Jun 2020 08:28:24 + > > "Tian, Kevin" wrote: > > > >

Re: [PATCH v2 1/3] docs: IOMMU user API

2020-06-18 Thread Alex Williamson
On Wed, 17 Jun 2020 08:28:24 + "Tian, Kevin" wrote: > > From: Liu, Yi L > > Sent: Wednesday, June 17, 2020 2:20 PM > > > > > From: Jacob Pan > > > Sent: Tuesday, June 16, 2020 11:22 PM > > > > > > On Thu, 11 Jun 2020 17:27:27 -0700 > > > Jacob Pan wrote: > > > > > > > > > > > > > But

[PATCH] vfio: Cleanup allowed driver naming

2020-06-18 Thread Alex Williamson
No functional change, avoid non-inclusive naming schemes. Signed-off-by: Alex Williamson --- drivers/vfio/vfio.c | 12 ++-- 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/vfio/vfio.c b/drivers/vfio/vfio.c index 580099afeaff..833da937b7fc 100644 --- a/drivers

[PATCH] vfio/type1: Fix migration info capability ID

2020-06-18 Thread Alex Williamson
ID 1 is already used by the IOVA range capability, use ID 2. Reported-by: Liu Yi L Cc: Kirti Wankhede Fixes: ad721705d09c ("vfio iommu: Add migration capability to report supported features") Signed-off-by: Alex Williamson --- include/uapi/linux/vfio.h |2 +- 1 file changed, 1

Re: [PATCH AUTOSEL 5.7 280/388] vfio/pci: fix memory leaks of eventfd ctx

2020-06-17 Thread Alex Williamson
_eventfd+0x54/0x1ac > [<82791a69>] __arm64_sys_eventfd2+0x34/0x44 > [<0000b819758c>] do_el0_svc+0x128/0x1dc > [<b244e810>] el0_sync_handler+0xd0/0x268 > [<d495ef94>] el0_sync+0x164/0x180 > > Signed-off-by: Q

Re: [PATCH AUTOSEL 5.4 191/266] vfio/pci: fix memory leaks of eventfd ctx

2020-06-17 Thread Alex Williamson
_eventfd+0x54/0x1ac > [<82791a69>] __arm64_sys_eventfd2+0x34/0x44 > [<0000b819758c>] do_el0_svc+0x128/0x1dc > [<b244e810>] el0_sync_handler+0xd0/0x268 > [<d495ef94>] el0_sync+0x164/0x180 > > Signed-off-by: Q

Re: [PATCH AUTOSEL 4.19 120/172] vfio/pci: fix memory leaks of eventfd ctx

2020-06-17 Thread Alex Williamson
_eventfd+0x54/0x1ac > [<82791a69>] __arm64_sys_eventfd2+0x34/0x44 > [<0000b819758c>] do_el0_svc+0x128/0x1dc > [<b244e810>] el0_sync_handler+0xd0/0x268 > [<d495ef94>] el0_sync+0x164/0x180 > > Signed-off-by: Q

Re: [PATCH AUTOSEL 4.4 50/60] vfio/pci: fix memory leaks of eventfd ctx

2020-06-17 Thread Alex Williamson
_eventfd+0x54/0x1ac > [<82791a69>] __arm64_sys_eventfd2+0x34/0x44 > [<0000b819758c>] do_el0_svc+0x128/0x1dc > [<b244e810>] el0_sync_handler+0xd0/0x268 > [<d495ef94>] el0_sync+0x164/0x180 > > Signed-off-by: Q

Re: [PATCH AUTOSEL 4.14 079/108] vfio/pci: fix memory leaks of eventfd ctx

2020-06-17 Thread Alex Williamson
_eventfd+0x54/0x1ac > [<82791a69>] __arm64_sys_eventfd2+0x34/0x44 > [<0000b819758c>] do_el0_svc+0x128/0x1dc > [<b244e810>] el0_sync_handler+0xd0/0x268 > [<d495ef94>] el0_sync+0x164/0x180 > > Signed-off-by: Q

Re: [PATCH AUTOSEL 4.9 64/80] vfio/pci: fix memory leaks of eventfd ctx

2020-06-17 Thread Alex Williamson
_eventfd+0x54/0x1ac > [<82791a69>] __arm64_sys_eventfd2+0x34/0x44 > [<0000b819758c>] do_el0_svc+0x128/0x1dc > [<b244e810>] el0_sync_handler+0xd0/0x268 > [<d495ef94>] el0_sync+0x164/0x180 > > Signed-off-by: Q

Re: vfio: refcount_t: underflow; use-after-free.

2020-06-16 Thread Alex Williamson
On Tue, 16 Jun 2020 10:50:52 +0200 Daniel Wagner wrote: > Hi, > > I'm getting the warning below when starting a KVM the second time with an > Emulex PCI card 'passthroughed' into a KVM. I'm terminating the session > via 'ctrl-a x', not sure if this is relevant. > > This is with 5.8-rc1. IIRC,

[PATCH] vfio/pci: Clear error and request eventfd ctx after releasing

2020-06-16 Thread Alex Williamson
The next use of the device will generate an underflow from the stale reference. Cc: Qian Cai Fixes: 1518ac272e78 ("vfio/pci: fix memory leaks of eventfd ctx") Reported-by: Daniel Wagner Signed-off-by: Alex Williamson --- drivers/vfio/pci/vfio_pci.c |8 ++-- 1 file

Re: [PATCH v2 3/3] iommu/vt-d: Sanity check uapi argsz filled by users

2020-06-11 Thread Alex Williamson
On Thu, 11 Jun 2020 13:02:24 -0700 Jacob Pan wrote: > On Thu, 11 Jun 2020 11:08:16 -0600 > Alex Williamson wrote: > > > On Wed, 10 Jun 2020 21:12:15 -0700 > > Jacob Pan wrote: > > > > > IOMMU UAPI data has an argsz field which is filled by user. As the

Re: [PATCH v2 1/3] docs: IOMMU user API

2020-06-11 Thread Alex Williamson
On Thu, 11 Jun 2020 12:52:05 -0700 Jacob Pan wrote: > Hi Alex, > > On Thu, 11 Jun 2020 09:47:41 -0600 > Alex Williamson wrote: > > > On Wed, 10 Jun 2020 21:12:13 -0700 > > Jacob Pan wrote: > > > > > IOMMU UAPI is newly introduced to support commun

Re: [PATCH v2 02/15] iommu: Report domain nesting info

2020-06-11 Thread Alex Williamson
On Thu, 11 Jun 2020 05:15:21 -0700 Liu Yi L wrote: > IOMMUs that support nesting translation needs report the capability info > to userspace, e.g. the format of first level/stage paging structures. > > Cc: Kevin Tian > CC: Jacob Pan > Cc: Alex Williamson > Cc: Eric Auger

Re: [PATCH v2 3/3] iommu/vt-d: Sanity check uapi argsz filled by users

2020-06-11 Thread Alex Williamson
On Wed, 10 Jun 2020 21:12:15 -0700 Jacob Pan wrote: > IOMMU UAPI data has an argsz field which is filled by user. As the data > structures expands, argsz may change. As the UAPI data are shared among > different architectures, extensions of UAPI data could be a result of > one architecture which

Re: [PATCH v2 2/3] iommu/uapi: Add argsz for user filled data

2020-06-11 Thread Alex Williamson
On Wed, 10 Jun 2020 21:12:14 -0700 Jacob Pan wrote: > As IOMMU UAPI gets extended, user data size may increase. To support > backward compatibiliy, this patch introduces a size field to each UAPI > data structures. It is *always* the responsibility for the user to fill in > the correct size.

Re: [PATCH v2 1/3] docs: IOMMU user API

2020-06-11 Thread Alex Williamson
On Wed, 10 Jun 2020 21:12:13 -0700 Jacob Pan wrote: > IOMMU UAPI is newly introduced to support communications between guest > virtual IOMMU and host IOMMU. There has been lots of discussions on how > it should work with VFIO UAPI and userspace in general. > > This document is indended to

Re: [RFC PATCH v4 07/10] vfio/pci: introduce a new irq type VFIO_IRQ_TYPE_REMAP_BAR_REGION

2020-06-05 Thread Alex Williamson
On Fri, 5 Jun 2020 00:26:10 + "He, Shaopeng" wrote: > > From: Alex Williamson > > Sent: Thursday, June 4, 2020 12:11 PM > > > > On Wed, 3 Jun 2020 22:42:28 -0400 > > Yan Zhao wrote: > > > > > On Wed, Jun 03, 2020 at 05:04:52PM -06

Re: [RFC PATCH v4 07/10] vfio/pci: introduce a new irq type VFIO_IRQ_TYPE_REMAP_BAR_REGION

2020-06-05 Thread Alex Williamson
On Thu, 4 Jun 2020 22:02:31 -0400 Yan Zhao wrote: > On Wed, Jun 03, 2020 at 10:10:58PM -0600, Alex Williamson wrote: > > On Wed, 3 Jun 2020 22:42:28 -0400 > > Yan Zhao wrote: > > > > > On Wed, Jun 03, 2020 at 05:04:52PM -0600, Alex Williamson wrote: >

Re: [PATCH v5 0/4] introduction of migration_version attribute for VFIO live migration

2020-06-05 Thread Alex Williamson
On Fri, 5 Jun 2020 11:22:24 +0100 "Dr. David Alan Gilbert" wrote: > * Alex Williamson (alex.william...@redhat.com) wrote: > > On Wed, 3 Jun 2020 01:24:43 -0400 > > Yan Zhao wrote: > > > > > On Tue, Jun 02, 2020 at 09:55:28PM -0600, Alex Williamson wrot

Re: [RFC PATCH v4 07/10] vfio/pci: introduce a new irq type VFIO_IRQ_TYPE_REMAP_BAR_REGION

2020-06-03 Thread Alex Williamson
On Wed, 3 Jun 2020 22:42:28 -0400 Yan Zhao wrote: > On Wed, Jun 03, 2020 at 05:04:52PM -0600, Alex Williamson wrote: > > On Tue, 2 Jun 2020 21:40:58 -0400 > > Yan Zhao wrote: > > > > > On Tue, Jun 02, 2020 at 01:34:35PM -0600, Alex Williamson wrote:

Re: [RFC PATCH v4 07/10] vfio/pci: introduce a new irq type VFIO_IRQ_TYPE_REMAP_BAR_REGION

2020-06-03 Thread Alex Williamson
On Tue, 2 Jun 2020 21:40:58 -0400 Yan Zhao wrote: > On Tue, Jun 02, 2020 at 01:34:35PM -0600, Alex Williamson wrote: > > I'm not at all happy with this. Why do we need to hide the migration > > sparse mmap from the user until migration time? What if instead we >

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

2020-06-03 Thread Alex Williamson
to 4f085ca2f5a8047845ab2d6bbe97089daed28655: Merge branch 'v5.8/vfio/kirti-migration-fixes' into v5.8/vfio/next (2020-06-02 13:53:00 -0600) VFIO updates for v5.8-rc1 - Block accesses to disabled MMIO space (Alex Williamson) - VFIO device migration API (Kirti

Re: [PATCH v5 0/4] introduction of migration_version attribute for VFIO live migration

2020-06-03 Thread Alex Williamson
On Wed, 3 Jun 2020 01:24:43 -0400 Yan Zhao wrote: > On Tue, Jun 02, 2020 at 09:55:28PM -0600, Alex Williamson wrote: > > On Tue, 2 Jun 2020 23:19:48 -0400 > > Yan Zhao wrote: > > > > > On Tue, Jun 02, 2020 at 04:55:27PM -0600, Alex Williamson wrote: > &

Re: [PATCH v5 0/4] introduction of migration_version attribute for VFIO live migration

2020-06-02 Thread Alex Williamson
On Tue, 2 Jun 2020 23:19:48 -0400 Yan Zhao wrote: > On Tue, Jun 02, 2020 at 04:55:27PM -0600, Alex Williamson wrote: > > On Wed, 29 Apr 2020 20:39:50 -0400 > > Yan Zhao wrote: > > > > > On Wed, Apr 29, 2020 at 05:48:44PM +0800

Re: [PATCH v5 0/4] introduction of migration_version attribute for VFIO live migration

2020-06-02 Thread Alex Williamson
On Wed, 29 Apr 2020 20:39:50 -0400 Yan Zhao wrote: > On Wed, Apr 29, 2020 at 05:48:44PM +0800, Dr. David Alan Gilbert wrote: > > > > > > > > > > > > > > > An mdev type is meant to define a software > > > > > > > > > > > > > > compatible interface, so in > > > > > > > > > > > > > > the case of

Re: linux-next: Tree for Jun 2 (vfio)

2020-06-02 Thread Alex Williamson
On Tue, 2 Jun 2020 09:16:15 -0600 Alex Williamson wrote: > On Tue, 2 Jun 2020 07:36:45 -0700 > Randy Dunlap wrote: > > > On 6/2/20 3:37 AM, Stephen Rothwell wrote: > > > Hi all, > > > > > > News: The merge window has opened, so please do *not*

Re: [RFC PATCH v4 07/10] vfio/pci: introduce a new irq type VFIO_IRQ_TYPE_REMAP_BAR_REGION

2020-06-02 Thread Alex Williamson
On Tue, 2 Jun 2020 04:28:58 -0400 Yan Zhao wrote: > On Mon, Jun 01, 2020 at 10:43:07AM -0600, Alex Williamson wrote: > > On Mon, 1 Jun 2020 02:57:26 -0400 > > Yan Zhao wrote: > > > > > On Fri, May 29, 2020 at 03:45:47PM -0600, Alex Williamson wrote: > &

Re: linux-next: Tree for Jun 2 (vfio)

2020-06-02 Thread Alex Williamson
On Tue, 2 Jun 2020 07:36:45 -0700 Randy Dunlap wrote: > On 6/2/20 3:37 AM, Stephen Rothwell wrote: > > Hi all, > > > > News: The merge window has opened, so please do *not* add v5.9 material > > to your linux-next included branches until after v5.8-rc1 has been > > released. > > > > Changes

Re: [PATCH v2 2/9] vfio/fsl-mc: Scan DPRC objects on vfio-fsl-mc driver bind

2020-06-01 Thread Alex Williamson
On Fri, 8 May 2020 10:20:32 +0300 Diana Craciun wrote: > The DPRC (Data Path Resource Container) device is a bus device and has > child devices attached to it. When the vfio-fsl-mc driver is probed > the DPRC is scanned and the child devices discovered and initialized. > > Signed-off-by:

Re: [PATCH v2 4/9] vfio/fsl-mc: Implement VFIO_DEVICE_GET_REGION_INFO ioctl call

2020-06-01 Thread Alex Williamson
On Fri, 8 May 2020 10:20:34 +0300 Diana Craciun wrote: > Expose to userspace information about the memory regions. > > Signed-off-by: Bharat Bhushan > Signed-off-by: Diana Craciun > --- > drivers/vfio/fsl-mc/vfio_fsl_mc.c | 77 ++- >

Re: [PATCH v2 5/9] vfio/fsl-mc: Allow userspace to MMAP fsl-mc device MMIO regions

2020-06-01 Thread Alex Williamson
On Fri, 8 May 2020 10:20:35 +0300 Diana Craciun wrote: > Allow userspace to mmap device regions for direct access of > fsl-mc devices. > > Signed-off-by: Bharat Bhushan > Signed-off-by: Diana Craciun > --- > drivers/vfio/fsl-mc/vfio_fsl_mc.c | 60 ++- >

Re: [PATCH] PCI: Relax ACS requirement for Intel RCiEP devices.

2020-06-01 Thread Alex Williamson
twork controller: Intel Corporation Device 9df0 (rev 30) > > > Capabilities: [40] Express (v2) Root Complex Integrated Endpoint, MSI 00 > > > > > > This permits assigning this device to a guest VM. > > > > > > Fixes: f096c061f552 ("iommu: Rewo

Re: [RFC PATCH v4 07/10] vfio/pci: introduce a new irq type VFIO_IRQ_TYPE_REMAP_BAR_REGION

2020-06-01 Thread Alex Williamson
On Mon, 1 Jun 2020 02:57:26 -0400 Yan Zhao wrote: > On Fri, May 29, 2020 at 03:45:47PM -0600, Alex Williamson wrote: > > On Sun, 17 May 2020 22:52:45 -0400 > > Yan Zhao wrote: > > > > > This is a virtual irq type. > > > vendor driver triggers thi

Re: [PATCH] vfio/mdev: Fix reference count leak in add_mdev_supported_type.

2020-05-29 Thread Alex Williamson
On Wed, 27 May 2020 21:01:09 -0500 wu000...@umn.edu wrote: > From: Qiushi Wu > > kobject_init_and_add() takes reference even when it fails. > If this function returns an error, kobject_put() must be called to > properly clean up the memory associated with the object. Thus, > replace kfree() by

Re: [RFC PATCH v4 07/10] vfio/pci: introduce a new irq type VFIO_IRQ_TYPE_REMAP_BAR_REGION

2020-05-29 Thread Alex Williamson
On Sun, 17 May 2020 22:52:45 -0400 Yan Zhao wrote: > This is a virtual irq type. > vendor driver triggers this irq when it wants to notify userspace to > remap PCI BARs. > > 1. vendor driver triggers this irq and packs the target bar number in >the ctx count. i.e. "1 << bar_number". >if

Re: [PATCH] PCI: Relax ACS requirement for Intel RCiEP devices.

2020-05-28 Thread Alex Williamson
Fixes tag. This seems like a feature, not a fix. If you want it in stable releases as a feature, request it via Cc: sta...@vger.kernel.org. I'd drop that tag, that's my nit. Otherwise: Reviewed-by: Alex Williamson > Signed-off-by: Ashok Raj > To: Joerg Roedel > To: Bjorn Helgaas

Re: [PATCH] iommu: Relax ACS requirement for Intel RCiEP devices.

2020-05-26 Thread Alex Williamson
r: Intel Corporation Device 9df0 (rev 30) > Capabilities: [40] Express (v2) Root Complex Integrated Endpoint, MSI 00 > > This permits assigning this device to a guest VM. > > Fixes: f096c061f552 ("iommu: Rework iommu_group_get_for_pci_dev()") > Signed-off-by: Ashok Raj &g

Re: [PATCH] iommu: Relax ACS requirement for RCiEP devices.

2020-05-26 Thread Alex Williamson
On Tue, 26 May 2020 11:06:48 -0700 "Raj, Ashok" wrote: > Hi Alex, > > I was able to find better language in the IOMMU spec that gaurantees > the behavior we need. See below. > > > On Tue, May 05, 2020 at 09:34:14AM -0600, Alex Williamson wrote: > > On Tu

Re: [PATCH -next] vfio/pci: fix a null-ptr-deref in vfio_config_free()

2020-05-26 Thread Alex Williamson
On Thu, 21 May 2020 21:18:29 -0400 Qian Cai wrote: > It is possible vfio_config_init() does not call vfio_cap_len(), and then > vdev->msi_perm == NULL. Later, in vfio_config_free(), it could trigger a > null-ptr-deref. > > BUG: kernel NULL pointer dereference, address: > RIP:

Re: [PATCH v3 3/3] vfio-pci: Invalidate mmaps and block MMIO access on disabled memory

2020-05-26 Thread Alex Williamson
On Tue, 26 May 2020 12:53:31 -0300 Jason Gunthorpe wrote: > On Tue, May 26, 2020 at 08:32:18AM -0600, Alex Williamson wrote: > > > > Certainly there is no reason to optimize the fringe case of vfio > > > > sleeping if there is and incorrect concurrnent attempt t

Re: [PATCH v3 3/3] vfio-pci: Invalidate mmaps and block MMIO access on disabled memory

2020-05-26 Thread Alex Williamson
On Tue, 26 May 2020 09:49:54 -0400 Peter Xu wrote: > On Mon, May 25, 2020 at 09:37:05PM -0300, Jason Gunthorpe wrote: > > On Mon, May 25, 2020 at 01:56:28PM -0700, John Hubbard wrote: > > > On 2020-05-25 09:56, Jason Gunthorpe wrote: > > > > On Mon, May 25, 2020 at 11:11:42AM -0400, Peter Xu

Re: [PATCH v3 3/3] vfio-pci: Invalidate mmaps and block MMIO access on disabled memory

2020-05-23 Thread Alex Williamson
On Sat, 23 May 2020 15:34:17 -0400 Peter Xu wrote: > Hi, Alex, > > On Fri, May 22, 2020 at 01:17:43PM -0600, Alex Williamson wrote: > > @@ -1346,15 +1526,32 @@ static vm_fault_t vfio_pci_mmap_fault(struct > > vm_fault *vmf) > > { > > struct vm_area_struc

Re: [PATCH v3 0/3] vfio-pci: Block user access to disabled device MMIO

2020-05-22 Thread Alex Williamson
On Fri, 22 May 2020 18:08:58 -0400 Qian Cai wrote: > On Fri, May 22, 2020 at 01:17:09PM -0600, Alex Williamson wrote: > > v3: > > > > The memory_lock semaphore is only held in the MSI-X path for callouts > > to functions that may access MSI-X MMIO space of the devi

[PATCH v3 3/3] vfio-pci: Invalidate mmaps and block MMIO access on disabled memory

2020-05-22 Thread Alex Williamson
to be compatible with known use cases and potentially provides better error handling capabilities than present in the hardware, while avoiding the more readily accessible and severe platform error responses that might otherwise occur. Fixes: CVE-2020-12888 Signed-off-by: Alex Williamson --- drivers/vfio/pci

[PATCH v3 2/3] vfio-pci: Fault mmaps to enable vma tracking

2020-05-22 Thread Alex Williamson
range so that all tracking is inserted in the fault handler and removed in the close handler. Reviewed-by: Peter Xu Signed-off-by: Alex Williamson --- drivers/vfio/pci/vfio_pci.c | 76 ++- drivers/vfio/pci/vfio_pci_private.h |7 +++ 2 files changed, 81

[PATCH v3 0/3] vfio-pci: Block user access to disabled device MMIO

2020-05-22 Thread Alex Williamson
ather than SIGBUS if we experience regressions, but without known code requiring that, SIGBUS seems the appropriate response to this condition. Thanks, Alex --- Alex Williamson (3): vfio/type1: Support faulting PFNMAP vmas vfio-pci: Fault mmaps to enable vma tracking vfio-pci: Invali

[PATCH v3 1/3] vfio/type1: Support faulting PFNMAP vmas

2020-05-22 Thread Alex Williamson
With conversion to follow_pfn(), DMA mapping a PFNMAP range depends on the range being faulted into the vma. Add support to manually provide that, in the same way as done on KVM with hva_to_pfn_remapped(). Reviewed-by: Peter Xu Signed-off-by: Alex Williamson --- drivers/vfio/vfio_iommu_type1

Re: [PATCH v2 3/3] vfio-pci: Invalidate mmaps and block MMIO access on disabled memory

2020-05-21 Thread Alex Williamson
On Thu, 21 May 2020 22:39:06 -0400 Qian Cai wrote: > On Tue, May 05, 2020 at 03:55:02PM -0600, Alex Williamson wrote: > [] > vfio_pci_mmap_fault(struct vm_fault *vmf) > > { > > struct vm_area_struct *vma = vmf->vma; > > struct vfio_pci_devic

Re: (a design open) RE: [PATCH v1 6/8] vfio/type1: Bind guest page tables to host

2020-05-15 Thread Alex Williamson
in next patch. > > > > In this patch, guest page table bind and unbind are done by using flags > > VFIO_IOMMU_BIND_GUEST_PGTBL and > > VFIO_IOMMU_UNBIND_GUEST_PGTBL under IOCTL > > VFIO_IOMMU_BIND, the bind/unbind data are conveyed by > > struct iommu_gpasid_b

Re: [PATCH 0/2] vfio/type1/pci: IOMMU PFNMAP invalidation

2020-05-15 Thread Alex Williamson
On Fri, 15 May 2020 11:22:51 -0400 Peter Xu wrote: > On Thu, May 14, 2020 at 04:55:17PM -0600, Alex Williamson wrote: > > > I'm not if this makes sense, can't we arrange to directly trap the > > > IOMMU failure and route it into qemu if that is what is desired? >

Re: [PATCH 0/2] vfio/type1/pci: IOMMU PFNMAP invalidation

2020-05-14 Thread Alex Williamson
On Thu, 14 May 2020 19:24:15 -0300 Jason Gunthorpe wrote: > On Thu, May 14, 2020 at 04:17:12PM -0600, Alex Williamson wrote: > > > that much. I think this would also address Jason's primary concern. > > It's better to get an IOMMU fault from the user trying to access those

Re: [PATCH 0/2] vfio/type1/pci: IOMMU PFNMAP invalidation

2020-05-14 Thread Alex Williamson
On Thu, 14 May 2020 17:25:38 -0400 Peter Xu wrote: > On Thu, May 14, 2020 at 10:51:46AM -0600, Alex Williamson wrote: > > This is a follow-on series to "vfio-pci: Block user access to disabled > > device MMIO"[1], which extends user access blocking of disabled M

[PATCH 2/2] vfio: Introduce strict PFNMAP mappings

2020-05-14 Thread Alex Williamson
, enabled by default, restricting IOMMU mapping of PFNMAP vmas to only those supporting invalidation callbacks. vfio-pci is updated to register vfio_pci_mmap_ops as supporting this feature. Signed-off-by: Alex Williamson --- drivers/vfio/pci/vfio_pci.c |7 drivers/vfio/vfio.c

[PATCH 1/2] vfio: Introduce bus driver to IOMMU invalidation interface

2020-05-14 Thread Alex Williamson
recommended as this support only provides invalidation, dropping unmapped vmas. Those vmas are not automatically re-installed when re-mapped. Signed-off-by: Alex Williamson --- drivers/vfio/pci/vfio_pci.c | 34 +- drivers/vfio/pci/vfio_pci_private.h |1 drivers/vfio/vfio.c

[PATCH 0/2] vfio/type1/pci: IOMMU PFNMAP invalidation

2020-05-14 Thread Alex Williamson
you'd like Suggested-by credit for the ideas here I'd be glad to add it. Thanks, Alex [1]https://lore.kernel.org/kvm/158871401328.15589.17598154478222071285.st...@gimli.home/ --- Alex Williamson (2): vfio: Introduce bus driver to IOMMU invalidation interface vfio: Introduce str

Re: [PATCH 08/12] vfio: use __anon_inode_getfd

2020-05-08 Thread Alex Williamson
> 1 file changed, 8 insertions(+), 29 deletions(-) Thanks! Acked-by: Alex Williamson > diff --git a/drivers/vfio/vfio.c b/drivers/vfio/vfio.c > index 765e0e5d83ed9..33a88103f857f 100644 > --- a/drivers/vfio/vfio.c > +++ b/drivers/vfio/vfio.c > @@ -1451,42 +1451,21 @@ static

Re: [PATCH v2 1/3] vfio/type1: Support faulting PFNMAP vmas

2020-05-08 Thread Alex Williamson
hu, May 07, 2020 at 08:54:21PM -0300, Jason Gunthorpe wrote: > > > > > On Thu, May 07, 2020 at 05:24:43PM -0400, Peter Xu wrote: > > > > > > On Tue, May 05, 2020 at 03:54:44PM -0600, Alex Williamson wrote: > > > > > > >

Re: [PATCH v2 0/3] vfio-pci: Block user access to disabled device MMIO

2020-05-07 Thread Alex Williamson
On Thu, 7 May 2020 17:59:08 -0400 Peter Xu wrote: > On Tue, May 05, 2020 at 03:54:36PM -0600, Alex Williamson wrote: > > v2: > > > > Locking in 3/ is substantially changed to avoid the retry scenario > > within the fault handler, therefore a caller who does not all

Re: [PATCH v2 2/3] vfio-pci: Fault mmaps to enable vma tracking

2020-05-07 Thread Alex Williamson
On Thu, 7 May 2020 17:47:44 -0400 Peter Xu wrote: > Hi, Alex, > > On Tue, May 05, 2020 at 03:54:53PM -0600, Alex Williamson wrote: > > +/* > > + * Zap mmaps on open so that we can fault them in on access and therefore > > + * our vma_list only tracks mappi

Re: [PATCH v2 1/3] vfio/type1: Support faulting PFNMAP vmas

2020-05-07 Thread Alex Williamson
On Thu, 7 May 2020 17:24:43 -0400 Peter Xu wrote: > On Tue, May 05, 2020 at 03:54:44PM -0600, Alex Williamson wrote: > > With conversion to follow_pfn(), DMA mapping a PFNMAP range depends on > > the range being faulted into the vma. Add support to manually provide > >

[PATCH v2] vfio-pci: Mask cap zero

2020-05-05 Thread Alex Williamson
this one rather than delving into the potentially subtle dependencies within our map. Seen on an NVIDIA Tesla T4. Signed-off-by: Alex Williamson --- drivers/vfio/pci/vfio_pci_config.c |7 ++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/drivers/vfio/pci/vfio_pci_config.c b

[PATCH v2 2/3] vfio-pci: Fault mmaps to enable vma tracking

2020-05-05 Thread Alex Williamson
range so that all tracking is inserted in the fault handler and removed in the close handler. Signed-off-by: Alex Williamson --- drivers/vfio/pci/vfio_pci.c | 76 ++- drivers/vfio/pci/vfio_pci_private.h |7 +++ 2 files changed, 81 insertions(+), 2

[PATCH v2 3/3] vfio-pci: Invalidate mmaps and block MMIO access on disabled memory

2020-05-05 Thread Alex Williamson
to be compatible with known use cases and potentially provides better error handling capabilities than present in the hardware, while avoiding the more readily accessible and severe platform error responses that might otherwise occur. Signed-off-by: Alex Williamson --- drivers/vfio/pci/vfio_pci.c

[PATCH v2 0/3] vfio-pci: Block user access to disabled device MMIO

2020-05-05 Thread Alex Williamson
response to this condition. Thanks, Alex --- Alex Williamson (3): vfio/type1: Support faulting PFNMAP vmas vfio-pci: Fault mmaps to enable vma tracking vfio-pci: Invalidate mmaps and block MMIO access on disabled memory drivers/vfio/pci/vfio_pci.c | 321

[PATCH v2 1/3] vfio/type1: Support faulting PFNMAP vmas

2020-05-05 Thread Alex Williamson
With conversion to follow_pfn(), DMA mapping a PFNMAP range depends on the range being faulted into the vma. Add support to manually provide that, in the same way as done on KVM with hva_to_pfn_remapped(). Signed-off-by: Alex Williamson --- drivers/vfio/vfio_iommu_type1.c | 36

Re: [PATCH 3/3] vfio-pci: Invalidate mmaps and block MMIO access on disabled memory

2020-05-05 Thread Alex Williamson
On Mon, 4 May 2020 17:01:23 -0300 Jason Gunthorpe wrote: > On Mon, May 04, 2020 at 01:35:52PM -0600, Alex Williamson wrote: > > > Ok, this all makes a lot more sense with memory_lock still in the > > picture. And it looks like you're not insisting on the wait_event

Re: [PATCH] iommu: Relax ACS requirement for RCiEP devices.

2020-05-05 Thread Alex Williamson
On Tue, 5 May 2020 07:56:06 -0700 "Raj, Ashok" wrote: > On Tue, May 05, 2020 at 08:05:14AM -0600, Alex Williamson wrote: > > On Mon, 4 May 2020 23:11:07 -0700 > > "Raj, Ashok" wrote: > > > > > Hi Alex > > > > > > + Joerg,

Re: [PATCH] iommu: Relax ACS requirement for RCiEP devices.

2020-05-05 Thread Alex Williamson
On Mon, 4 May 2020 23:11:07 -0700 "Raj, Ashok" wrote: > Hi Alex > > + Joerg, accidently missed in the Cc. > > On Mon, May 04, 2020 at 11:19:36PM -0600, Alex Williamson wrote: > > On Mon, 4 May 2020 21:42:16 -0700 > > Ashok Raj wrote: > >

Re: [PATCH] iommu: Relax ACS requirement for RCiEP devices.

2020-05-04 Thread Alex Williamson
. > > Fixes: f096c061f552 ("iommu: Rework iommu_group_get_for_pci_dev()") > Signed-off-by: Ashok Raj > To: Joerg Roedel > To: Bjorn Helgaas > Cc: linux-kernel@vger.kernel.org > Cc: io...@lists.linux-foundation.org > Cc: Lu Baolu > Cc: Alex Williamson

Re: [PATCH] vfio-pci: Mask cap zero

2020-05-04 Thread Alex Williamson
On Mon, 4 May 2020 15:08:08 -0700 Neo Jia wrote: > On Mon, May 04, 2020 at 12:52:53PM -0600, Alex Williamson wrote: > > External email: Use caution opening links or attachments > > > > > > On Mon, 4 May 2020 18:09:16 +0200 > > Cornelia Huck wrote: > >

Re: [PATCH 3/3] vfio-pci: Invalidate mmaps and block MMIO access on disabled memory

2020-05-04 Thread Alex Williamson
On Mon, 4 May 2020 15:44:36 -0300 Jason Gunthorpe wrote: > On Mon, May 04, 2020 at 12:26:43PM -0600, Alex Williamson wrote: > > On Fri, 1 May 2020 20:48:49 -0300 > > Jason Gunthorpe wrote: > > > > > On Fri, May 01, 2020 at 03:39:30PM -0600, Alex Williamson wrote

Re: [PATCH] vfio-pci: Mask cap zero

2020-05-04 Thread Alex Williamson
On Mon, 4 May 2020 18:09:16 +0200 Cornelia Huck wrote: > On Fri, 01 May 2020 15:41:24 -0600 > Alex Williamson wrote: > > > There is no PCI spec defined capability with ID 0, therefore we don't > > expect to find it in a capability chain and we use this index in

Re: [PATCH 3/3] vfio-pci: Invalidate mmaps and block MMIO access on disabled memory

2020-05-04 Thread Alex Williamson
On Fri, 1 May 2020 20:48:49 -0300 Jason Gunthorpe wrote: > On Fri, May 01, 2020 at 03:39:30PM -0600, Alex Williamson wrote: > > > static int vfio_pci_add_vma(struct vfio_pci_device *vdev, > > struct vm_area_struct *vma) > > { > >

Re: [PATCH 2/3] vfio-pci: Fault mmaps to enable vma tracking

2020-05-04 Thread Alex Williamson
On Mon, 4 May 2020 12:05:56 -0300 Jason Gunthorpe wrote: > On Mon, May 04, 2020 at 08:20:55AM -0600, Alex Williamson wrote: > > On Fri, 1 May 2020 20:25:50 -0300 > > Jason Gunthorpe wrote: > > > > > On Fri, May 01, 2020 at 03:39:19PM -0600, Alex Williamso

Re: [PATCH 2/3] vfio-pci: Fault mmaps to enable vma tracking

2020-05-04 Thread Alex Williamson
On Fri, 1 May 2020 20:25:50 -0300 Jason Gunthorpe wrote: > On Fri, May 01, 2020 at 03:39:19PM -0600, Alex Williamson wrote: > > Rather than calling remap_pfn_range() when a region is mmap'd, setup > > a vm_ops handler to support dynamic faulting of the range on access. >

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