Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp1115522pxf; Fri, 2 Apr 2021 01:23:32 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxJKy99diUuR80Ts63K89poCgFLr5yHw1+VtTm/QxAg2xDo9IxDKOfKIYWj7JjESB94vji+ X-Received: by 2002:a05:6e02:1b01:: with SMTP id i1mr10223774ilv.253.1617351812017; Fri, 02 Apr 2021 01:23:32 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1617351812; cv=pass; d=google.com; s=arc-20160816; b=Ln1zMOeIpe5D1b0L3CnExXxClt4Ont73XFdYqYJ3cf6un/V5T6BQCKMFnh8arscgCn 7MF1epThPHZEX9iEpzzUJ4Hwz3n71X/g9pUfbwyd2T+HpO9bsKIzmyC0ieqkzlVfbVsB 0Bz22uSqkHx9xrSxw8xshIRz4UIsFHdAJATEQ47E0Mto/BWQtBhpPccHS0aBcBjyztgF 6+Z/ox3vp+VC/KS+bUHGad3FiQgrXbJ5eH2M+lQGc7AycxmqZhok0tubXMuSGk7TBAlm g7uhtJ4yaTncbUfBzW0EH8sXN7XkayZsseTak6rpi8pr3w+YGhXuMlMXv//MkJAfTUCY 7U4A== 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=VusmaX7Q1WBEhTczFXap0omSnLIBW7wEZc8f3ATgVr0=; b=FC1kgbY62fIp7UxvaEzEoZFVn1ejR8IdJKxAEaWUt3X3daQc52jmUlwJWSDfLDkMeN jLrt/VrjVaua0jNfT/cTZksEXQe2TMV/AyocVehzyaVPt4Yo9DX0ixx5lWxsdUXyEEuk ar93E27PZzoWmSW96SCmImXmip/oCJtu7S/bHeYZwbVfcYn9GfILdXYdhd+/Ot7mH+CZ CJKfdzefKZy6EwKt+UxkGTjwnTPM3+O3q1k6T/RYZH+Znhk37BCnwNSM10IOE+Px1y8z UUfBZK2bXAOTcy9My4mMkL/hWkWwKes3JCEv2KCQmLC3/qmS6mwppGGm/oap/5Qpu44l ufCQ== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@intel.onmicrosoft.com header.s=selector2-intel-onmicrosoft-com header.b=fKoh+xpW; 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 q13si8356345ilg.122.2021.04.02.01.23.18; Fri, 02 Apr 2021 01:23:32 -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=fKoh+xpW; 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 S234361AbhDBIWe (ORCPT + 99 others); Fri, 2 Apr 2021 04:22:34 -0400 Received: from mga18.intel.com ([134.134.136.126]:1213 "EHLO mga18.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229522AbhDBIWc (ORCPT ); Fri, 2 Apr 2021 04:22:32 -0400 IronPort-SDR: B+NgqlJFdtmxKXxb0eZn5Bhs8ml2hG7G6nll+QnkbD6vjhtkckEKiV2QpZJq9xCmX9EVRDokza qgyP1Lb7AaiA== X-IronPort-AV: E=McAfee;i="6000,8403,9941"; a="179949982" X-IronPort-AV: E=Sophos;i="5.81,299,1610438400"; d="scan'208";a="179949982" Received: from orsmga005.jf.intel.com ([10.7.209.41]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 02 Apr 2021 01:22:30 -0700 IronPort-SDR: 2crRJvln5awoHIY3DB7DM7g/N/1WYmWlPhp2To+YzTItAVjoWav5hKhiMSZ5pck6qqZSuLMD06 zWLfP/doGKQg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.81,299,1610438400"; d="scan'208";a="596657406" Received: from orsmsx603.amr.corp.intel.com ([10.22.229.16]) by orsmga005.jf.intel.com with ESMTP; 02 Apr 2021 01:22:30 -0700 Received: from orsmsx607.amr.corp.intel.com (10.22.229.20) by ORSMSX603.amr.corp.intel.com (10.22.229.16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2106.2; Fri, 2 Apr 2021 01:22:30 -0700 Received: from orsmsx611.amr.corp.intel.com (10.22.229.24) by ORSMSX607.amr.corp.intel.com (10.22.229.20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2106.2; Fri, 2 Apr 2021 01:22:30 -0700 Received: from ORSEDG601.ED.cps.intel.com (10.7.248.6) 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 via Frontend Transport; Fri, 2 Apr 2021 01:22:30 -0700 Received: from NAM10-MW2-obe.outbound.protection.outlook.com (104.47.55.102) by edgegateway.intel.com (134.134.137.102) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2106.2; Fri, 2 Apr 2021 01:22:29 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Rai8AxMN65pxk0Xb8TVWOgGXB3+Mc2Sch+l6nVkHhRw9Yvn5FAEHNDG06CG8iAn0OZhQnVbLV2wVH619Pglhz0DmkJ4dKuOmiXodw5Zs0aDd8LKB8n2e2TVZxUpTt0BfKURYxfAaZrbJGRTnK0/n1tSBP2xLvt+R9ZU3Yo93pCJKqoKpNWdD43H5Y16vxwDd9xobBMKcwqMwL03OJ8DHdK1s1DQhMmmfTNVTPSdewwHmCUpbx/WhjlcibRe2uBvOhtVa8DEYcyfXU0hoiS5BSzvvn+tsDkc606XcII4LPixEutef/CaNTXn8VMC6CYk3LZwXz2ZrSu9yAhafuFYLfw== 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=VusmaX7Q1WBEhTczFXap0omSnLIBW7wEZc8f3ATgVr0=; b=lX4Fe5tdcz7Yxxo6SxB2dA1yPgxJtLjm12jAp4PCKd9ppC7bb/LxuTA1OqVrD7vAEVuOmp6S80pBWL3pBJ092QnqSJ2E9CwyGTe/ISNqtabsqWm8+TToqlhM/Ex9m8mUMd0LbiEhpjIwMD38ECoQd6WQ65nn5kpq2dmJZbeF+7ZqYdurIDAyhiuxy49TaptlXsHxhqrndGVRo2gwcwuXHd0zP5V0RJ3M+kNII9F9p4y7kvSFn4MBzRdb43yugJjRuLUlwaBzgbV9rQL9zZrdi3JmGmNpfeOXbY+URF1zxM7T63dXf0FTYjjifYL0I4WDfeA7VNQnScLLdkvmTCW3NQ== 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=VusmaX7Q1WBEhTczFXap0omSnLIBW7wEZc8f3ATgVr0=; b=fKoh+xpWV++sSCesW9H+Kiz6H9HqMENFBsclT9RX3WL0/9D6qLgB2X6oKKpWTpGLas23B2VhQHMZpNYNx3VPtUD5BQn0P/pGm+3TO3PfC6OI7TQm/lv+i1Grl13Rnv9G9ZwHhiid9r73NU/9tEZfUThKSTENN00p7HOaP3wGMY0= Received: from MWHPR11MB1886.namprd11.prod.outlook.com (2603:10b6:300:110::9) by MWHPR11MB1327.namprd11.prod.outlook.com (2603:10b6:300:2a::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3999.26; Fri, 2 Apr 2021 08:22:28 +0000 Received: from MWHPR11MB1886.namprd11.prod.outlook.com ([fe80::75b0:a8e9:60cb:7a29]) by MWHPR11MB1886.namprd11.prod.outlook.com ([fe80::75b0:a8e9:60cb:7a29%9]) with mapi id 15.20.3999.030; Fri, 2 Apr 2021 08:22:28 +0000 From: "Tian, Kevin" To: Jason Gunthorpe CC: Jacob Pan , 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" , Alex Williamson , Eric Auger , "Jonathan Corbet" , "Raj, Ashok" , "Liu, Yi L" , "Wu, Hao" , "Jiang, Dave" , Jason Wang 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: AQHXDZub0CDG82VGXUmLEYgvMuPs4KqKkLIAgACg94CAAC72gIAAD04AgAADogCAAErUgIAETQEAgAOaswCAB7C3gIAAhxQwgADYDACABFtkwA== Date: Fri, 2 Apr 2021 08:22:28 +0000 Message-ID: References: <20210318172234.3e8c34f7@jacob-builder> <20210319124645.GP2356281@nvidia.com> <20210319135432.GT2356281@nvidia.com> <20210319112221.5123b984@jacob-builder> <20210322120300.GU2356281@nvidia.com> <20210324120528.24d82dbd@jacob-builder> <20210329163147.GG2356281@nvidia.com> <20210330132830.GO2356281@nvidia.com> In-Reply-To: <20210330132830.GO2356281@nvidia.com> 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: nvidia.com; dkim=none (message not signed) header.d=none;nvidia.com; dmarc=none action=none header.from=intel.com; x-originating-ip: [192.198.147.211] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: b5b7ba21-3f3e-487b-595f-08d8f5b07401 x-ms-traffictypediagnostic: MWHPR11MB1327: 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:9508; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: g9xs5GHqoOvo4kOKlHHkaDyADmKUNDl+QYiU+i4492oZQisEINAmmhC3RkbRGRipc5gIj1GvgavtPImx/GRpMP8RCjA5z4OfNFDSLk9xzWwlAvEsHiRviaaxWflPK8a1flIqOQUrUjciblhJQ2E8KSG+Sx4/WI1HPnEmdL0Nx8sCb2VinC+CDqe1C6mVHkqSlNnyhgMr64bKbMHciJvssTnetSLOOYMR8ovAAsXR+sowIROmXfeLgFWfEr0xZBMflJr/lJPZw+sn3dmGQrqGngLSHUNfM+GaWhWPEaUMPLMSo4FGEzmw20jvRqI1nFx5ltX03B5rioiBZt5ZBPFg12MrxcOZjUcC8OtD2qqwGvRnDnm1ObR1R0fs0U39jb97PHzRy5qOWxu8/UyV0+JMuKTXduJD6ytMJa6o/s4uLJkXjtiJBQOM4IYd72p7ZFMchPhibdHSMqdnNL7/Jv3M4laFcmDnxwPNOIfK/EdYuB7hl8gr1DIvPxmnY5CMJoXx0kReTodLLZZO3c37dn8uZhL2rJWykplqh6G1+GsCfMPk7McQikaaG8VBTfy11VSI3BEDm+OAyjZLOUUHIGAHG0t38Hb+5SdHqz9IWk/OKLsKZacOPzG/oKHaklqnzfXEol2S+/fTLX0WP9v6/yE7G5wWkZ15a6f0taC1p/4cjaw= 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:(376002)(366004)(346002)(39860400002)(396003)(136003)(83380400001)(55016002)(5660300002)(38100700001)(66556008)(26005)(66476007)(316002)(6916009)(66446008)(64756008)(52536014)(54906003)(8936002)(9686003)(8676002)(33656002)(186003)(6506007)(86362001)(4326008)(66946007)(76116006)(2906002)(478600001)(7696005)(7416002)(71200400001);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata: =?us-ascii?Q?OPuqJhROTQ6nchvXbUIzlGsAxCgKmtFSal0QZNfGrQ3CsPguSiRgTSL/1n9A?= =?us-ascii?Q?qhWkSPUJkfM9agDksXqfbXLbOiasrUiLjKaMfGnwZxnvIOhcPBGrz2LwELuz?= =?us-ascii?Q?qGIF90zOthyLyUKzWm9svSzgbb3YdUYOexivzLwcOlEC9od1lqj/qJgZ8uYJ?= =?us-ascii?Q?yEq9NqDKTgBPEmZYqPe5iMdfEkXJefBJzZtiPNDp3+QeMNqU+NWL3DoGDuJq?= =?us-ascii?Q?EJJ3bIruAdMmDVgp1W4No3niKNnLty6s/3PLrWq6MKDM1vazk52nTlENrp9u?= =?us-ascii?Q?baa/P89iGuWIggWi/ByIULpiuW4tjhL9IKilz+0rHdjrWsSmBVBIe+D6AMJk?= =?us-ascii?Q?lp/vICU1Win6l5lE8L2UffY7QnNHbWWdNSeWfijGe25VM/r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iAqA7SDEv3KvMkPXgweoZWpP/MJnKUlvRBE4q+j?= =?us-ascii?Q?KFnNj2v23V1Q9e2lTxdMB3Ph?= 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: b5b7ba21-3f3e-487b-595f-08d8f5b07401 X-MS-Exchange-CrossTenant-originalarrivaltime: 02 Apr 2021 08:22:28.1590 (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: oLpuzb4KUwAeZqoKsatcHHvz8dewF6sMjtqP6y2UGhqKzbKou9uXhDoQd4NoQFd0CuHe6ey3DtANPAkNzkzNtg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR11MB1327 X-OriginatorOrg: intel.com Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > From: Jason Gunthorpe > Sent: Tuesday, March 30, 2021 9:29 PM >=20 > > > > First, userspace may use ioasid in a non-SVA scenario where ioasid is > > bound to specific security context (e.g. a control vq in vDPA) instead = of > > tying to mm. In this case there is no pgtable binding initiated from us= er > > space. Instead, ioasid is allocated from /dev/ioasid and then programme= d > > to the intended security context through specific passthrough framework > > which manages that context. >=20 > This sounds like the exact opposite of what I'd like to see. >=20 > I do not want to see every subsystem gaining APIs to program a > PASID. All of that should be consolidated in *one place*. >=20 > I do not want to see VDPA and VFIO have two nearly identical sets of > APIs to control the PASID. >=20 > Drivers consuming a PASID, like VDPA, should consume the PASID and do > nothing more than authorize the HW to use it. >=20 > quemu should have general code under the viommu driver that drives > /dev/ioasid to create PASID's and manage the IO mapping according to > the guest's needs. >=20 > Drivers like VDPA and VFIO should simply accept that PASID and > configure/authorize their HW to do DMA's with its tag. >=20 I agree with you on consolidating things in one place (especially for the general SVA support). But here I was referring to an usage without=20 pgtable binding (Possibly Jason. W can say more here), where the=20 userspace just wants to allocate PASIDs, program/accept PASIDs to=20 various workqueues (device specific), and then use MAP/UNMAP=20 interface to manage address spaces associated with each PASID.=20 I just wanted to point out that the latter two steps are through=20 VFIO/VDPA specific interfaces.=20 Thanks Kevin