From nobody Mon Nov 25 08:01:50 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass header.i=@eviden.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; arc=pass (i=1 dmarc=pass fromdomain=eviden.com); dmarc=pass(p=reject dis=none) header.from=eviden.com ARC-Seal: i=2; a=rsa-sha256; t=1717072015; cv=pass; d=zohomail.com; s=zohoarc; b=CJPNRXHVNR2WnBZx4Xq9TwEjS8kb31mWWLh1RIwKgpGyYB9S0CEz2s5nkDjCe/USeoxkQqZCtMs9EqcT+JSIpiqoZ0ErGAijzbPvdE7V9XqMDIKHo1joc+ZKt8OvYhtwfgvCD+mFoZIRZ6ssWx76INphDgfMeZXG/5i+tOqsijk= ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1717072015; h=Content-ID:Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=/KNC9YlY5dCStxnGJESvt06kpnylow9D0BXt0DFqGPc=; b=kZKBa8Fhl5fcP6c2cVfeyJ5z2LGilq7LIAb3e9GZNLqcd0qr5LUs+iU0lk+dsK2TiLx/JzSmMHyEknQT4Vf/HOVUkwwYXTl1z32AUpi0k2BKuhAua8krAerq7LuYzw+xnc1PPnwfcB4EJfZF0boaxOjXDXuJwTMFIXKF9JOQSnE= ARC-Authentication-Results: i=2; mx.zohomail.com; dkim=pass header.i=@eviden.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; arc=pass (i=1 dmarc=pass fromdomain=eviden.com); dmarc=pass header.from= (p=reject dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 171707201574544.39592985177626; Thu, 30 May 2024 05:26:55 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sCeqO-00073o-9B; Thu, 30 May 2024 08:25:20 -0400 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 1sCeqL-00072p-RF for qemu-devel@nongnu.org; Thu, 30 May 2024 08:25:17 -0400 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 1sCeqH-00060c-3F for qemu-devel@nongnu.org; Thu, 30 May 2024 08:25:17 -0400 Received: from mail-he1eur01lp2051.outbound.protection.outlook.com (HELO EUR01-HE1-obe.outbound.protection.outlook.com) ([104.47.0.51]) by smarthost3.eviden.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 30 May 2024 14:25:04 +0200 Received: from AM8PR07MB7602.eurprd07.prod.outlook.com (2603:10a6:20b:24b::7) by AS8PR07MB8069.eurprd07.prod.outlook.com (2603:10a6:20b:358::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7633.21; Thu, 30 May 2024 12:25:03 +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.7633.018; Thu, 30 May 2024 12:25:03 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=eviden.com; i=@eviden.com; q=dns/txt; s=mail; t=1717071913; x=1748607913; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-id:content-transfer-encoding: mime-version; bh=/KNC9YlY5dCStxnGJESvt06kpnylow9D0BXt0DFqGPc=; b=mCM2Vo+EUPllv77ox8NlC06wXaoor4vRDaUk+Nfjd5LB+z87JmeiKN9+ V0kE2GCncucyVkIxFArzapp/IXDQGG6/ZcOgvBxIGhZfcndoY265uANCk JVal2dBhIvivfCYEtxiEIBA+r8L83YnUpxg5KdY5MReokz8qhAP4tb5G7 g+hjvukmJTR6uWksHeul/jagT/7yL4copq7MrQL4ro/JD0vlk521D2Y0U DIJgjPPVkCsC94Uz5jZsCQMDOIWHdiRUcA14knUn7SRimq6zQp1Cl9abP l0VVxAKGEsRYa2oCzRCegS2KgtdB/EM+pPr8ehEOY3/tt9VwUuSzxIFxO g==; X-IronPort-AV: E=Sophos;i="6.08,201,1712613600"; d="scan'208";a="13581115" X-MGA-submission: =?us-ascii?q?MDGjkgWSbnOmxXEr9n3nj4xnTvOvTz++DNMLrr?= =?us-ascii?q?I2i7mIkF19EKy9SLv2BwvdW78SzO1Q/OmMHDlY8tnoy9HcXJtZTXXyoI?= =?us-ascii?q?oZJfSnNyKgWyaP24k4gtU8YXIvqY06EaOZKFiTWLQ+XLxohd0xrgclD/?= =?us-ascii?q?pBb389T5wCGSkdqdynGg7kNA=3D=3D?= ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=bZ5p3tfQWys1jZkUX7RRszpJE4NXAcG4I/Yo9V4exvzk45RDIcCkOSwOQ09sAYbnuBxJ3+P/kapwMt3IK8LreGMd73pP0Wc9ZJLnyAVdSQsXUinO2gJQZePyuPtXkikY5DmenoTVFNg9Kut3qxVzielCyvMJWp15s7TnG1MKH8VoPNR57wHxAHTjCCn0Bt/6cVPp0YIBmTSegEzbXu89ZSP5iAw6ab3vA9JISXjRW/xBkJvyFSdF2eXP49wdU5X8xjsx4J3P5sXgXjFTEZvi2XVmDN8b2KHl7+zBpxNpl8PBtjAbiMKrPkEgMVOlv8nM3xlujnA0FxoKuZ8/gykatQ== 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=/KNC9YlY5dCStxnGJESvt06kpnylow9D0BXt0DFqGPc=; b=fxKdN0N1/EisrjBTWI8XLjXttiGH0fdlUW4quCNNiL4/okzn4hHe0wZQQVj5vujuRFaPRtrmk6pfV/dNqbbzOy4jo30XKsL7tF6A1Y6+m+XqLMEFBGvqjIx+MJRTIXR2KVRjN6gG+vOGtJ+l3RpNNk7a45dvu0/+DyxVL2PX3Ox7Q2krsw2kwzdHxO6vOdJZW2t7AY4gPO17WzaACjSlPx/4XJrYMzoG3z+oxdGzIeVdaWAd6fNHdJ2/bfIMFCggkHGj5z1d4Kcg+mm1O1+5+MIi9/EXrvWBEhN1LTlPwC0v9ZyqE4aFtDyzc83w9n6IUiawgnpC+ex2S7xkp1M+pQ== 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 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" , CLEMENT MATHIEU--DRIF Subject: [PATCH v1 5/8] pci: add a PCI-level API for PRI Thread-Topic: [PATCH v1 5/8] pci: add a PCI-level API for PRI Thread-Index: AQHasoxlDbCdNhpNy0WmSlq+hx398A== Date: Thu, 30 May 2024 12:25:03 +0000 Message-ID: <20240530122439.42888-6-clement.mathieu--drif@eviden.com> References: <20240530122439.42888-1-clement.mathieu--drif@eviden.com> In-Reply-To: <20240530122439.42888-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_|AS8PR07MB8069:EE_ x-ms-office365-filtering-correlation-id: 020b8aaa-8221-451e-cc68-08dc80a38828 x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; ARA:13230031|376005|1800799015|366007|38070700009; x-microsoft-antispam-message-info: =?utf-8?B?M1JYakxrakRJeGQweUJTVjBGc1VlMHMvZ2E2aFIralIwcTVvSkVVdVpreEsz?= =?utf-8?B?aURMS0F1SFlpMjYwbXdPU1BrUDlPVzFCZFhYTjlNdFVERVVVN1N2dUVmMDBr?= =?utf-8?B?SXVqVUdEcWFrM3gwQmZGajZISm94Rit2ZWFMK0ZBOWlvbEpnd3drRDlTVUVQ?= =?utf-8?B?MENmbUhQUURNS2Z3S2NRdXJYcklFbDR1SW50bDhwc3NHMmx1SEo2S0JuMFhr?= =?utf-8?B?U2EzMk5FdHBiM24vaVVDaldpaHM1ZStWUU9WRXprdFM5eWVPZW8vL1Y4VW1H?= =?utf-8?B?ZkRsbERFWEc4N09VQWN1eVJydWdsclRjMHJXNHFvQ1pzRWNwb3BUS3loZzdh?= =?utf-8?B?b3FpRnllbmlOZUtHRGRzbzVtd3d0VGFGejMxdWE5TklNZ084d09yOU1LcmR5?= =?utf-8?B?aC9nQTVWeVVWdXRlK3NTMUlmazNTNkRmSC8wQU1wYWJwdzNkR1JIYWJMbzNk?= =?utf-8?B?WWE4VjVEbXEvVzJmeXZvWldnWHR1YjZiK1NKa2J3WjNPRU1pVVNQVXZWNGlL?= =?utf-8?B?dEg5UGdqYUp5SkhFeGRRK1hnOFF5Z0VSWG95VURQcy9RNDNBY0lFNHNseDlQ?= =?utf-8?B?cEEwR3VpakIzUnFsN09WRER6NXhrMzhXYjJWUXJORkFVaU5qQ3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zMmdqQXBiL0hmYWdQMG9o?= =?utf-8?B?WWwxUDRqRmpjc0ZuV25NQXI4eExldHZaNGpmMjQyWnV6T3R0TENLYXVUYmRj?= =?utf-8?B?ck5neS9iQ1dPbVlmemYwcWpZN0dLdHJUUllkd3oySGZCMnpBeDJHOUVsU1Vn?= =?utf-8?B?SUlNbGNNdnVOeE1DVnZKMDZXRnQ1ekV3Zzk0SzVueWV0UVlSWERsbFJNZG9G?= =?utf-8?B?VTY2R2JUSXRORThKVmZIK0tkMUdMOGt5b0FSQTBUK3ZqaksvY251VjNDQUFQ?= =?utf-8?B?QTYrdkhpY1NQbFhIWk1UZz09?= 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:(13230031)(376005)(1800799015)(366007)(38070700009); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?utf-8?B?UlFNbWlYSlJBUEpHdzZCeGI3TTk1UXBweTVWSi9ScXBvKzJYM3ZVbG1LTzBJ?= =?utf-8?B?UmJNZVpMOHZ2N1lWM1l5YnlwdDA3MFk3cXl6QmhCQm5zU3ZjbGZNMFhqRTE1?= =?utf-8?B?VGNwVG1MdWJmb3dIaHVwZjVQbzk0S25xWnNmeHZwd3FHRERtejYzQkV0dm9v?= =?utf-8?B?K09RVjIzUjNHQzFVWGlNNDhnampVOXhoOEVNRlRmYXdwN1F0UXFQdCtBOTFE?= =?utf-8?B?akZtUm4xcWo1VE9iTFRkYnk0RkhRdlJqZWpwK1V0SHBQZXVWdEs5SXo1THlt?= =?utf-8?B?NXpOUVY0VHNjaUF2dEptSmxaL1liYlpkakZiTVVXV0E5YmhHejRidGVxak9F?= =?utf-8?B?N0hyc2htUmpCTE9QdmxBZEZ5TlY3QnRSd0orQXBaMndUSmZzOU5UMU1kQ1NT?= =?utf-8?B?V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; charset="utf-8" Content-ID: <8281B5836E2F704D91A22E38E442386F@eurprd07.prod.outlook.com> Content-Transfer-Encoding: quoted-printable 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: 020b8aaa-8221-451e-cc68-08dc80a38828 X-MS-Exchange-CrossTenant-originalarrivaltime: 30 May 2024 12:25:03.1956 (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: VOeU5bDG+bE7EsRvy3pmnDMZZ3/dPVBLT1u+uxXBzVzlegbseBDmfORYnXRcS7EsjSH/UiNizpKl1rDRBF97EPbdFjj2zW4qgU3ZHk/WDmVQnGOCE8rqOnWt8Jcxzi+P X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR07MB8069 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; 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, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @eviden.com) X-ZM-MESSAGEID: 1717072016311100005 A device can send a PRI request to the IOMMU using pci_pri_request_page_pas= id. The PRI response is sent back using the notifier managed with pci_pri_register_notifier and pci_pri_unregister_notifier. Signed-off-by: Cl=C3=A9ment Mathieu--Drif --- hw/pci/pci.c | 37 ++++++++++++++++++++++++++++++++ include/exec/memory.h | 35 +++++++++++++++++++++++++++++++ include/hw/pci/pci.h | 45 +++++++++++++++++++++++++++++++++++++++ system/memory.c | 49 +++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 166 insertions(+) diff --git a/hw/pci/pci.c b/hw/pci/pci.c index 10b0708130..dd854fc18f 100644 --- a/hw/pci/pci.c +++ b/hw/pci/pci.c @@ -2833,6 +2833,43 @@ void pci_device_unset_iommu_device(PCIDevice *dev) } } =20 +int pci_pri_request_page_pasid(PCIDevice *dev, uint32_t pasid, bool priv_r= eq, + bool exec_req, hwaddr addr, bool lpig, + uint16_t prgi, bool is_read, bool is_write) +{ + IOMMUMemoryRegion *iommu_mr =3D pci_device_iommu_memory_region_pasid(d= ev, + pa= sid); + if (!iommu_mr || !pcie_pri_enabled(dev)) { + return -EPERM; + } + return memory_region_iommu_pri_request_page(iommu_mr, priv_req, exec_r= eq, + addr, lpig, prgi, is_read, + is_write); +} + +int pci_pri_register_notifier(PCIDevice *dev, uint32_t pasid, + IOMMUPRINotifier *notifier) +{ + IOMMUMemoryRegion *iommu_mr =3D pci_device_iommu_memory_region_pasid(d= ev, + pa= sid); + if (!iommu_mr || !pcie_pri_enabled(dev)) { + return -EPERM; + } + return memory_region_register_iommu_pri_notifier(MEMORY_REGION(iommu_m= r), + notifier); +} + +int pci_pri_unregister_notifier(PCIDevice *dev, uint32_t pasid) +{ + IOMMUMemoryRegion *iommu_mr =3D pci_device_iommu_memory_region_pasid(d= ev, + pa= sid); + if (!iommu_mr || !pcie_pri_enabled(dev)) { + return -EPERM; + } + memory_region_unregister_iommu_pri_notifier(MEMORY_REGION(iommu_mr)); + return 0; +} + ssize_t pci_ats_request_translation_pasid(PCIDevice *dev, uint32_t pasid, bool priv_req, bool exec_req, hw= addr addr, size_t length, bool no_write, diff --git a/include/exec/memory.h b/include/exec/memory.h index f4780d3920..71bdd7e64d 100644 --- a/include/exec/memory.h +++ b/include/exec/memory.h @@ -1870,6 +1870,16 @@ void memory_region_notify_iommu(IOMMUMemoryRegion *i= ommu_mr, int iommu_idx, IOMMUTLBEvent event); =20 +/** + * Notify the device attached to a memory region by calling the PRI + * callback (if exists) + * + * @iommu_mr: the region in which the PRI request has been performed + * @response: the response to be forwarded to the device + */ +void memory_region_notify_pri_iommu(IOMMUMemoryRegion *iommu_mr, + IOMMUPRIResponse *response); + /** * memory_region_notify_iommu_one: notify a change in an IOMMU translation * entry to a single notifier @@ -1944,6 +1954,31 @@ ssize_t memory_region_iommu_ats_request_translation(= IOMMUMemoryRegion *iommu_mr, size_t result_length, uint32_t *err_count); =20 +/** + * Register a PRI callback in an IOMMU memory region + * + * Return 0 if the notifier has been installed, + * error code otherwise. + * An error occurs when the region already has a + * callback configured. + * + * @mr: the target iommu memory region + * @n: the notifier to be installed + */ +int memory_region_register_iommu_pri_notifier(MemoryRegion *mr, + IOMMUPRINotifier *n); + +/** + * Unregister a PRI callback from an IOMMU memory region + * + * @mr: the target iommu memory region + */ +void memory_region_unregister_iommu_pri_notifier(MemoryRegion *mr); + +int memory_region_iommu_pri_request_page(IOMMUMemoryRegion *iommu_mr, + bool priv_req, bool exec_req, + hwaddr addr, bool lpig, uint16_t = prgi, + bool is_read, bool is_write); /** * memory_region_iommu_get_attr: return an IOMMU attr if get_attr() is * defined on the IOMMU. diff --git a/include/hw/pci/pci.h b/include/hw/pci/pci.h index 8adba6af97..76a6031d8d 100644 --- a/include/hw/pci/pci.h +++ b/include/hw/pci/pci.h @@ -473,6 +473,51 @@ bool pci_iommu_init_iotlb_notifier(PCIDevice *dev, uin= t32_t pasid, IOMMUNotifier *n, IOMMUNotify fn, void* opaque); =20 +/** + * Perform a PRI request + * + * This function is intended to be used by PCIe devices using SVM + * + * Return 0 if the PRI request has been sent to the guest OS, + * an error code otherwise + * + * @dev: the PRI capable PCI device + * @pasid: the pasid of the address space in which the translation will be= made + * @priv_req: privileged mode bit (PASID TLP) + * @exec_req: execute request bit (PASID TLP) + * @addr: untranslated address of the requested page + * @lpig: last page in group + * @prgi: page request group index + * @is_read: request read access + * @is_write: request write access + */ +int pci_pri_request_page_pasid(PCIDevice *dev, uint32_t pasid, bool priv_r= eq, + bool exec_req, hwaddr addr, bool lpig, + uint16_t prgi, bool is_read, bool is_write); + +/** + * Register a PRI callback for a given address space + * + * Return 0 on success, an error code otherwise + * + * @dev: the PRI-capable PCI device + * @pasid: the pasid of the address space to install the callback in + * @notifier: the notifier to register + */ +int pci_pri_register_notifier(PCIDevice *dev, uint32_t pasid, + IOMMUPRINotifier *notifier); + +/** + * Unregister a PRI callback from a given address space identified + * by a pasid. + * + * Return 0 if the callback has been unregistered, an error code otherwise + * + * @dev: the PRI-capable PCI device + * @pasid: the pasid of the address space to remove the callback from + */ +int pci_pri_unregister_notifier(PCIDevice *dev, uint32_t pasid); + /** * pci_ats_request_translation_pasid: perform an ATS request * diff --git a/system/memory.c b/system/memory.c index d9d66ae2e1..105c02b686 100644 --- a/system/memory.c +++ b/system/memory.c @@ -1765,6 +1765,7 @@ void memory_region_init_iommu(void *_iommu_mr, mr->terminates =3D true; /* then re-forwards */ QLIST_INIT(&iommu_mr->iommu_notify); iommu_mr->iommu_notify_flags =3D IOMMU_NOTIFIER_NONE; + iommu_mr->pri_notifier =3D NULL; } =20 static void memory_region_finalize(Object *obj) @@ -2025,6 +2026,45 @@ ssize_t memory_region_iommu_ats_request_translation(= IOMMUMemoryRegion *iommu_mr, result_length, err_count); } =20 +int memory_region_register_iommu_pri_notifier(MemoryRegion *mr, + IOMMUPRINotifier *n) +{ + IOMMUMemoryRegion *iommu_mr; + if (mr->alias) { + return memory_region_register_iommu_pri_notifier(mr->alias, n); + } + iommu_mr =3D IOMMU_MEMORY_REGION(mr); + if (iommu_mr->pri_notifier) { + return -EBUSY; + } + iommu_mr->pri_notifier =3D n; + return 0; +} + +void memory_region_unregister_iommu_pri_notifier(MemoryRegion *mr) +{ + IOMMUMemoryRegion *iommu_mr; + if (mr->alias) { + memory_region_unregister_iommu_pri_notifier(mr->alias); + return; + } + iommu_mr =3D IOMMU_MEMORY_REGION(mr); + iommu_mr->pri_notifier =3D NULL; +} + +int memory_region_iommu_pri_request_page(IOMMUMemoryRegion *iommu_mr, + bool priv_req, bool exec_req, + hwaddr addr, bool lpig, uint16_t = prgi, + bool is_read, bool is_write) +{ + IOMMUMemoryRegionClass *imrc =3D memory_region_get_iommu_class_nocheck= (iommu_mr); + if (!imrc->iommu_pri_request_page) { + return -ENODEV; + } + return imrc->iommu_pri_request_page(iommu_mr, addr, lpig, prgi, is_rea= d, + is_write, exec_req, priv_req); +} + void memory_region_notify_iommu_one(IOMMUNotifier *notifier, IOMMUTLBEvent *event) { @@ -2085,6 +2125,15 @@ void memory_region_notify_iommu(IOMMUMemoryRegion *i= ommu_mr, } } =20 +void memory_region_notify_pri_iommu(IOMMUMemoryRegion *iommu_mr, + IOMMUPRIResponse *response) +{ + assert(memory_region_is_iommu(MEMORY_REGION(iommu_mr))); + if (iommu_mr->pri_notifier) { + iommu_mr->pri_notifier->notify(iommu_mr->pri_notifier, response); + } +} + int memory_region_iommu_get_attr(IOMMUMemoryRegion *iommu_mr, enum IOMMUMemoryRegionAttr attr, void *data) --=20 2.45.1