Message ID | 20231026043938.63898-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:a59:d641:0:b0:403:3b70:6f57 with SMTP id cy1csp423108vqb; Wed, 25 Oct 2023 21:40:00 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEzxaTNMQeRhTNMzKpoK/VWjgqicLeVgXUxkSvtgbKqy/EOfYe7M9TD2Y+uT/L+tb4crKHC X-Received: by 2002:a81:ad43:0:b0:5ae:ebad:a972 with SMTP id l3-20020a81ad43000000b005aeebada972mr752785ywk.9.1698295200134; Wed, 25 Oct 2023 21:40:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698295200; cv=none; d=google.com; s=arc-20160816; b=vUGYxw2q1CPiaQnM1OUEi1uc9INpcBo1iDAVl5i129e705SVscLIvj23qaznJloVwH tDdCG5MRowq2UZnf9MNDDn7aWq78/l+CzVbN0FxF0xL/yyWV1jQtzMeSH38Be6LMUDsl BtO7FZF7E149RnRunifHTS9+kD7Fg1RyUdp2x1iybTkFjlkc05jXIgQfYd3pxaWkrfqu pLeJsDqEEpK4T+XiSTCLUHhO2blnlMNERGjKkatuIgDHNtFovf50MeIltnQkkMBHtiYS eB1K4VOSx7kbosMESXQXLnWRS2lytl6qIiozE6uDiHjwOWBXBUOfSkIMSD1P5vCKSfth rclw== 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=t6I2oK0f6VX9GG4h2vcITl0bMIj9Cpsr+zbUEknXdas=; fh=AYfEg8UxxCZNlRHxnJWvHuqsheVQzM8ymhb/+J0VVdk=; b=At8ckoKR+t96bATO9LJOwGGQBohuN/cRpAT/cBT362EWzDU3UlGosxaI9aGNAK8WYY KhrvvMvDsUfRPvqPfHgsZg6F4Jg5WcbLUJNEUKKuvejAOrU+T6W47sOCMcNUptAUSdhU tUOyOp+cXFvpzXAuociue480BwnWx0EZZ5QCmuVTxXJKOJwWOjQVZ1QHbkLtR23ySpbv NUd5LcYvyMaieb9QEp4ThPJ5YoyeaDmpafimAoZfnZM43l5fC7u6oyE+B7VvXEBwOlfi ZBACBDhibfdH3YzftTa85Xr8BPzACZOdokf5kFPjr9NoG8vAV02MxBq7Ws7KOS5MZ8u1 oiEA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=kQylrdeA; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 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 snail.vger.email (snail.vger.email. [2620:137:e000::3:7]) by mx.google.com with ESMTPS id s206-20020a8177d7000000b005a7b918c656si14033414ywc.168.2023.10.25.21.39.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 25 Oct 2023 21:40:00 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) client-ip=2620:137:e000::3:7; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=kQylrdeA; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 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 snail.vger.email (Postfix) with ESMTP id 01B6581B93EB; Wed, 25 Oct 2023 21:39:59 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233186AbjJZEju (ORCPT <rfc822;aposhian.dev@gmail.com> + 26 others); Thu, 26 Oct 2023 00:39:50 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36642 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233048AbjJZEjp (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Thu, 26 Oct 2023 00:39:45 -0400 Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.7]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 50E4018C; Wed, 25 Oct 2023 21:39:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1698295184; x=1729831184; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=UOhGIFSVU2siqA4+T4Fh3zBHdDxssB2+XzHFtkW1ZL4=; b=kQylrdeAzzBFSaVC921L20VumYFGNWGC/y2Uk1VtFj+e1AWWaH0JxuMz PMAWRhy03loSJKLVVavbMBx3F3bC8o8sM0XR/cPhAevPjdJnBWukyhpP7 JBtBGz2zIttRiWtW7Q1TsK7rUibUx2WKWrvZKXpXklOyA4IzXygSc/34i olaZw8Y+N4X6yb/80FTS8PEIfIAiktmCIOAhE1WrKjuTNkmBgfP5Atw+C 0aXsN50T4Jos/1EJIFUzNUE4G9xHgDXMIX5NLE9WB1m1mRB+QLCRgVWsa VerBp/W7slwrIV+x21dlE7T83P/OSioIniMNMZnmaWO4Rx9LV5MrgbIh/ g==; X-IronPort-AV: E=McAfee;i="6600,9927,10874"; a="9014407" X-IronPort-AV: E=Sophos;i="6.03,252,1694761200"; d="scan'208";a="9014407" Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmvoesa101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 25 Oct 2023 21:39:41 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10874"; a="708931229" X-IronPort-AV: E=Sophos;i="6.03,252,1694761200"; d="scan'208";a="708931229" Received: from 984fee00a4c6.jf.intel.com ([10.165.58.231]) by orsmga003.jf.intel.com with ESMTP; 25 Oct 2023 21:39:40 -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 v7 01/10] iommu: Add IOMMU_DOMAIN_NESTED Date: Wed, 25 Oct 2023 21:39:29 -0700 Message-Id: <20231026043938.63898-2-yi.l.liu@intel.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231026043938.63898-1-yi.l.liu@intel.com> References: <20231026043938.63898-1-yi.l.liu@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_NONE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net 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 (snail.vger.email [0.0.0.0]); Wed, 25 Oct 2023 21:39:59 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1780791587527177128 X-GMAIL-MSGID: 1780791587527177128 |
Series |
iommufd: Add nesting infrastructure (part 1/2)
|
|
Commit Message
Yi Liu
Oct. 26, 2023, 4:39 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> Signed-off-by: Nicolin Chen <nicolinc@nvidia.com> Signed-off-by: Yi Liu <yi.l.liu@intel.com> Reviewed-by: Kevin Tian <kevin.tian@intel.com> Reviewed-by: Jason Gunthorpe <jgg@nvidia.com> Signed-off-by: Jason Gunthorpe <jgg@nvidia.com> --- include/linux/iommu.h | 4 ++++ 1 file changed, 4 insertions(+)
diff --git a/include/linux/iommu.h b/include/linux/iommu.h index 1d42bdb37cbc..bc303cb2af37 100644 --- a/include/linux/iommu.h +++ b/include/linux/iommu.h @@ -67,6 +67,9 @@ struct iommu_domain_geometry { #define __IOMMU_DOMAIN_SVA (1U << 4) /* Shared process address space */ +#define __IOMMU_DOMAIN_NESTED (1U << 6) /* 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 @@ -93,6 +96,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;