Received: by 2002:a05:6a10:2785:0:0:0:0 with SMTP id ia5csp321568pxb; Fri, 15 Jan 2021 04:17:16 -0800 (PST) X-Google-Smtp-Source: ABdhPJwOnudFVs5kJSaDWe6FM3ULNFIgoyhovo0BX86OurTaszzeZwgM9zsuXEMh01SX2iTkQ8E0 X-Received: by 2002:a05:6402:7d7:: with SMTP id u23mr9091985edy.325.1610713036340; Fri, 15 Jan 2021 04:17:16 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1610713036; cv=none; d=google.com; s=arc-20160816; b=f8oL+C5/VLo3NyiX9zepL40hHqSn4iyVHzOxoL9o+EBq8Bl6Tqse5XpTOr+psIwwJo k+GFUij1XFZWV52BgEU2Vlpoe3Yz1BhyIy+WXzLcqwAUmlXXVje41ZTDseG3/KJxJ3mQ fNltuyctibB0h9FoHssmibC5smYCA1kA2VZepA7P/FMcO/iBEjR4VbW/Yl5ZusRKMw0M QQGcBqNIyEnqTrD2rIcviZm8HFXzOe3yfbz6vxAMNZHO4cDlQEOTqEQ7Sro0/pDVxtvD zv//x35m5QvQ+lEy9IIwN7CbQ3Ed5d9HbfgYBVpe/Eepho1E8YDi5oVUp8mmxPzpQyIt 5Pmw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:references:in-reply-to:message-id:date:subject :cc:to:from; bh=VGiVt9Rw1xc3BpHb2Vt4D+uxzMQuXYAks7Et+68GaI8=; b=RnMf69w0c6TpwkoXBSfWKVnqAcMGiHxs7o8ZNcRgYbUcypbw6KkH6NdYxW1a1wB8KP k2HkTdWfQEpvK9J2UYZBVxPLsaqEFI4o6osv+K0ieZL6lL8G/FU5VPtxp54ujT4SxGTH ilQdNYlX3dfqDCXx/BMAug7E0XSsympG+BOLsa9Z+b111Y5R4mGPLUYP4/IuFVlMKqGl Xb7/RQBjBrOSmWWe8TngkT3Eqh8ND2uvPHuEEb676rZcPU5HgJCBs8FMfs+BvFEUpvDH uFT85fN4GKR+tWZ7qttoYAoH0ISlETzC2B7oLc6q11QHD62uxKWklHu9p3O/JjI4jGqX zgSQ== ARC-Authentication-Results: i=1; mx.google.com; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id n18si3624853ejr.448.2021.01.15.04.16.52; Fri, 15 Jan 2021 04:17:16 -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; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729451AbhAOMO6 (ORCPT + 99 others); Fri, 15 Jan 2021 07:14:58 -0500 Received: from foss.arm.com ([217.140.110.172]:37532 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729409AbhAOMO6 (ORCPT ); Fri, 15 Jan 2021 07:14:58 -0500 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 9E9881396; Fri, 15 Jan 2021 04:14:12 -0800 (PST) Received: from usa.arm.com (a074945.blr.arm.com [10.162.16.71]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 275AB3F70D; Fri, 15 Jan 2021 04:14:07 -0800 (PST) From: Vivek Gautam To: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, iommu@lists.linux-foundation.org, virtualization@lists.linux-foundation.org Cc: joro@8bytes.org, will.deacon@arm.com, mst@redhat.com, robin.murphy@arm.com, jean-philippe@linaro.org, eric.auger@redhat.com, alex.williamson@redhat.com, kevin.tian@intel.com, jacob.jun.pan@linux.intel.com, yi.l.liu@intel.com, lorenzo.pieralisi@arm.com, shameerali.kolothum.thodi@huawei.com, vivek.gautam@arm.com Subject: [PATCH RFC v1 04/15] iommu/arm-smmu-v3: Update CD base address info for user-space Date: Fri, 15 Jan 2021 17:43:31 +0530 Message-Id: <20210115121342.15093-5-vivek.gautam@arm.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20210115121342.15093-1-vivek.gautam@arm.com> References: <20210115121342.15093-1-vivek.gautam@arm.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Update base address information in vendor pasid table info to pass that to user-space for stage1 table management. Signed-off-by: Vivek Gautam Cc: Joerg Roedel Cc: Will Deacon Cc: Robin Murphy Cc: Jean-Philippe Brucker Cc: Eric Auger Cc: Alex Williamson Cc: Kevin Tian Cc: Jacob Pan Cc: Liu Yi L Cc: Lorenzo Pieralisi Cc: Shameerali Kolothum Thodi --- drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3-cd-lib.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3-cd-lib.c b/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3-cd-lib.c index 8a7187534706..ec37476c8d09 100644 --- a/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3-cd-lib.c +++ b/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3-cd-lib.c @@ -55,6 +55,9 @@ static __le64 *arm_smmu_get_cd_ptr(struct iommu_vendor_psdtable_cfg *pst_cfg, if (arm_smmu_alloc_cd_leaf_table(dev, l1_desc)) return NULL; + if (s1cfg->s1fmt == STRTAB_STE_0_S1FMT_LINEAR) + pst_cfg->base = l1_desc->l2ptr_dma; + l1ptr = cdcfg->cdtab + idx * CTXDESC_L1_DESC_DWORDS; arm_smmu_write_cd_l1_desc(l1ptr, l1_desc); /* An invalid L1CD can be cached */ @@ -211,6 +214,9 @@ static int arm_smmu_alloc_cd_tables(struct iommu_vendor_psdtable_cfg *pst_cfg) goto err_free_l1; } + if (s1cfg->s1fmt == STRTAB_STE_0_S1FMT_64K_L2) + pst_cfg->base = cdcfg->cdtab_dma; + return 0; err_free_l1: -- 2.17.1