Message ID | 20231020091946.12173-2-yi.l.liu@intel.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:2010:b0:403:3b70:6f57 with SMTP id fe16csp927113vqb; Fri, 20 Oct 2023 02:20:57 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGnhIgwUoeiWRrxW2QEPPqpgjq0QgWfXZkkYK0fEo10RfYpoJ+vJtA7e8TMqR6M2pjxrUFQ X-Received: by 2002:a17:90a:1a15:b0:27d:b22b:fb89 with SMTP id 21-20020a17090a1a1500b0027db22bfb89mr1126206pjk.35.1697793657053; Fri, 20 Oct 2023 02:20:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697793657; cv=none; d=google.com; s=arc-20160816; b=tzrwzwuIg7qquxBbI2tUDSAUO2go0veGnV/AP8TzDXq1gcfwfBlYl5QX7UF2YVm/Ah 5wEYpjLXsLb556m5DWH2nAQc65ABM3rvhAh9nCjhmbfSXeMX5Rdk2/8IzxjiOtn6n1HR qeTRM5Z+ODrzLxfTCovyABrOHJ+f8mG/ZaDM9qz8Yt6Z5PuaWUin2MRANCQOzYaE/lhH DS9SFh+g4n9XOpp+h3uKcsx1sqPhA05xtHKfIRAnq/EMN9//Bc9LTVxwaUa6fGBp4YqO pUKFPMAzV4wJhaVoPrt9dWNQJRuEkNyCkHT8fP6c+iUF59YbszgzOPuxi+hDPqBfvRrD M3tA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=RqgFIkEGUMu/lEP7LXc2ycqLZl9z/5oGF30HMBUaKlg=; fh=AYfEg8UxxCZNlRHxnJWvHuqsheVQzM8ymhb/+J0VVdk=; b=Ro11kxEhvCDzrUWa5BX+zXeM2KNkWBTVDJkrSE/A3JbDcgirBf9HHI/yS+TmpPfrm1 QUXBw6D0h0Zx2qQh2MJ84tQObK4beB0xkYoh3QUX/jp0GZIuSnYgc/bONBj6OtqFPRDH BwtNuuTgm7SoMKu/WhLnLNfHJcCPmx7Y6h0GPVYtLYyEsdI3Rxyp79wJknMCfrqp8xJI sUUxGf08R43Ude+ZpESgkMqExcZQh0kdri9tCDS9MLilQrS87t678KppwQEqY2ueNaI4 7M+IlhURDIrGzAJpQoVnqX0itEijTt6e58GE3Tc0fNThrpxnJIJ6sAxWcMI5yI+ja2wa y5kg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=M1hyzteG; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from agentk.vger.email (agentk.vger.email. [2620:137:e000::3:2]) by mx.google.com with ESMTPS id s1-20020a17090aad8100b0027d0c3507eesi4069525pjq.32.2023.10.20.02.20.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 20 Oct 2023 02:20:57 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) client-ip=2620:137:e000::3:2; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=M1hyzteG; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by agentk.vger.email (Postfix) with ESMTP id 5BA1E8067A47; Fri, 20 Oct 2023 02:20:16 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1376645AbjJTJUC (ORCPT <rfc822;lkml4gm@gmail.com> + 25 others); Fri, 20 Oct 2023 05:20:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42600 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1376647AbjJTJT7 (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Fri, 20 Oct 2023 05:19:59 -0400 Received: from mgamail.intel.com (mgamail.intel.com [192.55.52.151]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B1127D6B; Fri, 20 Oct 2023 02:19:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1697793597; x=1729329597; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=pw4CXcAB+7pwTGUAZedG47AYASIyAmD8xc7RBFXXQaw=; b=M1hyzteGZ++pCmeyOckTCUmHrL4tREeDlm4weqlCtnoDE6bUpsDVCczs qUFdKqrslDeaO0GSoKuiNeK75D1SD7nULgkeIxViS/PAnn902QwubqqNH k4rjR5OQeavwFGh1lzn/NTWuqDaGk47w1AJfcC0sVsnYVmVXa55JyBJbi Dg1RRTu7cvMW2znsEIrWueodyrM7DjB/vTLtwOEsg5F6Dqba/mGg4HNrQ XQG/I0NJ7mmb68SiXHvApz8/cNEvVEpz9M5IigNp6UpILT3l3pi/E7XTz jOh+I/y2IosFMu5/rXN9f624wisopLTfo6HlMkaCW5KtRB1CSq68Rx2UD w==; X-IronPort-AV: E=McAfee;i="6600,9927,10868"; a="366693298" X-IronPort-AV: E=Sophos;i="6.03,238,1694761200"; d="scan'208";a="366693298" Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 20 Oct 2023 02:19:57 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10868"; a="707179406" X-IronPort-AV: E=Sophos;i="6.03,238,1694761200"; d="scan'208";a="707179406" Received: from 984fee00a4c6.jf.intel.com ([10.165.58.231]) by orsmga003.jf.intel.com with ESMTP; 20 Oct 2023 02:19:56 -0700 From: Yi Liu <yi.l.liu@intel.com> To: joro@8bytes.org, alex.williamson@redhat.com, jgg@nvidia.com, kevin.tian@intel.com, robin.murphy@arm.com, baolu.lu@linux.intel.com Cc: cohuck@redhat.com, eric.auger@redhat.com, nicolinc@nvidia.com, kvm@vger.kernel.org, mjrosato@linux.ibm.com, chao.p.peng@linux.intel.com, yi.l.liu@intel.com, yi.y.sun@linux.intel.com, peterx@redhat.com, jasowang@redhat.com, shameerali.kolothum.thodi@huawei.com, lulu@redhat.com, suravee.suthikulpanit@amd.com, iommu@lists.linux.dev, linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org, zhenzhong.duan@intel.com, joao.m.martins@oracle.com, xin.zeng@intel.com Subject: [PATCH v5 01/10] iommu: Add IOMMU_DOMAIN_NESTED Date: Fri, 20 Oct 2023 02:19:37 -0700 Message-Id: <20231020091946.12173-2-yi.l.liu@intel.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231020091946.12173-1-yi.l.liu@intel.com> References: <20231020091946.12173-1-yi.l.liu@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on agentk.vger.email Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (agentk.vger.email [0.0.0.0]); Fri, 20 Oct 2023 02:20:16 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1780265681938017950 X-GMAIL-MSGID: 1780265681938017950 |
Series |
iommufd: Add nesting infrastructure (part 1/2)
|
|
Commit Message
Yi Liu
Oct. 20, 2023, 9:19 a.m. UTC
From: Lu Baolu <baolu.lu@linux.intel.com> Introduce a new domain type for a user I/O page table, which is nested on top of another user space address represented by a PAGING domain. This new domain can be allocated by the domain_alloc_user op, and attached to a device through the existing iommu_attach_device/group() interfaces. The mappings of a nested domain are managed by user space software, so it is not necessary to have map/unmap callbacks. Signed-off-by: Lu Baolu <baolu.lu@linux.intel.com> Reviewed-by: Kevin Tian <kevin.tian@intel.com> Signed-off-by: Nicolin Chen <nicolinc@nvidia.com> Signed-off-by: Yi Liu <yi.l.liu@intel.com> --- include/linux/iommu.h | 4 ++++ 1 file changed, 4 insertions(+)
diff --git a/include/linux/iommu.h b/include/linux/iommu.h index 3861d66b65c1..ce08a3c41446 100644 --- a/include/linux/iommu.h +++ b/include/linux/iommu.h @@ -65,6 +65,9 @@ struct iommu_domain_geometry { #define __IOMMU_DOMAIN_SVA (1U << 4) /* Shared process address space */ +#define __IOMMU_DOMAIN_NESTED (1U << 5) /* User-managed address space nested + on a stage-2 translation */ + #define IOMMU_DOMAIN_ALLOC_FLAGS ~__IOMMU_DOMAIN_DMA_FQ /* * This are the possible domain-types @@ -91,6 +94,7 @@ struct iommu_domain_geometry { __IOMMU_DOMAIN_DMA_API | \ __IOMMU_DOMAIN_DMA_FQ) #define IOMMU_DOMAIN_SVA (__IOMMU_DOMAIN_SVA) +#define IOMMU_DOMAIN_NESTED (__IOMMU_DOMAIN_NESTED) struct iommu_domain { unsigned type;