RE: [PATCH v1 1/8] vfio: Add VFIO_IOMMU_PASID_REQUEST(alloc/free)

2020-04-02 Thread Tian, Kevin
> From: Alex Williamson > Sent: Friday, April 3, 2020 1:50 AM > > On Sun, 22 Mar 2020 05:31:58 -0700 > "Liu, Yi L" wrote: > > > From: Liu Yi L > > > > For a long time, devices have only one DMA address space from platform > > IOMMU's point of view. This is true for both bare metal and

[RFC PATCH v4] iommu/virtio: Use page size bitmap supported by endpoint

2020-04-02 Thread Bharat Bhushan
Different endpoint can support different page size, probe endpoint if it supports specific page size otherwise use global page sizes. Signed-off-by: Bharat Bhushan --- v3->v4: - Fix whitespace error v2->v3: - Fixed error return for incompatible endpoint - __u64 changed to __le64 in header

[RFC PATCH v3] iommu/virtio: Use page size bitmap supported by endpoint

2020-04-02 Thread Bharat Bhushan
Different endpoint can support different page size, probe endpoint if it supports specific page size otherwise use global page sizes. Signed-off-by: Bharat Bhushan --- drivers/iommu/virtio-iommu.c | 54 +++ include/uapi/linux/virtio_iommu.h | 7 2 files

Re: [PATCH v1 2/2] vfio/pci: Emulate PASID/PRI capability for VFs

2020-04-02 Thread Alex Williamson
On Sun, 22 Mar 2020 05:33:14 -0700 "Liu, Yi L" wrote: > From: Liu Yi L > > Per PCIe r5.0, sec 9.3.7.14, if a PF implements the PASID Capability, the > PF PASID configuration is shared by its VFs. VFs must not implement their > own PASID Capability. > > Per PCIe r5.0, sec 9.3.7.11, VFs must

Re: [PATCH v1 8/8] vfio/type1: Add vSVA support for IOMMU-backed mdevs

2020-04-02 Thread Alex Williamson
On Sun, 22 Mar 2020 05:32:05 -0700 "Liu, Yi L" wrote: > From: Liu Yi L > > Recent years, mediated device pass-through framework (e.g. vfio-mdev) > are used to achieve flexible device sharing across domains (e.g. VMs). > Also there are hardware assisted mediated pass-through solutions from >

Re: [PATCH v1 7/8] vfio/type1: Add VFIO_IOMMU_CACHE_INVALIDATE

2020-04-02 Thread Alex Williamson
On Sun, 22 Mar 2020 05:32:04 -0700 "Liu, Yi L" wrote: > From: Liu Yi L > > For VFIO IOMMUs with the type VFIO_TYPE1_NESTING_IOMMU, guest "owns" the > first-level/stage-1 translation structures, the host IOMMU driver has no > knowledge of first-level/stage-1 structure cache updates unless the

Re: [PATCH V10 11/11] iommu/vt-d: Add custom allocator for IOASID

2020-04-02 Thread Jacob Pan
On Thu, 2 Apr 2020 02:18:45 + "Tian, Kevin" wrote: > > From: Jacob Pan > > Sent: Wednesday, April 1, 2020 11:48 PM > > > > On Sat, 28 Mar 2020 10:22:41 + > > "Tian, Kevin" wrote: > > > > > > From: Jacob Pan > > > > Sent: Saturday, March 21, 2020 7:28 AM > > > > > > > > When VT-d

Re: [PATCH v1 6/8] vfio/type1: Bind guest page tables to host

2020-04-02 Thread Alex Williamson
On Sun, 22 Mar 2020 05:32:03 -0700 "Liu, Yi L" wrote: > From: Liu Yi L > > VFIO_TYPE1_NESTING_IOMMU is an IOMMU type which is backed by hardware > IOMMUs that have nesting DMA translation (a.k.a dual stage address > translation). For such hardware IOMMUs, there are two stages/levels of >

Re: [PATCH v1 5/8] vfio/type1: Report 1st-level/stage-1 format to userspace

2020-04-02 Thread Alex Williamson
On Sun, 22 Mar 2020 05:32:02 -0700 "Liu, Yi L" wrote: > From: Liu Yi L > > VFIO exposes IOMMU nesting translation (a.k.a dual stage translation) > capability to userspace. Thus applications like QEMU could support > vIOMMU with hardware's nesting translation capability for pass-through >

