From patchwork Mon Jan 20 17:41:51 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: 13945425 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 2BB2BC02182 for ; Mon, 20 Jan 2025 17:42:48 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tZvmj-0004s0-Qa; Mon, 20 Jan 2025 12:42:02 -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-0004eY-BW for qemu-devel@nongnu.org; Mon, 20 Jan 2025 12:41:55 -0500 Received: from smarthost2.eviden.com ([80.78.11.83]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tZvmb-0000Yo-H2 for qemu-devel@nongnu.org; Mon, 20 Jan 2025 12:41:55 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=eviden.com; i=@eviden.com; q=dns/txt; s=mail; t=1737394914; x=1768930914; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=ZIOT9iQhluPDbIqbho90pINJD7KjmJBOhC3aAEtEqFI=; b=u83ksaAdHKGSO8j+rL58NNq0p5YGZFMaYxY/tWGcxEwdJNqwANJcWpPi vEcREfkX9EQZv5ySv+fH/o2vHfZfuVsCq2b4JmvPfdWj+geEW9XIiF8qv 8HCU6fUcaGu2s6u/IZD5reTZAp5DyIWmzhB45F4KhQdwN2UCUDyusI1sN GVCzr1l8aqwlFbu5cukis4W48aYzVDG3awnPyK/kb0QDyLfj2fXLEiIl7 9u4xCy9N5W/l56XSiqaRjI4ddwtaikQxl7SkZKMFAUdJd99IbHlCvPswC 0TNnskv6qtD5JyQ90NuSfLAaFCSduYIGky5U8yf7i2RBQ5K3u5cmwNLEp w==; X-CSE-ConnectionGUID: K3jlmBP/S2CO6pBWs3j6Fg== X-CSE-MsgGUID: GQmBHHyxSRWai9LvsQC1Ug== X-IronPort-AV: E=Sophos;i="6.13,219,1732575600"; d="scan'208";a="29125317" X-MGA-submission: MDG3E9SiOOAubCfPZA3XNhr4iuV/tOU12pFzDF1aYJswel0i5nTynKiLeOPyPiiUbokWfycUnXacXMQ975zg+pArpZUCHHyA7tRzGwdSlkmBYM8c4gBi8HYNMPfQ12Ev49gUcp5q376+A4Nyn6Bb8xAC9s4rG6Uxt5Rs3FEcZQpkwg== Received: from mail-am6eur05lp2112.outbound.protection.outlook.com (HELO EUR05-AM6-obe.outbound.protection.outlook.com) ([104.47.18.112]) by smarthost2.eviden.com with ESMTP/TLS/TLS_AES_256_GCM_SHA384; 20 Jan 2025 18:41:53 +0100 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=lA1zfjxAZZIT/RxW/kibn0+lUznTYSG20XewMNMAWvmmug6zwhY2r8SKw0JqqsLZ2eAZphU35vY8eUug6jni9oTeCQOFxtb2CY+kH5l7IIz+FKRYS7WmgslUzT2qanADsLrxNmDzK+a9YYmGOogbyGNTTx3wITPiHdudZVNk2at+avhLjcQnWoEpgkrzAmxXkWGvULVrakQk2/HYZNAG1JfCkl1l9J+r5gKSc1ymYmisXiPekHTTRk0GaJs6Nxk7RCUOFa0/+YPEdmaimZyLLB4mXth8QNRxeXTQkY3OXtoh9G3bkPbSWxPu11KMiUxZnVU26kqTzFGdB66IpNburw== 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=l8VdlQWnhpXy0HtPJRFkjFTGAckun8aBFJlSx79Q7CI=; b=V8yqhQPY+1+bCfePytQVdBlKiumN6hg2Np+jBXW8vBIo9R/B3bO38q/7tXOz7MOP6OvzWM/NFvaT8mFWsrQuZp/K9GJ0Xf32Uq+ypdL9dNQXNWr4po+/KGco4g3j72V8Jl4qS3sngZ/VL20uMLK9krZWZEDQZmpm8eBsgQDtxwN5KIPuJffcDrHMVsKWkz5YlrATjwBlJ6bfXwoi/jIRUYx+OyWM2nSmQYpfNBSq1gILo9/A1xgMvBMzJ6mbwLbFXeLk8oGSkOHWkJLyQzsXavv9xRwVfF6DPM9s8tHEifgEJOmmx+vEyQQJkhgQ181ZZdfFNTe1fgkSbsoQ2akBgQ== 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=l8VdlQWnhpXy0HtPJRFkjFTGAckun8aBFJlSx79Q7CI=; b=aeHW6zNk8lyxSIOqEwqzhOqkYV1tSpa+Qn1sJUv0Ti7YdLmDnY+LQ3bARzi4HOFX7XBYmq4Bs8QOafdyNvao+lizJrJJVxOoxUZmKK96EQnclaQI8WZCU6KaR1bxS1+UwOhKpgwQrOo94Vw9MMY/YmnF29dgtDOyWUo1sdHipwk5VazhewgP8YxqEYshfgQoQ86BQezIRYO0f6Y7kP1BjCtDNK0NDhJGI6J88LjPsM7KRAea2KXPbYJVT58e+3ZBo7CFhH0ER0sAqqj2QVQUbZm//AQI/xPTWaPWfmyxixd3Xc2Pv25ByrnSoefhLGPVr6oIBBCjjf74p2/IrSs86w== 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:51 +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:51 +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 12/19] pci: Add a pci-level initialization function for iommu notifiers Thread-Topic: [PATCH v2 12/19] pci: Add a pci-level initialization function for iommu notifiers Thread-Index: AQHba2KWf94PTyJm8UuanHrURjYpuA== Date: Mon, 20 Jan 2025 17:41:51 +0000 Message-ID: <20250120174033.308518-13-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: 793d97d7-4f0d-4787-1d12-08dd3979b8de 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?C50UJbo7WRU7MzUuWUvNFF/fmg?= =?iso-8859-1?q?3KNph+j4z0OZO1ZQQ2P+qewrxYiIC6qp444WdN4gGupdWkt4oFWljEa6Idep?= =?iso-8859-1?q?zGC0um8otgoz+PZ5m96EgLCf9IicDEdupIKnj4updGeyKUA40oDsQx7j71i0?= =?iso-8859-1?q?AlLMAfM2Fhdosn6+encuUNGFaIfWFg05JdJPocOMTCFkCsTefks3pZwbosnt?= =?iso-8859-1?q?Naih+sATO31Q7PPBUsVl1uxDq8CHyfxuocs9NUViTa2bEGdccIpDMTfwQOWP?= =?iso-8859-1?q?TYAEvQ9sbv3RpXq+NeSrnGXlnKGA7t7uoARXnqIy/E3J1JbfbLTy0H4lhL4p?= =?iso-8859-1?q?rMJfUENsguP/CmiEV3FaNGtfoAKj+8hnZteMpqOkkYI/KZSeQeiSLwo5FFSc?= =?iso-8859-1?q?YSgcxUu/YBH+jycQE1UwmWbc0iMT5ZGKoLXO/lJNmFRCiJXQfqnwQCHWmQig?= =?iso-8859-1?q?MDdEdhk/enmiH6nF0vOG8Iag/faY7lD0xtGVaKG7+SL8/KGbR2ijFNUUbBev?= =?iso-8859-1?q?Tzy3Spo67sGJ5i18jBLN0xNSEt5FH1mu0/Ru7d/To+cjI5Rj82HxRx/B9h8y?= =?iso-8859-1?q?2X1ZDAZPzpN13vwIO91izxKrdjDiyBZr1zOn2o5VUAL0EBTfQVAxeCdgUFQ5?= =?iso-8859-1?q?STkYuR44iT5QLr4scmXARIpHrguwBtgmrD5JkZf6VqmaJeTP7QkW8r94TFJT?= =?iso-8859-1?q?hQUaY5K6Nx0/m4tv6VeJ0Dln7+90Zrmxr5WNtLzhwK3nItiQjBpapWPRmenG?= =?iso-8859-1?q?QPmeJkEEslPIemWfsQp4/n3QKPG1dpfI/voNybWVa4fSvBuP2nncul1UzW9E?= =?iso-8859-1?q?0NgKRJ/s2Ha0sn/yMPb+IE89RWT+FBOkMy9mZRqUeb7dMECpkjJbEMNJd/R5?= =?iso-8859-1?q?EQ7/V/J8PUsz5FN0csD+MwHe5I/vUDvCWL/YH+au9fvwFMn7AEKa2HCMZFtI?= =?iso-8859-1?q?KaTA9s7pXJBmLl3n/6MTMD8DXlIDLRxZps4+3MlcryUKIcLY0OVp+akN+Ep7?= =?iso-8859-1?q?O53cTm6q77Dia1o5rRCx9y4eD8rcsE3lr9vv3IDDzv/JQ7rN6VQ6Lx4a6Di9?= =?iso-8859-1?q?90ywEWHzJwu8/bfGBnmHaVl7+K9eL2aZMgG/2djkY+IvNuUn9wm4Oqte//sB?= =?iso-8859-1?q?cL0iDgl5Cp5eLmko5r2W9tQemJomuMD2Nynh0LLhFuwwjRKi/MCp3dDKOlkk?= =?iso-8859-1?q?9kzTOfV5s3CyYicrMr+K76DXlzA6DmMkM+HRAuthURuoccGUw2q81bKj0bax?= =?iso-8859-1?q?k3hNqi89VLvThkEKBTbNgxpL7rgLJjdy9UYLwSAZ3/JyFe9yrKQwqvtuitN3?= =?iso-8859-1?q?Z0ooVqoZrBhBu7jwyznPFwDQDLbRjmNgow9cGBU84MNEIeMOlDvmXUctkRHW?= =?iso-8859-1?q?k2yMTEiN2DbnonpSFrXfKkRnRqFnur4EtMs9gslx38pz+deX0UmRbwOH9/5w?= =?iso-8859-1?q?O2Wol1UTIXgvPsKDvJY6UNcVuUUtbQmP3/V6UcAHo0Y5HfkqaV6M3LjOWyVg?= =?iso-8859-1?q?DfVeMi?= 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-messagedata-0: =?iso-8859-1?q?WaUaBSDpSjB4pchA9MYLV2s?= =?iso-8859-1?q?VVE2r1eIAFbStgYUTLP+sJ5DbT8UXn1P8Enqmh6UxbtRAEchIdcGuAHf7pl/?= =?iso-8859-1?q?hY1/gtL6V5q/IJv+8Ifzyn3bfk3sdouitwJD/14iBIJEC/cnVlDy1CdtMlNT?= =?iso-8859-1?q?5Y4lPs09/GWzvub40K3dQyt1wdE3l8Si/3iwt7P0TqB8WtDVGUFBfyce+gIY?= =?iso-8859-1?q?jUTQUUJjjk4udqPngH3BEZXK0cUfCR+c8PK99A0015xKToc3k+MrBMf/f04m?= =?iso-8859-1?q?Qg7AIQA58S1ueq7VJCUxU44ff6S3V++cmRiuKmgIhZumQ7tHL4pPATPikPBo?= =?iso-8859-1?q?GSnv15DQ/43wUp7RonJiSTaOPdeROZvcwOgE2xS9z27LJUbcnXmbqDcTny28?= =?iso-8859-1?q?NOIhnTIXzG9N+43O31oz28HQShHRjVWPe8IOtsc+gtubgS5iw79YX+KXlECS?= =?iso-8859-1?q?ENODPcRiwwSimAeTtS3h/wUTxA7JIP2FekQbTHl7JZaCIfknh0aWSWvXwZFs?= =?iso-8859-1?q?Ke3f4rZYUQ9JGjHYU6kU/LjEseXxSQ94BjGU0fxl98H/mGLlaR13ZtD73dpS?= =?iso-8859-1?q?/dOR0RcmvjMHd9g4kXbkmAJfE1F72A89L1RhT8npEYBKPmEWqqcuM3jzFtR9?= =?iso-8859-1?q?8njZOl5JL3/Rk3U466k1c/p54ztuw3+f7Ymzd1wcpbHKY/NQYJxtk9RDhKgD?= =?iso-8859-1?q?mtO+Lo2vNdCHn9/bRHd69K+ttQGpRmSG6bn5ze1VlkunoG+cmec3ggf/HUoj?= =?iso-8859-1?q?XIzjKGDpnkVIjG8ugMpUoxd9NJceil41g5RF6HYFUBvtIUP6oufLV9BhqV2m?= =?iso-8859-1?q?E9eeVS4jyRNlxyfFJiJqhOFHKSlGqb+/rGkERIjcg0g2YZggZ79b9caDELQV?= =?iso-8859-1?q?DFTXM8vpsv4fn9SwbsoKfutG4/7PHYOMVZ3k6s+ERcsJw8BKMVMnMvy9whI4?= =?iso-8859-1?q?rag9LR8ylf9trTOSLjrEh4jlbKQUf6FMQZE8ndbkpZxC5hUhU40OF9mjCByw?= =?iso-8859-1?q?ZHA2y5VqtMvs5HIlu4wdoFZwD9FzONGDstZffznqVk1i2T9qSsmBVfmnoXOx?= =?iso-8859-1?q?jWSjnfRmzOBx8LsEIyryAAHBA7IamqxRNmymAE5HM0cCCqsgihIChmPWWQWa?= =?iso-8859-1?q?pfULI6t6WJDZKLoXL2JrsuQlv91JvSGlsX043gDukl+AsnTFWphtSaHtVP3s?= =?iso-8859-1?q?PHcAXsJSWO3lWY/CK9Wj30XoyZwhSkikAUKyvwzkhwmHVH95du06rJvov1RO?= =?iso-8859-1?q?pe9cc3EyEAy1mWuNp8Nd2zpaKPP0/KNJT569ewKfQJcjMoxtfO+hispZRao4?= =?iso-8859-1?q?AtZ321V1mrTFnSKZksDFb9f8vR0M34uQ6vUuroCs+FTsB4BtsvFOjucZkZU3?= =?iso-8859-1?q?KWbdNLCFoKRRrm4YHjRvW5WkGcD4ovl4o/xiyxq+5Z7kVXJW9nv7bLdt4/rK?= =?iso-8859-1?q?IVybp3WuwmU3lSLj8U7XO1FZmBuktbyNSFSyNAEaC20i+2F4m2KBg7YJu+eM?= =?iso-8859-1?q?4azQi2lajJTYwPH5hZJe/zujJe1OdV6ior3n1PD8/r2zK/mp4CMODVvq1ayy?= =?iso-8859-1?q?pVY5GBEbaJ2UZ2iEnfCXRm+jtFl2QhFkuBUFIImDmu4/C754UH8cwezygHk3?= =?iso-8859-1?q?EeKQuYx6QS8ZUu6uzSPro2xmWsRji2UiLG08knzav6qCokP5ZodiLA4RmP6c?= =?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: 793d97d7-4f0d-4787-1d12-08dd3979b8de X-MS-Exchange-CrossTenant-originalarrivaltime: 20 Jan 2025 17:41:51.1525 (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: ERO4NnITtWXkli3U4IvTwdqg2A8nYHu1J+mP2SMI7snsRWpJH6xdRaRuuaPIj2CQ+HhK/wtvn3P7CiXQW5E0bc8KpNhC4nS/zbGL0yr0SNHRg+m3vPZP0mO6eqeO9tmC X-MS-Exchange-Transport-CrossTenantHeadersStamped: DBBPR07MB7548 Received-SPF: pass client-ip=80.78.11.83; envelope-from=clement.mathieu--drif@eviden.com; helo=smarthost2.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 We add a convenient way to initialize an device-iotlb notifier. This is meant to be used by ATS-capable devices. pci_device_iommu_memory_region_pasid is introduces in this commit and will be used in several other SVM-related functions exposed in the PCI API. Signed-off-by: Clement Mathieu--Drif --- hw/pci/pci.c | 40 ++++++++++++++++++++++++++++++++++++++++ include/hw/pci/pci.h | 15 +++++++++++++++ 2 files changed, 55 insertions(+) diff --git a/hw/pci/pci.c b/hw/pci/pci.c index 164bb22e05..be29c0375f 100644 --- a/hw/pci/pci.c +++ b/hw/pci/pci.c @@ -2825,6 +2825,46 @@ AddressSpace *pci_device_iommu_address_space(PCIDevice *dev) return &address_space_memory; } +static IOMMUMemoryRegion *pci_device_iommu_memory_region_pasid(PCIDevice *dev, + uint32_t pasid) +{ + PCIBus *bus; + PCIBus *iommu_bus; + int devfn; + + /* + * This function is for internal use in the module, + * we can call it with PCI_NO_PASID + */ + if (!dev->is_master || + ((pasid != PCI_NO_PASID) && !pcie_pasid_enabled(dev))) { + return NULL; + } + + pci_device_get_iommu_bus_devfn(dev, &bus, &iommu_bus, &devfn); + if (iommu_bus && iommu_bus->iommu_ops->get_memory_region_pasid) { + return iommu_bus->iommu_ops->get_memory_region_pasid(bus, + iommu_bus->iommu_opaque, devfn, pasid); + } + return NULL; +} + +bool pci_iommu_init_iotlb_notifier(PCIDevice *dev, uint32_t pasid, + IOMMUNotifier *n, IOMMUNotify fn, + void *opaque) +{ + IOMMUMemoryRegion *iommu_mr = pci_device_iommu_memory_region_pasid(dev, + pasid); + if (!iommu_mr) { + return false; + } + iommu_notifier_init(n, fn, IOMMU_NOTIFIER_DEVIOTLB_EVENTS, 0, HWADDR_MAX, + memory_region_iommu_attrs_to_index(iommu_mr, + MEMTXATTRS_UNSPECIFIED)); + n->opaque = opaque; + return true; +} + bool pci_device_set_iommu_device(PCIDevice *dev, HostIOMMUDevice *hiod, Error **errp) { diff --git a/include/hw/pci/pci.h b/include/hw/pci/pci.h index 644551550b..a11366e08d 100644 --- a/include/hw/pci/pci.h +++ b/include/hw/pci/pci.h @@ -446,6 +446,21 @@ bool pci_device_set_iommu_device(PCIDevice *dev, HostIOMMUDevice *hiod, Error **errp); void pci_device_unset_iommu_device(PCIDevice *dev); +/** + * pci_iommu_init_iotlb_notifier: initialize an IOMMU notifier + * + * This function is used by devices before registering an IOTLB notifier + * + * @dev: the device + * @pasid: the pasid of the address space to watch + * @n: the notifier to initialize + * @fn: the callback to be installed + * @opaque: user pointer that can be used to store a state + */ +bool pci_iommu_init_iotlb_notifier(PCIDevice *dev, uint32_t pasid, + IOMMUNotifier *n, IOMMUNotify fn, + void *opaque); + /** * pci_setup_iommu: Initialize specific IOMMU handlers for a PCIBus *