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 X-Spam-Level: X-Spam-Status: No, score=-3.7 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8B0F7C433B4 for ; Wed, 19 May 2021 09:30:28 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 64582611BD for ; Wed, 19 May 2021 09:30:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345404AbhESJbl convert rfc822-to-8bit (ORCPT ); Wed, 19 May 2021 05:31:41 -0400 Received: from szxga05-in.huawei.com ([45.249.212.191]:3025 "EHLO szxga05-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345392AbhESJbl (ORCPT ); Wed, 19 May 2021 05:31:41 -0400 Received: from dggems701-chm.china.huawei.com (unknown [172.30.72.58]) by szxga05-in.huawei.com (SkyGuard) with ESMTP id 4FlSDn5vZMzQpk8; Wed, 19 May 2021 17:26:49 +0800 (CST) Received: from dggpemm100001.china.huawei.com (7.185.36.93) by dggems701-chm.china.huawei.com (10.3.19.178) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2176.2; Wed, 19 May 2021 17:30:18 +0800 Received: from lhreml710-chm.china.huawei.com (10.201.108.61) by dggpemm100001.china.huawei.com (7.185.36.93) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2176.2; Wed, 19 May 2021 17:30:17 +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.2176.012; Wed, 19 May 2021 10:30:15 +0100 From: Shameerali Kolothum Thodi To: Joerg Roedel CC: "linux-arm-kernel@lists.infradead.org" , "linux-acpi@vger.kernel.org" , "iommu@lists.linux-foundation.org" , Linuxarm , "lorenzo.pieralisi@arm.com" , "robin.murphy@arm.com" , wanghuiqiang , "Guohanjun (Hanjun Guo)" , "steven.price@arm.com" , "Sami.Mujawar@arm.com" , "jon@solid-run.com" , "eric.auger@redhat.com" , yangyicong Subject: RE: [PATCH v4 2/8] iommu/dma: Introduce generic helper to retrieve RMR info Thread-Topic: [PATCH v4 2/8] iommu/dma: Introduce generic helper to retrieve RMR info Thread-Index: AQHXR/5vIFqlrwXwY0CsHMfFqGdLc6ro5LaAgACKY2A= Date: Wed, 19 May 2021 09:30:14 +0000 Message-ID: <503068eb5f184639a75d7d1ef929b4c6@huawei.com> References: <20210513134550.2117-1-shameerali.kolothum.thodi@huawei.com> <20210513134550.2117-3-shameerali.kolothum.thodi@huawei.com> In-Reply-To: Accept-Language: en-GB, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.47.88.84] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 8BIT MIME-Version: 1.0 X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org > -----Original Message----- > From: Joerg Roedel [mailto:joro@8bytes.org] > Sent: 18 May 2021 09:50 > To: Shameerali Kolothum Thodi > Cc: linux-arm-kernel@lists.infradead.org; linux-acpi@vger.kernel.org; > iommu@lists.linux-foundation.org; Linuxarm ; > lorenzo.pieralisi@arm.com; robin.murphy@arm.com; wanghuiqiang > ; Guohanjun (Hanjun Guo) > ; steven.price@arm.com; Sami.Mujawar@arm.com; > jon@solid-run.com; eric.auger@redhat.com; yangyicong > > Subject: Re: [PATCH v4 2/8] iommu/dma: Introduce generic helper to retrieve > RMR info > > On Thu, May 13, 2021 at 02:45:44PM +0100, Shameer Kolothum wrote: > > +/** > > + * struct iommu_rmr - Reserved Memory Region details per IOMMU > > + * @list: Linked list pointers to hold RMR region info > > + * @base_address: base address of Reserved Memory Region > > + * @length: length of memory region > > + * @sid: associated stream id > > + * @flags: flags that apply to the RMR node > > + */ > > +struct iommu_rmr { > > + struct list_head list; > > + phys_addr_t base_address; > > + u64 length; > > + u32 sid; > > + u32 flags; > > +}; > > + > > +/* RMR Remap permitted */ > > +#define IOMMU_RMR_REMAP_PERMITTED (1 << 0) > > + > > This struct has lots of overlap with 'struct iommu_resv_region'. Any > reason the existing struct can't be used here? > Hmm..main reason is "sid". RMRs are associated with stream ids and that is used to install bypass STEs/SMRs in SMMU drivers and also to check whether a dev has any RMR regions associated with it. I think we could add sid/dev_id to 'struct iommu_resv_region', and modify iommu_alloc_resv_region() accordingly. That can get rid of the above struct and iommu_dma_alloc_rmr() fn. Not sure this will complicate things as the dev_id is only valid for RMR reservation region cases. Please let me know your thoughts. Thanks, Shameer 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 X-Spam-Level: X-Spam-Status: No, score=-3.7 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 59D83C43460 for ; Wed, 19 May 2021 09:30:30 +0000 (UTC) Received: from smtp3.osuosl.org (smtp3.osuosl.org [140.211.166.136]) (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 DB107611B0 for ; Wed, 19 May 2021 09:30:29 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org DB107611B0 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=huawei.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=iommu-bounces@lists.linux-foundation.org Received: from localhost (localhost [127.0.0.1]) by smtp3.osuosl.org (Postfix) with ESMTP id A8ADB6066E; Wed, 19 May 2021 09:30:29 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp3.osuosl.org ([127.0.0.1]) by localhost (smtp3.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id nwLL6zx0HtTN; Wed, 19 May 2021 09:30:28 +0000 (UTC) Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [IPv6:2605:bc80:3010:104::8cd3:938]) by smtp3.osuosl.org (Postfix) with ESMTP id 8238660657; Wed, 19 May 2021 09:30:28 +0000 (UTC) Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id 52A00C000E; Wed, 19 May 2021 09:30:28 +0000 (UTC) Received: from smtp1.osuosl.org (smtp1.osuosl.org [IPv6:2605:bc80:3010::138]) by lists.linuxfoundation.org (Postfix) with ESMTP id 770A5C0001 for ; Wed, 19 May 2021 09:30:26 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp1.osuosl.org (Postfix) with ESMTP id 7206384225 for ; Wed, 19 May 2021 09:30:26 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp1.osuosl.org ([127.0.0.1]) by localhost (smtp1.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id y2b-uvYAmW27 for ; Wed, 19 May 2021 09:30:24 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.8.0 Received: from szxga05-in.huawei.com (szxga05-in.huawei.com [45.249.212.191]) by smtp1.osuosl.org (Postfix) with ESMTPS id 6DA9E83C63 for ; Wed, 19 May 2021 09:30:24 +0000 (UTC) Received: from dggems701-chm.china.huawei.com (unknown [172.30.72.58]) by szxga05-in.huawei.com (SkyGuard) with ESMTP id 4FlSDn5vZMzQpk8; Wed, 19 May 2021 17:26:49 +0800 (CST) Received: from dggpemm100001.china.huawei.com (7.185.36.93) by dggems701-chm.china.huawei.com (10.3.19.178) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2176.2; Wed, 19 May 2021 17:30:18 +0800 Received: from lhreml710-chm.china.huawei.com (10.201.108.61) by dggpemm100001.china.huawei.com (7.185.36.93) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2176.2; Wed, 19 May 2021 17:30:17 +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.2176.012; Wed, 19 May 2021 10:30:15 +0100 From: Shameerali Kolothum Thodi To: Joerg Roedel Subject: RE: [PATCH v4 2/8] iommu/dma: Introduce generic helper to retrieve RMR info Thread-Topic: [PATCH v4 2/8] iommu/dma: Introduce generic helper to retrieve RMR info Thread-Index: AQHXR/5vIFqlrwXwY0CsHMfFqGdLc6ro5LaAgACKY2A= Date: Wed, 19 May 2021 09:30:14 +0000 Message-ID: <503068eb5f184639a75d7d1ef929b4c6@huawei.com> References: <20210513134550.2117-1-shameerali.kolothum.thodi@huawei.com> <20210513134550.2117-3-shameerali.kolothum.thodi@huawei.com> In-Reply-To: Accept-Language: en-GB, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.47.88.84] MIME-Version: 1.0 X-CFilter-Loop: Reflected Cc: "jon@solid-run.com" , Linuxarm , "steven.price@arm.com" , "linux-acpi@vger.kernel.org" , "iommu@lists.linux-foundation.org" , wanghuiqiang , "Guohanjun \(Hanjun Guo\)" , yangyicong , "Sami.Mujawar@arm.com" , "robin.murphy@arm.com" , "linux-arm-kernel@lists.infradead.org" X-BeenThere: iommu@lists.linux-foundation.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: Development issues for Linux IOMMU support List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: iommu-bounces@lists.linux-foundation.org Sender: "iommu" > -----Original Message----- > From: Joerg Roedel [mailto:joro@8bytes.org] > Sent: 18 May 2021 09:50 > To: Shameerali Kolothum Thodi > Cc: linux-arm-kernel@lists.infradead.org; linux-acpi@vger.kernel.org; > iommu@lists.linux-foundation.org; Linuxarm ; > lorenzo.pieralisi@arm.com; robin.murphy@arm.com; wanghuiqiang > ; Guohanjun (Hanjun Guo) > ; steven.price@arm.com; Sami.Mujawar@arm.com; > jon@solid-run.com; eric.auger@redhat.com; yangyicong > > Subject: Re: [PATCH v4 2/8] iommu/dma: Introduce generic helper to retrieve > RMR info > > On Thu, May 13, 2021 at 02:45:44PM +0100, Shameer Kolothum wrote: > > +/** > > + * struct iommu_rmr - Reserved Memory Region details per IOMMU > > + * @list: Linked list pointers to hold RMR region info > > + * @base_address: base address of Reserved Memory Region > > + * @length: length of memory region > > + * @sid: associated stream id > > + * @flags: flags that apply to the RMR node > > + */ > > +struct iommu_rmr { > > + struct list_head list; > > + phys_addr_t base_address; > > + u64 length; > > + u32 sid; > > + u32 flags; > > +}; > > + > > +/* RMR Remap permitted */ > > +#define IOMMU_RMR_REMAP_PERMITTED (1 << 0) > > + > > This struct has lots of overlap with 'struct iommu_resv_region'. Any > reason the existing struct can't be used here? > Hmm..main reason is "sid". RMRs are associated with stream ids and that is used to install bypass STEs/SMRs in SMMU drivers and also to check whether a dev has any RMR regions associated with it. I think we could add sid/dev_id to 'struct iommu_resv_region', and modify iommu_alloc_resv_region() accordingly. That can get rid of the above struct and iommu_dma_alloc_rmr() fn. Not sure this will complicate things as the dev_id is only valid for RMR reservation region cases. Please let me know your thoughts. Thanks, Shameer _______________________________________________ iommu mailing list iommu@lists.linux-foundation.org https://lists.linuxfoundation.org/mailman/listinfo/iommu 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 X-Spam-Level: X-Spam-Status: No, score=-4.1 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id A2E92C433ED for ; Wed, 19 May 2021 09:32:43 +0000 (UTC) Received: from desiato.infradead.org (desiato.infradead.org [90.155.92.199]) (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 2D6D2613AC for ; Wed, 19 May 2021 09:32:43 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 2D6D2613AC Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=huawei.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=desiato.20200630; 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=vSGW2VYepXct+M20Rj6I619iRO14ywB7ZGMRo4Ajvz8=; b=fuQ7Hf6OXxTfpyX9mDEcxzrNM n2aR2wB+8H7LHn40+kQ5ppZHFOcvLK86G7rvMX3fzSPdEkeqnGXrYPM6bKkO8Zc0oru0U74nxJ3/W hKplNpLUqAXGOXeBndkmzyx+r4oAfv58i/ZXvATQpIibWGzrzjyBJ8cqzfvb3h9BwtG+kzsvwl6jk igb9QEzI3cnhbzW8zb4B2q3BBoNPk5vuYNdJc/crH707/fBkWBhIi83St4kflu+1Y+bWEeEM18zDr i3/QUqXNELedn3uj4RSrcDhi3f/vHPo1I7tSRzIC6H+TiabGt0o71vnR9EgDAy8ekKnoh+2PRfzOf Bla8XDe7A==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1ljIXF-003S4T-Ji; Wed, 19 May 2021 09:30:37 +0000 Received: from bombadil.infradead.org ([2607:7c80:54:e::133]) by desiato.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1ljIXD-003S4J-4B for linux-arm-kernel@desiato.infradead.org; Wed, 19 May 2021 09:30:35 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=MIME-Version: Content-Transfer-Encoding:Content-Type:In-Reply-To:References:Message-ID:Date :Subject:CC:To:From:Sender:Reply-To:Content-ID:Content-Description; bh=aFW5UFH5zA2l7ftbQFP6BvmYb/22YAI5tC9ChILLV6s=; b=vwMO5QvG3lcoWgVwCJ9Omzttpg X4cXfPAGzH9HB2mZZMkG4+q8+Ht/0sqkEiog8JWOaWwQBKz4sIvGnAwuBpXhbP8IcZXoYa9ZzBvWe TegQeGOkOHrro+7JbSmgwzc5FE9YkHIhNUXqhqqlDPdkhOfTd1zGRjViUa2/h4KCv+w9/npIOBTvX 47dEklcGIjnUX5mw5ukxPiNeT6JCTk9KyamGlRHjLrN4ethjA/Vbwqi7WYhQ1o8bDO/nzS5BZXnlS z4QLv6STMCwbVFSuJRJPo3r+cmjndbU62dFavIRy06A9+phI+5k11QDkbREbS6tdtQSI0x6zPuM+I J5RHa1pA==; Received: from szxga05-in.huawei.com ([45.249.212.191]) by bombadil.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1ljIX9-00FJuN-Tu for linux-arm-kernel@lists.infradead.org; Wed, 19 May 2021 09:30:33 +0000 Received: from dggems701-chm.china.huawei.com (unknown [172.30.72.58]) by szxga05-in.huawei.com (SkyGuard) with ESMTP id 4FlSDn5vZMzQpk8; Wed, 19 May 2021 17:26:49 +0800 (CST) Received: from dggpemm100001.china.huawei.com (7.185.36.93) by dggems701-chm.china.huawei.com (10.3.19.178) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2176.2; Wed, 19 May 2021 17:30:18 +0800 Received: from lhreml710-chm.china.huawei.com (10.201.108.61) by dggpemm100001.china.huawei.com (7.185.36.93) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2176.2; Wed, 19 May 2021 17:30:17 +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.2176.012; Wed, 19 May 2021 10:30:15 +0100 From: Shameerali Kolothum Thodi To: Joerg Roedel CC: "linux-arm-kernel@lists.infradead.org" , "linux-acpi@vger.kernel.org" , "iommu@lists.linux-foundation.org" , Linuxarm , "lorenzo.pieralisi@arm.com" , "robin.murphy@arm.com" , wanghuiqiang , "Guohanjun (Hanjun Guo)" , "steven.price@arm.com" , "Sami.Mujawar@arm.com" , "jon@solid-run.com" , "eric.auger@redhat.com" , yangyicong Subject: RE: [PATCH v4 2/8] iommu/dma: Introduce generic helper to retrieve RMR info Thread-Topic: [PATCH v4 2/8] iommu/dma: Introduce generic helper to retrieve RMR info Thread-Index: AQHXR/5vIFqlrwXwY0CsHMfFqGdLc6ro5LaAgACKY2A= Date: Wed, 19 May 2021 09:30:14 +0000 Message-ID: <503068eb5f184639a75d7d1ef929b4c6@huawei.com> References: <20210513134550.2117-1-shameerali.kolothum.thodi@huawei.com> <20210513134550.2117-3-shameerali.kolothum.thodi@huawei.com> In-Reply-To: Accept-Language: en-GB, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.47.88.84] MIME-Version: 1.0 X-CFilter-Loop: Reflected X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210519_023032_312257_41660BB2 X-CRM114-Status: GOOD ( 16.39 ) 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: Joerg Roedel [mailto:joro@8bytes.org] > Sent: 18 May 2021 09:50 > To: Shameerali Kolothum Thodi > Cc: linux-arm-kernel@lists.infradead.org; linux-acpi@vger.kernel.org; > iommu@lists.linux-foundation.org; Linuxarm ; > lorenzo.pieralisi@arm.com; robin.murphy@arm.com; wanghuiqiang > ; Guohanjun (Hanjun Guo) > ; steven.price@arm.com; Sami.Mujawar@arm.com; > jon@solid-run.com; eric.auger@redhat.com; yangyicong > > Subject: Re: [PATCH v4 2/8] iommu/dma: Introduce generic helper to retrieve > RMR info > > On Thu, May 13, 2021 at 02:45:44PM +0100, Shameer Kolothum wrote: > > +/** > > + * struct iommu_rmr - Reserved Memory Region details per IOMMU > > + * @list: Linked list pointers to hold RMR region info > > + * @base_address: base address of Reserved Memory Region > > + * @length: length of memory region > > + * @sid: associated stream id > > + * @flags: flags that apply to the RMR node > > + */ > > +struct iommu_rmr { > > + struct list_head list; > > + phys_addr_t base_address; > > + u64 length; > > + u32 sid; > > + u32 flags; > > +}; > > + > > +/* RMR Remap permitted */ > > +#define IOMMU_RMR_REMAP_PERMITTED (1 << 0) > > + > > This struct has lots of overlap with 'struct iommu_resv_region'. Any > reason the existing struct can't be used here? > Hmm..main reason is "sid". RMRs are associated with stream ids and that is used to install bypass STEs/SMRs in SMMU drivers and also to check whether a dev has any RMR regions associated with it. I think we could add sid/dev_id to 'struct iommu_resv_region', and modify iommu_alloc_resv_region() accordingly. That can get rid of the above struct and iommu_dma_alloc_rmr() fn. Not sure this will complicate things as the dev_id is only valid for RMR reservation region cases. Please let me know your thoughts. Thanks, Shameer _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel