Received: by 2002:a05:7412:da14:b0:e2:908c:2ebd with SMTP id fe20csp1632039rdb; Sun, 8 Oct 2023 18:10:07 -0700 (PDT) X-Google-Smtp-Source: AGHT+IE0lU+eUxq4U8UMpdIzUXfaqVLqKHY+wEbeN/Q2lGcsXxlPyU83TrQ2WlzcFoObB9p+1gRn X-Received: by 2002:a05:6a20:7345:b0:167:26c4:256d with SMTP id v5-20020a056a20734500b0016726c4256dmr13141087pzc.21.1696813807283; Sun, 08 Oct 2023 18:10:07 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1696813807; cv=pass; d=google.com; s=arc-20160816; b=lQG6vFjScD5qH5Gs0Dfr/yfJJX+fowtCNxYycFScRCVhP5u75+30cUrHovD4ec+VZN X0m7sLNzhoU2nlj3YrnehWaEfp+HSnxYAjoUEOVz1R+tceN+76kttJRBnmwFo58RfKwb IfsdSyIdPkTj/36R7e83m9Ej4TJnvcRzC2SPU2Il6aGzjzZVh16t6ICSByvsYhxII0Rc 0GyvZLbdJi5hKQmzwsR5DyLEWkLlrz2mA3guH33fGkYqZJ46yiTH77vwC5rp3RF9ymR0 Xgo3pdb7ItdUeRGPwPGE0vycrlid9ecWE9EZRE6Ujf85Xc5DrWcGVj5S4Fr78YZ+56oN IuPA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :content-language:accept-language:in-reply-to:references:message-id :date:thread-index:thread-topic:subject:cc:to:from:dkim-signature; bh=PF5OUdZBhXpAl8YsNa2OrfuxinMJWTVlhjFtzyHXg1c=; fh=rzJXgqYMkpXQIFArmKrceTst9cIY3xeR6wJcDhf4/fY=; b=azOaBN6zaDi8WlIU3BtDr+6ez07K3ukx6JNBdjXbQ79mzya3+2Q/O9QU/aiyaT0X7G WgwuL7ZqV0dXIQsT6uM38LrAG/B2cr7CsLKo4AeNmvh/psEwzNSmIRlbFuGpRuCHgUzT pG8dA5TK5lMTZAurNZCHDNR+2+BYX9AZgcYYtpNVsyt+Rk4dpg5bFKqgJELW2x26o+sO 2OpORTrsblISTANenhPx/Yi6SVc7S+EuAfmzxTBXXvuqPjLMa3eIBaqjOS46PvxUCU1l x97ZQFYS5sDxPdSE6VGFI8OfNzp4TQdN+a2xMn2cGBtcBFu5/ZWhvbghhv3r8LW6VEcz Bpsg== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=FdjHMCNs; arc=pass (i=1 spf=pass spfdomain=intel.com dkim=pass dkdomain=intel.com dmarc=pass fromdomain=intel.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from snail.vger.email (snail.vger.email. [23.128.96.37]) by mx.google.com with ESMTPS id c20-20020a056a00249400b00690d457764fsi6776190pfv.42.2023.10.08.18.10.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 08 Oct 2023 18:10:07 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) client-ip=23.128.96.37; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=FdjHMCNs; arc=pass (i=1 spf=pass spfdomain=intel.com dkim=pass dkdomain=intel.com dmarc=pass fromdomain=intel.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 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 6284080A8B71; Sun, 8 Oct 2023 18:10:06 -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 S1344723AbjJIBJz (ORCPT + 99 others); Sun, 8 Oct 2023 21:09:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58472 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229704AbjJIBJx (ORCPT ); Sun, 8 Oct 2023 21:09:53 -0400 Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.9]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 91CCEAB; Sun, 8 Oct 2023 18:09:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1696813793; x=1728349793; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=tefx/3h1WR6EJOM+8PNLlCYjWX1fBOCg8xSwp8pviMo=; b=FdjHMCNsAqsbvLG59R3PqNI0BPMZEW6zBJyj7WOlKOz6JxVWDYJvQOS5 vRNaH5HzV1VcKQxz1/86KSvXRotbMBx932LjJCE0kdH0jKLtve6OzO2ss uQPRLc7ncMAQl+/QGABOJFxb5PYuicJtmvMthgTK0UJgNAO5JpBIf///u QiPc8ehKd2xoiaH4XlTDLJSgvXu1QFmo5h0XwGgfhSLwDcbreg2ft3wZV ttTFmPCzKN2QEenBUwrse3piPSwUIDNm0vhuSxOJKSPTbH7Jp0XbMSSSY /hRA9JuqOw15cC2qXBxZ+rbHqvkyOXuf3jmctvulJ2Z4gts/ltImDaPFp A==; X-IronPort-AV: E=McAfee;i="6600,9927,10857"; a="2649171" X-IronPort-AV: E=Sophos;i="6.03,209,1694761200"; d="scan'208";a="2649171" Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by orvoesa101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 Oct 2023 18:09:53 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10857"; a="843525003" X-IronPort-AV: E=Sophos;i="6.03,209,1694761200"; d="scan'208";a="843525003" Received: from fmsmsx601.amr.corp.intel.com ([10.18.126.81]) by FMSMGA003.fm.intel.com with ESMTP/TLS/AES256-GCM-SHA384; 08 Oct 2023 18:09:51 -0700 Received: from fmsmsx601.amr.corp.intel.com (10.18.126.81) by fmsmsx601.amr.corp.intel.com (10.18.126.81) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.32; Sun, 8 Oct 2023 18:09:51 -0700 Received: from FMSEDG603.ED.cps.intel.com (10.1.192.133) by fmsmsx601.amr.corp.intel.com (10.18.126.81) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.32 via Frontend Transport; Sun, 8 Oct 2023 18:09:51 -0700 Received: from NAM10-BN7-obe.outbound.protection.outlook.com (104.47.70.101) by edgegateway.intel.com (192.55.55.68) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.32; Sun, 8 Oct 2023 18:09:51 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ivf8ELBI9C2nWtSyIIU1PzcgtBKp6xR5aZRwAIS4fkzELdv8uxgHbRAyYo8pBNw/hOJIR0ImehTasmHvvmPEtf4ZQivdGjYgRrYHqlogCHlemjwuFeum+2Ua+0I98Shi7KmhLcy8MnM00kZb3Q5XRroifkn9zfx7HQ3WYRozoUw+kyTc0WlKI6bLKsGh+z8Nui4sQVXHehL0t/SMFw6qif615G3KHMyaYx39oIKBYEzuypMH2ZX+Ov36+aZIhKxoZshbKYeudZm7drxhxBJ9NGqxzyj2Q+kXNTrrCBlCBIJGIoC3c6tUFTjhAqVki2xbS+IueKDxFXhXuT6OIJsruA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=PF5OUdZBhXpAl8YsNa2OrfuxinMJWTVlhjFtzyHXg1c=; b=mAxZM6o+o/HrfIfml4xgxxkaIlzxaDriNLLNgZldqHlTIXt2rKf9GIbSMcmd6IH+1ZJTp5OOr4ZmZ1QqCc5hw1n+B5sNkU0AxOmyD+hSFezGcLXMVGrHwZvRMIT4TTHVBAL7odFFOKmt2JBg3/4lPbs/kdPMt0xYjMbO2sOAS/70Dr8pwZBaF12mI9paAd3Zy4wlIFHhzXwoSgqGCGBJB+tMJUo4RFZFlzobwPt3miensEhrOqmqGaj80a7BqpTxccROiAJMckgZ8OLlQ/K44+Wt7l4B7MGAF4kygGRMU5CzgHv1inUx+Z2jx0h8MXkEtPGB+WH1J3hdQ6xDCeMMrQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none Received: from BL1PR11MB5271.namprd11.prod.outlook.com (2603:10b6:208:31a::21) by BL1PR11MB5445.namprd11.prod.outlook.com (2603:10b6:208:30b::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6863.37; Mon, 9 Oct 2023 01:09:48 +0000 Received: from BL1PR11MB5271.namprd11.prod.outlook.com ([fe80::53dc:1b11:86de:ff9c]) by BL1PR11MB5271.namprd11.prod.outlook.com ([fe80::53dc:1b11:86de:ff9c%4]) with mapi id 15.20.6863.032; Mon, 9 Oct 2023 01:09:48 +0000 From: "Tian, Kevin" To: "Liu, Yi L" , "joro@8bytes.org" , "alex.williamson@redhat.com" , "jgg@nvidia.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.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" , "Duan, Zhenzhong" , "Martins, Joao" Subject: RE: [PATCH v2 1/6] iommu: Add new iommu op to create domains owned by userspace Thread-Topic: [PATCH v2 1/6] iommu: Add new iommu op to create domains owned by userspace Thread-Index: AQHZ8duSU5XbTPBwc06Tv5gX+XskOrBAtr5A Date: Mon, 9 Oct 2023 01:09:48 +0000 Message-ID: References: <20230928071528.26258-1-yi.l.liu@intel.com> <20230928071528.26258-2-yi.l.liu@intel.com> In-Reply-To: <20230928071528.26258-2-yi.l.liu@intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=intel.com; x-ms-publictraffictype: Email x-ms-traffictypediagnostic: BL1PR11MB5271:EE_|BL1PR11MB5445:EE_ x-ms-office365-filtering-correlation-id: 8893dbb5-a61f-4355-d424-08dbc8646edd x-ld-processed: 46c98d88-e344-4ed4-8496-4ed7712e255d,ExtAddr x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: zTC+O2iophLLVrtUh3lNMufjOSvkSDQx7gAo6AgQw05v4d2sYLoKaWnZZvR3VtPqPkT1MTPb3hNuhvbJwsQ61RIdrbrP51hwTAbgrrcQUqVaAIq0TT9SuIF+8qu2LRbnu3AW/+PWzaTjLPtjsgc7RmU2wEb7GcETIe9nLDCyqO6+Abj1mmWkrFPN38nzM+b6N9m4zW8+BQs0p5bLYhbmP7tnk2PDwnNPSD/h80I2YF4kTtlJfwb21lw9GbbQXLfGEY6BwysGQJr5OmcJ1GgesvH+7p756LBPTsYRL95bi30ZPgtnW2indQn7hNmsg+Y9oyOl6Z4n1LV4kn+0HXIlxbqLCshc+TKJilbKWqS811H5RSLogL6D2cVrxeSS09lwxBAJfbZHuznrvo8uNCyeNgZvFLe1JEM1n/w0X4EiecrabVWDyhA3zrkZpfSoMpIFFXRW9tpA6eqfA/eFIs7492UkE6evyZ9H1BI4Eh2zTPXaaYBDALXmetrPKecy07T+92Z/auNN/2QZyVviTg2b+CNkVIsTof7FnG9l2uWkSGmACz+964T6YBR4axJGBQMUwXeNc8YQGmesON8R/W6l0ww98DIwV8gyCOOB+TdA/e9m9wD4GIQHeJg++wIXahbP x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:BL1PR11MB5271.namprd11.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(39860400002)(136003)(366004)(396003)(346002)(376002)(230922051799003)(451199024)(64100799003)(186009)(1800799009)(55016003)(83380400001)(66476007)(66556008)(66946007)(54906003)(76116006)(110136005)(66446008)(316002)(64756008)(7416002)(8936002)(8676002)(4326008)(5660300002)(52536014)(41300700001)(7696005)(6506007)(71200400001)(9686003)(2906002)(478600001)(33656002)(38070700005)(38100700002)(82960400001)(122000001)(86362001);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?dD8n3AqQ+FXJmPq0hCRezi956xa7mjdQQ4QW4OM6B227PF2J/oLv+f8LnAbp?= =?us-ascii?Q?tksF5RDJenFLhC/IijGSgxY30IkQwu8oYbtCK20uKNh/74OPEblryr0YeRy6?= =?us-ascii?Q?UBEJuOQI+dtTEXPoxSDFEHW6ACKR1F0sUv81fVmxMy1FoLbXZas+xqXtgpYM?= =?us-ascii?Q?XJY6ZoLJrCXxcyseICEGMaPMcVPS3Ka+cfTIrfeKbJeZcj4YM0d/IzO0+bLT?= =?us-ascii?Q?ijycz581DEgdDdr6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?us-ascii?Q?96xG0lvvnT+WXlvwNmHlXBEO4BhlZG3JFYvCCyta0jEltxU/yaQDn8mfd2Ig?= =?us-ascii?Q?qK0dSYOsuJ9cEDLOu2gU92JsTMILNDs/vrIrH0aLtK5I8iKdAejnuYmh2lAB?= =?us-ascii?Q?C8tqe/aD4KXnUlGuvT9+kHG863h5Tf0Ma0Hhu8wi4K0Pamk1Yca7yTvz/0hC?= =?us-ascii?Q?i9SCQQ/QiQJeqnUB4OUn+kuCN0NN4n64+ooneALjPqQ7MtFJnM95nl6vSXNc?= =?us-ascii?Q?d2mImhWdrUY3+63SXcQNSl0u/wGokcdAuKx5mASxKK4eIx572Gx3DC/GMh8C?= =?us-ascii?Q?viC+P1ZQXOVINxso/4Q+weA3QDEvAgqKv3fQp23w3HsPT1l+oKl+3pHTsi0X?= =?us-ascii?Q?p/CSy4to083FD2zOjcQi6F5EFWP2OwBNX5Vh14IuvWP1wsNmhgaD0juwNQ?= =?us-ascii?Q?=3D=3D?= Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: BL1PR11MB5271.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 8893dbb5-a61f-4355-d424-08dbc8646edd X-MS-Exchange-CrossTenant-originalarrivaltime: 09 Oct 2023 01:09:48.5052 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: OhIrUIwH22f/hkQnhucMUK+/5BppUOOii2bYs/a15HvBvfXA1HngnPh4To4s7sJ7PfnvP2LKOToMW2+LnZjl/w== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BL1PR11MB5445 X-OriginatorOrg: intel.com 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,SPF_HELO_NONE, SPF_NONE 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: 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]); Sun, 08 Oct 2023 18:10:06 -0700 (PDT) > From: Liu, Yi L > Sent: Thursday, September 28, 2023 3:15 PM >=20 > Introduce a new iommu_domain op to create domains owned by userspace, > e.g. through IOMMUFD. These domains have a few different properties > compares to kernel owned domains: >=20 > - They may be UNMANAGED domains, but created with special parameters. > For instance aperture size changes/number of levels, different > IOPTE formats, or other things necessary to make a vIOMMU work >=20 > - We have to track all the memory allocations with GFP_KERNEL_ACCOUNT > to make the cgroup sandbox stronger >=20 > - Device-specialty domains, such as NESTED domains can be created by > IOMMUFD. >=20 > The new op clearly says the domain is being created by IOMMUFD, that > the domain is intended for userspace use, and it provides a way to pass > user flags or a driver specific uAPI structure to customize the created > domain to exactly what the vIOMMU userspace driver requires. >=20 > iommu drivers that cannot support VFIO/IOMMUFD should not support this > op. This includes any driver that cannot provide a fully functional > UNMANAGED domain. >=20 > This new op for now is only supposed to be used by IOMMUFD, hence no > wrapper for it. IOMMUFD would call the callback directly. As for domain > free, IOMMUFD would use iommu_domain_free(). >=20 > Suggested-by: Jason Gunthorpe > Signed-off-by: Lu Baolu > Co-developed-by: Nicolin Chen > Signed-off-by: Nicolin Chen > Signed-off-by: Yi Liu Reviewed-by: Kevin Tian