Received: by 2002:a05:7412:2a8c:b0:e2:908c:2ebd with SMTP id u12csp2596191rdh; Wed, 27 Sep 2023 07:17:10 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFYEh9v70vFhUi2JKuUtCRHfn7jMy5209go+6F9avLbsfspPduZ5m6Uy74vmvKRHHMiaXlE X-Received: by 2002:a05:6870:ac29:b0:1d6:e027:5adb with SMTP id kw41-20020a056870ac2900b001d6e0275adbmr2379350oab.48.1695824230303; Wed, 27 Sep 2023 07:17:10 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1695824230; cv=pass; d=google.com; s=arc-20160816; b=RA37+3SFfRE1catOYvAb5JHWByM85KEo60vm4UZLr+F7n1nLObOXa4K5a6Fm9qMUO8 fpW3IxnY8ANOrNT2dRR0MOaN9bFDmBUKZAevcBARl9iGsKpQ/7DHVwivQ89Cmivxj3OE 27hqullDOk5ZkI28bdz64XNaP83H9RsC8fXczG0N5c/8rPNKpzoZwiUAfVm2roVVnHzg yC9Rb2KANMGnlxL8WV9WQ4Tk0QFjD0wd6aUpmORXuaNA1rofa3DIl/kybGJTrfzxE0bd T8kcs0ETwfdMFA/m0t9/bUF0Mg2p11zONsyVhfpj74GC6D5aCMKy3BEKxOMUUbm83A4f /Rug== 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=9Kcg7mH4NG04NJ+nF+3+GE2tKiS35+QSsncIBOCiKIk=; fh=oxrEsq1+QX2+hN3RZ/IyycuBsHdxch73KpkIXjBxZKM=; b=yAlKiVavMI9og9Uc1Par7tTNwocN+88e7+4U6ADozy4oXeaJGlhNfC6UwBb0KEH+s1 XPYLvpwyUp4YOg/50YFYlWUYQJoqQB2d7VtobsdPZ32rZzvz+ZsuQC7/lrGeQsYu+41A cUfvO/AAYeudEmcysYrKX6BSdr/uT9RcsxD8DNF3//IL6DIyeH3gSz8A5jOj1nl9g8on IT81O8R4F5yAzXhRF+KjhLMJOXrWuPLNm5Bj7Gfc205zSQ0Xt8QarGIJhYxJ5y7RneIH Cf4uVAnLvof8ouZJVUuoTGfuMzAvMkm7/QfANc3IbBlntQF3M3CH0H87ibv8UJdCmeVI q/9g== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=WKakc0e2; 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 w20-20020a63fb54000000b00565f20a03f3si15223431pgj.774.2023.09.27.07.16.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 27 Sep 2023 07:17:10 -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=WKakc0e2; 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 4476E810652F; Wed, 27 Sep 2023 01:08:09 -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 S230062AbjI0IIG (ORCPT + 99 others); Wed, 27 Sep 2023 04:08:06 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37394 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229993AbjI0IIE (ORCPT ); Wed, 27 Sep 2023 04:08:04 -0400 Received: from mgamail.intel.com (mgamail.intel.com [134.134.136.65]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B2D14B3; Wed, 27 Sep 2023 01:08:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1695802083; x=1727338083; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=Rih9x4uKO7X2zbzxbyVhACcK28Wg1CQcOLHs6un1tZQ=; b=WKakc0e21qs+7FAedQHma5rRWU+CHExKDRw2v1Vrby17B7S3Ys8PVJDB mSeOyAOxKEIBgwiedE20B+fjl1KBTs9R/6PuiqirE+Qv4CftOIDw5FgOG 1e++WbgP7UNlhP8I35TMU05NRRb8Wf6aJXLg8D9ql7GEGnZdn+HRU4cBx eRr48TYlVMrOEjM2NIoyQpuW/Sl9cN7r/aYUGyN19ijebTGe/DR9AXDLv C6cPyaN2YjID9h+aKITue8VM2/s+Hu2Jm3e3/wun6Cb5Q5oVvbnKe+GJy mMBp36Izlx9KkUHqxQeBuVUW8lYLD3QQfBCf1M1pHaPAVNGvQWTmUmFBN Q==; X-IronPort-AV: E=McAfee;i="6600,9927,10845"; a="385616476" X-IronPort-AV: E=Sophos;i="6.03,179,1694761200"; d="scan'208";a="385616476" Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 Sep 2023 01:07:59 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10845"; a="839340385" X-IronPort-AV: E=Sophos;i="6.03,179,1694761200"; d="scan'208";a="839340385" Received: from fmsmsx603.amr.corp.intel.com ([10.18.126.83]) by FMSMGA003.fm.intel.com with ESMTP/TLS/AES256-GCM-SHA384; 27 Sep 2023 01:07:59 -0700 Received: from fmsmsx610.amr.corp.intel.com (10.18.126.90) by fmsmsx603.amr.corp.intel.com (10.18.126.83) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.32; Wed, 27 Sep 2023 01:07:58 -0700 Received: from fmsedg601.ED.cps.intel.com (10.1.192.135) by fmsmsx610.amr.corp.intel.com (10.18.126.90) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.32 via Frontend Transport; Wed, 27 Sep 2023 01:07:58 -0700 Received: from NAM12-BN8-obe.outbound.protection.outlook.com (104.47.55.171) by edgegateway.intel.com (192.55.55.70) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.32; Wed, 27 Sep 2023 01:07:58 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=hht6u43fmjE3Ukcel3XUNYIkXJ5FnbbmZZUXPsYz5hYm2HbqT0a+ccMrQGbwaEPC0+1x2fBWpG67TcPM6nuVi+JVwsP9rRsDRZ21c+rKhmuPe10Gvopk3GOQw6C6PxL5QJgM+D0GHzu/7S8q13w8z6fN7ail7Ppin3KwEn7vi4FOdowOZ6AmOhLwp2TsaI+DHOz5bhNVr93OAlse7cnmzJNSVPAvrcGlfVey5aCPc3c+n6l+Y9QuvDoRF8JGwXk1zMQK+fF3wchBkBhLYcahXV+YFkfwS2kwLiR8t4bsG+hEpDRuRah7c2esicNQX42voQwNuJSsADlJWzgLYCZh2w== 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=9Kcg7mH4NG04NJ+nF+3+GE2tKiS35+QSsncIBOCiKIk=; b=WYTQfckU66RX01Q/Gg03QQoDvDnUb4uE0LE4VI9xn5qLYQqS0N6msXqqUHHhK9Wt4gs95GuCvX95pm87IyAh4w72cp9uxPgR7bZOCCCri9N6XBzRqh+3I05yuzK2jYRGLXwkCJZofP+IGJDaDUnUYWdLdw+L3LOHH+IqXnLNzpGL+lyZXVF8BPpyitqPLtARUYWcVBJsVfoXbysiLgw5V75aZoTGlxOcw1g7WKU9AvWse6bkThBTcwGJmENA86I0/00d3H4b3B1D2IHSOMZc8oSV7YVnEcyY2LkygZhswBsooxuBPs/RbHrG3WM3iHDEoQmF5IgKAwgH35EFId4zbQ== 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 MN2PR11MB4518.namprd11.prod.outlook.com (2603:10b6:208:24f::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6813.28; Wed, 27 Sep 2023 08:07:55 +0000 Received: from BN9PR11MB5276.namprd11.prod.outlook.com ([fe80::1bfc:7af0:dc68:839d]) by BN9PR11MB5276.namprd11.prod.outlook.com ([fe80::1bfc:7af0:dc68:839d%4]) with mapi id 15.20.6813.017; Wed, 27 Sep 2023 08:07:55 +0000 From: "Tian, Kevin" To: "Liu, Yi L" , "alex.williamson@redhat.com" , "jgg@nvidia.com" , "robin.murphy@arm.com" , "baolu.lu@linux.intel.com" CC: "joro@8bytes.org" , "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 3/3] vfio/pci: Expose PCIe PASID capability to userspace Thread-Topic: [RFC 3/3] vfio/pci: Expose PCIe PASID capability to userspace Thread-Index: AQHZ8FxBOJ6q7SodUkevUoT08ZF/YrAuTq0g Date: Wed, 27 Sep 2023 08:07:54 +0000 Message-ID: References: <20230926093121.18676-1-yi.l.liu@intel.com> <20230926093121.18676-4-yi.l.liu@intel.com> In-Reply-To: <20230926093121.18676-4-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_|MN2PR11MB4518:EE_ x-ms-office365-filtering-correlation-id: 68febf0f-db79-48b4-7b29-08dbbf30da8b 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: rVn1PvPh894LNAp0E6VlqvBTOhf77OTHg5jQLrRCkti4UJZELp0hfchcarja/2664By4gbG9c6iw0vuS71yhJf5XtGgvyRHWLR4xEVv3mGoHV9Ns5aKVfFLukKMaWfNrZS7dD96hlggWa0g391vFhmMmPTkHfc7HKTtgvYlycrxnjMrspnR/znX86RZETl6GYDRFJJsfSdEX0mX6jb40eenpBqPHBrFYbqI9nKJvJEaDTl0wn6touPnUfO2FUNBl74VVWfDZkrRfQ5FqXSE54elXW5sVGnsIcs68hy/9blXjP45kpDnJD7sc3veX1doNUKQ2bjkK0PL+cBfjP9COKloKoUz39vR95sDOwkPfPzar/ZIWH2Da8tnKXFaFA0zpwnQORjZri7lVkGPH3HhlHb4GaAf9jn3LKkOtO8K3FlEahBxPmWobc9YZKkMfl6gInOCNcGiQdhMm9o/lXIXhYdOLXfdh01tZ8KmVXZSHrtjj/mFjOnP+1SR6BAV/dHx6rdgOIu/q+JkJuT3Tl+uc/Tbf+sK25C4pLUYSbO7vYRmjNgZvih1mkbG47CyEDLbMFolvDR8sXd7sttSrGJlv7SnmikkVn1uFRpYIEZzNtkPIwfTiI5xlYih8M32/mqCYuUiso4027kP/ZF3FJNyGXA== 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)(136003)(376002)(39860400002)(396003)(366004)(346002)(230922051799003)(1800799009)(186009)(451199024)(66946007)(7696005)(26005)(6506007)(9686003)(82960400001)(38100700002)(86362001)(38070700005)(55016003)(33656002)(122000001)(41300700001)(316002)(8676002)(8936002)(4326008)(66556008)(66446008)(66476007)(54906003)(5660300002)(110136005)(52536014)(76116006)(7416002)(2906002)(64756008)(45080400002)(71200400001)(966005)(478600001);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?Dho1NIsZ4hPazxZNzxDxlky3M5zPzyuTX6al1/aGgcAlmyMHhOnwNwq9kwwR?= =?us-ascii?Q?/3umITh7ZH2xwRG6MCTcmZOvB1uQpfU8LkwpTOf3U+jYPeqJNtUlGA86YFME?= =?us-ascii?Q?slG23MwjrZYTlvrYn8wa92/aLF7siDzqGjjvV2Ty9ty3Xd79uoK3ZVY7MkdW?= =?us-ascii?Q?ThLFRAlZ5HMilfxX2nnSBzlHMmWQitrJ2TLXylI6kx3aBc3Za9PnvLhW8IV4?= =?us-ascii?Q?ZVDaPyiLMT5O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Qg4GC?= =?us-ascii?Q?//B+MdFn4myNfcBGYdPIhqFJ9wcbUy4tFI8fJAugfz6ugz6iTmBQaIn62+sI?= =?us-ascii?Q?QQLNLEAK8Iz9oU4o3KYGef1V4fW9712FhidRi9m/VFmITD1SE9pkRadWnl1A?= =?us-ascii?Q?u69Fqv2drDhW+ZfQzDqwou8GLtefKxiphFAi3ltCH/rM07lu8h0Mx6QRpevj?= =?us-ascii?Q?f/ClrBSvqgSanumVr7Cso6sZzwvTBm6BtMto72VxK8sNM7No3AmHIwrHiiv3?= =?us-ascii?Q?d/j1MITg7x2W32cPylxceLe9THQrEYr4Z6a3gDOlQRCedJuM/FMQW5QMvRVh?= =?us-ascii?Q?gz4zcMIYlOdht0SeJ+Vl+MJWET6b0JVcYpDWpbtcmhOH5H6x6ogEuSslIK1F?= =?us-ascii?Q?UqycnIGwMCYTLDzf67VuHSrCGT+eX6Kdw7zen8qMVHIqrDAxKJBgI02vFoue?= =?us-ascii?Q?Iy4cptq+Qt+uS3U82+UuewSC6Nk0yGtn6hYpxGMQ?= 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: 68febf0f-db79-48b4-7b29-08dbbf30da8b X-MS-Exchange-CrossTenant-originalarrivaltime: 27 Sep 2023 08:07:54.8411 (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: yJ6ES+5pzmIuCW9yKAx79nijgnU/NYq/p4udPCScdXKWHXevTkpORB0QIiniaiwmJJZ8D2dwOO5BLDdvLUp7XA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR11MB4518 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, RCVD_IN_DNSWL_BLOCKED,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]); Wed, 27 Sep 2023 01:08:09 -0700 (PDT) > From: Liu, Yi L > Sent: Tuesday, September 26, 2023 5:31 PM >=20 > This exposes PCIe PASID capability to userspace and where to emulate this > capability if wants to further expose it to VM. >=20 > And this only exposes PASID capability for devices which has PCIe PASID > extended struture in its configuration space. While for VFs, userspace > is still unable to see this capability as SR-IOV spec forbides VF to > implement PASID capability extended structure. It is a TODO in future. > Related discussion can be found in below links: >=20 > https://lore.kernel.org/kvm/20200407095801.648b1371@w520.home/ > https://lore.kernel.org/kvm/BL1PR11MB5271A60035EF591A5BE8AC878C01A > @BL1PR11MB5271.namprd11.prod.outlook.com/ >=20 Yes, we need a decision for VF case. If the consensus is to continue exposing the PASID capability in vfio-pci config space by developing a kernel quirk mechanism to find offset for VF, then this patch for PF is orthogonal to that VF work and can go as it i= s. But if the decision is to have a device feature for the user to enumerate the vPASID capability and let the VMM take care of finding the vPASID cap offset, then better we start doing that for PF too since it's not good to have two enumeration interfaces for PF/VF respectively. My preference is via device feature given Qemu already includes lots of quirks for vfio-pci devices. Another reason is that when supporting vPASID with SIOV there are some arch constraints which the driver needs to report to the user to follow (e.g. don't assign ENQCMD-capable sibling vdev's to a same guest, etc.). A device feature interface can better encapsulate everything related to vPASID in one place. Thanks Kevin