Re: [RFC PATCH v3 1/2] iommu: Add capability IOMMU_CAP_VIOMMU

2021-01-14 Thread Leon Romanovsky
On Fri, Jan 15, 2021 at 07:49:47AM +0800, Lu Baolu wrote: > Hi Leon, > > On 1/14/21 9:26 PM, Leon Romanovsky wrote: > > On Thu, Jan 14, 2021 at 09:30:02AM +0800, Lu Baolu wrote: > > > Some vendor IOMMU drivers are able to declare that it is running in a VM > > > context. This is very valuable for t

Re: [PATCH v6 06/33] of/device: Move dma_range_map before of_iommu_configure

2021-01-14 Thread Yong Wu
On Thu, 2021-01-14 at 13:27 -0600, Rob Herring wrote: > On Mon, Jan 11, 2021 at 07:18:47PM +0800, Yong Wu wrote: > > "dev->dma_range_map" contains the devices' dma_ranges information, > > This patch moves dma_range_map before of_iommu_configure. The iommu > > driver may need to know the dma_address

Re: [RFC PATCH v3 1/2] iommu: Add capability IOMMU_CAP_VIOMMU

2021-01-14 Thread Jason Wang
On 2021/1/14 上午9:30, Lu Baolu wrote: Some vendor IOMMU drivers are able to declare that it is running in a VM context. This is very valuable for the features that only want to be supported on bare metal. Add a capability bit so that it could be used. Signed-off-by: Lu Baolu --- drivers/iommu

Re: [RFC PATCH v3 6/6] of: Add plumbing for restricted DMA pool

2021-01-14 Thread Claire Chang
On Fri, Jan 15, 2021 at 2:52 AM Florian Fainelli wrote: > > On 1/14/21 1:08 AM, Claire Chang wrote: > > On Wed, Jan 13, 2021 at 7:48 AM Florian Fainelli > > wrote: > >> > >> On 1/5/21 7:41 PM, Claire Chang wrote: > >>> If a device is not behind an IOMMU, we look up the device node and set > >>>

[PATCH 1/1] iommu/vt-d: Preset Access/Dirty bits for IOVA over FL

2021-01-14 Thread Lu Baolu
The Access/Dirty bits in the first level page table entry will be set whenever a page table entry was used for address translation or write permission was successfully translated. This is always true when using the first-level page table for kernel IOVA. Instead of wasting hardware cycles to update

Re: [RFC PATCH v3 1/2] iommu: Add capability IOMMU_CAP_VIOMMU

2021-01-14 Thread Lu Baolu
Hi Leon, On 1/14/21 9:26 PM, Leon Romanovsky wrote: On Thu, Jan 14, 2021 at 09:30:02AM +0800, Lu Baolu wrote: Some vendor IOMMU drivers are able to declare that it is running in a VM context. This is very valuable for the features that only want to be supported on bare metal. Add a capability b

Intel gvt-g with nvidia prime render offload causes several issues (regression)

2021-01-14 Thread Anton Gubar'kov
Dears, there is thread https://github.com/intel/gvt-linux/issues/162 discussing issues when gvt-g is used in Windows guest while the host has prime render offload enabled. I have this issue as well and I did a kernel bisect between v5.7 (works kind of OK, at least there are no qemu/guest crashes)

Re: [PATCH v6 06/33] of/device: Move dma_range_map before of_iommu_configure

2021-01-14 Thread Rob Herring
On Mon, Jan 11, 2021 at 07:18:47PM +0800, Yong Wu wrote: > "dev->dma_range_map" contains the devices' dma_ranges information, > This patch moves dma_range_map before of_iommu_configure. The iommu > driver may need to know the dma_address requirements of its iommu > consumer devices. > > CC: Rob He

Re: [RFC PATCH v3 6/6] of: Add plumbing for restricted DMA pool

2021-01-14 Thread Florian Fainelli
On 1/14/21 1:08 AM, Claire Chang wrote: > On Wed, Jan 13, 2021 at 7:48 AM Florian Fainelli wrote: >> >> On 1/5/21 7:41 PM, Claire Chang wrote: >>> If a device is not behind an IOMMU, we look up the device node and set >>> up the restricted DMA when the restricted-dma-pool is presented. >>> >>> Sig

Re: [PATCH v13 07/15] iommu/smmuv3: Allow stage 1 invalidation with unmanaged ASIDs

2021-01-14 Thread Auger Eric
Hi Jean, On 1/14/21 6:33 PM, Jean-Philippe Brucker wrote: > Hi Eric, > > On Thu, Jan 14, 2021 at 05:58:27PM +0100, Auger Eric wrote: The uacce-devel branches from > https://github.com/Linaro/linux-kernel-uadk do provide this at the moment > (they track the latest sva/zip-devel branc

Re: [PATCH v13 07/15] iommu/smmuv3: Allow stage 1 invalidation with unmanaged ASIDs

2021-01-14 Thread Jean-Philippe Brucker
Hi Eric, On Thu, Jan 14, 2021 at 05:58:27PM +0100, Auger Eric wrote: > >> The uacce-devel branches from > >>> https://github.com/Linaro/linux-kernel-uadk do provide this at the moment > >>> (they track the latest sva/zip-devel branch > >>> https://jpbrucker.net/git/linux/ which is roughly based o

Re: [PATCH 1/5] vfio/iommu_type1: Fixes vfio_dma_populate_bitmap to avoid dirty lose

2021-01-14 Thread Alex Williamson
On Thu, 14 Jan 2021 21:05:23 +0800 Keqian Zhu wrote: > Hi Alex, > > On 2021/1/13 5:20, Alex Williamson wrote: > > On Thu, 7 Jan 2021 17:28:57 +0800 > > Keqian Zhu wrote: > > > >> Defer checking whether vfio_dma is of fully-dirty in update_user_bitmap > >> is easy to lose dirty log. For examp

