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 C45C4D1715E for ; Tue, 22 Oct 2024 03:30:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: Content-Type:In-Reply-To:From:References:To:Subject:Cc:MIME-Version:Date: Message-ID:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=jaYuOSU2JAHI0tgmDhzgJR7z3JMydYmJhEEhPwaNqK4=; b=UqAZZ+rryKeXJU/YMrlsz9UVEL n7eDjORamVFwv63UdqKVKxL52QVL5/Q3eE+kv55LZKASSFGMV34/X+jIWnAfC4GeAxGDdFkg0lCtI lPS18WG+9L7wSoznu1k78ytZdJQe7o+UxYCpzL09w1Z/Zn8/jySU2bJGUhHgFIaCrCaSR17OZ6WAD lyh49uLcDprynuM/cOVVu6qz+hBp2X9sNv4JNfgIZlnOplppBYxm044mAaWGJU/IoIA2XyRqAd2yM 06gsWl7dd4VW8NNriUnLxlL/ui1WDYZByBleddnu4B0SToyNNB6KWf4Km9uKrS0Dvr8oeRNtEDOsg T4XvhxDQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1t35bT-00000009Sj2-3kON; Tue, 22 Oct 2024 03:30:39 +0000 Received: from mgamail.intel.com ([198.175.65.19]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1t34dT-00000009KLJ-1xAC for linux-arm-kernel@lists.infradead.org; Tue, 22 Oct 2024 02:28:40 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1729564119; x=1761100119; h=message-id:date:mime-version:cc:subject:to:references: from:in-reply-to:content-transfer-encoding; bh=iEVflV2wjj9RZWicdMKZ+yzF/35ywBCnw8lgo8VyfoU=; b=fk4YWK0+JUuL7IiMjjoaoKi8nc79pebTBEJTEEvGzBnBxTnAklfhju/b fm9fwTHZCIenlQcyUiKqk2znMQeVIQMljCcTcnBmXJTW+W3dcvxyqs52n lCTqq7iVZGyPu6kY4n2gn/PyGXjrw/SsbJdaT7B1EbrTKerynXqmsgs1n O8eIHxojipFTtO9XA0sz7TCFeEXzgiKoGWuGijgMdq2piYyjk5IOIfRjZ ODIf++mOSQyY7CVcW7yi8Doz836ekfqGQ9a+6jOmDvt4YaVCZPc2h/ycZ 5updLe+Sdlj1GzzTrSwVNBG9FaoM8hkUq4qT+7VYR6mrKrxFkK7FpiWAD A==; X-CSE-ConnectionGUID: DqOjPXQFT3qEcLAaB0AqIA== X-CSE-MsgGUID: iU2PSS/eSmuzp0ts51QP3g== X-IronPort-AV: E=McAfee;i="6700,10204,11222"; a="28954292" X-IronPort-AV: E=Sophos;i="6.11,199,1725346800"; d="scan'208";a="28954292" Received: from fmviesa006.fm.intel.com ([10.60.135.146]) by orvoesa111.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 21 Oct 2024 19:28:38 -0700 X-CSE-ConnectionGUID: V/GHqH7dS5aJ9QT0c3vq+w== X-CSE-MsgGUID: 1rV8F+TdROq4Rkx6rM0JtQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.11,222,1725346800"; d="scan'208";a="79288212" Received: from unknown (HELO [10.238.0.51]) ([10.238.0.51]) by fmviesa006-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 21 Oct 2024 19:28:33 -0700 Message-ID: Date: Tue, 22 Oct 2024 10:28:30 +0800 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Cc: baolu.lu@linux.intel.com, joro@8bytes.org, suravee.suthikulpanit@amd.com, robin.murphy@arm.com, dwmw2@infradead.org, shuah@kernel.org, linux-kernel@vger.kernel.org, iommu@lists.linux.dev, linux-arm-kernel@lists.infradead.org, linux-kselftest@vger.kernel.org, eric.auger@redhat.com, jean-philippe@linaro.org, mdf@kernel.org, mshavit@google.com, shameerali.kolothum.thodi@huawei.com, smostafa@google.com, yi.l.liu@intel.com, aik@amd.com, zhangfei.gao@linaro.org, patches@lists.linux.dev Subject: Re: [PATCH v4 02/11] iommufd: Introduce IOMMUFD_OBJ_VIOMMU and its related struct To: Nicolin Chen , jgg@nvidia.com, kevin.tian@intel.com, will@kernel.org References: <74fec8c38a7d568bd88beba9082b4a5a4bc2046f.1729553811.git.nicolinc@nvidia.com> Content-Language: en-US From: Baolu Lu In-Reply-To: <74fec8c38a7d568bd88beba9082b4a5a4bc2046f.1729553811.git.nicolinc@nvidia.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20241021_192839_593452_294D8B75 X-CRM114-Status: GOOD ( 11.40 ) 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: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On 2024/10/22 8:19, Nicolin Chen wrote: > + * @viommu_alloc: Allocate an iommufd_viommu on a physical IOMMU instance behind > + * the @dev, as the set of virtualization resources shared/passed > + * to user space IOMMU instance. And associate it with a nesting > + * @parent_domain. The @viommu_type must be defined in the header > + * include/uapi/linux/iommufd.h > + * It is suggested to call iommufd_viommu_alloc() helper for > + * a bundled allocation of the core and the driver structures, > + * using the given @ictx pointer. > * @pgsize_bitmap: bitmap of all possible supported page sizes > * @owner: Driver module providing these ops > * @identity_domain: An always available, always attachable identity > @@ -591,6 +601,10 @@ struct iommu_ops { > void (*remove_dev_pasid)(struct device *dev, ioasid_t pasid, > struct iommu_domain *domain); > > + struct iommufd_viommu *(*viommu_alloc)( > + struct device *dev, struct iommu_domain *parent_domain, > + struct iommufd_ctx *ictx, unsigned int viommu_type); Is the vIOMMU object limited to a parent domain? Thanks, baolu