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 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 smtp.lore.kernel.org (Postfix) with ESMTPS id 2409DC27C53 for ; Wed, 5 Jun 2024 15:22:37 +0000 (UTC) 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=wgIvo+DiHjYGKkY6WB/mqKS8IabHlGBt8EyIArB0/NY=; b=15miS/qp9+pb15 pe5MOmE/YaFWchBJbBNHHXlGgbyOc7HyLBD9UVaZ+z4PwAyc1vJxwt9b1jDVQ2d7RWXfSMTounUu4 JPt4fPX+JjwTT4O8dHMgCyOjMzZfHoofRozZYFKXnCy1TnuuOqahmkhc1LTtiHhoDjDd68ek/ZmWC H6hOahj3gGY2/z1+U+7Y1q7Q3Ud30Qi1aQojxAViLNTllpYer/tWr83EiN6Q0Wq0VVE4COlbgJ7sR 2rbfZwzGZllwoUoksJbYn14X8x+xBNytQZVnlIx0G+SOXj1MmWHHXFRveqlfccud5dKuDyM9XbvuC Q+Jbbh/jHFReAamCsrYQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sEsSw-00000006all-1lF3; Wed, 05 Jun 2024 15:22:18 +0000 Received: from szxga01-in.huawei.com ([45.249.212.187]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sEsSs-00000006agI-3ALu for linux-arm-kernel@lists.infradead.org; Wed, 05 Jun 2024 15:22:16 +0000 Received: from mail.maildlp.com (unknown [172.19.162.254]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4VvWLJ1WVjzsShQ; Wed, 5 Jun 2024 23:18:00 +0800 (CST) Received: from dggems705-chm.china.huawei.com (unknown [10.3.19.182]) by mail.maildlp.com (Postfix) with ESMTPS id 35B801800CB; Wed, 5 Jun 2024 23:21:42 +0800 (CST) Received: from lhrpeml500005.china.huawei.com (7.191.163.240) by dggems705-chm.china.huawei.com (10.3.19.182) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.39; Wed, 5 Jun 2024 23:19:12 +0800 Received: from lhrpeml500005.china.huawei.com ([7.191.163.240]) by lhrpeml500005.china.huawei.com ([7.191.163.240]) with mapi id 15.01.2507.039; Wed, 5 Jun 2024 16:19:09 +0100 From: Shameerali Kolothum Thodi To: Jason Gunthorpe CC: "iommu@lists.linux.dev" , "linux-arm-kernel@lists.infradead.org" , "robin.murphy@arm.com" , "will@kernel.org" , "joro@8bytes.org" , "ryan.roberts@arm.com" , "kevin.tian@intel.com" , "nicolinc@nvidia.com" , "mshavit@google.com" , "eric.auger@redhat.com" , "joao.m.martins@oracle.com" , jiangkunkun , zhukeqian , Linuxarm Subject: RE: [PATCH v4 2/7] iommu/arm-smmu-v3: Factor out a common arm_smmu_domain_alloc() Thread-Topic: [PATCH v4 2/7] iommu/arm-smmu-v3: Factor out a common arm_smmu_domain_alloc() Thread-Index: AQHasM+khiD4CP1qnE6UTTUODRhpdbGzXOCAgAX4qaA= Date: Wed, 5 Jun 2024 15:19:09 +0000 Message-ID: References: <20240528071831.17560-1-shameerali.kolothum.thodi@huawei.com> <20240528071831.17560-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.202.227.28] MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240605_082215_256993_B7D2DBFB X-CRM114-Status: GOOD ( 15.31 ) 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: Jason Gunthorpe > Sent: Saturday, June 1, 2024 10:07 PM > To: Shameerali Kolothum Thodi > Cc: iommu@lists.linux.dev; linux-arm-kernel@lists.infradead.org; > robin.murphy@arm.com; will@kernel.org; joro@8bytes.org; > ryan.roberts@arm.com; kevin.tian@intel.com; nicolinc@nvidia.com; > mshavit@google.com; eric.auger@redhat.com; joao.m.martins@oracle.com; > jiangkunkun ; zhukeqian > ; Linuxarm > Subject: Re: [PATCH v4 2/7] iommu/arm-smmu-v3: Factor out a common > arm_smmu_domain_alloc() > > On Tue, May 28, 2024 at 08:18:26AM +0100, Shameer Kolothum wrote: > > > +++ b/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3-sva.c > > @@ -648,7 +648,7 @@ static int arm_smmu_sva_set_dev_pasid(struct > iommu_domain *domain, > > > > static void arm_smmu_sva_domain_free(struct iommu_domain *domain) > > { > > - kfree(domain); > > + kfree(to_smmu_domain(domain)); > > } > > > > @@ -659,13 +659,16 @@ static const struct iommu_domain_ops > arm_smmu_sva_domain_ops = { > > struct iommu_domain *arm_smmu_sva_domain_alloc(struct device *dev, > > struct mm_struct *mm) > > { > > - struct iommu_domain *domain; > > + struct arm_smmu_master *master = dev_iommu_priv_get(dev); > > + struct arm_smmu_device *smmu = master->smmu; > > + struct arm_smmu_domain *smmu_domain; > > > > - domain = kzalloc(sizeof(*domain), GFP_KERNEL); > > - if (!domain) > > - return ERR_PTR(-ENOMEM); > > - domain->type = IOMMU_DOMAIN_SVA; > > - domain->ops = &arm_smmu_sva_domain_ops; > > + smmu_domain = arm_smmu_domain_alloc(); > > + if (IS_ERR(smmu_domain)) > > + return ERR_CAST(smmu_domain); > > + smmu_domain->domain.type = IOMMU_DOMAIN_SVA; > > + smmu_domain->domain.ops = &arm_smmu_sva_domain_ops; > > + smmu_domain->smmu = smmu; > > > > - return domain; > > + return &smmu_domain->domain; > > } > > If you drop these two hunks you can drop the first patch as well. There > is no need to touch SVA in this series That is right. I will make those changes and re-spin soon. Thanks, SHameer _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel