Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp201351pxj; Tue, 15 Jun 2021 23:58:47 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyqae2gh475uftkbNxyeoP7RKre2CFA3Ea8cCb48r64SxEnj/qEsNYhSlT4ek3zDkID/kCG X-Received: by 2002:a92:cdad:: with SMTP id g13mr2531691ild.111.1623826727111; Tue, 15 Jun 2021 23:58:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1623826727; cv=none; d=google.com; s=arc-20160816; b=0az08lRUfrzPDPxivPj8z4oReovLI6q4NbvAQ0YxU0XV5isQIkm+ZlrVj68rVm/Y9c UVxWNRI9EvBk0RglH9W3RJ2TbT9j/2PT9TCA7caBruVXfylwX+xOuEaiG80ap2vrpzi7 qSC6gFp/y65RZ9E9TAHLcZIrMGKauMwM+bQDZth4k2ktSRudSDSu+pH/g5IM42vPXg1W BRPrRDsfvm3hpZYlMw5/kXwpSJUZz8UPHjYm2WN5n4VokNIV/SZ7qXfn3wNsz9G0MOW4 7z2FRevkel3IboTfUO/GfJhjK3sRdJhZ3yJ0BJJlyIulhDM6KJVzrKatNScf/i2fKVF3 TApw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:message-id:references:in-reply-to :subject:cc:to:from:date:content-transfer-encoding:mime-version :sender:dkim-signature; bh=I0eydOR0xnXCnwZc0aveamd5PTl1UHcBko2iiIqk/Yg=; b=mJRm7SePGDxDtmG/3O/R2zrHY9cniJ5hfMGT6wbVTkpij0D/mTpX9O5ycFWIeGYFyw 83h/z6d25HM4fR5ZD80ZBsryaewGCe7OGmUlOx8YxQnFY/HBbpGCsbP/qSCnbCNxIE8B RmI5cIk3LcPBRCVTWW97aL/QvQlFqV+NVM+W2Q97DnOgu2Pet39IElWQ8AkS4VWFXzse vi1crEgPhIor0j8sXqwljEQYlHy9/CsiIaC9UQEU/aiSXZ3Or4q+JPNhR8KHRvq9U9YW aQ0OaYE687tSPBIdh+5M/dUxWLzpmJDrlCNRcUIGKCRenKi2WYUh9DC5QZCYNzs4eFX5 IZFA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@mg.codeaurora.org header.s=smtp header.b=LRQsghAD; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id y3si1990239jad.12.2021.06.15.23.58.35; Tue, 15 Jun 2021 23:58:47 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@mg.codeaurora.org header.s=smtp header.b=LRQsghAD; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231152AbhFPHAM (ORCPT + 99 others); Wed, 16 Jun 2021 03:00:12 -0400 Received: from so254-9.mailgun.net ([198.61.254.9]:30191 "EHLO so254-9.mailgun.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230360AbhFPHAL (ORCPT ); Wed, 16 Jun 2021 03:00:11 -0400 DKIM-Signature: a=rsa-sha256; v=1; c=relaxed/relaxed; d=mg.codeaurora.org; q=dns/txt; s=smtp; t=1623826685; h=Message-ID: References: In-Reply-To: Subject: Cc: To: From: Date: Content-Transfer-Encoding: Content-Type: MIME-Version: Sender; bh=I0eydOR0xnXCnwZc0aveamd5PTl1UHcBko2iiIqk/Yg=; b=LRQsghADI94Y4ikIuPxzDU6K1YzDkpe3YtnjcsrmbLpFQH3gY+PE1jcge+wY1KUYkJnm9jDq 0rzhOULMFGMv8AT0YeSETTCMxXQxOaWpMzhm1VODYpn1kPvKIqYPW5guCba05ywx++pnfAio wTADuk+5b1kuBY9xRx7AIRnsLGA= X-Mailgun-Sending-Ip: 198.61.254.9 X-Mailgun-Sid: WyI0MWYwYSIsICJsaW51eC1rZXJuZWxAdmdlci5rZXJuZWwub3JnIiwgImJlOWU0YSJd Received: from smtp.codeaurora.org (ec2-35-166-182-171.us-west-2.compute.amazonaws.com [35.166.182.171]) by smtp-out-n05.prod.us-west-2.postgun.com with SMTP id 60c9a0fce570c05619939a0d (version=TLS1.2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256); Wed, 16 Jun 2021 06:58:04 GMT Sender: saiprakash.ranjan=codeaurora.org@mg.codeaurora.org Received: by smtp.codeaurora.org (Postfix, from userid 1001) id 790E3C4323A; Wed, 16 Jun 2021 06:58:04 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-caf-mail-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=ALL_TRUSTED,BAYES_00 autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.codeaurora.org (localhost.localdomain [127.0.0.1]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) (Authenticated sender: saiprakash.ranjan) by smtp.codeaurora.org (Postfix) with ESMTPSA id B795BC4338A; Wed, 16 Jun 2021 06:58:03 +0000 (UTC) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Date: Wed, 16 Jun 2021 12:28:03 +0530 From: Sai Prakash Ranjan To: Robin Murphy Cc: Krishna Reddy , linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, iommu@lists.linux-foundation.org, Will Deacon , linux-arm-kernel@lists.infradead.org, Thierry Reding Subject: Re: [PATCH] iommu/io-pgtable-arm: Optimize partial walk flush for large scatter-gather list In-Reply-To: References: <20210609145315.25750-1-saiprakash.ranjan@codeaurora.org> <35bfd245-45e2-8083-b620-330d6dbd7bd7@arm.com> <12067ffb8243b220cf03e83aaac3e823@codeaurora.org> <266f190e-99ae-9175-cf13-7a77730af389@arm.com> <61c69d23-324a-85d7-2458-dfff8df9280b@arm.com> <07001b4ed6c0a491eacce6e4dc13ab5e@codeaurora.org> <5eb5146ab51a8fe0b558680d479a26cd@codeaurora.org> Message-ID: <8535b6c757a5584b495f135f4377053c@codeaurora.org> X-Sender: saiprakash.ranjan@codeaurora.org User-Agent: Roundcube Webmail/1.3.9 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Robin, On 2021-06-15 19:23, Robin Murphy wrote: > On 2021-06-15 12:51, Sai Prakash Ranjan wrote: ... >> 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