Re: [PATCH 0/4] iommu/vtd-: Misc fixes on scalable mode

2020-12-22 Thread Jacob Pan
Hi Yi, nit: The cover letter is 0/4, patches are 1/3 - 3/3. You also need to copy LKML. On Sun, 20 Dec 2020 08:03:49 +0800, Liu Yi L wrote: > Hi, > > This patchset aims to fix a bug regards to SVM usage on native, and perhaps 'native SVM usage' > also several bugs around subdevice (attached

[PATCH] iommu/iova: fix 'domain' typos

2020-12-22 Thread Stefano Garzarella
Replace misspelled 'doamin' with 'domain' in several comments. Signed-off-by: Stefano Garzarella --- drivers/iommu/iova.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/iommu/iova.c b/drivers/iommu/iova.c index 4bb3293ae4d7..d20b8b333d30 100644 ---

[GIT PULL] dma-mapping updates for 5.11

2020-12-22 Thread Christoph Hellwig
The following changes since commit 418baf2c28f3473039f2f7377760bd8f6897ae18: Linux 5.10-rc5 (2020-11-22 15:36:08 -0800) are available in the Git repository at: git://git.infradead.org/users/hch/dma-mapping.git tags/dma-mapping-5.11 for you to fetch changes up to

Re: [PATCH v2 1/7] iommu/io-pgtable: Introduce dynamic io-pgtable fmt registration

2020-12-22 Thread isaacm
On 2020-12-22 11:27, Robin Murphy wrote: On 2020-12-22 00:44, Isaac J. Manjarres wrote: The io-pgtable code constructs an array of init functions for each page table format at compile time. This is not ideal, as this increases the footprint of the io-pgtable code, as well as prevents io-pgtable

Re: [PATCH 2/3] iommu/vt-d: Track device aux-attach with subdevice_domain_info.

2020-12-22 Thread Jacob Pan
Hi Yi, On Sun, 20 Dec 2020 08:03:51 +0800, Liu Yi L wrote: > In existing code, if wanting to loop all devices attached to a domain, > current code can only loop the devices which are attached to the domain > via normal manner. While for devices attached via auxiliary manner, this > is

Re: [PATCH v2 1/7] iommu/io-pgtable: Introduce dynamic io-pgtable fmt registration

2020-12-22 Thread Robin Murphy
On 2020-12-22 00:44, Isaac J. Manjarres wrote: The io-pgtable code constructs an array of init functions for each page table format at compile time. This is not ideal, as this increases the footprint of the io-pgtable code, as well as prevents io-pgtable formats from being built as kernel

Re: [PATCH v2 3/7] iommu/arm-smmu: Add dependency on io-pgtable format modules

2020-12-22 Thread Robin Murphy
On 2020-12-22 00:44, Isaac J. Manjarres wrote: The SMMU driver depends on the availability of the ARM LPAE and ARM V7S io-pgtable format code to work properly. In preparation Nit: we don't really depend on v7s - we *can* use it if it's available, address constraints are suitable, and the SMMU

Re: [PATCH v2 3/7] iommu/arm-smmu: Add dependency on io-pgtable format modules

2020-12-22 Thread isaacm
On 2020-12-22 11:27, Robin Murphy wrote: On 2020-12-22 00:44, Isaac J. Manjarres wrote: The SMMU driver depends on the availability of the ARM LPAE and ARM V7S io-pgtable format code to work properly. In preparation Nit: we don't really depend on v7s - we *can* use it if it's available,

Re: [GIT PULL] dma-mapping updates for 5.11

2020-12-22 Thread pr-tracker-bot
The pull request you sent on Tue, 22 Dec 2020 17:01:12 +0100: > git://git.infradead.org/users/hch/dma-mapping.git tags/dma-mapping-5.11 has been merged into torvalds/linux.git: https://git.kernel.org/torvalds/c/347d81b68b8f7044c9ce3fefa130a736ca916176 Thank you! -- Deet-doot-dot, I am a bot.

[PATCH v3 0/3] Audit Capability and Extended Capability among IOMMUs

2020-12-22 Thread Kyung Min Park
Modern platforms have more than one IOMMU. Each IOMMU has its own feature set. Some of these features must be consistent among IOMMUs. Otherwise, these differences can lead to improper behavior in the system. On the other hand, for some features, each IOMMU can have different capacity values. So,

[PATCH v3 3/3] iommu/vt-d: Disable SVM in the platform when IOMMUs have inconsistencies

2020-12-22 Thread Kyung Min Park
Some IOMMU Capabilities must be consistent for Shared Virtual Memory (SVM). Audit IOMMU Capability/Extended Capabilities and check if IOMMUs have the consistent value for features as below. When the features are not matched among IOMMUs, disable SVMs in the platform during DMAR initialization.

[PATCH v3 2/3] iommu/vt-d: Move capability check code to cap_audit files

2020-12-22 Thread Kyung Min Park
Move IOMMU capability check and sanity check code to cap_audit files. Also implement some helper functions for sanity checks. Signed-off-by: Kyung Min Park --- drivers/iommu/intel/cap_audit.c | 20 + drivers/iommu/intel/cap_audit.h | 20 + drivers/iommu/intel/iommu.c | 76

[PATCH v3 1/3] iommu/vt-d: Audit IOMMU Capabilities and add helper functions

2020-12-22 Thread Kyung Min Park
Audit IOMMU Capability/Extended Capability and check if the IOMMUs have the consistent value for features. Report out or scale to the lowest supported when IOMMU features have incompatibility among IOMMUs. Report out features when below features are mismatched: - First Level 5 Level Paging

[PATCH AUTOSEL 5.10 065/217] pinctrl: qcom: Kconfig: Rework PINCTRL_MSM to be a depenency rather then a selected config

2020-12-22 Thread Sasha Levin
From: John Stultz [ Upstream commit be117ca32261c3331b614f440c737650791a6998 ] This patch reworks PINCTRL_MSM to be a visible option, and instead of having the various SoC specific drivers select PINCTRL_MSM, this switches those configs to depend on PINCTRL_MSM. This is useful, as it will be

[PATCH AUTOSEL 5.4 070/130] iommu/tegra-smmu: Expand mutex protection range

2020-12-22 Thread Sasha Levin
From: Nicolin Chen [ Upstream commit d5f583bf8654c231b781096bc1a186065cda72b3 ] This is used to protect potential race condition at use_count. since probes of client drivers, calling attach_dev(), may run concurrently. Signed-off-by: Nicolin Chen Tested-by: Dmitry Osipenko Reviewed-by:

[PATCH AUTOSEL 5.4 128/130] x86, swiotlb: Adjust SWIOTLB bounce buffer size for SEV guests

2020-12-22 Thread Sasha Levin
From: Ashish Kalra [ Upstream commit e998879d4fb7991856916972168cf27c0d86ed12 ] For SEV, all DMA to and from guest has to use shared (un-encrypted) pages. SEV uses SWIOTLB to make this happen without requiring changes to device drivers. However, depending on the workload being run, the default

[PATCH AUTOSEL 4.9 31/48] iommu/tegra-smmu: Expand mutex protection range

2020-12-22 Thread Sasha Levin
From: Nicolin Chen [ Upstream commit d5f583bf8654c231b781096bc1a186065cda72b3 ] This is used to protect potential race condition at use_count. since probes of client drivers, calling attach_dev(), may run concurrently. Signed-off-by: Nicolin Chen Tested-by: Dmitry Osipenko Reviewed-by:

RE: [PATCH 2/3] iommu/vt-d: Track device aux-attach with subdevice_domain_info.

2020-12-22 Thread Liu, Yi L
Hi Jacob, > From: Jacob Pan > Sent: Wednesday, December 23, 2020 4:21 AM > > Hi Yi, > > On Sun, 20 Dec 2020 08:03:51 +0800, Liu Yi L wrote: > > > In existing code, if wanting to loop all devices attached to a domain, > > current code can only loop the devices which are attached to the domain

[PATCH AUTOSEL 4.19 49/87] iommu/tegra-smmu: Expand mutex protection range

2020-12-22 Thread Sasha Levin
From: Nicolin Chen [ Upstream commit d5f583bf8654c231b781096bc1a186065cda72b3 ] This is used to protect potential race condition at use_count. since probes of client drivers, calling attach_dev(), may run concurrently. Signed-off-by: Nicolin Chen Tested-by: Dmitry Osipenko Reviewed-by:

[PATCH AUTOSEL 4.4 26/38] iommu/tegra-smmu: Expand mutex protection range

2020-12-22 Thread Sasha Levin
From: Nicolin Chen [ Upstream commit d5f583bf8654c231b781096bc1a186065cda72b3 ] This is used to protect potential race condition at use_count. since probes of client drivers, calling attach_dev(), may run concurrently. Signed-off-by: Nicolin Chen Tested-by: Dmitry Osipenko Reviewed-by:

[PATCH AUTOSEL 4.14 41/66] iommu/tegra-smmu: Expand mutex protection range

2020-12-22 Thread Sasha Levin
From: Nicolin Chen [ Upstream commit d5f583bf8654c231b781096bc1a186065cda72b3 ] This is used to protect potential race condition at use_count. since probes of client drivers, calling attach_dev(), may run concurrently. Signed-off-by: Nicolin Chen Tested-by: Dmitry Osipenko Reviewed-by:

RE: [PATCH 0/4] iommu/vtd-: Misc fixes on scalable mode

2020-12-22 Thread Liu, Yi L
> From: Jacob Pan > Sent: Wednesday, December 23, 2020 2:17 AM > > Hi Yi, > > nit: The cover letter is 0/4, patches are 1/3 - 3/3. You also need to copy > LKML. > > On Sun, 20 Dec 2020 08:03:49 +0800, Liu Yi L wrote: > > > Hi, > > > > This patchset aims to fix a bug regards to SVM usage on

[PATCH] x86/iommu: Fix two minimal issues in check_iommu_entries()

2020-12-22 Thread Zhenzhong Duan
check_iommu_entries() checks for cyclic dependency in iommu entries and fixes the cyclic dependency by setting x->depend to NULL. But this repairing isn't correct if q is in front of p, there will be "EXECUTION ORDER INVALID!" report following. Fix it by NULLing whichever in the front. The second

[PATCH v2 0/3] iommu/vt-d: Misc fixes on scalable mode

2020-12-22 Thread Liu Yi L
This patchset aims to fix a bug regards to native SVM usage, and also several bugs around subdevice (attached to device via auxiliary manner) tracking and ineffective device_tlb flush. Liu Yi L (3): iommu/vt-d: Move intel_iommu info from struct intel_svm to struct intel_svm_dev

[PATCH v2 1/3] iommu/vt-d: Move intel_iommu info from struct intel_svm to struct intel_svm_dev

2020-12-22 Thread Liu Yi L
Current struct intel_svm has a field to record the struct intel_iommu pointer for a PASID bind. And struct intel_svm will be shared by all the devices bind to the same process. The devices may be behind different DMAR units. As the iommu driver code uses the intel_iommu pointer stored in intel_svm

[PATCH v2 2/3] iommu/vt-d: Track device aux-attach with subdevice_domain_info

2020-12-22 Thread Liu Yi L
In the existing code, loop all devices attached to a domain does not include sub-devices attached via iommu_aux_attach_device(). This was found by when I'm working on the belwo patch, There is no device in the domain->devices list, thus unable to get the cap and ecap of iommu unit. But this

[PATCH v2 3/3] iommu/vt-d: Fix ineffective devTLB invalidation for subdevices

2020-12-22 Thread Liu Yi L
iommu_flush_dev_iotlb() is called to invalidate caches on device. It only loops the devices which are full-attached to the domain. For sub-devices, this is ineffective. This results in invalid caching entries left on the device. Fix it by adding loop for subdevices as well. Also, the domain->