Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp3985592pxb; Tue, 25 Jan 2022 00:42:49 -0800 (PST) X-Google-Smtp-Source: ABdhPJzENzANZwfkRcKmB247+abIYqAZTk4XoB+Ty4fTBV3k9GnN9hK7Sb9ATe+T62wGaFzgBJEC X-Received: by 2002:aa7:8190:0:b0:4c0:1332:4c8f with SMTP id g16-20020aa78190000000b004c013324c8fmr17402278pfi.23.1643100169295; Tue, 25 Jan 2022 00:42:49 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1643100169; cv=pass; d=google.com; s=arc-20160816; b=BxzNqf3UkzLXlIdOvR9Ltsxf1hoCyEWyjVj1ium0JDUDb2W+B15S1IpCAaBP0BXj2Q XW+xYTKiaRFt2rL5HxpZR5mMuvZALowMjEoNqKVW5Qg7VzL+/rgmVHb/Uh6mx3qwgM3J L9rcRuj+ygbt0dkCLiYZdP4IhTPzr8qjxn72aXBX6QDeYwIZPbyigvxttwM2oLt9tzyK 9mTiefr6vRhHiLScShD0l3WLXzyb5sF36u1iyY67M/cHBeTDQ2mEA7ir1ukh9EqIlsOB wFF95tldI9VRWwQLo/P+Et3TlRh5W3ZQ8eK1j2g+0OXNCd+y2+EX0zT11AW6dZeFEISg rZuw== 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=/40HLDCJCSrSE9Q5SsTOEql75csYZ5B/vwvUYkk+Ccs=; b=vs8fd0S3/1eQjb2UfIoCJ4QOtzMFg+sQt2hfUZSv+XBXjYNTH9I6+O7tnSidfIjpgR AP30UWsfMxeAva3I2AXZu7NC4WuSE8rHjjYJRTwLGawj+w/uT9e3FX/TGqK/3pcS5pVx 031X94XDLGf1JG3RdF5mD5h9GzN6jHG28UNBrkuIQLnFw4z+65o0o4w0es4Jhmad6n04 8lbtq7BMwjZMuoL0HiDiiA/nLRjfFwVL1VYB3rz0jawqBpPp6NeABMushBbtxvDs/3ZZ Z7xTdJV0L24LA4OAWcoNVr9lWXfAVM7ZNLJymtDa7dHl4RA5XzVD9KCZx7CHOAsrbFfT logA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=ZIsWt0w4; arc=pass (i=1); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id i3si13402582pgh.63.2022.01.25.00.42.36; Tue, 25 Jan 2022 00:42:49 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=ZIsWt0w4; arc=pass (i=1); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1319367AbiAYDIj (ORCPT + 99 others); Mon, 24 Jan 2022 22:08:39 -0500 Received: from mga03.intel.com ([134.134.136.65]:61324 "EHLO mga03.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S3419568AbiAYCTo (ORCPT ); Mon, 24 Jan 2022 21:19:44 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1643077180; x=1674613180; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=/40HLDCJCSrSE9Q5SsTOEql75csYZ5B/vwvUYkk+Ccs=; b=ZIsWt0w4tvETJ6vdQ4sH6UJFpg9sqPHGJaICNdSmZoYei/PgPuMg7UxY j7A+2OStaevGoMo3gnZ08eg3G241EP/lQYE6qW9KtoTtZ6ZVTdEJ9ci0B nxH9qaFUAd+t+wxuiPZwMMB+NaBcOiPzKaIKK49ZFhlHyDR3/T5b6Gbip 2g/JOe/hXUwNdS3NYuqt3CvLd3htVMeGobES1ZkIn9+QABooxvGCkL3P4 V/po1ymrknd7fPJ7Sdd+e3eGI121iPPipAvOAVTIBcTSHFSozyyL2KSL9 1At0tXqjSzYVxlwS4BNbHwHyMCO+ohTv7u0P430mPxbjXwYpGhDg1/cv9 A==; X-IronPort-AV: E=McAfee;i="6200,9189,10237"; a="246134518" X-IronPort-AV: E=Sophos;i="5.88,313,1635231600"; d="scan'208";a="246134518" Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 24 Jan 2022 17:11:58 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.88,313,1635231600"; d="scan'208";a="562864281" Received: from orsmsx601.amr.corp.intel.com ([10.22.229.14]) by orsmga001.jf.intel.com with ESMTP; 24 Jan 2022 17:11:58 -0800 Received: from orsmsx608.amr.corp.intel.com (10.22.229.21) by ORSMSX601.amr.corp.intel.com (10.22.229.14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.20; Mon, 24 Jan 2022 17:11:58 -0800 Received: from orsmsx601.amr.corp.intel.com (10.22.229.14) by ORSMSX608.amr.corp.intel.com (10.22.229.21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.20; Mon, 24 Jan 2022 17:11:57 -0800 Received: from ORSEDG602.ED.cps.intel.com (10.7.248.7) by orsmsx601.amr.corp.intel.com (10.22.229.14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.20 via Frontend Transport; Mon, 24 Jan 2022 17:11:57 -0800 Received: from NAM04-MW2-obe.outbound.protection.outlook.com (104.47.73.174) by edgegateway.intel.com (134.134.137.103) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2308.20; Mon, 24 Jan 2022 17:11:57 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=XxeYR7xGWtglI3udd0+j78/O/NbKWeRUHMThdz/Y4PdNZWutVMmFuac3DXoP57iXB58gyu8dw0E0+sxTRDu3nKZWOtGFbNlQHOSIZi+j+VFZMkpG1q1QPV/64ucVeJY0FsQzn/qkTO2K0jb95qwUpIosaoBBsN8/gUkIfGkoN5kfg2rfupaa+DOyTnXrzNdXw6eriijHh948W68cmW08ld35zv130mRmmuA1cNBMrWfze1j0ntOq3EDPK5XDAFUmGK2FoZTq0lEr/amTomQs/U8+4twcUl5fBlt87LOl9ZkFHYAioUJe5iE8RPbnIdrgRm8j7E1Arl8Vypod3dZJCg== 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=/40HLDCJCSrSE9Q5SsTOEql75csYZ5B/vwvUYkk+Ccs=; b=RGFSsCwEf9SlaKzB0fY0705xALGwfJXNpo6zti2f70RpeNv+j6QzXavoio85wjB7BL79x7V+TKbbA1z2rKtd7kCCYES7uOqVY6uMS7UBOsUP4OUL2kC7rPLufsu7ZsmqaEeozys9SquE0aIqepU6B33ggUdaLidhGAau6gMbQxvg1Qbcc5y201Dz77a5yoDxkc4mPyQk91mOs8hSj/ayZeMCjA7HhBxmcIxpaPICeFER/PbeWBHZHkCXBje3UrT4XytcKQuBqyScJhvIKWZBGbtuSG4g10jDmP9h6x8cvp3UhRyRDvfIlvzj9lrOZbxRtSZd1x0cdPBdZnR2WF7oTg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none Received: from BN9PR11MB5276.namprd11.prod.outlook.com (2603:10b6:408:135::18) by CH2PR11MB4262.namprd11.prod.outlook.com (2603:10b6:610:42::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4909.11; Tue, 25 Jan 2022 01:11:55 +0000 Received: from BN9PR11MB5276.namprd11.prod.outlook.com ([fe80::e46b:a312:2f85:76dc]) by BN9PR11MB5276.namprd11.prod.outlook.com ([fe80::e46b:a312:2f85:76dc%5]) with mapi id 15.20.4909.017; Tue, 25 Jan 2022 01:11:55 +0000 From: "Tian, Kevin" To: Jason Gunthorpe CC: Lu Baolu , Joerg Roedel , Christoph Hellwig , Ben Skeggs , "Raj, Ashok" , Will Deacon , Robin Murphy , Alex Williamson , "Eric Auger" , "Liu, Yi L" , "Pan, Jacob jun" , David Airlie , "Daniel Vetter" , Thierry Reding , Jonathan Hunter , "iommu@lists.linux-foundation.org" , "linux-kernel@vger.kernel.org" Subject: RE: [PATCH 0/7] iommu cleanup and refactoring Thread-Topic: [PATCH 0/7] iommu cleanup and refactoring Thread-Index: AQHYEPHAKjrfWJEn8EK96HWI6wkQH6xx4JAggACRgQCAAH0HkA== Date: Tue, 25 Jan 2022 01:11:55 +0000 Message-ID: References: <20220124071103.2097118-1-baolu.lu@linux.intel.com> <20220124174404.GG966497@nvidia.com> In-Reply-To: <20220124174404.GG966497@nvidia.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-office365-filtering-correlation-id: cd042b15-e788-4e4b-dc86-08d9df9fadbf x-ms-traffictypediagnostic: CH2PR11MB4262:EE_ x-ld-processed: 46c98d88-e344-4ed4-8496-4ed7712e255d,ExtAddr x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:8273; x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: DUeWjtfyyS5rDJqosbQs1W1+yKjgU9yPv0rbCQ1rUj9YVeJ4ciEIz3QRmjZysnx7+t7/C9tYgJC+koOxhCylz2RipJBwLDtmw+M7U8/bRT/taKFXt5FhyoJQrn5Fek4tZRjs298YeDMl4Eq3TF6ddITLUJ9UOrUoJHmxrQcSiW7oVihK9z9NE6+rXFzdSUrjJxwp828KLiHZGLCcn2WpmcYQfS/V/EREuQwWjJAStqKj4kTZkws1s71Uuxe1IEqFS+2Npps0e4efDbB0owZoueBUsosQqdKXGc5v2xv665Pb02KxPTD/5px/P9nQnHx1KukkrygONopK5baToirS7zFGK+dBfG7n3z6xP8ZU6EPT8L/qguTSCh+NIpdWgA1eSBaHS7qKr9U6dulhQlO63Z/QXwduw8K23aUu5UhoPuXgVibFCf1qtIu7O6O9dwvc+Ce5Sdxw/PeWa6hpFjcIcbjFNnjzuPIfN4Ez0wRVFwv8jo/v3bLJ+tDBL+kr9ssFjfN9tAudyLy/UTiQTc57FK8aQkwLryNnXQE5EByFKi1DqgTljLjiuYXXDg1VBy1JfTXOUKekap5k9/gIYPXWv8eDHlCkE52H6fhYVUjTrZXTaIJ0v87NENf/xps8Hu+sMSEBN6II96qdB31USBOWXN32ZvCLcNXmPYMc0aFLwHj7cbQ6ZStyOdYQyRbDmytNmUFehl5Nj8vYh/k2m0h08Q== x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:BN9PR11MB5276.namprd11.prod.outlook.com;PTR:;CAT:NONE;SFS:(366004)(64756008)(52536014)(66946007)(122000001)(8936002)(508600001)(316002)(71200400001)(7416002)(55016003)(9686003)(66476007)(2906002)(66446008)(7696005)(186003)(38100700002)(4326008)(6506007)(33656002)(5660300002)(82960400001)(54906003)(86362001)(38070700005)(8676002)(6916009)(76116006)(66556008)(26005);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?oXWWEJfaiAsoVEK1Su2U8AVUpshcqKceQhDANTQ86rM9cQOH2hCUnEKXJSTy?= =?us-ascii?Q?itYtgllTg7ZOFlPvpP8vepzLefq3CCH/31pkKmC0VUYbcsiqUflWw5b/YY3W?= =?us-ascii?Q?OQAFT/u0bcTpGPWMZ/+50AtZsN0mk0MDeS7BaQYm3UC1hqeOVNfUJRO2UdDa?= =?us-ascii?Q?bdsmc1HAZJ6bkqHRQeENVTWwNi1rHSlwjrwjXicTlqGg36Hr6nHiZChRlM3k?= =?us-ascii?Q?V9skdKPcP1qrSzsBXLv7MiUu2eAWvIzD5gjQMeGMhXLaTuYuiYchFZzDIFBQ?= =?us-ascii?Q?EYtYRm9dGR9YFXqSc75uPoPQAIWVj7J2720uvWP+4uMY7Xf0TjMQO2cPiwGo?= =?us-ascii?Q?AEGk8aqGSrr5oZFspGdgiCNn9hQEaocXwjp+JS3nN57sdhBAYSJHeMxk2e9J?= =?us-ascii?Q?eUwYj23FM5yJ9HT+2fuMDz8Zkq0sYHaGCLKaXH/9ZK/MyaAmU6slwo9dZteI?= =?us-ascii?Q?DIPZnVpp6mLsyuNQ+uDqFaIWWCrNYzVVjcHOX8YtlmnVrWTyipTeJaTbPmOC?= =?us-ascii?Q?b/ivKta7/nJz/YrQvkvwiPyQqEvHXpXOoYngx5m4XN8a/l6chJVvuZn/7JLE?= =?us-ascii?Q?w8TR0kLEQH2bX52enCbSic1DJPsFeZ8GRi0St90Ke44JjSkmkvKFjq4Q25r6?= =?us-ascii?Q?UwUxh3doxCqymYm7RV83bJ8d1nKq2yysPIo1FMN9V3IkKGpU/Zne4C0uRt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SUef2jbXJGIBOfnX0SaM+PRI1GHqi4eM?= =?us-ascii?Q?VvXdwpaRLP+iu/ZJloFyBZI=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: BN9PR11MB5276.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: cd042b15-e788-4e4b-dc86-08d9df9fadbf X-MS-Exchange-CrossTenant-originalarrivaltime: 25 Jan 2022 01:11:55.4024 (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: 8e3zUHYiY8EwySsdyBBS+Zege9A6R69aCW0cnTGTfrYErIJLr7Uw+jwClBsgNCl2uM/fr8DQ4bsBM193FOBBLg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH2PR11MB4262 X-OriginatorOrg: intel.com Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > From: Jason Gunthorpe > Sent: Tuesday, January 25, 2022 1:44 AM >=20 > On Mon, Jan 24, 2022 at 09:46:26AM +0000, Tian, Kevin wrote: > > > From: Lu Baolu > > > Sent: Monday, January 24, 2022 3:11 PM > > > > > > Hi, > > > > > > The guest pasid and aux-domain related code are dead code in current > > > iommu subtree. As we have reached a consensus that all these features > > > should be based on the new iommufd framework (which is under active > > > development), the first part of this series removes and cleanups all > > > the dead code. > > > > > > The second part of this series refactors the iommu_domain by moving a= ll > > > domain-specific ops from iommu_ops to a new domain_ops. This makes > an > > > iommu_domain self-contained and represent the abstraction of an I/O > > > translation table in the IOMMU subsystem. With different type of > > > iommu_domain providing different set of ops, it's easier to support m= ore > > > types of I/O translation tables. > > > > You may want to give more background on this end goal. In general there > > are four IOPT types in iommufd discussions: > > > > 1) The one currently tracked by iommu_domain, with a map/unmap > semantics > > 2) The one managed by mm and shared to iommu via sva_bind/unbind ops > > 3) The one managed by userspace and bound to iommu via iommufd > (require nesting) > > 4) The one managed by KVM (e.g. EPT) and shared to iommu via a TBD > interface >=20 > Yes, at least from an iommufd perspective I'd like to see one struct > for all of these types, mainly so we can have a uniform alloc, attach > and detatch flow for all io page table types. >=20 > If we want to use the iommu_domain, or make iommu_domain a sub-class > of a new struct, can be determined as we go along. >=20 > Regardless, I think this cleanup stands on its own. Moving the ops and > purging the dead code is clearly the right thing to do. >=20 Indeed!