RE: [PATCH v13 07/15] iommu/smmuv3: Allow stage 1 invalidation with unmanaged ASIDs

2021-01-14 Thread Shameerali Kolothum Thodi
Hi Eric, > -Original Message- > From: Auger Eric [mailto:eric.au...@redhat.com] > Sent: 14 January 2021 16:58 > To: Shameerali Kolothum Thodi ; > Jean-Philippe Brucker > Cc: Xieyingtai ; alex.william...@redhat.com; > wangxingang ; k...@vger.kernel.org; > m...@kernel.org; linux-ker...@vger

Re: [PATCH v13 07/15] iommu/smmuv3: Allow stage 1 invalidation with unmanaged ASIDs

2021-01-14 Thread Auger Eric
Hi Shameer, Jean-Philippe, On 12/4/20 11:23 AM, Auger Eric wrote: > Hi Shameer, Jean-Philippe, > > On 12/4/20 11:20 AM, Shameerali Kolothum Thodi wrote: >> Hi Jean, >> >>> -Original Message- >>> From: Jean-Philippe Brucker [mailto:jean-phili...@linaro.org] >>> Sent: 04 December 2020 09:54

Re: [PATCH v9 03/10] iommu: Separate IOMMU_DEV_FEAT_IOPF from IOMMU_DEV_FEAT_SVA

2021-01-14 Thread Jean-Philippe Brucker
On Wed, Jan 13, 2021 at 08:10:28AM +, Tian, Kevin wrote: > > >> Is this only for SVA? We may see more scenarios of using IOPF. For > > >> example, when passing through devices to user level, the user's pages > > >> could be managed dynamically instead of being allocated and pinned > > >> static

Re: [PATCH] iommu/arm-smmu-v3: Handle duplicated Stream IDs from other masters

2021-01-14 Thread Robin Murphy
On 2021-01-12 20:29, Ajay Kumar wrote: On Tue, Jan 12, 2021 at 12:57 AM Robin Murphy wrote: On 2021-01-07 13:03, Will Deacon wrote: On Thu, Jan 07, 2021 at 03:03:40PM +0530, Ajay Kumar wrote: When PCI function drivers(ex:pci-endpoint-test) are probed for already initialized PCIe-RC(Root Comp

Re: [RFC PATCH v3 1/2] iommu: Add capability IOMMU_CAP_VIOMMU

2021-01-14 Thread Leon Romanovsky
On Thu, Jan 14, 2021 at 09:30:02AM +0800, Lu Baolu wrote: > Some vendor IOMMU drivers are able to declare that it is running in a VM > context. This is very valuable for the features that only want to be > supported on bare metal. Add a capability bit so that it could be used. And how is it used?

Re: [PATCH 1/5] vfio/iommu_type1: Fixes vfio_dma_populate_bitmap to avoid dirty lose

2021-01-14 Thread Keqian Zhu
Hi Alex, On 2021/1/13 5:20, Alex Williamson wrote: > On Thu, 7 Jan 2021 17:28:57 +0800 > Keqian Zhu wrote: > >> Defer checking whether vfio_dma is of fully-dirty in update_user_bitmap >> is easy to lose dirty log. For example, after promoting pinned_scope of >> vfio_iommu, vfio_dma is not consid

Re: [PATCH 4/5] vfio/iommu_type1: Carefully use unmap_unpin_all during dirty tracking

2021-01-14 Thread Keqian Zhu
On 2021/1/13 3:53, Alex Williamson wrote: > On Tue, 12 Jan 2021 20:04:38 +0800 > Keqian Zhu wrote: > >> On 2021/1/12 5:49, Alex Williamson wrote: >>> On Thu, 7 Jan 2021 17:29:00 +0800 >>> Keqian Zhu wrote: >>> If we detach group during dirty page tracking, we shouldn't remove vfi

[PATCH 1/1] iommu/vt-d: Add qi_submit trace event

2021-01-14 Thread Lu Baolu
This adds a new trace event to track the submissions of requests to the invalidation queue. This event will provide the information like: - IOMMU name - Invalidation type - Descriptor raw data A sample output like: | qi_submit: iotlb_inv dmar1: 0x100e2 0x0 0x0 0x0 | qi_submit: dev_tlb_inv dmar1: 0

Re: [RFC PATCH v3 2/6] swiotlb: Add restricted DMA pool

2021-01-14 Thread Claire Chang
On Wed, Jan 13, 2021 at 8:42 PM Christoph Hellwig wrote: > > > +#ifdef CONFIG_SWIOTLB > > + struct io_tlb_mem *dma_io_tlb_mem; > > #endif > > Please add a new config option for this code instead of always building > it when swiotlb is enabled. > > > +static int swiotlb_init_io_tlb_mem(s

Re: [RFC PATCH v3 6/6] of: Add plumbing for restricted DMA pool

2021-01-14 Thread Claire Chang
On Wed, Jan 13, 2021 at 7:48 AM Florian Fainelli wrote: > > On 1/5/21 7:41 PM, Claire Chang wrote: > > If a device is not behind an IOMMU, we look up the device node and set > > up the restricted DMA when the restricted-dma-pool is presented. > > > > Signed-off-by: Claire Chang > > --- > > [snip]

[PATCH 1/1] iommu/vt-d: Consolidate duplicate cache invaliation code

2021-01-14 Thread Lu Baolu
The pasid based IOTLB and devTLB invalidation code is duplicate in several places. Consolidate them by using the common helpers. Signed-off-by: Lu Baolu --- drivers/iommu/intel/pasid.c | 18 ++-- drivers/iommu/intel/svm.c | 55 ++--- 2 files changed, 11