2019-10-02 21:35:03

by Jacob Pan

[permalink] [raw]
Subject: [PATCH v4 0/4] User API for nested shared virtual address (SVA)

This set consists of IOMMU APIs to support SVA in the guest, a.k.a nested
SVA. As the complete SVA support is complex, we break down the enabling
effort into three stages:
1. PCI device direct assignment
2. Fault handling, especially page request service support
3. Mediated device assignment

Each stage includes common API and vendor specific IOMMU driver changes. This
series is the common uAPI for stage #1. It is intended to build consensus on
the interface which all vendors reply on.

This series is extracted from the complete stage1 set which includes VT-d code.
https://lkml.org/lkml/2019/8/15/951

Changes:
- Use spinlock instead of mutex to protect ioasid custom allocators. This is
to support callers in atomic context
- Added more padding to guest PASID bind data for future extensions, suggested
by Joerg.
After much thinking, I did not do name change from PASID to IOASID in the uAPI,
considering we have been using PASID in the rest of uAPIs. IOASID will remain
used within the kernel.

For more discussions lead to this series, checkout LPC 2019 VFIO/IOMMU/PCI
microconference materials.
https://linuxplumbersconf.org/event/4/sessions/66/#20190909


Change log:
v4: - minor patch regroup and fixes based on review from Jean
v3: - include errno.h in ioasid.h to fix compile error
- rebased to v5.4-rc1, no change

v2:
- Addressed review comments by Jean on IOASID custom allocators, locking
fix, misc control flow fix.
- Fixed a compile error with missing header errno.h
- Updated Jean-Philiippe's new email and updateded reviewed-by tag

Jacob Pan (2):
iommu/ioasid: Add custom allocators
iommu: Introduce guest PASID bind function

Jean-Philippe Brucker (1):
iommu: Add I/O ASID allocator

Yi L Liu (1):
iommu: Introduce cache_invalidate API

drivers/iommu/Kconfig | 4 +
drivers/iommu/Makefile | 1 +
drivers/iommu/ioasid.c | 422 +++++++++++++++++++++++++++++++++++++++++++++
drivers/iommu/iommu.c | 30 ++++
include/linux/ioasid.h | 76 ++++++++
include/linux/iommu.h | 36 ++++
include/uapi/linux/iommu.h | 169 ++++++++++++++++++
7 files changed, 738 insertions(+)
create mode 100644 drivers/iommu/ioasid.c
create mode 100644 include/linux/ioasid.h

--
2.7.4


2019-10-07 19:38:31

by Jacob Pan

[permalink] [raw]
Subject: Re: [PATCH v4 0/4] User API for nested shared virtual address (SVA)

Hi Joerg and all,

Just wondering if you have more comments on this series.

Thanks,

Jacob

On Wed, 2 Oct 2019 12:42:39 -0700
Jacob Pan <[email protected]> wrote:

> This set consists of IOMMU APIs to support SVA in the guest, a.k.a
> nested SVA. As the complete SVA support is complex, we break down the
> enabling effort into three stages:
> 1. PCI device direct assignment
> 2. Fault handling, especially page request service support
> 3. Mediated device assignment
>
> Each stage includes common API and vendor specific IOMMU driver
> changes. This series is the common uAPI for stage #1. It is intended
> to build consensus on the interface which all vendors reply on.
>
> This series is extracted from the complete stage1 set which includes
> VT-d code. https://lkml.org/lkml/2019/8/15/951
>
> Changes:
> - Use spinlock instead of mutex to protect ioasid custom allocators.
> This is to support callers in atomic context
> - Added more padding to guest PASID bind data for future extensions,
> suggested by Joerg.
> After much thinking, I did not do name change from PASID to IOASID in
> the uAPI, considering we have been using PASID in the rest of uAPIs.
> IOASID will remain used within the kernel.
>
> For more discussions lead to this series, checkout LPC 2019
> VFIO/IOMMU/PCI microconference materials.
> https://linuxplumbersconf.org/event/4/sessions/66/#20190909
>
>
> Change log:
> v4: - minor patch regroup and fixes based on review from Jean
> v3: - include errno.h in ioasid.h to fix compile error
> - rebased to v5.4-rc1, no change
>
> v2:
> - Addressed review comments by Jean on IOASID custom
> allocators, locking fix, misc control flow fix.
> - Fixed a compile error with missing header errno.h
> - Updated Jean-Philiippe's new email and updateded
> reviewed-by tag
>
> Jacob Pan (2):
> iommu/ioasid: Add custom allocators
> iommu: Introduce guest PASID bind function
>
> Jean-Philippe Brucker (1):
> iommu: Add I/O ASID allocator
>
> Yi L Liu (1):
> iommu: Introduce cache_invalidate API
>
> drivers/iommu/Kconfig | 4 +
> drivers/iommu/Makefile | 1 +
> drivers/iommu/ioasid.c | 422
> +++++++++++++++++++++++++++++++++++++++++++++
> drivers/iommu/iommu.c | 30 ++++ include/linux/ioasid.h |
> 76 ++++++++ include/linux/iommu.h | 36 ++++
> include/uapi/linux/iommu.h | 169 ++++++++++++++++++
> 7 files changed, 738 insertions(+)
> create mode 100644 drivers/iommu/ioasid.c
> create mode 100644 include/linux/ioasid.h
>

