From patchwork Mon Jan 20 17:41:47 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: CLEMENT MATHIEU--DRIF X-Patchwork-Id: 13945442 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.gnu.org (lists.gnu.org [209.51.188.17]) (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 1D8F6C02185 for ; Mon, 20 Jan 2025 17:44:23 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tZvmi-0004mj-FM; Mon, 20 Jan 2025 12:42:00 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tZvmd-0004e5-1K for qemu-devel@nongnu.org; Mon, 20 Jan 2025 12:41:55 -0500 Received: from smarthost3.eviden.com ([80.78.11.84]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tZvmZ-0000YG-CE for qemu-devel@nongnu.org; Mon, 20 Jan 2025 12:41:54 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=eviden.com; i=@eviden.com; q=dns/txt; s=mail; t=1737394911; x=1768930911; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=rPkEds8qIZp9TtuHjcRhlqEFYcVgIFkbOepMRSmEI7s=; b=b+2jMOhjEgjokUzn9/ysLQv1yapM9QMUQg3yfxyI0yovwnTd842FcPGP V0TqXo3KEIRLt6dcPnzuWwCUbSdBnGD7bJ4q7EkHsIa7sbsVP5utBiPLj nzysO7Oz+C58JIdjDa3rhUt5uBj8XkFQwFXtCflXl9KR5nB/UWQI6jWWB 1bsK0gRK5zj5bZjW3co64/Ud3DPr8NPCKMZqoeOj9lNw+Lhn2H2jGl1Ya Q5nYm9trNBL73MW54gRmI7DkOVrcEgise+/hhTbtNSyNF1BB4Docl/NhZ Gx6zCnGmUjE5BXRQXvQuk23awm3GoILnWHrYyrt8J9GEzP5fh4CmOl/qN Q==; X-CSE-ConnectionGUID: BM7uEzDQRXenTiS/GdwBsw== X-CSE-MsgGUID: /B8S6bAcRmeVlC2t8tA5Kw== X-IronPort-AV: E=Sophos;i="6.13,219,1732575600"; d="scan'208";a="29125397" X-MGA-submission: MDHnk0s8qWZbw1BrlGt9IYR+THA0M0DDyYTKj6JAIDD9IzEzk7y+FLx0C/PVz4+uLhDhpmlykOEeub8R7rU0ur1KINHMVM0TRDX/CJxud/K+gy3eW3cxa0B1YaT/LDx0XgxLOMP4g8jQ495Jzd0eLjgiBNBiMzBeW8WHZlKOiw2BCg== Received: from mail-db8eur05lp2104.outbound.protection.outlook.com (HELO EUR05-DB8-obe.outbound.protection.outlook.com) ([104.47.17.104]) by smarthost3.eviden.com with ESMTP/TLS/TLS_AES_256_GCM_SHA384; 20 Jan 2025 18:41:48 +0100 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=FTQT2KdyyOKNHsOCJz4VLnkEAlIIlO9VuKSYiuCiqQZa/oWFxYifVh/MtwePVNuAUOV+VKoyrlsLwdE8elW+wxo1vO5k6qIV3if6youtMEWScng7arseJo6EsZqjBsZeIJCEAm+xaUEO7PBw7c/1M6EshDs5Y80es5TWVefsz8l0KYO2W0QUcstI5aV3MFg97B8XQseliD8dxt6e0grKDMPv6RH8ikd0qevjmW7LK6udvUhCI5fn7yV8AwLYm+s1KaXfgeO+5PmK/mUwrcrNqN02/hzaicqZtrhxSFhBJd/3QPk24S2xL5PSzooPiPXy1vlc8OxzJJjXZdNIzUEkKQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=qIAdhx2JHVjQ7wp//+y78pr/QiWJCBXfQSzY33lVXdM=; b=Egt5hAduivSlEP9es6MEyC5zM9Dpdl32xRhDq8Y6QUGKjDVjHpd/4NPB5OF4M0kAZTJnBH8tQzVjVk0w5li1/Pz+ruP16IkOnQfIcpHlbBVlyGP6BpVq5bUezUTirtrFZj37F9rcuarRmpuHe20i57GMU2V6eHNCMdHsYC2WGrMLIpVDQ05LXTlSCixyG6zeEduMIYkljG2Kgew5cxbmayXerWx4KBNFPLOay+PdDwCrLQ2wo6B4r9038rAEJu7QuKr8IbA4xPNZ4Mp8t1Z91ZcvHYN1FwtqcmN5MtGZ0DBJFy2vJB9HmhrPCzuR4+7WJ0d0fLvVPW487qNykCdBzA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=eviden.com; dmarc=pass action=none header.from=eviden.com; dkim=pass header.d=eviden.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Eviden.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=qIAdhx2JHVjQ7wp//+y78pr/QiWJCBXfQSzY33lVXdM=; b=po8H3mMk0tnfUhiQ0U4ghctTa/SXWbu5H0GQ8cjYT0TxQBGpnyTPs0qU38eIqwlT0pvP24RqTpzb7mhedSGWuJfbZaSywIYDryzCyKk/VxA8BT79SmYUIGRkqVyc8ldOe6sLCOyhACvGfdvaz+ZkiVDGHAfU6awi6oSpU2GvJmI38bWPsL6e4JatdmWcGyY34lvHqqwrNSGPmlYlf+Uta884oTVdjWqMBxVhxf77oWbi8ogE81B3SFg0TpE1B8+FpEgoWVQWIKfzlQXrZ2UmLjAaYOPPuF6YSM6doF5vEkuIEHS67NdxpXgJKs84AN2IZRpFhbHTfB8Fdp8xnFss+w== Received: from AM8PR07MB7602.eurprd07.prod.outlook.com (2603:10a6:20b:24b::7) by DBBPR07MB7548.eurprd07.prod.outlook.com (2603:10a6:10:1eb::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8356.21; Mon, 20 Jan 2025 17:41:47 +0000 Received: from AM8PR07MB7602.eurprd07.prod.outlook.com ([fe80::fbd7:ca71:b636:6f9d]) by AM8PR07MB7602.eurprd07.prod.outlook.com ([fe80::fbd7:ca71:b636:6f9d%5]) with mapi id 15.20.8356.020; Mon, 20 Jan 2025 17:41:47 +0000 From: CLEMENT MATHIEU--DRIF To: "qemu-devel@nongnu.org" CC: "jasowang@redhat.com" , "zhenzhong.duan@intel.com" , "kevin.tian@intel.com" , "yi.l.liu@intel.com" , "joao.m.martins@oracle.com" , "peterx@redhat.com" , "mst@redhat.com" , "tjeznach@rivosinc.com" , "minwoo.im@samsung.com" , CLEMENT MATHIEU--DRIF Subject: [PATCH v2 09/19] pci: Add IOMMU operations to get memory regions with PASID Thread-Topic: [PATCH v2 09/19] pci: Add IOMMU operations to get memory regions with PASID Thread-Index: AQHba2KUJdA6wV4bfU+cysc549ov3g== Date: Mon, 20 Jan 2025 17:41:47 +0000 Message-ID: <20250120174033.308518-10-clement.mathieu--drif@eviden.com> References: <20250120174033.308518-1-clement.mathieu--drif@eviden.com> In-Reply-To: <20250120174033.308518-1-clement.mathieu--drif@eviden.com> Accept-Language: en-GB, fr-FR, 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=eviden.com; x-ms-publictraffictype: Email x-ms-traffictypediagnostic: AM8PR07MB7602:EE_|DBBPR07MB7548:EE_ x-ms-office365-filtering-correlation-id: e7fcad6b-09f8-4d07-b5de-08dd3979b6d8 x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; ARA:13230040|1800799024|366016|7416014|376014|38070700018; x-microsoft-antispam-message-info: =?iso-8859-1?q?3ecSMNxJk1wR1RnNawbgqeovNr?= =?iso-8859-1?q?Hml1mCDSj9mNgjcvmjWgRgm+lfATSydmWeYKQprlty57cSVPAFftg9o50aD3?= =?iso-8859-1?q?d4IetT5g6qBBzerBuLoSfIaVBh0V/ASh8e5iDsH3LPWhEcQfUx/IcXWuRNZB?= =?iso-8859-1?q?rOBGaGW9itJmmiRUlv83iy4vlw4EF1DVl+NuuayI57J7MV0V71ov4IYsIIFT?= =?iso-8859-1?q?7bpxmfdjVV89qBOLQdEH0PeHclhjWNmfVgX+rq9uvPI3bIqzw3jmfCHcFdXT?= =?iso-8859-1?q?ms7TJSknLBuO+YCCuANX6LSexH/sYlZUrIrASSo6s5jV0Q2mentfQN1d6mpK?= =?iso-8859-1?q?d3wOWzaR9q2QaDv3FmSkSqCOjb6kHsb+X9+592xrjXCIs1R0VC6/5CuihR7O?= =?iso-8859-1?q?TSriZxYvIradPr51wuxa9K/oms09I/9WP8mj28iXOh75YueqJWKMt5t0KhGd?= =?iso-8859-1?q?0yYc/URWBCwaHIgmRqlzMYU5E71tQbQQiLtgBoVz+1i2FQXHjevM8Crr6H/O?= =?iso-8859-1?q?XTeTMnKRCb7FvfcrdIDTXYazOR3+qzINJ9ADkOjtwmG/0GpUVabWA9FX+Yi+?= =?iso-8859-1?q?8OYxFdHqgUXi/BXmsZKfIUoThNpL0QKWUjQWYP+RUHdQidZu0lSgKfusonXu?= =?iso-8859-1?q?7wVW2CTuL10emDCTZM2s2E2pQ229KY3lMmCpyhargMI30l5n7HetaMoIFzvc?= =?iso-8859-1?q?iqjqhrPQO8e7pEHnn3WmpObAz6bT1JhCjPwsal0JEnI1CxH1zHkKir2s1MGd?= =?iso-8859-1?q?8vUMfssANKIaeVKoFygi6Of2Ch2FvrYvsZ9cpG1ST/g55QVGjpDWyMNAZ9nt?= =?iso-8859-1?q?fAHBps1sQULr6MyZc1Z1nzifJsFkeQMH1k0hsyGoxopNmpg1P6XWK70SKCwl?= =?iso-8859-1?q?S/oBbOIGV7o4+uRl5NqqpbObf99s8P1LqWr3mPRs1yszIe7adkTGWf8pBxZs?= =?iso-8859-1?q?MzA84Vx6zytnVo+CFq5FNQmhiO4jCRoLea5VhvhwIJVziKRA2unO1rw+wf0R?= =?iso-8859-1?q?fkMcotUO8pk+n3EZ9Anx69Lbxqr3L7mrUgmSXWou8rjKcxWtwzQNVlSaXqUq?= =?iso-8859-1?q?NqBMQgTU9taJ2cDBVq/VOhzbnaoXeLuMSFzpt5B/UUqqB5qIowIPSO0GrDAX?= =?iso-8859-1?q?CvRLQwiKdho32TnE0TGaiuL2kLClEs8lZVCSM0MrdCCM3VF4wYHNA1mrxeZn?= =?iso-8859-1?q?huNPytx4Ae3bOUa4nkrgxuQgGsrhHZ0Xq9J1T+N+Dm0e65dtmU7sFx/1yN4t?= =?iso-8859-1?q?mCXWQ5gXIQIfklDfDSsoLzRjBGhCnS4XwydEe2tVvvIA4np3gdLc5ZZ8QfGs?= =?iso-8859-1?q?jZJU/o+Zh87d9SKN8erYK9gFy3YiphXbaiiZECOJRsjkpQgDRPGmJ0wm75Qi?= =?iso-8859-1?q?jvhtrvVyj+/2GnLz93fcT0KYVwq9YqhKnX6HZ6TVej1idPPILZgX0CHM/Faw?= =?iso-8859-1?q?N5nwPI1hb4J/+mxd2OpWG70+UTK0Qm7lIsqaXwHuis6R8J1l2E32Pj7frAYo?= =?iso-8859-1?q?IonFp5?= x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:AM8PR07MB7602.eurprd07.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230040)(1800799024)(366016)(7416014)(376014)(38070700018); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam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rAG+Q4r59esftxM1lutxVv?= =?iso-8859-1?q?q5sGt1E8q9wR1fbGWAZI7JblZi0J++/C6FSIxCxOdv1/aIyhLzxnNV2VioPf?= =?iso-8859-1?q?X3j97WS7H8X5EgDugmlBCEO6e5Kli82D2SJkPpeJvQvtb9CZ1FO1d4alnYPj?= =?iso-8859-1?q?C880LBmCqqs4DFJsD5h06BPPcG5lRfqgKs0z+TKqQM9fqcm4WE+hI/dERpQY?= =?iso-8859-1?q?OLSXGPzmNCmMPTKC+qH1Z9N6OZis1h77fBqqU0ysbhCWeFzU7t31f09B2VkV?= =?iso-8859-1?q?/6EhYmNmLhEgv7ec1G9SqIEyZ7kn7pOoWM+3UfiBCnNfScIEnyl4a1Hg6Mzn?= =?iso-8859-1?q?4xXVXtCIUk4e0rg3UkfPkHbMR0E/ruK/5j3vU2bGHJZXtVIbE63XnxSbDXrz?= =?iso-8859-1?q?8Q6TceDmzBz01HItM7ka7USpKqJav/0cnDI/FdgQqJXXHQ66ROhuMXQRfspy?= =?iso-8859-1?q?GOGF0D+ZqqSiQCNeB7kAsrwuEEGZPihkhef0mdoXec5WLypfcNA+jAAyi7d/?= =?iso-8859-1?q?vlwXvIB4gZIpjvsrUtxoCZ2+97aCFmQV7/fdMzbDL+lI6/EKllO+Yhh/kamK?= =?iso-8859-1?q?jOaBo/HtXeVfJCz9UgzPFmFw7EQvLbhbSBg5wHJRB8WMx8jbBUw4gDa0etLT?= =?iso-8859-1?q?hH+6XgU3eVtbU4I5rdwIUUgzRuVxFSXmso/WOsYGQlDj0WNnQka/4mBwgOIT?= =?iso-8859-1?q?UwdCnf99DEWy10m1P7/VRdTkc3U+/DDdi8AluEEWokZ1TTKN1X1SGtD/7o2V?= =?iso-8859-1?q?emD6/XbkhWsk2AtQxkhAB5WvM1lbI+3p/fP/Ykr/L70S2WEsAhUN3g+H/ON0?= =?iso-8859-1?q?=3D?= MIME-Version: 1.0 X-OriginatorOrg: eviden.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: AM8PR07MB7602.eurprd07.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: e7fcad6b-09f8-4d07-b5de-08dd3979b6d8 X-MS-Exchange-CrossTenant-originalarrivaltime: 20 Jan 2025 17:41:47.7939 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 7d1c7785-2d8a-437d-b842-1ed5d8fbe00a X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: Loib89T37uEn7S8mZIJy5H2BtT0w+tMlZ4xLrjBVW4yA6nD74RVmHEXypyVcc25I2fcMvVmvDKZkjU50EuV2JSt4gvtkp0eMeKVlJHqvmfn5/RQBtwBr+iylrzOnsvWR X-MS-Exchange-Transport-CrossTenantHeadersStamped: DBBPR07MB7548 Received-SPF: pass client-ip=80.78.11.84; envelope-from=clement.mathieu--drif@eviden.com; helo=smarthost3.eviden.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org From: Clement Mathieu--Drif The region returned by this operation will be used as the input region for ATS. Signed-off-by: Clement Mathieu--Drif --- include/hw/pci/pci.h | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/include/hw/pci/pci.h b/include/hw/pci/pci.h index 4002bbeebd..644551550b 100644 --- a/include/hw/pci/pci.h +++ b/include/hw/pci/pci.h @@ -391,6 +391,22 @@ typedef struct PCIIOMMUOps { * @devfn: device and function number */ AddressSpace * (*get_address_space)(PCIBus *bus, void *opaque, int devfn); + /** + * @get_memory_region_pasid: get the iommu memory region for a given + * device and pasid + * + * @bus: the #PCIBus being accessed. + * + * @opaque: the data passed to pci_setup_iommu(). + * + * @devfn: device and function number + * + * @pasid: the pasid associated with the requested memory region + */ + IOMMUMemoryRegion * (*get_memory_region_pasid)(PCIBus *bus, + void *opaque, + int devfn, + uint32_t pasid); /** * @set_iommu_device: attach a HostIOMMUDevice to a vIOMMU *