From: Robin Murphy <robin.murphy@arm.com> To: Jordan Crouse <jcrouse@codeaurora.org>, linux-arm-msm@vger.kernel.org Cc: Joerg Roedel <jroedel@suse.de>, Will Deacon <will@kernel.org>, linux-kernel@vger.kernel.org, iommu@lists.linux-foundation.org, John Stultz <john.stultz@linaro.org>, freedreno@lists.freedesktop.org Subject: Re: [PATCH v2 2/6] iommu/io-pgtable: Allow a pgtable implementation to skip TLB operations Date: Tue, 7 Jul 2020 12:34:26 +0100 [thread overview] Message-ID: <99ecd948-7476-b9b4-12b4-1ced0084654f@arm.com> (raw) In-Reply-To: <20200626200414.14382-3-jcrouse@codeaurora.org> On 2020-06-26 21:04, Jordan Crouse wrote: > Allow a io-pgtable implementation to skip TLB operations by checking for > NULL pointers in the helper functions. It will be up to to the owner > of the io-pgtable instance to make sure that they independently handle > the TLB correctly. I don't really understand what this is for - tricking the IOMMU driver into not performing its TLB maintenance at points when that maintenance has been deemed necessary doesn't seem like the appropriate way to achieve anything good :/ Robin. > Signed-off-by: Jordan Crouse <jcrouse@codeaurora.org> > --- > > include/linux/io-pgtable.h | 11 +++++++---- > 1 file changed, 7 insertions(+), 4 deletions(-) > > diff --git a/include/linux/io-pgtable.h b/include/linux/io-pgtable.h > index 53d53c6c2be9..bbed1d3925ba 100644 > --- a/include/linux/io-pgtable.h > +++ b/include/linux/io-pgtable.h > @@ -210,21 +210,24 @@ struct io_pgtable { > > static inline void io_pgtable_tlb_flush_all(struct io_pgtable *iop) > { > - iop->cfg.tlb->tlb_flush_all(iop->cookie); > + if (iop->cfg.tlb) > + iop->cfg.tlb->tlb_flush_all(iop->cookie); > } > > static inline void > io_pgtable_tlb_flush_walk(struct io_pgtable *iop, unsigned long iova, > size_t size, size_t granule) > { > - iop->cfg.tlb->tlb_flush_walk(iova, size, granule, iop->cookie); > + if (iop->cfg.tlb) > + iop->cfg.tlb->tlb_flush_walk(iova, size, granule, iop->cookie); > } > > static inline void > io_pgtable_tlb_flush_leaf(struct io_pgtable *iop, unsigned long iova, > size_t size, size_t granule) > { > - iop->cfg.tlb->tlb_flush_leaf(iova, size, granule, iop->cookie); > + if (iop->cfg.tlb) > + iop->cfg.tlb->tlb_flush_leaf(iova, size, granule, iop->cookie); > } > > static inline void > @@ -232,7 +235,7 @@ io_pgtable_tlb_add_page(struct io_pgtable *iop, > struct iommu_iotlb_gather * gather, unsigned long iova, > size_t granule) > { > - if (iop->cfg.tlb->tlb_add_page) > + if (iop->cfg.tlb && iop->cfg.tlb->tlb_add_page) > iop->cfg.tlb->tlb_add_page(gather, iova, granule, iop->cookie); > } > > _______________________________________________ iommu mailing list iommu@lists.linux-foundation.org https://lists.linuxfoundation.org/mailman/listinfo/iommu
next prev parent reply other threads:[~2020-07-07 11:34 UTC|newest] Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top 2020-06-26 20:04 [PATCH v2 0/6] iommu-arm-smmu: Add auxiliary domains and per-instance pagetables Jordan Crouse 2020-06-26 20:04 ` [PATCH v2 1/6] iommu/arm-smmu: Add auxiliary domain support for arm-smmuv2 Jordan Crouse 2020-07-07 10:48 ` Jean-Philippe Brucker 2020-07-07 12:34 ` Robin Murphy 2020-07-07 15:09 ` [Freedreno] " Rob Clark 2020-07-13 17:35 ` Jordan Crouse 2020-06-26 20:04 ` [PATCH v2 2/6] iommu/io-pgtable: Allow a pgtable implementation to skip TLB operations Jordan Crouse 2020-07-07 11:34 ` Robin Murphy [this message] 2020-07-07 14:25 ` [Freedreno] " Rob Clark 2020-07-07 14:58 ` Rob Clark 2020-07-08 19:19 ` Jordan Crouse 2020-06-26 20:04 ` [PATCH v2 3/6] iommu/arm-smmu: Add a domain attribute to pass the pagetable config Jordan Crouse 2020-06-26 20:04 ` [PATCH v2 4/6] drm/msm: Add support to create a local pagetable Jordan Crouse 2020-07-07 11:36 ` Robin Murphy 2020-07-07 14:41 ` [Freedreno] " Rob Clark 2020-07-08 19:35 ` Jordan Crouse 2020-06-26 20:04 ` [PATCH v2 5/6] drm/msm: Add support for address space instances Jordan Crouse 2020-06-26 20:04 ` [PATCH v2 6/6] drm/msm/a6xx: Add support for per-instance pagetables Jordan Crouse 2020-06-27 19:56 ` Rob Clark 2020-06-27 20:11 ` Rob Clark 2020-06-29 14:56 ` [Freedreno] " Jordan Crouse
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=99ecd948-7476-b9b4-12b4-1ced0084654f@arm.com \ --to=robin.murphy@arm.com \ --cc=freedreno@lists.freedesktop.org \ --cc=iommu@lists.linux-foundation.org \ --cc=jcrouse@codeaurora.org \ --cc=john.stultz@linaro.org \ --cc=jroedel@suse.de \ --cc=linux-arm-msm@vger.kernel.org \ --cc=linux-kernel@vger.kernel.org \ --cc=will@kernel.org \ --subject='Re: [PATCH v2 2/6] iommu/io-pgtable: Allow a pgtable implementation to skip TLB operations' \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: link
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for NNTP newsgroup(s).