[Jacob Pan]

2019-10-14 17:18:53

by Jacob Pan

[permalink] [raw]
Subject: Re: [PATCH v4 0/4] User API for nested shared virtual address (SVA)

Hi Joerg,

Just another gentle reminder. I think we have reached consensus in this
common code. Jean and Eric can confirm.

Thanks,

Jacob

On Mon, 7 Oct 2019 12:39:12 -0700
Jacob Pan <[email protected]> wrote:

> Hi Joerg and all,
>
> Just wondering if you have more comments on this series.
>
> Thanks,
>
> Jacob
>
> On Wed, 2 Oct 2019 12:42:39 -0700
> Jacob Pan <[email protected]> wrote:
>
> > This set consists of IOMMU APIs to support SVA in the guest, a.k.a
> > nested SVA. As the complete SVA support is complex, we break down
> > the enabling effort into three stages:
> > 1. PCI device direct assignment
> > 2. Fault handling, especially page request service support
> > 3. Mediated device assignment
> >
> > Each stage includes common API and vendor specific IOMMU driver
> > changes. This series is the common uAPI for stage #1. It is intended
> > to build consensus on the interface which all vendors reply on.
> >
> > This series is extracted from the complete stage1 set which includes
> > VT-d code. https://lkml.org/lkml/2019/8/15/951
> >
> > Changes:
> > - Use spinlock instead of mutex to protect ioasid custom
> > allocators. This is to support callers in atomic context
> > - Added more padding to guest PASID bind data for future
> > extensions, suggested by Joerg.
> > After much thinking, I did not do name change from PASID to IOASID
> > in the uAPI, considering we have been using PASID in the rest of
> > uAPIs. IOASID will remain used within the kernel.
> >
> > For more discussions lead to this series, checkout LPC 2019
> > VFIO/IOMMU/PCI microconference materials.
> > https://linuxplumbersconf.org/event/4/sessions/66/#20190909
> >
> >
> > Change log:
> > v4: - minor patch regroup and fixes based on review from Jean
> > v3: - include errno.h in ioasid.h to fix compile error
> > - rebased to v5.4-rc1, no change
> >
> > v2:
> > - Addressed review comments by Jean on IOASID custom
> > allocators, locking fix, misc control flow fix.
> > - Fixed a compile error with missing header errno.h
> > - Updated Jean-Philiippe's new email and updateded
> > reviewed-by tag
> >
> > Jacob Pan (2):
> > iommu/ioasid: Add custom allocators
> > iommu: Introduce guest PASID bind function
> >
> > Jean-Philippe Brucker (1):
> > iommu: Add I/O ASID allocator
> >
> > Yi L Liu (1):
> > iommu: Introduce cache_invalidate API
> >
> > drivers/iommu/Kconfig | 4 +
> > drivers/iommu/Makefile | 1 +
> > drivers/iommu/ioasid.c | 422
> > +++++++++++++++++++++++++++++++++++++++++++++
> > drivers/iommu/iommu.c | 30 ++++ include/linux/ioasid.h |
> > 76 ++++++++ include/linux/iommu.h | 36 ++++
> > include/uapi/linux/iommu.h | 169 ++++++++++++++++++
> > 7 files changed, 738 insertions(+)
> > create mode 100644 drivers/iommu/ioasid.c
> > create mode 100644 include/linux/ioasid.h
> >
>
> [Jacob Pan]

[Jacob Pan]

2019-10-15 10:51:19

by Jean-Philippe Brucker

