Re: [PATCHv6 3/3] iommu: arm-smmu-impl: Add sdm845 implementation hook

2019-09-18 Thread Sai Prakash Ranjan
On 2019-09-19 05:55, Bjorn Andersson wrote: In the transition to this new design we lost the ability to enable/disable the safe toggle per board, which according to Vivek would result in some issue with Cheza. Can you confirm that this is okay? (Or introduce the DT property for enabling the

Re: [PATCHv6 3/3] iommu: arm-smmu-impl: Add sdm845 implementation hook

2019-09-18 Thread Sai Prakash Ranjan
On 2019-09-19 06:27, Stephen Boyd wrote: Quoting Sai Prakash Ranjan (2019-09-17 02:45:04) diff --git a/drivers/iommu/arm-smmu-impl.c b/drivers/iommu/arm-smmu-impl.c index 3f88cd078dd5..d62da270f430 100644 --- a/drivers/iommu/arm-smmu-impl.c +++ b/drivers/iommu/arm-smmu-impl.c @@ -9,7 +9,6 @@

Re: [PATCH v4 0/4] Retrieving zPCI specific info with VFIO

2019-09-18 Thread Matthew Rosato
ping On 9/6/19 8:13 PM, Matthew Rosato wrote: > Note: These patches by Pierre got lost in the ether a few months back > as he has been unavailable to carry them forward. I've made changes > based upon comments received on his last version. > > We define a new configuration entry for VFIO/PCI,

Re: [PATCHv6 3/3] iommu: arm-smmu-impl: Add sdm845 implementation hook

2019-09-18 Thread Stephen Boyd
Quoting Sai Prakash Ranjan (2019-09-17 02:45:04) > diff --git a/drivers/iommu/arm-smmu-impl.c b/drivers/iommu/arm-smmu-impl.c > index 3f88cd078dd5..d62da270f430 100644 > --- a/drivers/iommu/arm-smmu-impl.c > +++ b/drivers/iommu/arm-smmu-impl.c > @@ -9,7 +9,6 @@ > > #include "arm-smmu.h" > > -

Re: [PATCHv6 2/3] firmware/qcom_scm: Add scm call to handle smmu errata

2019-09-18 Thread Stephen Boyd
Quoting Sai Prakash Ranjan (2019-09-17 02:45:03) > From: Vivek Gautam > > Qcom's smmu-500 needs to toggle wait-for-safe sequence to > handle TLB invalidation sync's. > Few firmwares allow doing that through SCM interface. > Add API to toggle wait for safe from firmware through a > SCM call. > >

Re: [PATCHv6 3/3] iommu: arm-smmu-impl: Add sdm845 implementation hook

2019-09-18 Thread Stephen Boyd
Quoting Bjorn Andersson (2019-09-18 17:25:01) > On Tue 17 Sep 02:45 PDT 2019, Sai Prakash Ranjan wrote: > > > From: Vivek Gautam > > > > There are other boards such as cheza whose bootloaders don't enable this > > logic. Such boards don't implement callbacks to handle the specific SCM > > call

Re: [PATCHv6 1/3] firmware: qcom_scm-64: Add atomic version of qcom_scm_call

2019-09-18 Thread Stephen Boyd
Quoting Sai Prakash Ranjan (2019-09-17 02:45:02) > From: Vivek Gautam > > There are scnenarios where drivers are required to make a > scm call in atomic context, such as in one of the qcom's > arm-smmu-500 errata [1]. > > [1] ("https://source.codeaurora.org/quic/la/kernel/msm-4.9/ >

Re: [PATCHv6 3/3] iommu: arm-smmu-impl: Add sdm845 implementation hook

2019-09-18 Thread Bjorn Andersson
On Tue 17 Sep 02:45 PDT 2019, Sai Prakash Ranjan wrote: > From: Vivek Gautam > > Add reset hook for sdm845 based platforms to turn off > the wait-for-safe sequence. > > Understanding how wait-for-safe logic affects USB and UFS performance > on MTP845 and DB845 boards: > > Qcom's

[PATCH 4/4] iommu: Introduce guest PASID bind function

2019-09-18 Thread Jacob Pan
Guest shared virtual address (SVA) may require host to shadow guest PASID tables. Guest PASID can also be allocated from the host via enlightened interfaces. In this case, guest needs to bind the guest mm, i.e. cr3 in guest physical address to the actual PASID table in the host IOMMU. Nesting will

[PATCH 2/4] iommu: Add I/O ASID allocator

2019-09-18 Thread Jacob Pan
From: Jean-Philippe Brucker Some devices might support multiple DMA address spaces, in particular those that have the PCI PASID feature. PASID (Process Address Space ID) allows to share process address spaces with devices (SVA), partition a device into VM-assignable entities (VFIO mdev) or

[PATCH 3/4] iommu/ioasid: Add custom allocators

2019-09-18 Thread Jacob Pan
IOASID allocation may rely on platform specific methods. One use case is that when running in the guest, in order to obtain system wide global IOASIDs, emulated allocation interface is needed to communicate with the host. Here we call these platform specific allocators custom allocators. Custom

[PATCH 1/4] iommu: Introduce cache_invalidate API

2019-09-18 Thread Jacob Pan
From: Yi L Liu In any virtualization use case, when the first translation stage is "owned" by the guest OS, the host IOMMU driver has no knowledge of caching structure updates unless the guest invalidation activities are trapped by the virtualizer and passed down to the host. Since the

[PATCH 0/4] User API for nested shared virtual address (SVA)

2019-09-18 Thread Jacob Pan
This set consists of IOMMU APIs to support SVA in the guest, a.k.a nested SVA. As the complete SVA support is complex, we break down the enabling effort into three stages: 1. PCI device direct assignment 2. Fault handling, especially page request service support 3. Mediated device assignment Each

Re: [PATCH 2/2] MIPS: remove support for DMA_ATTR_WRITE_COMBINE

2019-09-18 Thread Maciej W. Rozycki
On Wed, 7 Aug 2019, Christoph Hellwig wrote: > Mips uses the KSEG1 kernel memory segment to map dma coherent > allocations for non-coherent devices as uncacheable, and does not have > any kind of special support for DMA_ATTR_WRITE_COMBINE in the allocation > path. Thus supporting

Re: DMA_ATTR_WRITE_COMBINE on mips

2019-09-18 Thread Maciej W. Rozycki
Hi Christoph, > [I hope the imgtec address still works, but maybe the mips folks know > if it moved to mips] Alex left Imagination long before the transition to the interim MIPS company. > you added DMA_ATTR_WRITE_COMBINE support in dma_mmap_attrs to mips > in commit

[PATCH 0/4] iommu/arm-smmu: Remove arm_smmu_flush_ops

2019-09-18 Thread Robin Murphy
Hi all, Off the back of Will's iommu_flush_ops work, here's an initial followup to replace the temporary solution in arm-smmu with a full conversion. Removing teh extra layer of indirection should generally make things a good bit more efficient, and rather more readable to boot. Robin. Robin

[PATCH 1/4] iommu/arm-smmu: Remove .tlb_inv_range indirection

2019-09-18 Thread Robin Murphy
Fill in 'native' iommu_flush_ops callbacks for all the arm_smmu_flush_ops variants, and clear up the remains of the previous .tlb_inv_range abstraction. Signed-off-by: Robin Murphy --- drivers/iommu/arm-smmu.c | 110 ++- drivers/iommu/arm-smmu.h | 2 - 2

[PATCH 3/4] iommu/arm-smmu: Move .tlb_sync method to implementation

2019-09-18 Thread Robin Murphy
With the .tlb_sync interface no longer exposed directly to io-pgtable, strip away the remains of that abstraction layer. Retain the callback in spirit, though, by transforming it into an implementation override for the low-level sync routine itself, for which we will have at least one user.

[PATCH 4/4] iommu/arm-smmu: Remove arm_smmu_flush_ops

2019-09-18 Thread Robin Murphy
Now it's just an empty wrapper. Signed-off-by: Robin Murphy --- drivers/iommu/arm-smmu.c | 40 +--- drivers/iommu/arm-smmu.h | 6 +- 2 files changed, 18 insertions(+), 28 deletions(-) diff --git a/drivers/iommu/arm-smmu.c b/drivers/iommu/arm-smmu.c

[PATCH 2/4] iommu/arm-smmu: Remove "leaf" indirection

2019-09-18 Thread Robin Murphy
Now that the "leaf" flag is no longer part of an external interface, there's no need to use it to infer a register offset at runtime when we can just as easily encode the offset directly in its place. Signed-off-by: Robin Murphy --- drivers/iommu/arm-smmu.c | 29 - 1

Re: [PATCH 1/5] iommu: Implement iommu_put_resv_regions_simple()

2019-09-18 Thread Will Deacon
On Thu, Aug 29, 2019 at 01:17:48PM +0200, Thierry Reding wrote: > From: Thierry Reding > > Implement a generic function for removing reserved regions. This can be > used by drivers that don't do anything fancy with these regions other > than allocating memory for them. > > Signed-off-by:

Re: [PATCH v2] iommu/arm-smmu: Report USF more clearly

2019-09-18 Thread Doug Anderson
Hi, On Tue, Sep 17, 2019 at 7:45 AM Robin Murphy wrote: > > Although CONFIG_ARM_SMMU_DISABLE_BYPASS_BY_DEFAULT is a welcome tool > for smoking out inadequate firmware, the failure mode is non-obvious > and can be confusing for end users. Add some special-case reporting of > Unidentified Stream

[GIT PULL] dma-mapping updates for 5.4

2019-09-18 Thread Christoph Hellwig
Hi Linus, please pull the dma-mapping updates for 5.4. In addition to the usual Kconfig conflics where you just want to keep both edits there are a few more interesting merge issues this time: - most importanly powerpc and microblaze add new callers of dma_atomic_pool_init, while this tree

Re: [bug] __blk_mq_run_hw_queue suspicious rcu usage

2019-09-18 Thread Christoph Hellwig
On Tue, Sep 17, 2019 at 06:41:02PM +, Lendacky, Thomas wrote: > > diff --git a/drivers/nvme/host/pci.c b/drivers/nvme/host/pci.c > > --- a/drivers/nvme/host/pci.c > > +++ b/drivers/nvme/host/pci.c > > @@ -1613,7 +1613,8 @@ static int nvme_alloc_admin_tags(struct nvme_dev *dev) > >