Re: [PATCH v2 1/3] iommu/uapi: Define uapi version and capabilities

2020-04-02 Thread Jacob Pan
On Wed, 1 Apr 2020 05:32:21 + "Tian, Kevin" wrote: > > From: Jacob Pan > > Sent: Tuesday, March 31, 2020 11:55 PM > > > > On Tue, 31 Mar 2020 06:06:38 + > > "Tian, Kevin" wrote: > > > > > > From: Jacob Pan > > > > Sent: Tuesday, March 31, 2020 12:08 AM > > > > > > > > On Mon, 30

Re: [PATCH v1 3/8] vfio/type1: Report PASID alloc/free support to userspace

2020-04-02 Thread Alex Williamson
On Sun, 22 Mar 2020 05:32:00 -0700 "Liu, Yi L" wrote: > From: Liu Yi L > > This patch reports PASID alloc/free availability to userspace (e.g. QEMU) > thus userspace could do a pre-check before utilizing this feature. > > Cc: Kevin Tian > CC: Jacob Pan > Cc: Alex Williamson > Cc: Eric

Re: [PATCH v1 2/8] vfio/type1: Add vfio_iommu_type1 parameter for quota tuning

2020-04-02 Thread Alex Williamson
On Mon, 30 Mar 2020 11:44:08 + "Tian, Kevin" wrote: > > From: Liu, Yi L > > Sent: Monday, March 30, 2020 5:27 PM > > > > > From: Tian, Kevin > > > Sent: Monday, March 30, 2020 5:20 PM > > > To: Liu, Yi L ; alex.william...@redhat.com; > > > Subject: RE: [PATCH v1 2/8] vfio/type1: Add

Re: [PATCH v1 1/8] vfio: Add VFIO_IOMMU_PASID_REQUEST(alloc/free)

2020-04-02 Thread Alex Williamson
On Sun, 22 Mar 2020 05:31:58 -0700 "Liu, Yi L" wrote: > From: Liu Yi L > > For a long time, devices have only one DMA address space from platform > IOMMU's point of view. This is true for both bare metal and directed- > access in virtualization environment. Reason is the source ID of DMA in >

Re: How to fix WARN from drivers/base/dd.c in next-20200401 if CONFIG_MODULES=y?

2020-04-02 Thread John Stultz
On Thu, Apr 2, 2020 at 3:17 AM Yoshihiro Shimoda wrote: > > I found an issue after applied the following patches: > --- > 64c775f driver core: Rename deferred_probe_timeout and make it global > 0e9f8d0 driver core: Remove driver_deferred_probe_check_state_continue() > bec6c0e pinctrl: Remove use

Re: [PATCH 00/10] IOASID extensions for guest SVA

2020-04-02 Thread Jacob Pan
On Thu, 2 Apr 2020 14:26:33 +0200 Jean-Philippe Brucker wrote: > On Wed, Apr 01, 2020 at 04:38:42PM -0700, Jacob Pan wrote: > > On Wed, 1 Apr 2020 16:03:01 +0200 > > Jean-Philippe Brucker wrote: > > > > > Hi Jacob, > > > > > > On Wed, Mar 25, 2020 at 10:55:21AM -0700, Jacob Pan wrote: > >

Re: [PATCH V10 08/11] iommu/vt-d: Add svm/sva invalidate function

2020-04-02 Thread Jacob Pan
On Wed, 1 Apr 2020 09:32:37 +0200 Auger Eric wrote: > > I didn’t read through all comments. Here is a concern with this 2-D > > table, the iommu cache type is defined as below. I suppose there is > > a problem here. If I'm using IOMMU_CACHE_INV_TYPE_PASID, it will > > beyond the 2-D table. > >

[PATCH] iommu: Fix the memory leak in dev_iommu_free()

2020-04-02 Thread Kevin Hao
In iommu_probe_device(), we would invoke dev_iommu_free() to free the dev->iommu after the ->add_device() returns failure. But after commit 72acd9df18f1 ("iommu: Move iommu_fwspec to struct dev_iommu"), we also need to free the iommu_fwspec before the dev->iommu is freed. This fixes the following

[PATCH] iommu/qcom:fix local_base status check