[permalink] [raw]
Subject: Re: [PATCH v4 0/4] User API for nested shared virtual address (SVA)

On Mon, Oct 14, 2019 at 10:14:05AM -0700, Jacob Pan wrote:
> Hi Joerg,
>
> Just another gentle reminder. I think we have reached consensus in this
> common code. Jean and Eric can confirm.

Yes for the whole series

Reviewed-by: Jean-Philippe Brucker <[email protected]>

2019-10-15 11:13:19

by Eric Auger

[permalink] [raw]
Subject: Re: [PATCH v4 0/4] User API for nested shared virtual address (SVA)

Hi,

On 10/2/19 9:42 PM, Jacob Pan wrote:
> This set consists of IOMMU APIs to support SVA in the guest, a.k.a nested
> SVA. As the complete SVA support is complex, we break down the enabling
> effort into three stages:
> 1. PCI device direct assignment
> 2. Fault handling, especially page request service support
> 3. Mediated device assignment
>
> Each stage includes common API and vendor specific IOMMU driver changes. This
> series is the common uAPI for stage #1. It is intended to build consensus on
> the interface which all vendors reply on.
>
> This series is extracted from the complete stage1 set which includes VT-d code.
> https://lkml.org/lkml/2019/8/15/951
>
> Changes:
> - Use spinlock instead of mutex to protect ioasid custom allocators. This is
> to support callers in atomic context
> - Added more padding to guest PASID bind data for future extensions, suggested
> by Joerg.
> After much thinking, I did not do name change from PASID to IOASID in the uAPI,
> considering we have been using PASID in the rest of uAPIs. IOASID will remain
> used within the kernel.
>
> For more discussions lead to this series, checkout LPC 2019 VFIO/IOMMU/PCI
> microconference materials.
> https://linuxplumbersconf.org/event/4/sessions/66/#20190909
>
>
> Change log:
> v4: - minor patch regroup and fixes based on review from Jean
> v3: - include errno.h in ioasid.h to fix compile error
> - rebased to v5.4-rc1, no change
>
> v2:
> - Addressed review comments by Jean on IOASID custom allocators, locking
> fix, misc control flow fix.
> - Fixed a compile error with missing header errno.h
> - Updated Jean-Philiippe's new email and updateded reviewed-by tag
>
> Jacob Pan (2):
> iommu/ioasid: Add custom allocators
> iommu: Introduce guest PASID bind function
>
> Jean-Philippe Brucker (1):
> iommu: Add I/O ASID allocator
>
> Yi L Liu (1):
> iommu: Introduce cache_invalidate API
>
> drivers/iommu/Kconfig | 4 +
> drivers/iommu/Makefile | 1 +
> drivers/iommu/ioasid.c | 422 +++++++++++++++++++++++++++++++++++++++++++++
> drivers/iommu/iommu.c | 30 ++++
> include/linux/ioasid.h | 76 ++++++++
> include/linux/iommu.h | 36 ++++
> include/uapi/linux/iommu.h | 169 ++++++++++++++++++
> 7 files changed, 738 insertions(+)
> create mode 100644 drivers/iommu/ioasid.c
> create mode 100644 include/linux/ioasid.h

For the whole series,
Reviewed-by: Eric Auger <[email protected]>

Thanks

Eric

>

2019-10-15 12:13:40

by Joerg Roedel

[permalink] [raw]
Subject: Re: [PATCH v4 0/4] User API for nested shared virtual address (SVA)

On Wed, Oct 02, 2019 at 12:42:39PM -0700, Jacob Pan wrote:
> Jacob Pan (2):
> iommu/ioasid: Add custom allocators
> iommu: Introduce guest PASID bind function
>
> Jean-Philippe Brucker (1):
> iommu: Add I/O ASID allocator
>
> Yi L Liu (1):
> iommu: Introduce cache_invalidate API
>
> drivers/iommu/Kconfig | 4 +
> drivers/iommu/Makefile | 1 +
> drivers/iommu/ioasid.c | 422 +++++++++++++++++++++++++++++++++++++++++++++
> drivers/iommu/iommu.c | 30 ++++
> include/linux/ioasid.h | 76 ++++++++
> include/linux/iommu.h | 36 ++++
> include/uapi/linux/iommu.h | 169 ++++++++++++++++++
> 7 files changed, 738 insertions(+)
> create mode 100644 drivers/iommu/ioasid.c
> create mode 100644 include/linux/ioasid.h

Applied for v5.5, thanks everyone who worked on this!