Re: [RFC PATCH 1/2] dma-mapping: Clean up dma_set_*mask() hooks

2018-07-08 Thread Christoph Hellwig
On Fri, Jul 06, 2018 at 03:20:34PM +0100, Robin Murphy wrote: >> What are you trying to do? I really don't want to see more users of >> the hooks as they are are a horribly bad idea. > > I really need to fix the ongoing problem we have where, due to funky > integrations, devices suffer some downs

[PATCH v12 1/4] iommu/arm-smmu: Add pm_runtime/sleep ops

2018-07-08 Thread Vivek Gautam
From: Sricharan R The smmu needs to be functional only when the respective master's using it are active. The device_link feature helps to track such functional dependencies, so that the iommu gets powered when the master device enables itself using pm_runtime. So by adapting the smmu driver for r

[PATCH v12 0/4] iommu/arm-smmu: Add runtime pm/sleep support

2018-07-08 Thread Vivek Gautam
This series provides the support for turning on the arm-smmu's clocks/power domains using runtime pm. This is done using the recently introduced device links patches, which lets the smmu's runtime to follow the master's runtime pm, so the smmu remains powered only when the masters use it. As not al

[PATCH v12 2/4] iommu/arm-smmu: Invoke pm_runtime during probe, add/remove device

2018-07-08 Thread Vivek Gautam
From: Sricharan R The smmu device probe/remove and add/remove master device callbacks gets called when the smmu is not linked to its master, that is without the context of the master device. So calling runtime apis in those places separately. Signed-off-by: Sricharan R [vivek: Cleanup pm runtim

[PATCH v12 3/4] iommu/arm-smmu: Add the device_link between masters and smmu

2018-07-08 Thread Vivek Gautam
From: Sricharan R Finally add the device link between the master device and smmu, so that the smmu gets runtime enabled/disabled only when the master needs it. This is done from add_device callback which gets called once when the master is added to the smmu. Signed-off-by: Sricharan R Signed-of

[PATCH v12 4/4] iommu/arm-smmu: Add support for qcom,smmu-v2 variant

2018-07-08 Thread Vivek Gautam
qcom,smmu-v2 is an arm,smmu-v2 implementation with specific clock and power requirements. This smmu core is used with multiple masters on msm8996, viz. mdss, video, etc. Add bindings for the same. Signed-off-by: Vivek Gautam Reviewed-by: Rob Herring Reviewed-by: Tomasz Figa --- - No change si

Aw: Re: [PATCH] dma-mapping: Relax warnings for per-device areas

2018-07-08 Thread Jürgen Urban
Hello Fredrik, > Gesendet: Samstag, 07. Juli 2018 um 08:32 Uhr > Von: "Fredrik Noring" > An: "Jürgen Urban" , "Robin Murphy" > > Cc: "Christoph Hellwig" , linux-ker...@vger.kernel.org, > iommu@lists.linux-foundation.org, "Maciej W. Rozycki" > Betreff: Re: [PATCH] dma-mapping: Relax warnings f

[PATCH] iommu/ipmmu-vmsa: IMUCTRn.TTSEL needs a special usage on R-Car Gen3

2018-07-08 Thread Yoshihiro Shimoda
The TTSEL bit of IMUCTRn register of R-Car Gen3 needs to be set unused MMU context number even if uTLBs are disabled (The MMUEN bit of IMUCTRn register = 0). Since initial values of IMUCTRn.TTSEL on all IPMMU-domains are 0, this patch adds a new feature "reserved_context" to reserve IPMMU context n

[PATCH v4 0/9] iommu/vt-d: Improve PASID id and table management

2018-07-08 Thread Lu Baolu
Hi, This patch set improves the PASID id and PASID table management for Intel IOMMU driver. PATCH 1~3 replace per IOMMU idr name space with a global one. Current per IOMMU idr doesn't work in some cases where one application (associated with a PASID) might talk to two physical devices simultaneou

[PATCH v4 1/9] iommu/vt-d: Global PASID name space

2018-07-08 Thread Lu Baolu
This adds the system wide PASID name space for the PASID allocation. Currently we are using per IOMMU PASID name spaces which are not suitable for some use cases. For an example, one application (associated with a PASID) might talk to two physical devices simultaneously while the two devices could

[PATCH v4 2/9] iommu/vt-d: Avoid using idr_for_each_entry()

2018-07-08 Thread Lu Baolu
idr_for_each_entry() is used to iteratte over idr elements of a given type. It isn't suitable for the globle pasid idr since the pasid idr consumer could specify different types of pointers to bind with a pasid. Cc: Ashok Raj Cc: Jacob Pan Cc: Kevin Tian Cc: Liu Yi L Signed-off-by: Lu Baolu R

[PATCH v4 3/9] iommu/vt-d: Apply global PASID in SVA

2018-07-08 Thread Lu Baolu
This patch applies the global pasid name space in the shared virtual address (SVA) implementation. Cc: Ashok Raj Cc: Jacob Pan Cc: Kevin Tian Cc: Liu Yi L Signed-off-by: Lu Baolu Reviewed-by: Kevin Tian Reviewed-by: Liu Yi L --- drivers/iommu/intel-svm.c | 22 +++--- incl

[PATCH v4 4/9] iommu/vt-d: Move device_domain_info to header

2018-07-08 Thread Lu Baolu
This allows the per device iommu data and some helpers to be used in other files. Cc: Ashok Raj Cc: Jacob Pan Cc: Kevin Tian Cc: Liu Yi L Signed-off-by: Lu Baolu Reviewed-by: Liu Yi L --- drivers/iommu/intel-iommu.c | 63 +++-- include/linux/intel-iom

[PATCH v4 5/9] iommu/vt-d: Add for_each_device_domain() helper

2018-07-08 Thread Lu Baolu
This adds a helper named for_each_device_domain() to iterate over the elements in device_domain_list and invoke a callback against each element. This allows to search the device_domain list in other source files. Cc: Ashok Raj Cc: Jacob Pan Cc: Kevin Tian Cc: Liu Yi L Signed-off-by: Lu Baolu

[PATCH v4 6/9] iommu/vt-d: Per PCI device pasid table interfaces

2018-07-08 Thread Lu Baolu
This patch adds the interfaces for per PCI device pasid table management. Currently we allocate one pasid table for all PCI devices under the scope of an IOMMU. It's insecure in some cases where multiple devices under one single IOMMU unit support PASID features. With per PCI device pasid table, we

[PATCH v4 7/9] iommu/vt-d: Allocate and free pasid table

2018-07-08 Thread Lu Baolu
This patch allocates a PASID table for a PCI device at the time when the dmar dev_info is attached to dev->archdata.iommu, and free it in the opposite case. Cc: Ashok Raj Cc: Jacob Pan Cc: Kevin Tian Cc: Liu Yi L Signed-off-by: Lu Baolu Reviewed-by: Liu Yi L --- drivers/iommu/intel-iommu.c

[PATCH v4 8/9] iommu/vt-d: Apply per pci device pasid table in SVA

2018-07-08 Thread Lu Baolu
This patch applies the per pci device pasid table in the Shared Virtual Address (SVA) implementation. Cc: Ashok Raj Cc: Jacob Pan Cc: Kevin Tian Cc: Liu Yi L Signed-off-by: Lu Baolu Reviewed-by: Liu Yi L --- drivers/iommu/intel-iommu.c | 29 + drivers/iommu/intel

[PATCH v4 9/9] iommu/vt-d: Remove the obsolete per iommu pasid tables

2018-07-08 Thread Lu Baolu
The obsolete per iommu pasid tables are no longer used. Hence, clean up them. Cc: Ashok Raj Cc: Jacob Pan Cc: Kevin Tian Cc: Liu Yi L Signed-off-by: Lu Baolu Reviewed-by: Liu Yi L --- drivers/iommu/intel-iommu.c | 6 +++--- drivers/iommu/intel-svm.c | 17 ++--- include/linux/

Re: [PATCH 1/5 V5] Add a function(ioremap_encrypted) for kdump when AMD sme enabled

2018-07-08 Thread lijiang
在 2018年07月03日 19:44, lijiang 写道: > 在 2018年07月03日 19:14, Borislav Petkov 写道: >> On Tue, Jul 03, 2018 at 06:58:14PM +0800, lijiang wrote: >>> For kdump, the elf header finally use the crash kernel reserved memory, it >>> is not an old memory. >> >> Lamme repeat my suggestion: >> >> So beef up the lo