From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8E7FAC433EF for ; Mon, 11 Oct 2021 15:44:18 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 6056660E94 for ; Mon, 11 Oct 2021 15:44:18 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 6056660E94 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=huawei.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:In-Reply-To:References: Message-ID:Date:Subject:CC:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=smtes5a/EC8DSeQv1ag9a6hix8Dvd4/tLO4+E0z5QOs=; b=sAAujbq1ovBpeC t9IhNTtQQD96uvuVBs9hRHgDK2O/d9srDHSMpKGHkWlyIO5vwBEK6Y3S6KOLPHdOtTXgSSXCojGqh kjefFF+n8fqWXKqc9yTG5/fnTLzlebqQBcBmtRVSxX30lwZIXrNPX2JIgpVmVi5GnRHhSmyh/m4zo y6C8fvH/RxBEhcStVDftqnL3THOwCJqjqrDoy3NFgsKFYGQJMJKJIbqCf/UP+xIq8u42xB9+mR6k6 kMJWFqYfkUCTI1/hsVHyIid3vnPy/DR+XDHeqkHBVVOAsGaxtso6b+dzTvXnRkDi1TijMlMqQ2e1a +gAzArKZiDe+GtHX5epw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mZxRb-009wzK-RN; Mon, 11 Oct 2021 15:42:28 +0000 Received: from szxga03-in.huawei.com ([45.249.212.189]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mZxRW-009wy5-C2 for linux-arm-kernel@lists.infradead.org; Mon, 11 Oct 2021 15:42:25 +0000 Received: from dggemv703-chm.china.huawei.com (unknown [172.30.72.56]) by szxga03-in.huawei.com (SkyGuard) with ESMTP id 4HSjgr6NBGz8tYr; Mon, 11 Oct 2021 23:41:12 +0800 (CST) Received: from dggpemm100006.china.huawei.com (7.185.36.196) by dggemv703-chm.china.huawei.com (10.3.19.46) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.8; Mon, 11 Oct 2021 23:42:17 +0800 Received: from lhreml710-chm.china.huawei.com (10.201.108.61) by dggpemm100006.china.huawei.com (7.185.36.196) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.8; Mon, 11 Oct 2021 23:42:16 +0800 Received: from lhreml710-chm.china.huawei.com ([169.254.81.184]) by lhreml710-chm.china.huawei.com ([169.254.81.184]) with mapi id 15.01.2308.008; Mon, 11 Oct 2021 16:42:14 +0100 From: Shameerali Kolothum Thodi To: Robin Murphy , Jon Nettleton CC: linux-arm-kernel , "ACPI Devel Maling List" , Linux IOMMU , Linuxarm , "Lorenzo Pieralisi" , Joerg Roedel , "Will Deacon" , wanghuiqiang , "Guohanjun (Hanjun Guo)" , Steven Price , Sami Mujawar , Eric Auger , yangyicong Subject: RE: [PATCH v7 9/9] iommu/dma: Reserve any RMR regions associated with a dev Thread-Topic: [PATCH v7 9/9] iommu/dma: Reserve any RMR regions associated with a dev Thread-Index: AQHXidFJPtitnW05ZU6HeLs3tvFT7qvJZyyAgAEtMACAA6jKAIAAG4sQ Date: Mon, 11 Oct 2021 15:42:14 +0000 Message-ID: <9a84c9d20094403ea5aea53d6f6c304f@huawei.com> References: <20210805080724.480-1-shameerali.kolothum.thodi@huawei.com> <20210805080724.480-10-shameerali.kolothum.thodi@huawei.com> <44e00e32-be89-1174-beb5-9a2fca85a683@arm.com> <706e2dc8-37af-2344-0d99-6da1f27ba0fb@arm.com> In-Reply-To: <706e2dc8-37af-2344-0d99-6da1f27ba0fb@arm.com> Accept-Language: en-GB, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.47.25.32] MIME-Version: 1.0 X-CFilter-Loop: Reflected X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20211011_084223_556758_6DAC7263 X-CRM114-Status: GOOD ( 22.55 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org > -----Original Message----- > From: Robin Murphy [mailto:robin.murphy@arm.com] > Sent: 11 October 2021 16:01 > To: Jon Nettleton > Cc: Shameerali Kolothum Thodi ; > linux-arm-kernel ; ACPI Devel Maling > List ; Linux IOMMU > ; Linuxarm ; > Lorenzo Pieralisi ; Joerg Roedel > ; Will Deacon ; wanghuiqiang > ; Guohanjun (Hanjun Guo) > ; Steven Price ; Sami > Mujawar ; Eric Auger ; > yangyicong > Subject: Re: [PATCH v7 9/9] iommu/dma: Reserve any RMR regions associated > with a dev > > On 2021-10-09 08:07, Jon Nettleton wrote: > > On Fri, Oct 8, 2021 at 3:10 PM Robin Murphy > wrote: > >> > >> On 2021-08-05 09:07, Shameer Kolothum wrote: > >>> Get ACPI IORT RMR regions associated with a dev reserved > >>> so that there is a unity mapping for them in SMMU. > >> > >> This feels like most of it belongs in the IORT code rather than > >> iommu-dma (which should save the temporary list copy as well). > > > > See previous comment. The original intent was for device-tree to also > > be able to use these mechanisms to create RMR's and support them > > in the SMMU. > > Can you clarify how code behind an "if (!is_of_node(...))" check > alongside other IORT-specific code is expected to be useful for DT? > > Yes, iommu_dma_get_resv_regions() itself wants to end up serving as an > abstraction layer, but that still doesn't mean it has to do much more > than dispatch into firmware-specific backends as appropriate. (Resending as I accidently replied earlier from our internal ML id. Sorry) The way I thought about is as below, 1. iommu_dma_get_resv_regions() will invoke the common iommu_dma_get_rmr_resv_regions(). Yes, the if (!is_of_node(...)) is not required here. 2. iommu_dma_get_rmr_resv_regions() calls iommu_dma_get_rmrs(). iommu_dma_get_rmrs() has the (!is_of_node(...)) check to call into IORT or DT specific functions to retrieve the RMR reserve regions associated with a given iommu_fwnode. 3. The common iommu_dma_get_rmr_resv_regions() further checks for PCI host preserve_config and whether the returned RMR list actually has any dev specific region to reserve or not. So the only firmware specific backend is handled inside the iommu_dma_get_rmrs() and that is also called from the SMMU driver probe to install bypass SIDs. Anyway, if the eventual DT implementation or further IORT spec changes makes this abstraction irrelevant I am Ok to move this into the IORT code. Thanks, Shameer _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel