[PATCH v3] dt-bindings: iommu: renesas, ipmmu-vmsa: convert to json-schema

2020-04-16 Thread Yoshihiro Shimoda
Convert Renesas VMSA-Compatible IOMMU bindings documentation to json-schema. Note that original documentation doesn't mention renesas,ipmmu-vmsa for R-Mobile APE6. But, R-Mobile APE6 is similar to the R-Car Gen2. So, renesas,ipmmu-r8a73a4 belongs the renesas,ipmmu-vmsa section. Signed-off-by:

Re: [PATCH v2 5/7] iommu/vt-d: Save prq descriptors in an internal list

2020-04-16 Thread Lu Baolu
Hi Kevin, On 2020/4/16 9:46, Lu Baolu wrote: On 2020/4/15 17:30, Tian, Kevin wrote: From: Lu Baolu Sent: Wednesday, April 15, 2020 1:26 PM Currently, the page request interrupt thread handles the page requests in the queue in this way: - Clear PPR bit to ensure new interrupt could come in; -

RE: [PATCH v11 05/10] iommu/vt-d: Add bind guest PASID support

2020-04-16 Thread Tian, Kevin
> From: Auger Eric > Sent: Thursday, April 16, 2020 6:43 PM > [...] > >>> + if (svm) { > >>> + /* > >>> + * If we found svm for the PASID, there must be at > >>> + * least one device bond, otherwise svm should be > >>> freed. > >>> + */ > >>> + if

RE: [PATCH v2 6/7] iommu/vt-d: Add page request draining support

2020-04-16 Thread Tian, Kevin
> From: Lu Baolu > Sent: Thursday, April 16, 2020 4:38 PM > > Hi Kevin, > > On 2020/4/15 19:10, Tian, Kevin wrote: > > the completion of above sequence ensures that previous queued > > page group responses are sent out and received by the endpoint > > and vice versa all in-fly page requests

Re: [RFC PATCH] iommu/amd: fix a race in fetch_pte()

2020-04-16 Thread Qian Cai
> On Apr 13, 2020, at 9:36 PM, Qian Cai wrote: > > > >> On Apr 8, 2020, at 10:19 AM, Joerg Roedel wrote: >> >> Hi Qian, >> >> On Tue, Apr 07, 2020 at 11:36:05AM -0400, Qian Cai wrote: >>> After further testing, the change along is insufficient. What I am chasing >>> right >>> now is the

Re: [PATCH v1 0/2] vfio/pci: expose device's PASID capability to VMs

2020-04-16 Thread Yan Zhao
On Fri, Apr 17, 2020 at 06:33:54AM +0800, Raj, Ashok wrote: > Hi Zhao > > > On Thu, Apr 16, 2020 at 06:12:26PM -0400, Yan Zhao wrote: > > On Tue, Mar 31, 2020 at 03:08:25PM +0800, Lu, Baolu wrote: > > > On 2020/3/31 14:35, Tian, Kevin wrote: > > > >> From: Liu, Yi L > > > >> Sent: Sunday, March

Re: [PATCH v2 00/33] iommu: Move iommu_group setup to IOMMU core code

2020-04-16 Thread Derrick, Jonathan
Hi Daniel, On Fri, 2020-04-17 at 09:03 +0800, Daniel Drake wrote: > Hi Joerg, > > > Hi, > > > > here is the second version of this patch-set. The first version with > > some more introductory text can be found here: > > > >

Re: [PATCH v2 00/33] iommu: Move iommu_group setup to IOMMU core code

2020-04-16 Thread Daniel Drake
Hi Joerg, > Hi, > > here is the second version of this patch-set. The first version with > some more introductory text can be found here: > > https://lore.kernel.org/lkml/20200407183742.4344-1-j...@8bytes.org/ Thanks for the continued improvements in this area! I may have spotted a

Re: [PATCH v1 0/2] vfio/pci: expose device's PASID capability to VMs

2020-04-16 Thread Yan Zhao
On Tue, Mar 31, 2020 at 03:08:25PM +0800, Lu, Baolu wrote: > On 2020/3/31 14:35, Tian, Kevin wrote: > >> From: Liu, Yi L > >> Sent: Sunday, March 22, 2020 8:33 PM > >> > >> From: Liu Yi L > >> > >> Shared Virtual Addressing (SVA), a.k.a, Shared Virtual Memory (SVM) on > >> Intel platforms allows

Re: [PATCH v1 0/2] vfio/pci: expose device's PASID capability to VMs

2020-04-16 Thread Raj, Ashok
Hi Zhao On Thu, Apr 16, 2020 at 06:12:26PM -0400, Yan Zhao wrote: > On Tue, Mar 31, 2020 at 03:08:25PM +0800, Lu, Baolu wrote: > > On 2020/3/31 14:35, Tian, Kevin wrote: > > >> From: Liu, Yi L > > >> Sent: Sunday, March 22, 2020 8:33 PM > > >> > > >> From: Liu Yi L > > >> > > >> Shared Virtual

Re: [PATCH 0/2] iommu: Remove iommu_sva_ops::mm_exit()

2020-04-16 Thread Jacob Pan
On Wed, 15 Apr 2020 09:47:36 +0200 Jean-Philippe Brucker wrote: > On Fri, Apr 10, 2020 at 08:52:49AM -0700, Jacob Pan wrote: > > On Thu, 9 Apr 2020 16:50:58 +0200 > > Jean-Philippe Brucker wrote: > > > > > > So unbind is coming anyway, the difference in handling in mmu > > > > release

Re: [PATCH 11/29] mm: only allow page table mappings for built-in zsmalloc

2020-04-16 Thread Minchan Kim
On Tue, Apr 14, 2020 at 03:13:30PM +0200, Christoph Hellwig wrote: > This allows to unexport map_vm_area and unmap_kernel_range, which are > rather deep internal and should not be available to modules, as they for > example allow fine grained control of mapping permissions, and also > allow

Re: [PATCH 10/28] mm: only allow page table mappings for built-in zsmalloc

2020-04-16 Thread Minchan Kim
Hi Christoph, Sorry for the late. On Sat, Apr 11, 2020 at 09:20:52AM +0200, Christoph Hellwig wrote: > Hi Minchan, > > On Fri, Apr 10, 2020 at 04:11:36PM -0700, Minchan Kim wrote: > > It doesn't mean we couldn't use zsmalloc as module any longer. It means > > we couldn't use zsmalloc as module

Re: [PATCH 2/2] iommu/arm-smmu: Allow client devices to select direct mapping

2020-04-16 Thread Sai Prakash Ranjan
Hi Robin, On 2020-04-16 22:47, Robin Murphy wrote: On 2020-04-16 5:23 pm, Sai Prakash Ranjan wrote: Hi Robin, On 2020-04-16 19:28, Robin Murphy wrote: On 2020-01-22 11:48 am, Sai Prakash Ranjan wrote: From: Jordan Crouse Some client devices want to directly map the IOMMU themselves

Re: [PATCH 2/2] iommu/arm-smmu: Allow client devices to select direct mapping

2020-04-16 Thread Robin Murphy
On 2020-04-16 5:23 pm, Sai Prakash Ranjan wrote: Hi Robin, On 2020-04-16 19:28, Robin Murphy wrote: On 2020-01-22 11:48 am, Sai Prakash Ranjan wrote: From: Jordan Crouse Some client devices want to directly map the IOMMU themselves instead of using the DMA domain. Allow those devices to opt

Re: [PATCH 2/2] iommu/arm-smmu: Allow client devices to select direct mapping

2020-04-16 Thread Sai Prakash Ranjan
Hi Robin, On 2020-04-16 19:28, Robin Murphy wrote: On 2020-01-22 11:48 am, Sai Prakash Ranjan wrote: From: Jordan Crouse Some client devices want to directly map the IOMMU themselves instead of using the DMA domain. Allow those devices to opt in to direct mapping by way of a list of

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

2020-04-16 Thread Auger Eric
Hi Kevin, On 4/16/20 3:28 PM, Tian, Kevin wrote: >> From: Auger Eric >> Sent: Thursday, April 16, 2020 8:43 PM >> >> Hi Kevin, >> On 4/16/20 2:09 PM, Tian, Kevin wrote: From: Liu, Yi L Sent: Thursday, April 16, 2020 6:40 PM Hi Alex, Still have a direction question with

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

2020-04-16 Thread Alex Williamson
On Thu, 16 Apr 2020 08:40:31 -0600 Alex Williamson wrote: > On Thu, 16 Apr 2020 10:40:03 + > "Liu, Yi L" wrote: > > > Hi Alex, > > Still have a direction question with you. Better get agreement with you > > before heading forward. > > > > > From: Alex Williamson > > > Sent: Friday,

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

2020-04-16 Thread Alex Williamson
On Thu, 16 Apr 2020 10:40:03 + "Liu, Yi L" wrote: > Hi Alex, > Still have a direction question with you. Better get agreement with you > before heading forward. > > > From: Alex Williamson > > Sent: Friday, April 3, 2020 11:35 PM > [...] > > > > > + * > > > > > + * returns: 0 on success,

Re: [RFC PATCH 1/4] bus: fsl-mc: add custom .dma_configure implementation

2020-04-16 Thread Laurentiu Tudor
On 4/15/2020 7:04 PM, Lorenzo Pieralisi wrote: > On Wed, Apr 15, 2020 at 06:44:37PM +0300, Laurentiu Tudor wrote: >> >> >> On 4/14/2020 5:32 PM, Lorenzo Pieralisi wrote: >>> On Wed, Mar 25, 2020 at 06:48:55PM +0200, Laurentiu Tudor wrote: Hi Lorenzo, On 3/25/2020 2:51 PM, Lorenzo

Re: [PATCH 2/2] iommu/arm-smmu: Allow client devices to select direct mapping

2020-04-16 Thread Robin Murphy
On 2020-01-22 11:48 am, Sai Prakash Ranjan wrote: From: Jordan Crouse Some client devices want to directly map the IOMMU themselves instead of using the DMA domain. Allow those devices to opt in to direct mapping by way of a list of compatible strings. Signed-off-by: Jordan Crouse

Re: [PATCH 1/2] iommu: arm-smmu-impl: Convert to a generic reset implementation

2020-04-16 Thread Robin Murphy
On 2020-01-22 11:48 am, Sai Prakash Ranjan wrote: Currently the QCOM specific smmu reset implementation is very specific to SDM845 SoC and has a wait-for-safe logic which may not be required for other SoCs. So move the SDM845 specific logic to its specific reset function. Also add SC7180 SMMU

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

2020-04-16 Thread Tian, Kevin
> From: Auger Eric > Sent: Thursday, April 16, 2020 8:43 PM > > Hi Kevin, > On 4/16/20 2:09 PM, Tian, Kevin wrote: > >> From: Liu, Yi L > >> Sent: Thursday, April 16, 2020 6:40 PM > >> > >> Hi Alex, > >> Still have a direction question with you. Better get agreement with you > >> before heading

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

2020-04-16 Thread Auger Eric
Hi Kevin, On 4/16/20 2:09 PM, Tian, Kevin wrote: >> From: Liu, Yi L >> Sent: Thursday, April 16, 2020 6:40 PM >> >> Hi Alex, >> Still have a direction question with you. Better get agreement with you >> before heading forward. >> >>> From: Alex Williamson >>> Sent: Friday, April 3, 2020 11:35 PM

Re: [PATCH v5 02/25] iommu/sva: Manage process address spaces

2020-04-16 Thread Christoph Hellwig
On Thu, Apr 16, 2020 at 10:54:02AM +0200, Jean-Philippe Brucker wrote: > On Thu, Apr 16, 2020 at 12:28:52AM -0700, Christoph Hellwig wrote: > > > + rcu_read_lock(); > > > + hlist_for_each_entry_rcu(bond, _mm->devices, mm_node) > > > + io_mm->ops->invalidate(bond->sva.dev, io_mm->pasid,

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

2020-04-16 Thread Tian, Kevin
> From: Liu, Yi L > Sent: Thursday, April 16, 2020 6:40 PM > > Hi Alex, > Still have a direction question with you. Better get agreement with you > before heading forward. > > > From: Alex Williamson > > Sent: Friday, April 3, 2020 11:35 PM > [...] > > > > > + * > > > > > + * returns: 0 on

Re: [PATCH v2 00/33] iommu: Move iommu_group setup to IOMMU core code

2020-04-16 Thread Marek Szyprowski
Hi Joerg, On 14.04.2020 15:15, Joerg Roedel wrote: > here is the second version of this patch-set. The first version with > some more introductory text can be found here: > > https://lore.kernel.org/lkml/20200407183742.4344-1-j...@8bytes.org/ > > Changes v1->v2: > > * Rebased to

Re: [PATCH v11 07/10] iommu/vt-d: Add svm/sva invalidate function

2020-04-16 Thread Auger Eric
Hi Jacob, On 4/10/20 11:56 PM, Jacob Pan wrote: > On Thu, 9 Apr 2020 10:50:34 +0200 > Auger Eric wrote: > >> Hi Jacob, >> >> On 4/3/20 8:42 PM, Jacob Pan wrote: >>> When Shared Virtual Address (SVA) is enabled for a guest OS via >>> vIOMMU, we need to provide invalidation support at IOMMU API

Re: [PATCH v11 05/10] iommu/vt-d: Add bind guest PASID support

2020-04-16 Thread Auger Eric
Hi Jacob, On 4/10/20 11:06 PM, Jacob Pan wrote: > Hi Eric, > > Missed a few things in the last reply. > > On Thu, 9 Apr 2020 09:41:32 +0200 > Auger Eric wrote: > >>> + intel_pasid_tear_down_entry(iommu, dev, >>> svm->pasid); >> intel_svm_unbind_mm() calls

Re: [PATCH v11 05/10] iommu/vt-d: Add bind guest PASID support

2020-04-16 Thread Auger Eric
Hi Jacob, On 4/10/20 9:45 PM, Jacob Pan wrote: > Hi Eric, > > On Thu, 9 Apr 2020 09:41:32 +0200 > Auger Eric wrote: > >> Hi Jacob, >> >> On 4/3/20 8:42 PM, Jacob Pan wrote: >>> When supporting guest SVA with emulated IOMMU, the guest PASID >>> table is shadowed in VMM. Updates to guest vIOMMU

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

2020-04-16 Thread Liu, Yi L
Hi Alex, Still have a direction question with you. Better get agreement with you before heading forward. > From: Alex Williamson > Sent: Friday, April 3, 2020 11:35 PM [...] > > > > + * > > > > + * returns: 0 on success, -errno on failure. > > > > + */ > > > > +struct

RE: [PATCH] dt-bndings: iommu: renesas,ipmmu-vmsa: convert to json-schema

2020-04-16 Thread Yoshihiro Shimoda
Hi Geert-san, > From: Geert Uytterhoeven, Sent: Thursday, April 16, 2020 7:06 PM > > > > --- /dev/null > > > > +++ b/Documentation/devicetree/bindings/iommu/renesas,ipmmu-vmsa.yaml > > > > > + renesas,ipmmu-main: > > > > +$ref: /schemas/types.yaml#/definitions/phandle-array > > > > +

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

2020-04-16 Thread Tang Bin
On 2020/4/16 18:05, Robin Murphy wrote: On 2020-04-02 7:33 am, Tang Bin wrote: 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

Re: [PATCH] dt-bndings: iommu: renesas, ipmmu-vmsa: convert to json-schema

2020-04-16 Thread Geert Uytterhoeven
Hi Shimoda-san, On Thu, Apr 16, 2020 at 11:56 AM Yoshihiro Shimoda wrote: > > From: Geert Uytterhoeven, Sent: Wednesday, April 15, 2020 11:21 PM > > On Tue, Apr 14, 2020 at 2:26 AM Yoshihiro Shimoda > > wrote: > > > Convert Renesas VMSA-Compatible IOMMU bindings documentation > > > to

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

2020-04-16 Thread Robin Murphy
On 2020-04-02 7:33 am, Tang Bin wrote: 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

RE: [PATCH] dt-bndings: iommu: renesas,ipmmu-vmsa: convert to json-schema

2020-04-16 Thread Yoshihiro Shimoda
Hi Geert-san, Thank you for your review! > From: Geert Uytterhoeven, Sent: Wednesday, April 15, 2020 11:21 PM > > Hi Shimoda-san, > > On Tue, Apr 14, 2020 at 2:26 AM Yoshihiro Shimoda > wrote: > > Convert Renesas VMSA-Compatible IOMMU bindings documentation > > to json-schema. > > > >

[PATCH v2] of_device: removed #include that caused a recursion in included headers

2020-04-16 Thread Hadar Gat
Both of_platform.h and of_device.h were included each other. In of_device.h, removed unneeded #include to of_platform.h and added include to of_platform.h in the files that needs it. Signed-off-by: Hadar Gat --- v2: add include to of_platform.h in more files. (reported due other builds)

Re: [PATCH v5 02/25] iommu/sva: Manage process address spaces

2020-04-16 Thread Jean-Philippe Brucker
On Thu, Apr 16, 2020 at 12:28:52AM -0700, Christoph Hellwig wrote: > > + rcu_read_lock(); > > + hlist_for_each_entry_rcu(bond, _mm->devices, mm_node) > > + io_mm->ops->invalidate(bond->sva.dev, io_mm->pasid, io_mm->ctx, > > + start, end - start); > >

Re: [PATCH v2 6/7] iommu/vt-d: Add page request draining support

2020-04-16 Thread Lu Baolu
Hi Kevin, On 2020/4/15 19:10, Tian, Kevin wrote: the completion of above sequence ensures that previous queued page group responses are sent out and received by the endpoint and vice versa all in-fly page requests from the endpoint are queued in iommu page request queue. Then comes a problem -

Re: [PATCH v11 00/13] SMMUv3 Nested Stage Setup (IOMMU part)

2020-04-16 Thread Auger Eric
Hi Zhangfei, On 4/16/20 6:25 AM, Zhangfei Gao wrote: > > > On 2020/4/14 下午11:05, Eric Auger wrote: >> This version fixes an issue observed by Shameer on an SMMU 3.2, >> when moving from dual stage config to stage 1 only config. >> The 2 high 64b of the STE now get reset. Otherwise, leaving the

Re: [PATCH v3 1/3] iommu/vt-d: Allow 32bit devices to uses DMA domain

2020-04-16 Thread Lu Baolu
Hi Christoph, On 2020/4/16 15:01, Christoph Hellwig wrote: On Thu, Apr 16, 2020 at 02:23:52PM +0800, Lu Baolu wrote: Currently, if a 32bit device initially uses an identity domain, Intel IOMMU driver will convert it forcibly to a DMA one if its address capability is not enough for the whole

Re: [PATCH v5 02/25] iommu/sva: Manage process address spaces

2020-04-16 Thread Christoph Hellwig
> + rcu_read_lock(); > + hlist_for_each_entry_rcu(bond, _mm->devices, mm_node) > + io_mm->ops->invalidate(bond->sva.dev, io_mm->pasid, io_mm->ctx, > +start, end - start); > + rcu_read_unlock(); > +} What is the reason that the devices

Re: [PATCH v3 1/3] iommu/vt-d: Allow 32bit devices to uses DMA domain

2020-04-16 Thread Christoph Hellwig
On Thu, Apr 16, 2020 at 02:23:52PM +0800, Lu Baolu wrote: > Currently, if a 32bit device initially uses an identity domain, > Intel IOMMU driver will convert it forcibly to a DMA one if its > address capability is not enough for the whole system memory. > The motivation was to overcome the

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

2020-04-16 Thread Tang Bin
Hi Bjorn: On 2020/4/2 14:45, Bjorn Andersson wrote: On Wed 01 Apr 23:33 PDT 2020, Tang Bin wrote: Release resources when exiting on error. Reviewed-by: Bjorn Andersson Thanks for your positive feedback. I don't know whether the commit message affect this patch's result. If so, I think

[PATCH v3 1/3] iommu/vt-d: Allow 32bit devices to uses DMA domain

2020-04-16 Thread Lu Baolu
Currently, if a 32bit device initially uses an identity domain, Intel IOMMU driver will convert it forcibly to a DMA one if its address capability is not enough for the whole system memory. The motivation was to overcome the overhead caused by possible bounced buffer. Unfortunately, this

[PATCH v3 0/3] Replace private domain with per-group default domain

2020-04-16 Thread Lu Baolu
Some devices are required to use a specific type (identity or dma) of default domain when they are used with a vendor iommu. When the system level default domain type is different from it, the vendor iommu driver has to request a new default domain with either iommu_request_dma_domain_for_dev() or

[PATCH v3 2/3] iommu/vt-d: Allow PCI sub-hierarchy to use DMA domain

2020-04-16 Thread Lu Baolu
Before commit fa954e6831789 ("iommu/vt-d: Delegate the dma domain to upper layer"), Intel IOMMU started off with all devices in the identity domain, and took them out later if it found they couldn't access all of memory. This required devices behind a PCI bridge to use a DMA domain at the

[PATCH v3 3/3] iommu/vt-d: Apply per-device dma_ops

2020-04-16 Thread Lu Baolu
Current Intel IOMMU driver sets the system level dma_ops. This causes each dma API to go through the IOMMU driver even the devices are using identity mapped domains. This sets per-device dma_ops only if a device is using a DMA domain. Otherwise, use the default system level dma_ops for direct dma.