From patchwork Wed Dec 13 23:44:56 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Volodymyr Babchuk X-Patchwork-Id: 13492132 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 490A3C4167B for ; Wed, 13 Dec 2023 23:45:36 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.654254.1020945 (Exim 4.92) (envelope-from ) id 1rDYuk-0003f6-7E; Wed, 13 Dec 2023 23:45:18 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 654254.1020945; Wed, 13 Dec 2023 23:45:18 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1rDYuk-0003ez-4G; Wed, 13 Dec 2023 23:45:18 +0000 Received: by outflank-mailman (input) for mailman id 654254; Wed, 13 Dec 2023 23:45:17 +0000 Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254] helo=se1-gles-sth1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1rDYuj-0003eo-9j for xen-devel@lists.xenproject.org; Wed, 13 Dec 2023 23:45:17 +0000 Received: from mx0a-0039f301.pphosted.com (mx0a-0039f301.pphosted.com [148.163.133.242]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id a967eaf6-9a11-11ee-98e9-6d05b1d4d9a1; Thu, 14 Dec 2023 00:45:15 +0100 (CET) Received: from pps.filterd (m0174678.ppops.net [127.0.0.1]) by mx0a-0039f301.pphosted.com (8.17.1.24/8.17.1.24) with ESMTP id 3BDJ2iKW012660; Wed, 13 Dec 2023 23:45:02 GMT Received: from eur04-he1-obe.outbound.protection.outlook.com (mail-he1eur04lp2051.outbound.protection.outlook.com [104.47.13.51]) by mx0a-0039f301.pphosted.com (PPS) with ESMTPS id 3uy0y4vams-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 13 Dec 2023 23:45:01 +0000 (GMT) Received: from VI1PR03MB3710.eurprd03.prod.outlook.com (2603:10a6:803:31::18) by AS8PR03MB8666.eurprd03.prod.outlook.com (2603:10a6:20b:54c::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7091.26; Wed, 13 Dec 2023 23:44:57 +0000 Received: from VI1PR03MB3710.eurprd03.prod.outlook.com ([fe80::8e03:368:1fd7:1822]) by VI1PR03MB3710.eurprd03.prod.outlook.com ([fe80::8e03:368:1fd7:1822%6]) with mapi id 15.20.7091.022; Wed, 13 Dec 2023 23:44:57 +0000 X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: a967eaf6-9a11-11ee-98e9-6d05b1d4d9a1 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=K6DQwe66U3SwrXOqtVQYC4Gy9syTXVyPFNTEWnalKLwEIRdov8WXQJ+AaltvjBbqS6cVYVv+h6w8HRDumOlB31glcxR8ur5dgMLrARfcBycAqJLvB/Gl96DyMGI6rumgyTIGg1oJsIWY5aFEjT8fHvad537nbesHIHzIeQzlR6j+wZe+Xy1yk45VvEOivOuWwdMP4Vastx69OB7LgkM788pMMNlDiDu6/gQk//sov2LAn4zPq9oh1cfVv6F3mG69rkx+B32dbMkHPPOjOfy7asewHbqCkuSKRxAz5ABS16STORu6NRjYWv20TuwBheRbKqGYsuji4SivKEIfcSb7Lw== 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=cwOLHmt/xVQKtVQ7dFIiwMzlKRmuQ+IjFFkVQYwTpbE=; b=kCbpnkHRUCGXnEJ9edKwrzP1XcWZH/2D8IgXyxd7CJxmH4WuidUGtADIeKVvOBQWtAGnSSurbGFKF9fCLNtVuKoTvvazu6qXvycJYh0cfeRaB0D6TMDQfGx1qOHLs85KEtWVPbOIFrLp9fla7QOLCuB7GmANCNax3ujb/2BsWhS7SvrSf9Sjryq+hRK2i8jf5ZXCzaNJzCz7ryq9x8WvG4WjTZEiS38zTuKqQDNSB6/0xsEggL0MWgBobuDuoSfvckLrYeMEMI1m0gavM3XVfEuMVF2RJzYltQqSjhEuD/bJvzdCqxxaEU5P9BEAmgJeOUfx841XMAXxCW7EbXKOMg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=epam.com; dmarc=pass action=none header.from=epam.com; dkim=pass header.d=epam.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=epam.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=cwOLHmt/xVQKtVQ7dFIiwMzlKRmuQ+IjFFkVQYwTpbE=; b=rqsjj3bEp6fzB+vPTJemzRmPex1AvoJE6X/J3yDzfnTUE8e4pTEsAbMSMD4Zl593KBmkkX1S1zr28tFo7vcenA3vRT86Ztk3oeQ5+Xk+caRJN891prj/ljKxzemLwohMuEXU+dQzsrNak8/xuo3loonD38Bs1W5RR2TRnVEiCyTwEL9Qdkupwa7/8tH1Dhc6LxQoCm8zlGqoCIH+YjHyQPlDhtJ0Lu+Iteau5v8vAtoVY/oiEylFzEN7U077MJZFJW2GIANd/PKBufv3l/Mnrp7VkOCM3O2wezfhFY9PlIUnwowRrDhGDyioSWKxhEPZSCZqvPYgAkhhzecftEn5SA== From: Volodymyr Babchuk To: "xen-devel@lists.xenproject.org" CC: Stewart Hildebrand , Stefano Stabellini , Julien Grall , Volodymyr Babchuk , Wei Liu , Anthony PERARD , Juergen Gross , Andrew Cooper , George Dunlap , Jan Beulich , Paul Durrant , =?iso-8859-1?q?Roger_Pau_Monn=E9?= , Christian Lindig , David Scott , =?iso-8859-1?q?Marek_Marczykowski-G=F3recki?= Subject: [RFC,FUTURE 0/3] Make vSBDF configurable by toolstack Thread-Topic: [RFC,FUTURE 0/3] Make vSBDF configurable by toolstack Thread-Index: AQHaLh5gqP9om/bdnUuJG4CQUapQdQ== Date: Wed, 13 Dec 2023 23:44:56 +0000 Message-ID: <20231213234345.779722-1-volodymyr_babchuk@epam.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-mailer: git-send-email 2.43.0 x-ms-publictraffictype: Email x-ms-traffictypediagnostic: VI1PR03MB3710:EE_|AS8PR03MB8666:EE_ x-ms-office365-filtering-correlation-id: 3d17fa42-7f18-436a-1956-08dbfc358343 x-ld-processed: b41b72d0-4e9f-4c26-8a69-f949f367c91d,ExtAddr x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: H+uVTkZ+H5p67ftzYdLEoL0Ja40q0O+H6kHv9fMuypktwSWH76DJN9U1XEgN2biUrn8RzEOLjRQfaUWSwWuxVlrd6mtf8ekB5Ss0FZHzTaUivD9jimReFGLMV4SyezjkS9upnO9PTbn5YC45Vo2dYgC9aCwKDVmPJgjWFlTS6iEFVnjHinF+kuKLqxhRxe5tKwzEEzeZM3jpNudfjBU0mSh43GeH60C53+xaUPhXaIiBTVjo8AIMhDq7VnIVoShQfapIFLDOLtTjloavKRq3Qav7luBiNjw/vHH+ZjykjdcmeLoEDvTMIoQHG7X2HhQZmtX0zwkOz2KWmrOadWtIMQTa91YyW6jK+xgNHSpgv+2ImiA98iiEtNtSlk103oIBDtzWWrC75l2ZM6pD/5RtMfUM7y98aPQChxWI0SnspjQl5ePbcudhxGYJn3/1aNXH7GEzzbH/XGi/vUnabNcSi+BBQD+9+Ddt0kfXgp4R/PauWAW59gWL0dUjuJ0IILXjqWInFYZLbYrNTZZDt4B1Ni72a9Et9HAjHrd9IgTkKiMBNL2eq9re2hhg5z56uCHmuGIha6NeDGCie7kC1QXkMAieHXml3bLZFCkxpbMu39Y= x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:VI1PR03MB3710.eurprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(346002)(366004)(376002)(396003)(39860400002)(136003)(230922051799003)(451199024)(1800799012)(186009)(64100799003)(1076003)(26005)(2616005)(71200400001)(6506007)(6512007)(55236004)(83380400001)(5660300002)(7416002)(8936002)(41300700001)(2906002)(4326008)(478600001)(6486002)(966005)(66556008)(8676002)(76116006)(66946007)(91956017)(316002)(6916009)(54906003)(64756008)(66446008)(66476007)(86362001)(122000001)(38100700002)(36756003)(38070700009);DIR:OUT;SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?iso-8859-1?q?3o/rOBUCL3+rGJYffQvq9P7?= =?iso-8859-1?q?uVhaEY3UeqppqKlJkFxyhpk6DJyTQHW7JTtymmm0MKq8yLK0ffkc6m1UFC26?= =?iso-8859-1?q?Cir30XWAGnHXQX7VPDhU7/jr7jcSvVQVjaE+bzsDOtoRY5OJlcBV1DUIJ5vX?= =?iso-8859-1?q?ZAI+vw4I5mFAgpTGXUIa4edUZxQWOXg+LfFmFYZ/VU/V1PBxhMotOtEiHUda?= =?iso-8859-1?q?Vs7hvApXYEeksIK39XBiKDpoC+mlf5xUQucnnDQ4pMChpVwSV5s3wJRnu2+o?= =?iso-8859-1?q?Tv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2V89v11J99BUL1sZEsM3qiFTVMu/bSVVza1uMbqYa?= =?iso-8859-1?q?RLz3XgBw0YlKDutOM/WmoPHNcPOg6+YOTOfkYegQJi8OSvb3MPILcRR5seQr?= =?iso-8859-1?q?WkUmUV3Lnv2pRbC8OJo111RyUeeL5/XWGfd73u8BcRNwuD6ENkNd+KU1JtQh?= =?iso-8859-1?q?minTdZ6+NQHKEjQm8SBbC36xUtTvup6ZZzKLNT/JWHPWtw0vxEyZmdtFirtY?= =?iso-8859-1?q?XhOUu1I/J9t7uMltGpwxW4i76HacjL/Zcjyk/Qcm6BtU7kjUCsiE4AmNaGi1?= =?iso-8859-1?q?s2OXTMf4WhxxOUvPTWN1q8DYYLFtDuUCFJqPU2ELUv/XButUOoE/WakgCG1c?= =?iso-8859-1?q?tg8LqynNwtqdST4l91JYrlyCiZJEKAY4h0WKtYNYbEJald34kBvb3cftYyEF?= =?iso-8859-1?q?AXme3Oxhxr7072qYh3Yl0Bjb4mHZ51w4ezIQycrtCO9wKCo1gS8zsX8hRvPh?= =?iso-8859-1?q?pRzriB1kTLSKMtNn72s5bnQ9HwkzRF4sFgU8Qjw=3D=3D?= MIME-Version: 1.0 X-OriginatorOrg: epam.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: VI1PR03MB3710.eurprd03.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 3d17fa42-7f18-436a-1956-08dbfc358343 X-MS-Exchange-CrossTenant-originalarrivaltime: 13 Dec 2023 23:44:56.8674 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: b41b72d0-4e9f-4c26-8a69-f949f367c91d X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: SmPnDhMJp+B7mVkDrSwiaBuTSwwykX/j85XCMLFBIjcxBsCjOpfCy82F4hTC/F3o9BQshrsSZLjRcvmVKsV7oaVM48ZrX2ztn0xs2e3UFYM= X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR03MB8666 X-Proofpoint-GUID: wLneGQ2sNluAE_XUS8cx3v-VZ9Z4XQmh X-Proofpoint-ORIG-GUID: wLneGQ2sNluAE_XUS8cx3v-VZ9Z4XQmh X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.997,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2023-12-09_02,2023-12-07_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 mlxscore=0 impostorscore=0 lowpriorityscore=0 adultscore=0 clxscore=1011 spamscore=0 bulkscore=0 suspectscore=0 mlxlogscore=587 phishscore=0 malwarescore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2311290000 definitions=main-2312130168 This patch series is a follow up for the dicsussion at [1]. It adds ability for toolstack to chose Device part of SBDF for a PCI device when passing it to DomU. First and last patches are quite straightforward, but the second one ("tools: libxc: add virtual_sbdf parameter to xc_assign_device") changes API of libxc, which is big no-no, so it is just a starting point for a discussion. What is the best way to do this? Another topic for discussion is the first patch ("domctl/pci: add ability to provide/request a virtual SBDF"). It extends existing domctl for assigning devices, which is fine for this use case. But we also discussed use case of virtio-pci devices, for which we want to allocate/request vSBDFs as well. Problem is that we cant't use assign_device call for this because there is no physical device which can be assigned. Probably we will need another domctl - specifically for allocating vSBDFs. But then there would be two domctls that are capable of allocating vSBDFs: assign_device and this new call... So yeah, I am open for suggestions. [1] https://lore.kernel.org/all/d6a58e73-da51-40f1-a2f7-576274945585@xen.org/ Volodymyr Babchuk (3): domctl/pci: add ability to provide/request a virtual SBDF tools: libxc: add virtual_sbdf parameter to xc_assign_device tools: libxl: use "vslot" parameter when assigning a PCI device tools/include/xenctrl.h | 1 + tools/libs/ctrl/xc_domain.c | 13 +++++++++- tools/libs/light/libxl_pci.c | 9 +++++-- tools/ocaml/libs/xc/xenctrl_stubs.c | 2 +- tools/python/xen/lowlevel/xc/xc.c | 2 +- xen/drivers/passthrough/pci.c | 17 ++++++++----- xen/drivers/vpci/vpci.c | 38 +++++++++++++++++++++++------ xen/include/public/domctl.h | 9 ++++++- xen/include/xen/vpci.h | 4 +-- 9 files changed, 73 insertions(+), 22 deletions(-)