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 A064FD2E008 for ; Wed, 23 Oct 2024 01:50: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: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=klzBerMwBnTU7xvwXaxeTsBcwiuVRVINwFL7yYYQVNI=; b=Fyj6kIhQ1ZpvvZ331m3IofFNvj 6IW7+HULtIAu/SrF9g1MYtxql6TjsQfSu086OR94FZVRBt9DnYqu6A/ta7wQhdAtIrX+WvC/tJBwO BgczDmkqO/oQAL/PJmd568m37OKfgKfXvhAo5ocWo90B23mIEwxgjg/VZ05tiLujRZjHWIbsiKRm9 9tX8Ep/gLYfJIXCFvcCijBTRaxmoumGkrr/YOklYBwM3zb1uM0F6CkZous4vxBuob2FXjOuErNkdF m1FhswZCmknSDYVw52arPWM9FzEHXP+9ftceIYY939kPN9ReJvRCqI+8dDmb9ZkaMamlvXa5uLB+0 vMbgcCtw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1t3QVy-0000000CeJP-27IA; Wed, 23 Oct 2024 01:50:22 +0000 Received: from mgamail.intel.com ([192.198.163.16]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1t3QUS-0000000CeBp-0Gb5 for linux-arm-kernel@lists.infradead.org; Wed, 23 Oct 2024 01:48:49 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1729648128; x=1761184128; h=message-id:date:mime-version:cc:subject:to:references: from:in-reply-to:content-transfer-encoding; bh=OPsf2f9vTyNmn26NM00dQj65lrjywxxlSAM0Y4JmhPE=; b=YF+P0gYS2dfLijmEqH6VzoY7nPkU0xza+BsXq/Wjxu1pUof5U+uPLAVc PLh8SaYepI+Nad7U0kzHgCngRQm6Eao0zIXKP272ntPVpPYVJhHciI+PH fEiM3MAdyrlSTTP44dodreM6w0zLTXYsEAJk9L9BPemzYYMaTWWKq1iAc ftHwOI61Gyfp18spgx7+/F5C1k1M82+RDLH+cRYOmKW9nNiB8yV4yplh8 RCPKlZjhSNnsdn6Otg5Q0LsBOfC0eI8qWQHMKtsX6fKvI6Y5UeELIKjaB pi+My4dWdRUEgkGb5ErlcDK2cy2+wdGmlLPORfFa7P8jaZ8R94wUiL5wV Q==; X-CSE-ConnectionGUID: Lr3UUYSlTpK45Z+OWNb3ZA== X-CSE-MsgGUID: J2DAZqRNS8WQayLfvj9K3Q== X-IronPort-AV: E=McAfee;i="6700,10204,11233"; a="16838942" X-IronPort-AV: E=Sophos;i="6.11,223,1725346800"; d="scan'208";a="16838942" Received: from fmviesa010.fm.intel.com ([10.60.135.150]) by fmvoesa110.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 22 Oct 2024 18:48:43 -0700 X-CSE-ConnectionGUID: ja4EwEbFS4SiZHofiWkthg== X-CSE-MsgGUID: FrkOTik4RQeF2TiG3rO6mA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.11,223,1725346800"; d="scan'208";a="80386440" Received: from unknown (HELO [10.238.0.51]) ([10.238.0.51]) by fmviesa010-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 22 Oct 2024 18:48:38 -0700 Message-ID: <0db7401c-ca89-49a7-a9cc-502a581af66d@linux.intel.com> Date: Wed, 23 Oct 2024 09:48:36 +0800 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Cc: baolu.lu@linux.intel.com, Nicolin Chen , kevin.tian@intel.com, will@kernel.org, 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: Jason Gunthorpe References: <74fec8c38a7d568bd88beba9082b4a5a4bc2046f.1729553811.git.nicolinc@nvidia.com> <20241022131554.GF13034@nvidia.com> Content-Language: en-US From: Baolu Lu In-Reply-To: <20241022131554.GF13034@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-20241022_184848_184484_BDAC1105 X-CRM114-Status: GOOD ( 15.33 ) 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 21:15, Jason Gunthorpe wrote: > On Tue, Oct 22, 2024 at 04:59:07PM +0800, Baolu Lu wrote: > >> Is it feasible to make vIOMMU object more generic, rather than strictly >> tying it to nested translation? For example, a normal paging domain that >> translates gPAs to hPAs could also have a vIOMMU object associated with >> it. >> >> While we can only support vIOMMU object allocation uAPI for S2 paging >> domains in the context of this series, we could consider leaving the >> option open to associate a vIOMMU object with other normal paging >> domains that are not a nested parent? > Why? The nested parent flavour of the domain is basically free to > create, what reason would be to not do that? Above addressed my question. The software using vIOMMU should allocate a domain of nested parent type. > > If the HW doesn't support it, then does the HW really need/support a > VIOMMU? > > I suppose it could be made up to the driver, but for now I think we > should leave it as is in the core code requiring it until we have a > reason to relax it. Yes. In such cases, the iommu driver could always allow nested parent domain allocation, but fails to allocate a nested domain if the hardware is not capable of nesting translation. Thanks, baolu