Received: by 2002:a05:7412:da14:b0:e2:908c:2ebd with SMTP id fe20csp2368016rdb; Tue, 10 Oct 2023 01:34:20 -0700 (PDT) X-Google-Smtp-Source: AGHT+IE46L9sIfF3F2hRtSY4PtP2dvo/2HEp0WFqRzzaUzsLrTMujn0oz3TYVvSlkloTkH4dPkbr X-Received: by 2002:a05:6a20:7348:b0:154:d3ac:2063 with SMTP id v8-20020a056a20734800b00154d3ac2063mr18284962pzc.27.1696926860592; Tue, 10 Oct 2023 01:34:20 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1696926860; cv=pass; d=google.com; s=arc-20160816; b=1JHaEapeiakGsVTBx2UvNeXEluFSeiyLAhEgyX9C6JvlNpgwgdzLhej/KW4oIRqSaF 1JjCaHHH5HDRbygZQXjKTCo06Ci5iUHWzsbXn+c0Ma0cbN9YsdQmQ/Q3QtzWi3Rve05+ C+/h1ezmVvv7s4MqIMLpGsV2C05rzszXmNsgXLO/zr0jZcEvYOtRyHN4cC77JodGUqTa bLAMRqWO+11BkjvX5wU0uqXntPzchisIri7o6e9+ixpDsbNzshbb8SSviiUzk8U6l65H vdIBj7178QKPXVQiAEsdbE4ig8+nvLRn65ePoM8oJQ/ggf7GRx8b8TCX70m4KJd+g9Qh CQ/g== 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=Kcxj7cZWSM2OS1A1OaCCLn7MF2on63bpWMxds8wKgwA=; fh=rzJXgqYMkpXQIFArmKrceTst9cIY3xeR6wJcDhf4/fY=; b=akycedoh47Ncbjv1J6iuCIdRuJM7tz0irdv8YgqUlMIJGdDvYVzBFq4n/l/NUYXqeW i/A/SDKw6ewdmdYkPvS/pE7g6jsumbZTirAMSUfAvxFHPY2hlhgS6/vLqL/SFVaQLq4C 6DK6fcZyv5+6vS1aw/TCPairx5oBh78JqhPpDZfk52SScEPM+cFqYA9o8kjdIt66hnQw HHa047iRVCrTjBr4nMXF03TBgXVMn+Xbuqtyy4+nosKNnuaOF5kfOlkuoqFjxyVakgw7 RX1D9AuyeCj78THa4fdnL518UvqFJh8g/XWA0LKg6Uzdbxc8XAiJeVlHixtftxwFTNgb duFw== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=AEWysyLo; 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 2620:137:e000::3:2 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 agentk.vger.email (agentk.vger.email. [2620:137:e000::3:2]) by mx.google.com with ESMTPS id q17-20020a170902eb9100b001be025f8407si1200945plg.37.2023.10.10.01.34.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 10 Oct 2023 01:34:20 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) client-ip=2620:137:e000::3:2; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=AEWysyLo; 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 2620:137:e000::3:2 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 agentk.vger.email (Postfix) with ESMTP id 3CB148022719; Tue, 10 Oct 2023 01:34:17 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1442880AbjJJIeK (ORCPT + 99 others); Tue, 10 Oct 2023 04:34:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57102 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1442915AbjJJIeA (ORCPT ); Tue, 10 Oct 2023 04:34:00 -0400 Received: from mgamail.intel.com (mgamail.intel.com [134.134.136.20]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D74219F; Tue, 10 Oct 2023 01:33:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1696926838; x=1728462838; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=Kcxj7cZWSM2OS1A1OaCCLn7MF2on63bpWMxds8wKgwA=; b=AEWysyLojFhe7WrmNJ6Q2xZCTqW12OAon4ZbMOUWqFsgzV6VVYLoCQIu FyVKOlo6MS408uXzY9R8wuPZPifB/SqtoVVz2kfNfwZQuSXzPwc4lOkRy /l/PgS8gjpLEwsOiPpam8H/wEJHBs48FZkRfME7GcAbqUQP4gmyeLIP2B Vm4c6BvvMNJDcxI/zHI7izQMLFshtxjXxZiKsGBLfKSWwQDF1azCVshCC dNwf3SwgzylkIGw7e43lJvGkKwRgqXo+Yfa+olucoUPFeBkkuJx4Hlo1+ IqIkkQut6Oi8ICsDqjatQKSh0Dtyl8kabltKYORBHPwPKlaWQvDcbJZSP A==; X-IronPort-AV: E=McAfee;i="6600,9927,10858"; a="374685362" X-IronPort-AV: E=Sophos;i="6.03,212,1694761200"; d="scan'208";a="374685362" Received: from orsmga004.jf.intel.com ([10.7.209.38]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 Oct 2023 01:33:58 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10858"; a="877144149" X-IronPort-AV: E=Sophos;i="6.03,212,1694761200"; d="scan'208";a="877144149" Received: from orsmsx601.amr.corp.intel.com ([10.22.229.14]) by orsmga004.jf.intel.com with ESMTP/TLS/AES256-GCM-SHA384; 10 Oct 2023 01:33:58 -0700 Received: from orsmsx611.amr.corp.intel.com (10.22.229.24) 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.2507.32; Tue, 10 Oct 2023 01:33:57 -0700 Received: from orsmsx610.amr.corp.intel.com (10.22.229.23) 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.2507.32; Tue, 10 Oct 2023 01:33:57 -0700 Received: from ORSEDG601.ED.cps.intel.com (10.7.248.6) by orsmsx610.amr.corp.intel.com (10.22.229.23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.32 via Frontend Transport; Tue, 10 Oct 2023 01:33:57 -0700 Received: from NAM02-DM3-obe.outbound.protection.outlook.com (104.47.56.41) 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.2507.32; Tue, 10 Oct 2023 01:33:57 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=nb+8Gs9oS6oysYnCrf6dxKSuKsVps7Y02J6W0ZxaXk5lRVDcMSOBc0rMSNuXbKyHSQzrjM8AMKch8sqpR2iNuIHXA7TizAs2zDLsoK655W3fJ4ypfP6yPSUaYh2Gm0t0GhDVzdocYgOiMvbsgSjA+CaJRH+f2JqOl+fzIdR1LmfR+7ZoaNRVzRy8T2CiSN8MEFuPg6UKwL+c0BWWU1puS2RAHZwMu5LM3SczvkvRIN2bGYOkdHgvKvU7l3CxpSrhIsEs5Q51XGq3BXMhpI7o0pXxDsLEeQsaQJBbH+gF2+z+uXJRI2GD6f7hFaiaUwLOn1vt4P3n2SpWqJ2nkMbv/w== 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=Kcxj7cZWSM2OS1A1OaCCLn7MF2on63bpWMxds8wKgwA=; b=GElT7AN2l7olgE0AdSrjmJIPklagbN43Zs/AQ8I9aD9TaHwZRGBcruMYsb/Fz5KDt1vz3oGlQuVFTVzy3WjkWEWdx+Ch53e6CJokSdCY47bD102dGTd6M/6lLMyPKv6ok4AqKYZniDtrnxnY4dTLkFbuZGqYLWblTD8ZeXjLVC+2359JUHCIulij/xQF25RnVr+JRn7zBUnEZcXW695XhDT3B1PqKHTbdm5ni73em6BaTLuPav6JAxOpymW78Zf+xggsqTJAZigpLCz46wkar7nu6W0692CfNp+7AjaJongQqwjIjG3+/Z18L0aPtMwsWVI8plVcUIaW+ATbbm2j7Q== 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 BN9PR11MB5276.namprd11.prod.outlook.com (2603:10b6:408:135::18) by CH0PR11MB5705.namprd11.prod.outlook.com (2603:10b6:610:ec::5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6863.38; Tue, 10 Oct 2023 08:33:55 +0000 Received: from BN9PR11MB5276.namprd11.prod.outlook.com ([fe80::7116:9866:8367:95b4]) by BN9PR11MB5276.namprd11.prod.outlook.com ([fe80::7116:9866:8367:95b4%3]) with mapi id 15.20.6863.032; Tue, 10 Oct 2023 08:33:55 +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: [RFC 7/7] vfio: Add vfio_register_pasid_iommu_dev() Thread-Topic: [RFC 7/7] vfio: Add vfio_register_pasid_iommu_dev() Thread-Index: AQHZ+o3ZhQduZ+T030mKo+5fLXvrlbBCs3Uw Date: Tue, 10 Oct 2023 08:33:55 +0000 Message-ID: References: <20231009085123.463179-1-yi.l.liu@intel.com> <20231009085123.463179-8-yi.l.liu@intel.com> In-Reply-To: <20231009085123.463179-8-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: BN9PR11MB5276:EE_|CH0PR11MB5705:EE_ x-ms-office365-filtering-correlation-id: 8a9eddb8-b707-429b-bdb0-08dbc96ba3f7 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: nRGhu/yu1s2OnIP0kSEPzJHDaNF8KLqNTXFrLcfx3Lk9fzwGbIrnfna/HvnGg5LcCJzN9DIkWfXVPXtuZyUspPsSmyV1wbDKJ9LOb0IarBTIJTJZffFZyOTTbGyUavBTsOIHCSOHttYGcQfQNXsrubD6HMwijwZLbAQpDGy0TWuXhPjUIEs6FuS5amtdvPvyZQoEHPEUyhOpywXnsfP8IfnA5twqXRbI2BugB5Wg8KklznokCKwKcs8peoIB5vNU2vkLMkCjmU4rnbFlKEqpAE/6LPh5ai5vhB8pPcr7oNfkP7zr82l4rRjmQVdnAu+Nt7qoegvYfEs81YOdFUx/Oz24ldyj/SkpGkDakYtoQCa8Z0mnelqiwmbLX9YvGrF5DDnUnBekovFmQ9E86+DiXu6rrsZdbuKCevQ6aqcA2D2U9F5S52d521I/++lJWsv4kzAxg8JwD1GE3zd/ZQoKHM2Q/O4H7met0+Ky6mKseALzRvrnMqucNEAfprgGH27IS8U6XPpUsCs1XAeIHoYlA2xJSloLkMA8NuVstoNV4PMImK7UxKuB1Pc2gGNBpl/7BJX5hKTxsEvjAhomoRs8+cDPDUjfniOGSd8bVDSeeeE9EKulIN56bkCvn/vXI7HP 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:(13230031)(346002)(376002)(396003)(136003)(366004)(39860400002)(230922051799003)(1800799009)(186009)(64100799003)(451199024)(9686003)(33656002)(86362001)(55016003)(38100700002)(38070700005)(82960400001)(122000001)(26005)(7416002)(2906002)(71200400001)(7696005)(6506007)(478600001)(4326008)(8936002)(8676002)(52536014)(41300700001)(5660300002)(76116006)(110136005)(66446008)(66476007)(66946007)(66556008)(64756008)(54906003)(316002);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?2Pw99fnd15+nWTvsp5r4mWE7tpaZn4JiW6iuhFOiKhzqzydLdHbT3MbPH6WM?= =?us-ascii?Q?uIbdmoHI2Baf8Flh547MgG/SSuUXNCFp9AB8iDCJkUV7/RuAv5Lcq3AfelzD?= =?us-ascii?Q?fv+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BoPiRYvwMy0JcEORaXTfu+8H?= =?us-ascii?Q?1GQJJEdUA0nFOvYroUvDm7FKIheBTgPMl3+XYqlbkfOrF0hGFwFxqLC3covS?= =?us-ascii?Q?3g+aPEznsIfcfO33t/0uu3R/ckE3mZc3tL5uCUnVIZorxrOBRBN+SPPZPq2X?= =?us-ascii?Q?LNIWH5csGFK4UuC6iGZivQPxStHwspaO2XsiYMK3RLPRfpC8ZC9J4zOgTbNX?= =?us-ascii?Q?d4vD1I5jcFnG3kUgGU5MA7QuZmSc7XUDToE62ngt/bzpv0cbPSXRlSZxudwN?= =?us-ascii?Q?f/DCr9rMRwc6rhuF+vrDqvLT34I4yFxcMceYNC7HLS98geMeV5cUQ2mnU2Ah?= =?us-ascii?Q?ZghE4XNAsdqHPDY/DfB62M4w4p54s2qUD+u+Hk15zZZujecXN7Yq1Bnw8H+O?= =?us-ascii?Q?2+BMA8k7T8+YtpewUTFtZXPvFuyhmACcSJtKbBLj6TP+cawE60kF8c59EMOn?= =?us-ascii?Q?zJTAyJ0eFVxIUUf5317jJzEEEMIVhGp6Nih3UKKoEReQaQPPJZVh186hbTE0?= =?us-ascii?Q?mfBYDxD9zbhKHN2FBwEb5XVFg+binLiB0A6vAOSbGfltvD47KR8DOlz6HQwQ?= =?us-ascii?Q?zepbLOXI3+L9lyfHFZQcCWscE8XwqgbwcIknHHr/?= 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: 8a9eddb8-b707-429b-bdb0-08dbc96ba3f7 X-MS-Exchange-CrossTenant-originalarrivaltime: 10 Oct 2023 08:33:55.2349 (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: BJF/GkR6iutm7nw4x/+Roo8qzf4iblQ4n2nAR6t06gYf8TcPrpTpoVBGzNEuFt5ggH2MfijoAy8VO9d+dYVvqw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH0PR11MB5705 X-OriginatorOrg: intel.com X-Spam-Status: No, score=2.7 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RCVD_IN_SBL_CSS,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on agentk.vger.email 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 (agentk.vger.email [0.0.0.0]); Tue, 10 Oct 2023 01:34:17 -0700 (PDT) X-Spam-Level: ** > From: Liu, Yi L > Sent: Monday, October 9, 2023 4:51 PM >=20 > From: Kevin Tian >=20 > This adds vfio_register_pasid_iommu_dev() for device driver to register > virtual devices which are isolated per PASID in physical IOMMU. The major > usage is for the SIOV devices which allows device driver to tag the DMAs > out of virtual devices within it with different PASIDs. >=20 > For a given vfio device, VFIO core creates both group user interface and > device user interface (device cdev) if configured. However, for the virtu= al > devices backed by PASID of the device, VFIO core shall only create device > user interface as there is no plan to support such devices in the legacy > vfio_iommu drivers which is a must if creating group user interface for > such virtual devices. This introduces a VFIO_PASID_IOMMU group type for > the device driver to register PASID virtual devices, and provides a wrapp= er > API for it. In particular no iommu group (neither fake group or real grou= p) > exists per PASID, hence no group interface for this type. >=20 this commit msg needs some revision. The key is that there is no group per pasid *in concept* so it doesn't make sense to fake a group...