Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp2364189pxk; Mon, 14 Sep 2020 11:16:41 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwbArrGDnztBuZ9rKKeZf3OyGutAAx9ztmGLqdXU/Twk25kZ6rcoIgqBcMhs5ukClSEXTnL X-Received: by 2002:aa7:d3da:: with SMTP id o26mr17978539edr.169.1600107401367; Mon, 14 Sep 2020 11:16:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1600107401; cv=none; d=google.com; s=arc-20160816; b=mnsyoGwqATVM/ghH098nTWLYaOzyHI4fLe21Y+GID7veh3v9MWLSXeLDLeN0RXfc87 DkXUD2yPQTfNEeo7OOt7c7ZE8MWMS5/Xc/Z1eSIROhCAkfELhJxQcM7e9ZEO9E5pgqtd UD8Dvc9aztB3nJTrY5Ck6b0xSdRbn7Ed9K91F3uVvRwSTL0q55ZCq4KMDD9HQ7d6kdzb 1D+KAkoeVbDPSqhYPAt6BtCnW7c2zcOeAoCOtrtP9x7cthETjM7dSRKlYCGOAnJbB7Xl Ypl1jBNA/vU9+ALJ3xEaqjIK2Ya/ZwpJdsB5NWtxVAFFdlm7beZpVjWPkjsK0V42A9Jd YREQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature:dkim-filter; bh=O7GLupHZ3pFPFMY1HucftGastWnLX6zwmGrMq8vy3/Q=; b=pXpkrfkwklqPmymkY3taihdvT8pek15sByP7AqW1oDOtf53Zepj7DQuKM5wfQOESAo BsnX3/mxLUWgiycP0bjPcsSQcE7Cv1iOBkk7P0Sj9YOZFg/l4Nqdu8EIn2ci5h2GLUew 3K2Vv3uHgo4Vb2rHgRaG2AHD3VIG7ZyuhsbQUlBAAgjYGpeWjUEYUeNctOBhTqjIZzZq bl5wK5ZWYxRPjbJzwgFEjs+ESNNBDc4eDYrIzKjh9IR4g4Jd42XNF0FuH8hR5uEh28e2 WI+0K9Is0G9nuQ1Z0b2ReP8VpEYiMAcLbzTf8JZiAIf1UbGnqSRh5gMAG1ylodIU91Jc RXIw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux.microsoft.com header.s=default header.b=FvzLRbDD; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linux.microsoft.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id 12si2324188ejn.498.2020.09.14.11.16.17; Mon, 14 Sep 2020 11:16:41 -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=@linux.microsoft.com header.s=default header.b=FvzLRbDD; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linux.microsoft.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726076AbgINSNg (ORCPT + 99 others); Mon, 14 Sep 2020 14:13:36 -0400 Received: from linux.microsoft.com ([13.77.154.182]:42804 "EHLO linux.microsoft.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725984AbgINSNN (ORCPT ); Mon, 14 Sep 2020 14:13:13 -0400 Received: from vennila-Virtual-Machine.redmond.corp.microsoft.com (unknown [131.107.159.190]) by linux.microsoft.com (Postfix) with ESMTPSA id 39C22209F32A; Mon, 14 Sep 2020 11:13:13 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com 39C22209F32A DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1600107193; bh=O7GLupHZ3pFPFMY1HucftGastWnLX6zwmGrMq8vy3/Q=; h=From:To:Cc:Subject:Date:From; b=FvzLRbDDDQ0e3o8Xv8DroMUwzD8FyDiLQjkhEkuxRsYaSBRXGwAfzHH5QdmnCSie4 ZzB52f1Zlpq3WImYIGvfufg8G674cmHPUwl8gavyQUVYyBvacLyU2yrO21Ry+w2zmV 2fjoh1StkSTJX0WStYOVObcYo75weOlRNY9Fhkog= From: Vennila Megavannan To: will@kernel.org, robin.murphy@arm.com, joro@8bytes.org Cc: srinath.mannam@broadcom.com, jean-philippe@linaro.org, eric.auger@redhat.com, shameerali.kolothum.thodi@huawei.com, tyhicks@linux.microsoft.com, linux-arm-kernel@lists.infradead.org, iommu@lists.linux-foundation.org, linux-kernel@vger.kernel.org, bcm-kernel-feedback-list@broadcom.com Subject: [PATCH v2] iommu/arm: Add module parameter to set msi iova address Date: Mon, 14 Sep 2020 11:13:07 -0700 Message-Id: <20200914181307.117792-1-vemegava@linux.microsoft.com> X-Mailer: git-send-email 2.17.1 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Srinath Mannam Add provision to change default value of MSI IOVA base to platform's suitable IOVA using module parameter. The present hardcoded MSI IOVA base may not be the accessible IOVA ranges of platform. If any platform has the limitaion to access default MSI IOVA, then it can be changed using "arm-smmu.msi_iova_base=0xa0000000" command line argument. Signed-off-by: Srinath Mannam Co-developed-by: Vennila Megavannan Signed-off-by: Vennila Megavannan --- drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c | 5 ++++- drivers/iommu/arm/arm-smmu/arm-smmu.c | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c b/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c index c192544e874b..dfef0df66c19 100644 --- a/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c +++ b/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c @@ -417,6 +417,9 @@ static bool disable_bypass = 1; module_param_named(disable_bypass, disable_bypass, bool, S_IRUGO); MODULE_PARM_DESC(disable_bypass, "Disable bypass streams such that incoming transactions from devices that are not attached to an iommu domain will report an abort back to the device and will not be allowed to pass through the SMMU."); +static unsigned long msi_iova_base = MSI_IOVA_BASE; +module_param(msi_iova_base, ulong, S_IRUGO); +MODULE_PARM_DESC(msi_iova_base, "set MSI IOVA base address if default (0x8000000) does not work for your platform."); enum pri_resp { PRI_RESP_DENY = 0, @@ -3102,7 +3105,7 @@ static void arm_smmu_get_resv_regions(struct device *dev, struct iommu_resv_region *region; int prot = IOMMU_WRITE | IOMMU_NOEXEC | IOMMU_MMIO; - region = iommu_alloc_resv_region(MSI_IOVA_BASE, MSI_IOVA_LENGTH, + region = iommu_alloc_resv_region(msi_iova_base, MSI_IOVA_LENGTH, prot, IOMMU_RESV_SW_MSI); if (!region) return; diff --git a/drivers/iommu/arm/arm-smmu/arm-smmu.c b/drivers/iommu/arm/arm-smmu/arm-smmu.c index 09c42af9f31e..9d46a2628dd5 100644 --- a/drivers/iommu/arm/arm-smmu/arm-smmu.c +++ b/drivers/iommu/arm/arm-smmu/arm-smmu.c @@ -64,6 +64,9 @@ static bool disable_bypass = module_param(disable_bypass, bool, S_IRUGO); MODULE_PARM_DESC(disable_bypass, "Disable bypass streams such that incoming transactions from devices that are not attached to an iommu domain will report an abort back to the device and will not be allowed to pass through the SMMU."); +static unsigned long msi_iova_base = MSI_IOVA_BASE; +module_param(msi_iova_base, ulong, S_IRUGO); +MODULE_PARM_DESC(msi_iova_base, "set MSI IOVA base address if default (0x8000000) does not work for your platform."); struct arm_smmu_s2cr { struct iommu_group *group; @@ -1603,7 +1606,7 @@ static void arm_smmu_get_resv_regions(struct device *dev, struct iommu_resv_region *region; int prot = IOMMU_WRITE | IOMMU_NOEXEC | IOMMU_MMIO; - region = iommu_alloc_resv_region(MSI_IOVA_BASE, MSI_IOVA_LENGTH, + region = iommu_alloc_resv_region(msi_iova_base, MSI_IOVA_LENGTH, prot, IOMMU_RESV_SW_MSI); if (!region) return; -- 2.17.1