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 8774BC64EC4 for ; Thu, 9 Mar 2023 16:01:57 +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=kw1G7iOMbGODnUyqyMv+mWpOcJEe2DfnbD9ulrMIVHM=; b=k4nMnWfj7AQP99 +q58/F9sNgB0ogTlnBOK7CrCbtlFfJr9vuqnPu0o7dZXOWTnlNgUdvN0SHRaBQn+vPyf1FnfREuyD kLJ+LiezBoUBahn9mN4F3GPkteplFPXjkU2G4m2QH+zcqWU7Y5vh6qcxUkDvFhfqcVVxVltSFWV2R 1emET8LcmaRJYn1G8InyiXI945/n5DGLQ/XZyj18MoWi6mcrHDjA2+PEOAYmfaOrbJJNUDDtXVWsr AAUXXLMGpFH7qgOMaxHJjs0ROaRt2tf5rHdj5WR16dUtFpJSjVuWwFeI4UINmZ00S+whkfaKRNIlY /568FTudKYTufz6SXLOA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1paIh0-00B6wt-Jw; Thu, 09 Mar 2023 16:00:35 +0000 Received: from frasgout.his.huawei.com ([185.176.79.56]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1paIYV-00B341-G2 for linux-arm-kernel@lists.infradead.org; Thu, 09 Mar 2023 15:51:50 +0000 Received: from lhrpeml100005.china.huawei.com (unknown [172.18.147.200]) by frasgout.his.huawei.com (SkyGuard) with ESMTP id 4PXYWX5s9sz688wM; Thu, 9 Mar 2023 23:48:56 +0800 (CST) Received: from lhrpeml500005.china.huawei.com (7.191.163.240) by lhrpeml100005.china.huawei.com (7.191.160.25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.21; Thu, 9 Mar 2023 15:51:42 +0000 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.021; Thu, 9 Mar 2023 15:51:42 +0000 From: Shameerali Kolothum Thodi To: Jason Gunthorpe CC: Jean-Philippe Brucker , Nicolin Chen , "robin.murphy@arm.com" , "will@kernel.org" , "eric.auger@redhat.com" , "kevin.tian@intel.com" , "baolu.lu@linux.intel.com" , "joro@8bytes.org" , "linux-arm-kernel@lists.infradead.org" , "iommu@lists.linux.dev" , "linux-kernel@vger.kernel.org" , "yi.l.liu@intel.com" Subject: RE: [PATCH v1 02/14] iommufd: Add nesting related data structures for ARM SMMUv3 Thread-Topic: [PATCH v1 02/14] iommufd: Add nesting related data structures for ARM SMMUv3 Thread-Index: AQHZUnWTVXhuXoh0OkWPSyQY1srSfq7ydQKAgAAVzLCAAAsqAIAAANyQ Date: Thu, 9 Mar 2023 15:51:42 +0000 Message-ID: <39979642ba8042ba9d4de651fecfeffb@huawei.com> References: <364cfbe5b228ab178093db2de13fa3accf7a6120.1678348754.git.nicolinc@nvidia.com> <20230309134217.GA1673607@myrica> <213a05ef06944a55a148995053b187f8@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.178] MIME-Version: 1.0 X-CFilter-Loop: Reflected X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230309_075147_857266_93CC8979 X-CRM114-Status: GOOD ( 24.18 ) 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 [mailto:jgg@nvidia.com] > Sent: 09 March 2023 15:40 > To: Shameerali Kolothum Thodi > Cc: Jean-Philippe Brucker ; Nicolin Chen > ; robin.murphy@arm.com; will@kernel.org; > eric.auger@redhat.com; kevin.tian@intel.com; baolu.lu@linux.intel.com; > joro@8bytes.org; linux-arm-kernel@lists.infradead.org; > iommu@lists.linux.dev; linux-kernel@vger.kernel.org; yi.l.liu@intel.com > Subject: Re: [PATCH v1 02/14] iommufd: Add nesting related data structures > for ARM SMMUv3 > > On Thu, Mar 09, 2023 at 03:26:12PM +0000, Shameerali Kolothum Thodi > wrote: > > > On platforms that supports BTM [1], we may need the VMID allocated by > KVM. > > But again getting that from user pace doesn't look safe. I have attempted > to revise > > the earlier RFC to pin and use the KVM VMID from SMMUv3 here[2]. > > Gurk > > > " In the new design we can require from the start that creating a nesting > IOMMU > > container through /dev/iommu *must* come with a KVM context, that way > > we're sure to reuse the existing VMID. " > > I've been dreading this but yes I execpt we will eventually need to > connect kvm and iommufd together. The iommu driver can receive a kvm > pointer as part of the alloc domain operation to do any setups like > this. That will make life easier :) > If there is no KVM it should either fail to setup the domain or setup > a domain disconnected from KVM. > If no KVM the SMMUv3 can fall back to its internal VMID allocation I guess. And my intention was to use KVM VMID only if the platform supports BTM. > If IOMMU HW and KVM HW are using the same ID number space then > arguably the two kernel drivers need to use a shared ID allocator in > the arch, regardless of what iommufd/etc does. Using KVM should not be > mandatory for iommufd. > > For ARM cases where there is no shared VMID space with KVM, the ARM > VMID should be somehow assigned to the iommfd_ctx itself and the alloc > domain op should receive it from there. Is there any use of VMID outside SMMUv3? I was thinking if nested domain alloc doesn't provide the KVM instance, then SMMUv3 can use its internal VMID. Thanks, Shameer > Nicolin, that seems to be missing in this series? I'm not entirely > sure how to elegantly code it :\ > > Jason _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel