Received: by 2002:a05:6a10:2785:0:0:0:0 with SMTP id ia5csp2297155pxb; Mon, 11 Jan 2021 06:19:25 -0800 (PST) X-Google-Smtp-Source: ABdhPJzbj+I8uH2c1c4xnagoe6tOn5mEUchw0zeCVst5vIqZa9LZ5QMaXXmYzfIegvWzYNcHdpa2 X-Received: by 2002:aa7:c58a:: with SMTP id g10mr14087910edq.315.1610374764899; Mon, 11 Jan 2021 06:19:24 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1610374764; cv=none; d=google.com; s=arc-20160816; b=Zv18y5vtPRWMAAvqvDQ11WCDUSn/W1FhTiF5SEePsptZTqqGNrUvb3axsEWdF08gVe 427xEJo57I93Knunnczr3AXGmD8G32H5VugtIJhvKtRlHowTrrfFA/D7zMxFQZ78uK2q 9iQngAB0PsDWh4yK+WGUTWRmDc/fO8UQr5gnbj76ocn5eOuYoShBrXEcD+ny2GxRcUTE lewmrQm64/EtJOo1mS68jMMd3jHSkIRMGp5lyyj7YSoXlihua6f7N7mGWo3Abpr0pXPi 44pU8LmitOmEWZKL1uYqgnNUEyFoMgFN5f4nKjH/p934EI7q64rZGgUbr33ttKlC6SNb NRqA== 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=eiM2UOZ6hpfSzg4IkDKgfLblWUge3D6QsBc+85ur9bA=; b=fJn2qS2suiPACUoNQeSdNhn8ghI+ZT56mD0IUi5ywhvvDHy6lO465DI79IEda1Hjz1 fOzwl13Uh02VUKpMnCpPfL3vQCt8HiAeaze9/daCiktidJQMyw6Eva9x63BcB+4ZZiw7 RBAg04UvLCh6MCTJ4eI2yHQ55oIJDGFrdTeLnAEECRctWf9+yI/4ghmoUs3FVv4lnFtJ GrmhL98yci0k2+vJunTxAtoZ4sMwLH67pBNwPNi+z7YvxJnfnVqfjPN29Kjif3p/hjR/ yQysPVwO36re68IZCfjPoHd0pAXDhiizXF2Kb+ANnxfjWh+SW6sdSzpkPd+LThQ0WFx0 PImA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@mg.codeaurora.org header.s=smtp header.b=ASHksGep; 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 d16si6735153edp.251.2021.01.11.06.19.00; Mon, 11 Jan 2021 06:19:24 -0800 (PST) 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=ASHksGep; 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 S1730011AbhAKOQ0 (ORCPT + 99 others); Mon, 11 Jan 2021 09:16:26 -0500 Received: from m43-15.mailgun.net ([69.72.43.15]:27420 "EHLO m43-15.mailgun.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726999AbhAKOQZ (ORCPT ); Mon, 11 Jan 2021 09:16:25 -0500 DKIM-Signature: a=rsa-sha256; v=1; c=relaxed/relaxed; d=mg.codeaurora.org; q=dns/txt; s=smtp; t=1610374559; h=Content-Transfer-Encoding: MIME-Version: References: In-Reply-To: Message-Id: Date: Subject: Cc: To: From: Sender; bh=eiM2UOZ6hpfSzg4IkDKgfLblWUge3D6QsBc+85ur9bA=; b=ASHksGepUqOpMuEnrHDcpfIp77a0QvzWrAPUFdrzFLUjAsfz39E8teLUAzBzpbGZ/zoliXCE vz9iZ0T4CfqMSaqUmqs3nNy9Rav+Q3xojFeFiDmL5zcpCPOPrc/ovHlFxQgiYJvv2+dDZuf3 9SG3/S1MX6gOhlLR/KZYgx5hhSA= X-Mailgun-Sending-Ip: 69.72.43.15 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-east-1.postgun.com with SMTP id 5ffc5d838fb3cda82fc23929 (version=TLS1.2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256); Mon, 11 Jan 2021 14:15:31 GMT Sender: saiprakash.ranjan=codeaurora.org@mg.codeaurora.org Received: by smtp.codeaurora.org (Postfix, from userid 1001) id DEC8EC433ED; Mon, 11 Jan 2021 14:15:30 +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 659F5C433CA; Mon, 11 Jan 2021 14:15:24 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org 659F5C433CA 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 , Jordan Crouse , Rob Clark , Akhil P Oommen , isaacm@codeaurora.org Cc: iommu@lists.linux-foundation.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, freedreno , Kristian H Kristensen , Sean Paul , David Airlie , Daniel Vetter , dri-devel@lists.freedesktop.org, Sai Prakash Ranjan Subject: [PATCH 1/3] iommu/io-pgtable: Rename last-level cache quirk to IO_PGTABLE_QUIRK_PTW_LLC Date: Mon, 11 Jan 2021 19:45:03 +0530 Message-Id: <2efa980419567aeebbe677b696ef0c3bec9c51cf.1610372717.git.saiprakash.ranjan@codeaurora.org> 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 Rename last-level cache quirk IO_PGTABLE_QUIRK_ARM_OUTER_WBWA to IO_PGTABLE_QUIRK_PTW_LLC which is used to set the required TCR attributes for non-coherent page table walker to be more generic and in sync with the upcoming page protection flag IOMMU_LLC. Signed-off-by: Sai Prakash Ranjan --- drivers/gpu/drm/msm/adreno/adreno_gpu.c | 2 +- drivers/iommu/io-pgtable-arm.c | 6 +++--- include/linux/io-pgtable.h | 6 +++--- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/drivers/gpu/drm/msm/adreno/adreno_gpu.c b/drivers/gpu/drm/msm/adreno/adreno_gpu.c index 0f184c3dd9d9..82b5e4969195 100644 --- a/drivers/gpu/drm/msm/adreno/adreno_gpu.c +++ b/drivers/gpu/drm/msm/adreno/adreno_gpu.c @@ -190,7 +190,7 @@ void adreno_set_llc_attributes(struct iommu_domain *iommu) { struct io_pgtable_domain_attr pgtbl_cfg; - pgtbl_cfg.quirks = IO_PGTABLE_QUIRK_ARM_OUTER_WBWA; + pgtbl_cfg.quirks = IO_PGTABLE_QUIRK_PTW_LLC; iommu_domain_set_attr(iommu, DOMAIN_ATTR_IO_PGTABLE_CFG, &pgtbl_cfg); } diff --git a/drivers/iommu/io-pgtable-arm.c b/drivers/iommu/io-pgtable-arm.c index 7c9ea9d7874a..7439ee7fdcdb 100644 --- a/drivers/iommu/io-pgtable-arm.c +++ b/drivers/iommu/io-pgtable-arm.c @@ -762,7 +762,7 @@ 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_PTW_LLC)) return NULL; data = arm_lpae_alloc_pgtable(cfg); @@ -774,12 +774,12 @@ arm_64_lpae_alloc_pgtable_s1(struct io_pgtable_cfg *cfg, void *cookie) tcr->sh = ARM_LPAE_TCR_SH_IS; tcr->irgn = ARM_LPAE_TCR_RGN_WBWA; tcr->orgn = ARM_LPAE_TCR_RGN_WBWA; - if (cfg->quirks & IO_PGTABLE_QUIRK_ARM_OUTER_WBWA) + if (cfg->quirks & IO_PGTABLE_QUIRK_PTW_LLC) goto out_free_data; } else { tcr->sh = ARM_LPAE_TCR_SH_OS; tcr->irgn = ARM_LPAE_TCR_RGN_NC; - if (!(cfg->quirks & IO_PGTABLE_QUIRK_ARM_OUTER_WBWA)) + if (!(cfg->quirks & IO_PGTABLE_QUIRK_PTW_LLC)) tcr->orgn = ARM_LPAE_TCR_RGN_NC; else tcr->orgn = ARM_LPAE_TCR_RGN_WBWA; diff --git a/include/linux/io-pgtable.h b/include/linux/io-pgtable.h index fb4d5a763e0c..6f996a817441 100644 --- a/include/linux/io-pgtable.h +++ b/include/linux/io-pgtable.h @@ -87,8 +87,8 @@ struct io_pgtable_cfg { * IO_PGTABLE_QUIRK_ARM_TTBR1: (ARM LPAE format) Configure the table * for use in the upper half of a split address space. * - * 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_PTW_LLC: Override the outer-cacheability attributes + * set in the TCR for a non-coherent page-table walker. */ #define IO_PGTABLE_QUIRK_ARM_NS BIT(0) #define IO_PGTABLE_QUIRK_NO_PERMS BIT(1) @@ -96,7 +96,7 @@ struct io_pgtable_cfg { #define IO_PGTABLE_QUIRK_ARM_MTK_EXT BIT(3) #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_PTW_LLC BIT(6) 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