Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp1034255pxj; Thu, 17 Jun 2021 20:47:09 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz8BylcR+lG+1/TJDVFce7Ay30XolLNqbpyZmjA4gWFUZVROAE5Rc3zDAbaYTDGQMOXRVTu X-Received: by 2002:a17:906:470c:: with SMTP id y12mr865928ejq.54.1623988028823; Thu, 17 Jun 2021 20:47:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1623988028; cv=none; d=google.com; s=arc-20160816; b=yUh7QspTxp3nfF+HteimLkIJTsJ+NOw4fPYu+TlpAnWY63b5h5BcQ5lARpQibaBQxC /nyisI/roYgmhOvlK+VLQyAzEqN6s322c5ZDSHTS/abGoe5uqgYUdVOHf3NgT1KvDmTU 2moPtAUslLywp3OSYQOoMnFa9awv2Y3XkpkIUnBkIh/tv+GAyIOnystQ3i3QsRsI7dsn snvZwJLW7Rzqkm+NRHnOluqVU5jIcMm7xhdxk50whUbc+8g+dIvnNWy+2chYy6iWFY3s chZ6aB1tunM1/ImtFvwnwi2YfzeqBw43YG2FazZVlPhDLUbu1w0LQnUOjHAyk58/YMcS 8SnA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dmarc-filter:sender:dkim-signature; bh=zxQPpeHE4PXZNtmwVzMelrgiyD5OIghIFBC3EGIdK0Q=; b=z8P/VEq13CDpLwK7BGF/iQZt67SGsSu5AOQgcQWnhyVcU3x6XGkX5zfjj1orCPa/UN FNVHhK0ZGuQfyhy4AetIMHFiUQpE1oepnc6KgkGhCFn2fVT80q66OyCVpulGM8cLydZq lEIOCnrhKkIIAVq31Y71K8XX34bDKVBxnIE2WzA6Pv46Z3av6duvdyPRStFq2c4HQomg plhmWaWm0V7/Tf08Y1eQSB0+psjc+Y+8tlhPoZ22thud/Jh040S4VdoBxpkesYnyrwSk 18GLW3I6pNRVJunUvrDq74r7YdUOREpRArwgDyN38gN8uhgu51pbGSgI32HUkSgi1wKM nWqQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@mg.codeaurora.org header.s=smtp header.b=rRBjLrm6; 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 cb22si7798870edb.401.2021.06.17.20.46.46; Thu, 17 Jun 2021 20:47:08 -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=rRBjLrm6; 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 S231298AbhFRCxl (ORCPT + 99 others); Thu, 17 Jun 2021 22:53:41 -0400 Received: from so254-9.mailgun.net ([198.61.254.9]:24291 "EHLO so254-9.mailgun.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231689AbhFRCxk (ORCPT ); Thu, 17 Jun 2021 22:53:40 -0400 DKIM-Signature: a=rsa-sha256; v=1; c=relaxed/relaxed; d=mg.codeaurora.org; q=dns/txt; s=smtp; t=1623984691; h=Content-Transfer-Encoding: MIME-Version: References: In-Reply-To: Message-Id: Date: Subject: Cc: To: From: Sender; bh=zxQPpeHE4PXZNtmwVzMelrgiyD5OIghIFBC3EGIdK0Q=; b=rRBjLrm6Rkdsuy+aFGN0C1sWhBlq8w8pAsN5Fnsw9ojsf3TdImsbc5PIv3nXCTsi2u2Kxnmy HXzEzuMXtMEqS9JGm/5oSKTwUZajvakOy5c8RcurWqtwxmDISZwO8zHfB4cuXMOgD3kdBkBt VOkSqUea++Lgo5JSHjZLkQ5ioqg= 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-n07.prod.us-west-2.postgun.com with SMTP id 60cc0a2fb6ccaab753da6e2b (version=TLS1.2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256); Fri, 18 Jun 2021 02:51:27 GMT Sender: saiprakash.ranjan=codeaurora.org@mg.codeaurora.org Received: by smtp.codeaurora.org (Postfix, from userid 1001) id AC490C4360C; Fri, 18 Jun 2021 02:51:27 +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,SPF_FAIL, URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.0 Received: from blr-ubuntu-253.qualcomm.com (blr-bdr-fw-01_GlobalNAT_AllZones-Outside.qualcomm.com [103.229.18.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: saiprakash.ranjan) by smtp.codeaurora.org (Postfix) with ESMTPSA id 283B3C4338A; Fri, 18 Jun 2021 02:51:22 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org 283B3C4338A Authentication-Results: aws-us-west-2-caf-mail-1.web.codeaurora.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: aws-us-west-2-caf-mail-1.web.codeaurora.org; spf=fail smtp.mailfrom=saiprakash.ranjan@codeaurora.org From: Sai Prakash Ranjan To: Will Deacon , Robin Murphy , Joerg Roedel Cc: iommu@lists.linux-foundation.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, Bjorn Andersson , Douglas Anderson , Krishna Reddy , Thierry Reding , Tomasz Figa , Sai Prakash Ranjan Subject: [PATCHv2 1/3] iommu/io-pgtable: Add a quirk to use tlb_flush_all() for partial walk flush Date: Fri, 18 Jun 2021 08:21:03 +0530 Message-Id: X-Mailer: git-send-email 2.29.0 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Add a quirk IO_PGTABLE_QUIRK_TLB_INV_ALL to invalidate entire context with tlb_flush_all() callback in partial walk flush to improve unmap performance on select few platforms where the cost of over-invalidation is less than the unmap latency. Signed-off-by: Sai Prakash Ranjan --- drivers/iommu/io-pgtable-arm.c | 3 ++- include/linux/io-pgtable.h | 5 +++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/drivers/iommu/io-pgtable-arm.c b/drivers/iommu/io-pgtable-arm.c index 87def58e79b5..5d362f2214bd 100644 --- a/drivers/iommu/io-pgtable-arm.c +++ b/drivers/iommu/io-pgtable-arm.c @@ -768,7 +768,8 @@ arm_64_lpae_alloc_pgtable_s1(struct io_pgtable_cfg *cfg, void *cookie) if (cfg->quirks & ~(IO_PGTABLE_QUIRK_ARM_NS | IO_PGTABLE_QUIRK_NON_STRICT | IO_PGTABLE_QUIRK_ARM_TTBR1 | - IO_PGTABLE_QUIRK_ARM_OUTER_WBWA)) + IO_PGTABLE_QUIRK_ARM_OUTER_WBWA | + IO_PGTABLE_QUIRK_TLB_INV_ALL)) return NULL; data = arm_lpae_alloc_pgtable(cfg); diff --git a/include/linux/io-pgtable.h b/include/linux/io-pgtable.h index 4d40dfa75b55..45441592a0e6 100644 --- a/include/linux/io-pgtable.h +++ b/include/linux/io-pgtable.h @@ -82,6 +82,10 @@ struct io_pgtable_cfg { * * IO_PGTABLE_QUIRK_ARM_OUTER_WBWA: Override the outer-cacheability * attributes set in the TCR for a non-coherent page-table walker. + * + * IO_PGTABLE_QUIRK_TLB_INV_ALL: Use TLBIALL/TLBIASID to invalidate + * entire context for partial walk flush to increase unmap + * performance on select few platforms. */ #define IO_PGTABLE_QUIRK_ARM_NS BIT(0) #define IO_PGTABLE_QUIRK_NO_PERMS BIT(1) @@ -89,6 +93,7 @@ struct io_pgtable_cfg { #define IO_PGTABLE_QUIRK_NON_STRICT BIT(4) #define IO_PGTABLE_QUIRK_ARM_TTBR1 BIT(5) #define IO_PGTABLE_QUIRK_ARM_OUTER_WBWA BIT(6) + #define IO_PGTABLE_QUIRK_TLB_INV_ALL BIT(7) unsigned long quirks; unsigned long pgsize_bitmap; unsigned int ias; -- QUALCOMM INDIA, on behalf of Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, hosted by The Linux Foundation