Re: [PATCH] iommu/io-pgtable-arm: Optimize partial walk flush for large scatter-gather list

From: Sai Prakash Ranjan
Date: Wed Jun 16 2021 - 02:58:09 EST


Hi Robin,

On 2021-06-15 19:23, Robin Murphy wrote:
On 2021-06-15 12:51, Sai Prakash Ranjan wrote:

<snip>...

Hi @Robin, from these discussions it seems they are not ok with the change
for all SoC vendor implementations and do not have any data on such impact.
As I mentioned above, on QCOM platforms we do have several optimizations in HW
for TLBIs and would like to make use of it and reduce the unmap latency.
What do you think, should this be made implementation specific?

Yes, it sounds like there's enough uncertainty for now that this needs
to be an opt-in feature. However, I still think that non-strict mode
could use it generically, since that's all about over-invalidating to
save time on individual unmaps - and relatively non-deterministic -
already.

So maybe we have a second set of iommu_flush_ops, or just a flag
somewhere to control the tlb_flush_walk functions internally, and the
choice can be made in the iommu_get_dma_strict() test, but also forced
on all the time by your init_context hook. What do you reckon?


Sounds good to me. Since you mentioned non-strict mode using it generically,
can't we just set tlb_flush_all() in io_pgtable_tlb_flush_walk() like below
based on quirk so that we don't need to add any check in iommu_get_dma_strict()
and just force the new flush_ops in init_context hook?

if (iop->cfg.quirks & IO_PGTABLE_QUIRK_NON_STRICT) {
iop->cfg.tlb->tlb_flush_all(iop->cookie);
return;
}

Thanks,
Sai

--
QUALCOMM INDIA, on behalf of Qualcomm Innovation Center, Inc. is a member
of Code Aurora Forum, hosted by The Linux Foundation