Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp100647pxj; Wed, 12 May 2021 23:54:24 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy8pDz/Q06vSEDhze15rqe8iCAyp7SPTZr8XnPj2GWYCJ3BGdqSbdhvfspBHmh0+FLBzeze X-Received: by 2002:a05:6402:1a58:: with SMTP id bf24mr8771940edb.146.1620888864445; Wed, 12 May 2021 23:54:24 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1620888864; cv=pass; d=google.com; s=arc-20160816; b=JALjqjLQh8QYQe2+dn9aZNaRVaR1CU5K8B0fc05OlNAeJ2w7MiiRfUaKSdt0uY3sYg 72/wZBkcCyxSG9g74Z27QpYdMO8CB+OzFpvLLvpa7MITCnGKqg7k6RRR1JU/sDY4+voU EO7BSGniZOnt/oXP+g3oJMVrCecq0Dt+YFaUT2xGFewDsl4nmx7UtCY66YQDP3IpLUXs EGikdbk/9IuWXnDKeD3qvEhY6rrv15sFUQQK6ZtmhQd/kJdxVS7+OdV2O6FPbHLDe2Fh RPSPyfn6bBXCxkbOMw1qEnaqVYB0ND/szLZu8Olg4qCq/80VG6MV3yyRoUdg1qPxCejn Go+w== 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 :dlp-reaction:dlp-product:dlp-version:content-language :accept-language:in-reply-to:references:message-id:date:thread-index :thread-topic:subject:cc:to:from:dkim-signature:ironport-sdr :ironport-sdr; bh=dOxG10YlcjhdLDqR+LeNIuApwba0FwwP6LcqPjTuLGk=; b=S5ufHggxTBsYiKwfmxIQzNjwhdRg+mAefYI/1vWHgF37XXCgWOY/xWxDAybPRs9wMZ vbizFl9QTI2dKSAjFHPb+GTv75Eg5BHjNXdW9rn7eDU+4MIqForj830qIMU9ar+tVwR8 WUi+4ndD+HBx//meSQYn4NTRbQs6PK5qpRAxiachG+wA+tTODqVWSS+KrdQiYnILGx+e IyxQWopd27H7SwmRUuU4Ckpj5HyNzsEX4+GmZdlGPSh3BRLuPOVRzMkxS6fWCMqMyzj0 N0NblQl3x93iLUwLcyuSuHJeMk/hbtHbLkC6a/zgkWCdIznaZgS7fLWW/c27w1uxRLru zslA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@intel.onmicrosoft.com header.s=selector2-intel-onmicrosoft-com header.b=MVgQ2DzC; 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.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (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 dp16si2687347ejc.478.2021.05.12.23.54.00; Wed, 12 May 2021 23:54:24 -0700 (PDT) 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.onmicrosoft.com header.s=selector2-intel-onmicrosoft-com header.b=MVgQ2DzC; 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.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231387AbhEMGx5 (ORCPT + 99 others); Thu, 13 May 2021 02:53:57 -0400 Received: from mga14.intel.com ([192.55.52.115]:28990 "EHLO mga14.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230063AbhEMGx4 (ORCPT ); Thu, 13 May 2021 02:53:56 -0400 IronPort-SDR: OcHoUxV0Wd6H7zflArNhZbn91eM5PrPYhohCsJz3O4ai6P5gpLSwfTYsxCShGN/Gjv7C+SB0+u QSJK4hzS/Kww== X-IronPort-AV: E=McAfee;i="6200,9189,9982"; a="199565804" X-IronPort-AV: E=Sophos;i="5.82,296,1613462400"; d="scan'208";a="199565804" Received: from orsmga005.jf.intel.com ([10.7.209.41]) by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 12 May 2021 23:52:47 -0700 IronPort-SDR: FQg7HvmIHCOV+RTTwmMMgI1HrjgCBQ/CZJWikYaJacWOnc/DBYyT5ol1pF5KmxTyWNhUQYQAhJ 4fJWhqxrROOA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.82,296,1613462400"; d="scan'208";a="610269489" Received: from orsmsx605.amr.corp.intel.com ([10.22.229.18]) by orsmga005.jf.intel.com with ESMTP; 12 May 2021 23:52:46 -0700 Received: from orsmsx611.amr.corp.intel.com (10.22.229.24) by ORSMSX605.amr.corp.intel.com (10.22.229.18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2106.2; Wed, 12 May 2021 23:52:46 -0700 Received: from orsmsx605.amr.corp.intel.com (10.22.229.18) by ORSMSX611.amr.corp.intel.com (10.22.229.24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2106.2; Wed, 12 May 2021 23:52:45 -0700 Received: from orsedg603.ED.cps.intel.com (10.7.248.4) by orsmsx605.amr.corp.intel.com (10.22.229.18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2106.2 via Frontend Transport; Wed, 12 May 2021 23:52:45 -0700 Received: from NAM02-BN1-obe.outbound.protection.outlook.com (104.47.51.49) by edgegateway.intel.com (134.134.137.100) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2106.2; Wed, 12 May 2021 23:52:45 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=RlmpPomPLIqLuV/osuTvFRzD9RNArQYW50d6SsWZIfRUBgd61zQwfC7wZDypkcBP6M1Mlcog7vdriPbbX0BrTC4AuMFjKoX9nugR6EZSIRArHNu/NBTZQtUe7XzTq0eBZR/XFD36/G2+6wb7fkVyh5hy7Nj/FoMyYo6hlbE79Gk2KTzNQQ/jNF1/Oi5gbXvf3BXEsFveVlJEbAUUAbyGcOLKjT9G+1LjKv+0PQvdIwRijqB4VyHmktvJR5dKq+sYit5HLZXz4AwtRFpzYzxxmNOuol1Ji/HE74UYfuLtjfPU1q5bkQgg5PSHeqeZioGhUz4R6KOCCAVea69cVsoG2A== 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-SenderADCheck; bh=dOxG10YlcjhdLDqR+LeNIuApwba0FwwP6LcqPjTuLGk=; b=jGk83dYr7+as2wM0SAyELjHimA6XxkXTioWHLuViEUfVyYKj7HUnex5yBYi2i0BzGVdEleerPWrklCXLR5hd3YZocooh5RoGKGKQrvbhIjj1dfSYZkdQ2i3BWTHSNdwbqmOc5/dk2rlz6OXmDJpIdhyoP7VS3aHUG9NzKDIUoylTAA4sjYhwItLurqhBg3kwPNFS1v2gp0pQyZyW3XBaBHRxV67+4uEKOnzzLwaLhVxS+BJjdgy22NN0vqNqLMf/6+uacewyVqGveP3WnRthi3ca7FP3Rpt9L/RB62d6LzawKLQpeSDHkGP6VZELbund/xQ2Q9ZIRusQT/wqB6TgcA== 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 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intel.onmicrosoft.com; s=selector2-intel-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=dOxG10YlcjhdLDqR+LeNIuApwba0FwwP6LcqPjTuLGk=; b=MVgQ2DzC1AOPcKQ5zPaFn7LetXGCcpepufHDO0+utMNN0i9biBIb1a12iN5P8HXCCzdW7BMIY61cX641dQSsTInDRLLiiGFgk5fvdEUJo73HphYq65nRkylkSNYly6/MOQKE8ODmrCBU4qb7uIpnuP6rlEMOaYrlPthUBrpoPKs= Received: from MWHPR11MB1886.namprd11.prod.outlook.com (10.175.54.9) by CO1PR11MB5153.namprd11.prod.outlook.com (20.182.137.77) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4129.25; Thu, 13 May 2021 06:52:43 +0000 Received: from MWHPR11MB1886.namprd11.prod.outlook.com ([fe80::6597:eb05:c507:c6c1]) by MWHPR11MB1886.namprd11.prod.outlook.com ([fe80::6597:eb05:c507:c6c1%12]) with mapi id 15.20.4129.026; Thu, 13 May 2021 06:52:43 +0000 From: "Tian, Kevin" To: David Gibson , Jason Gunthorpe CC: Alex Williamson , "Liu, Yi L" , Jacob Pan , Auger Eric , Jean-Philippe Brucker , LKML , Joerg Roedel , Lu Baolu , David Woodhouse , "iommu@lists.linux-foundation.org" , "cgroups@vger.kernel.org" , Tejun Heo , Li Zefan , Johannes Weiner , Jean-Philippe Brucker , Jonathan Corbet , "Raj, Ashok" , "Wu, Hao" , "Jiang, Dave" , "Alexey Kardashevskiy" Subject: RE: [PATCH V4 05/18] iommu/ioasid: Redefine IOASID set and allocation APIs Thread-Topic: [PATCH V4 05/18] iommu/ioasid: Redefine IOASID set and allocation APIs Thread-Index: AQHXDZub0CDG82VGXUmLEYgvMuPs4KqKkLIAgACg94CAAC72gIAAD04AgAADogCAAErUgIAETQEAgAOaswCAB7C3gIAAhxQwgADYDACAATCSAIAAVGMAgAELsQCAACiXgIAAVBgAgAAaMwCAAAESAIAABy2AgAAgOYCAFdCAgIAAppUAgADsNgCAACqygIAHsmaAgAAzsYCAAAjdgIAAD/yAgAAcQgCAADqggIABMLWAgAcMG4CAANKaAIAAhd2AgAGBD4CAADHjAIAHHxkAgADGNoCAAPB6gIANV9MAgAAMdIA= Date: Thu, 13 May 2021 06:52:43 +0000 Message-ID: References: <20210421230301.GP1370958@nvidia.com> <20210422111337.6ac3624d@redhat.com> <20210427172432.GE1370958@nvidia.com> <20210429002149.GZ1370958@nvidia.com> <20210503160530.GL1370958@nvidia.com> <20210504181537.GC1370958@nvidia.com> In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-version: 11.5.1.3 dlp-product: dlpe-windows dlp-reaction: no-action authentication-results: gibson.dropbear.id.au; dkim=none (message not signed) header.d=none;gibson.dropbear.id.au; dmarc=none action=none header.from=intel.com; x-originating-ip: [101.80.65.46] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: acc38c54-8998-45ae-0da1-08d915dbb573 x-ms-traffictypediagnostic: CO1PR11MB5153: x-ld-processed: 46c98d88-e344-4ed4-8496-4ed7712e255d,ExtAddr x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:10000; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: wi7waP/PKC7Im2zH8qVoqDQ9E99q91/0Rv5VisE1XQtyLNKJxie0ZCqpmqpw+oGfrLGKAwo6CklQmP9kc388uP4hBMuWA4hGLTRm4Bkm9QtIfxmyfwD9vP9SDrrjQ0dGRd61Xt3M4kfQNobu1ZCyjfohgUMxCHUD9gdpD7LOQt1fRg/N749pRfx+JIJpTPO6TrjxnKrDunSuNpCsr0cfki9fSQM86ZC3mquoUZL4fBlwXixIoF9leBV9C51C8PvSV0hn+n/m9Bz3CQ554qq4r5r1QZ4Ty0Pe4td1a+oniKEoVF7S7bFeyhAuzi3tQjUS28uuJBBBglByQk/Ssn+r9qvL41z5qnb1IJNR7GnN1E11iIDSNzECZhSE01JRmlpheq8hPBp7OgnAdpPQ5bQNuxhdcTiQGhQLEcQn7fX8mkaszpYdc5NX7qBuPoRFY1iKNq5AVUttq8TCYAL+QQubgVVLnIYz84R8sLqVB9I17emCyU+O6NQSprb8l5mgA9UK2FephEvRT0kHsohrE0G3ZOlCxI3k8XzaR0hgzTYAfJ+x1rz2FRK81qH8yZFMZeYP8j03Cvu8Og9GTSymk1P01JICgfEAYBL+KhudxmSXj8A= x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:MWHPR11MB1886.namprd11.prod.outlook.com;PTR:;CAT:NONE;SFS:(136003)(396003)(346002)(39860400002)(376002)(366004)(7696005)(4744005)(66446008)(64756008)(76116006)(4326008)(122000001)(478600001)(52536014)(71200400001)(2906002)(7416002)(38100700002)(66476007)(26005)(66946007)(66556008)(6506007)(186003)(9686003)(55016002)(5660300002)(316002)(54906003)(110136005)(33656002)(8676002)(86362001)(8936002);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata: =?us-ascii?Q?VhO4/1dscOl9cdswVYrzwmkJ/srAZNTy6UWWoqC7vfPLczpOAlF8maT6mTaN?= =?us-ascii?Q?5i243gwtPsAt37DswRByoLcOU1CGBjeGGYKX8wsEsDGwzVH2yrVWHfEzIAyk?= =?us-ascii?Q?qDPXDsSrUWt2KIox17L1xLz5RDMbsjBWOrs1e0QgeugktzJNCrYiW5xmMhYM?= =?us-ascii?Q?le6wTIUBMqrVg7HwMUiR+vmQ3/pQLcdn8jxnnzZiofIMILKpm61wWKOywIQX?= =?us-ascii?Q?RIZbFOrX+KL6DJlpC9FXoHeko4ZEcIbHeiFMlRjdJwCeqBrh1aJY8XT+K83o?= =?us-ascii?Q?H1djmIvkyKrDfsj/+DpfkG3xeNWjkvw+8jyXcppuBmcS0QjeargjtBFdwhB5?= =?us-ascii?Q?HyRAay/1xv7uviQj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?Q?EJJrRLhrEpBsdPWRgjsMjBocKwKlZkBuurvPrz99pp6XOJMXBRmiDaS0C3df?= =?us-ascii?Q?SJYl4SEQuyXJsRCydsWiHdJj?= 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: MWHPR11MB1886.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: acc38c54-8998-45ae-0da1-08d915dbb573 X-MS-Exchange-CrossTenant-originalarrivaltime: 13 May 2021 06:52:43.5423 (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: 022A+rbHP6Hy9GIbG2V/wAHEZFYtRK5DQ5v1Xyxj83ekYoG9vMtZBrV5CrRnFvm8oMrzDNRcjRwOClC/ATPRkw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CO1PR11MB5153 X-OriginatorOrg: intel.com Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > From: David Gibson > Sent: Thursday, May 13, 2021 2:01 PM > > > > But this definitely all becomes HW specific. > > > > For instance I want to have an ARM vIOMMU driver it needs to do some > > > > ret =3D ioctl(ioasid_fd, CREATE_NESTED_IOASID, [page table format is > ARMvXXX]) > > if (ret =3D=3D -EOPNOTSUPP) > > ret =3D ioctl(ioasid_fd, CREATE_NORMAL_IOASID, ..) > > // and do completely different and more expensive emulation > > > > I can get a little bit of generality, but at the end of the day the > > IOMMU must create a specific HW layout of the nested page table, if it > > can't, it can't. >=20 > Erm.. I don't really know how your IOASID interface works here. I'm > thinking about the VFIO interface where maps and unmaps are via > explicit ioctl()s, which provides an obvious point to do translation > between page table formats. >=20 We are working on a draft uAPI proposal based on the discussions in this thread. expect to send it out next week.=20 Thanks Kevin