2020-04-02 Thread Tang Bin
Release resources when exiting on error. Signed-off-by: Tang Bin --- drivers/iommu/qcom_iommu.c | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/iommu/qcom_iommu.c b/drivers/iommu/qcom_iommu.c index 4328da0b0..c08aa9651 100644 --- a/drivers/iommu/qcom_iommu.c +++

Re: [PATCH v1 1/8] vfio: Add VFIO_IOMMU_PASID_REQUEST(alloc/free)

2020-04-02 Thread Jean-Philippe Brucker
Hi Yi, On Sun, Mar 22, 2020 at 05:31:58AM -0700, Liu, Yi L wrote: > From: Liu Yi L > > For a long time, devices have only one DMA address space from platform > IOMMU's point of view. This is true for both bare metal and directed- > access in virtualization environment. Reason is the source ID

Re: How to fix WARN from drivers/base/dd.c in next-20200401 if CONFIG_MODULES=y?

2020-04-02 Thread Robin Murphy
On 2020-04-02 11:16 am, Yoshihiro Shimoda wrote: Hi John, I found an issue after applied the following patches: --- 64c775f driver core: Rename deferred_probe_timeout and make it global 0e9f8d0 driver core: Remove driver_deferred_probe_check_state_continue() bec6c0e pinctrl: Remove use of

Re: [PATCH 00/10] IOASID extensions for guest SVA

2020-04-02 Thread Jean-Philippe Brucker
On Wed, Apr 01, 2020 at 04:38:42PM -0700, Jacob Pan wrote: > On Wed, 1 Apr 2020 16:03:01 +0200 > Jean-Philippe Brucker wrote: > > > Hi Jacob, > > > > On Wed, Mar 25, 2020 at 10:55:21AM -0700, Jacob Pan wrote: > > > IOASID was introduced in v5.5 as a generic kernel allocator service > > > for

How to fix WARN from drivers/base/dd.c in next-20200401 if CONFIG_MODULES=y?

2020-04-02 Thread Yoshihiro Shimoda
Hi John, I found an issue after applied the following patches: --- 64c775f driver core: Rename deferred_probe_timeout and make it global 0e9f8d0 driver core: Remove driver_deferred_probe_check_state_continue() bec6c0e pinctrl: Remove use of driver_deferred_probe_check_state_continue() e2cec7d

Re: [EXT] Re: [RFC PATCH v2] iommu/virtio: Use page size bitmap supported by endpoint

2020-04-02 Thread Jean-Philippe Brucker
On Thu, Apr 02, 2020 at 03:53:40AM +, Bharat Bhushan wrote: > > > > +struct virtio_iommu_probe_pgsize_mask { > > > > + struct virtio_iommu_probe_property head; > > > > + __u8reserved[4]; > > > > + __u64

RE: [PATCH v1 6/8] vfio/type1: Bind guest page tables to host

2020-04-02 Thread Liu, Yi L
> From: Tian, Kevin > Sent: Thursday, April 2, 2020 10:12 AM > To: Liu, Yi L ; alex.william...@redhat.com; > Subject: RE: [PATCH v1 6/8] vfio/type1: Bind guest page tables to host > > > From: Liu, Yi L > > Sent: Wednesday, April 1, 2020 5:13 PM > > > > > From: Tian, Kevin > > > Sent: Monday,

Re: [PATCH] iommu/vt-d: add NUMA awareness to intel_alloc_coherent()

2020-04-02 Thread Christoph Hellwig
On Wed, Apr 01, 2020 at 03:53:38PM -0700, Eric Dumazet wrote: > > > On 2/2/18 10:59 AM, Eric Dumazet wrote: > > On Fri, Feb 2, 2018 at 10:53 AM, Christoph Hellwig > > wrote: > >> I've got patches pending to replace all that code with > >> dma_direct_alloc, which will do the right thing. They

Re: [PATCH] iommu/qcom:fix local_base status check

2020-04-02 Thread Bjorn Andersson
On Wed 01 Apr 23:33 PDT 2020, Tang Bin wrote: > Release resources when exiting on error. > Reviewed-by: Bjorn Andersson Regards, Bjorn > Signed-off-by: Tang Bin > --- > drivers/iommu/qcom_iommu.c | 5 - > 1 file changed, 4 insertions(+), 1 deletion(-) > > diff --git