From patchwork Mon Jan 20 17:41:53 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: 13945444 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 9E1FCC02182 for ; Mon, 20 Jan 2025 17:45:04 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tZvml-0004vY-5c; Mon, 20 Jan 2025 12:42:03 -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 1tZvmg-0004jF-PP for qemu-devel@nongnu.org; Mon, 20 Jan 2025 12:41:58 -0500 Received: from smarthost1.eviden.com ([80.78.11.82]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tZvme-0000bO-NE for qemu-devel@nongnu.org; Mon, 20 Jan 2025 12:41:58 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=eviden.com; i=@eviden.com; q=dns/txt; s=mail; t=1737394916; x=1768930916; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=hS+ubrQMFsIzNpAi8WQb/IPQKIWvAB02nNA7fqJhrm8=; b=u+JCSzJJjlNSHViL9atfL33bXCglLZyGXV66k1SukLtIjcPtENkpqc8s Q6F60/l5ry5b+5U+cmqunrRddU6Tv9TA2Iun0ZU1Q/dfbA14XAwRnzPxo US3gYL99Uj9vc85uALSsbFyaCgC7hz0wrhzO5yHdTtICRL4PYLpUawfw/ xZydDzAoT3+Ci704v6/wfJF16zF54o2PJx13g8aYbcMVsL0RykWohO4BY VixDGzZtjyD7vtC6ZXuP/sOmpYuF25IaPIYaRiP53x8NHwrya6rbBmoDk UVuMaQKT0luFYp1oxlGkv1Pjq8DTeFRx7pFBYJZ6DCTiSeRiYf0UQ/3CW w==; X-CSE-ConnectionGUID: TUUnE5xnSkCQwBYtOhr/fw== X-CSE-MsgGUID: I+QRl/JoTGO/N+VPov5Bwg== X-IronPort-AV: E=Sophos;i="6.13,219,1732575600"; d="scan'208";a="29133404" X-MGA-submission: MDEf8bepAENXnAdZCGtLsxUOXsrupHjthICINDhJ6f4/YzxG4W5vrhaAm4mG384pd0rf5p82MsrUdPii0AQs4mX4GNKC5r+WxKWv7heq25R8QFgyZ+Wfm82Xqnf8MGR68ItsbSMiOuj1gbb67H6W3zVBt5HjN+VcY4T73Pe2Axz8iw== Received: from mail-am6eur05lp2113.outbound.protection.outlook.com (HELO EUR05-AM6-obe.outbound.protection.outlook.com) ([104.47.18.113]) by smarthost1.eviden.com with ESMTP/TLS/TLS_AES_256_GCM_SHA384; 20 Jan 2025 18:41:54 +0100 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=BW1KUV/nxFleGQsXGECz59AzBFSUN1ZY+tqj4xNnOEej52xyqZybv0cW1EHHxLPgnt7PqxWKB9F6itWZQcvRcDib0//qxcA8Ty46DwlKg+nnXwp1jLNpCgpplLqbKSgMHgmaJ5WMPDVGTQYD/SGQJBmNzBViOfUq2PLHCygJvftw6iYJAkNrU9w0qa4VhMMvoviG2lFSp27Q5m+kIYmrWvJHJv/yGtSZHQwnlaVtY38LcirSdtTb2Z8dvAcMT3y4B3dXJRv9ClYH+A1HW8j4OmegfRoFiW9afAXr5Kk0JmZxeI+dDjCCgfZRO2XXErLEJgl8T73tQyXhp9ndroPE/w== 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=VOf2f5rIkqvUHqqQnX73Mt6rzDe2WT3VgsfOVe4zjtA=; b=C6zhInCcKvD0hHY+nkzfLRwSn+4q8ZE1y59zW27KW8AielqZe/CuPC+7X4WIk/gTXZOch5sifVgyyEkWmywOpvPvhKeDmgYKWqmuxI1//0FHFgXsR5142JudwbHhm8oQ5+Z5C4F/wMh/czYEEHXylKRLPYfHC03zKtY9fdZPgdu5f53/iB67lBcLBNGDoCaWISXhk95GyUXgXoo0VQDMshleEJQzWvEPGPijw5QV4gJbcjISADDPcgFFkFmmje53aLMMiGXgj7Pyq20IcCVfGzTqZLHC0GehpZiSBowIXWjJD2OHqa24kqutdWE0hnXqTbYXqbx2O7giYjNqhQgpJA== 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=VOf2f5rIkqvUHqqQnX73Mt6rzDe2WT3VgsfOVe4zjtA=; b=L/GfRFjvNWwF+smwD/UIhCCmbgFdydQBywmn7lXSf3W75sre0JdCBp7+RGYyfoS0mkw8yqoRnCuTgkWzqCLjC/Hk4NmwSQmvEPx9y5HwVhSGKXCOIR+PsxS+gx6/CL6+iQeVcS6+KHkRiZrbYP4ZOb2472dLuU84xQs8q7jEBQgljiDPdottlOxONoOjQdRDLHoOlc7p0hAP+oHujqSI6xyrBpHisCPENr5uDAwdrS+mvVMCiq0Fvqy9PHXkNMLsWjU3JU6SUvNnmGBPoRx+8Q++uZ8KMOIUIXI2KIxr+JeaGO5rz3jZ6hFkS+G1sOx3zlEQl12LtHLgstDbTGIEOg== 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:54 +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:54 +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 15/19] memory: Add an API for ATS support Thread-Topic: [PATCH v2 15/19] memory: Add an API for ATS support Thread-Index: AQHba2KYusTOf31TZkq7lrpG5ZaiWA== Date: Mon, 20 Jan 2025 17:41:53 +0000 Message-ID: <20250120174033.308518-16-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: da147a44-d56b-49a6-d08d-08dd3979ba8d 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?BtJrSx9h+6TFlEx+9MWXlF/bzH?= =?iso-8859-1?q?E+CAfEVxL/yRB8vKoJdiLv8JR+Nh0lh4v6Q7Zga8JIV2qazRzshonDp0W6Dy?= =?iso-8859-1?q?KVPOZ+h4/iIZVu82pnwe5eXkugpBaPq6ElDUiBaEzam47LkkRa7hhZ5tdoFw?= =?iso-8859-1?q?r+nxoRQLMRL2cYGlLlEs2n3O4y5HVdK69g88SRQDjjd0q9xW1Xx+VaSTWr2T?= =?iso-8859-1?q?XaoAeo3AysSPQXPNJ1wQc6I3mbR0R+6lwz6YoILcTw1b+3MG9adJ+/NtLmn2?= =?iso-8859-1?q?gmNJhVYRu7Z8nifL4rifJQ8DmTZooSOPJ1EhljKUq7ZTnFOI1FCIb+3rMyQe?= =?iso-8859-1?q?An5KWBqvFUq/sDGUpGGppW8MMBUUuXuzAU+pUM1Q4bDLtOUeHc1C9ZlwzGu0?= =?iso-8859-1?q?+y4OOq8UuyWmLCyE4GQUsySJNd99kFXd9Xo52KcWC5rTZJQPEPPhAfFLOMqR?= =?iso-8859-1?q?aGdsv+SGOCa734IV1JjoWZUAhG1bIe1EQ1zegVPnkN4+sIqTmL/5PuSBsVjp?= =?iso-8859-1?q?bwLSPyeY3n4EmLzBYbbUbRaHs1BYFtaG4QL1hi91Xv+JfALBwUwXGdnn7SQA?= =?iso-8859-1?q?aJzsK9cMq3B2EV24C9FNStsOC17tCVKgKhRM3sC0Vzx4Kqsqf+gsLnAlyjNb?= =?iso-8859-1?q?X9DPgpJMLSyztYimyCAlhvDci7G6ZOgTNMuiT6O1HaPO60BOdn7ohgSd8cWc?= =?iso-8859-1?q?yXbFf4UdV/lKnHSFoy2ZuU9fFB1vDHhNMbgv+tjHaGPSl8ZJiKhIxKi+MDpO?= =?iso-8859-1?q?dmdgUCDYJ7VwGM+mBAuqXwt4YzxXIWkuyYjB+DNMObZ8WyBjB7++21G0mSCj?= =?iso-8859-1?q?1H9nT5tD0U90BzMS2O6nDv4g024j+2i93PMiZoqgfHIFt5qYovxenWdp182n?= =?iso-8859-1?q?DGpFedV/dD5WEg0xf7Ga26shId4OuPdsbrPLVMT686H1+3GeE2mQxzRzvT2G?= =?iso-8859-1?q?YbRdJjkiqd/JJdFI9PqQdKTdig79PYDyKKyE6uR/xZSV1cdXkhkG0qD1oCiB?= =?iso-8859-1?q?CbGfYukpit8Tl0BXfNM6vUcqIR2YYYqNcvkfbkNRO34TSme40vX4o1QBZaqQ?= =?iso-8859-1?q?9RopwGnVPzoM6HHrGc8k80V/B7Z7ONNmSTNpoLrExzsruusREE+UKKZtfxZ2?= =?iso-8859-1?q?UoQ+dt7/+RshORiVQz+mL2jHzSXbzDra3oHLYNpHxM4wpdxo4hb7FmcGvoA9?= =?iso-8859-1?q?qP5uR4B8wG6mva+cT7BMWon+jgl92iRlux0HRDY4UjRKcHJ7Z9pp4N8bY8RT?= =?iso-8859-1?q?Lm4iCGN0Y8Qg/KJkG8y6B/Ht7dG5RnlYkw/YZyOPRMkm67A3OxZcXqLF3+FK?= =?iso-8859-1?q?k4XSF0s2uM4APetYJJXZEAQukh20EpUpp8OKEvOyMoguPEHELFFMWltQHpW+?= =?iso-8859-1?q?NMwExUmsjGpCVfv/w9TtxPTqZM0PTxfLfQF/GXn9FyMyJUvON9D8qx+4RavB?= =?iso-8859-1?q?W5jwDydSY6Ja08kp7FcrOsTA9GfHqmbpiR7O32goM1+qDUyxIL+PSkw+YTit?= =?iso-8859-1?q?zrQJv5?= 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?VvFJLeHCpl3hkzgaMqoskqs?= =?iso-8859-1?q?XMJjUWJvGofX4+WwyWK+uqt0Ebxy8+wPzVW+zhryNMFrA+oQFvFuj7P4L3PM?= =?iso-8859-1?q?ktpLe9G9nGtoo5+Y5TbPZu3XuvkIlK1xgS/MX14sKccTiDNu9eHlqW48QHqz?= =?iso-8859-1?q?UEq19mC8RqiNSjIirZLIKv/e+cqqzadAE4+eAmlO74LCuUPG/Xs7H6OKgwcU?= =?iso-8859-1?q?QF2Mn2jEERceaVN0E9DSO33L5fdAdguW4I+ZNXN/WCbTgPsFmVyiu2MrmU4k?= =?iso-8859-1?q?/ebMr4kIAihVy0cDbmcL5FHQRAxmMwnNHh9FzSOpmKViTwY20RLuahR0KL+v?= =?iso-8859-1?q?7FAgS3rwZfJQle7cFWdG4t34jNx9rz2tkshro/PwW9Ytljz0IpMy1ZApbhWy?= =?iso-8859-1?q?69GF7GzcTPBGuSxuozTpJrVtDmlQ9NLuf655tPThEjcwuLzLjef9PH6tooom?= =?iso-8859-1?q?oYyd+rDRfC7v+bmRjNxeWVSeWC/CkahzcW8fKszZZrjbSnNOFOsEFGgqEubk?= =?iso-8859-1?q?sP+WFyKYct54V38XpVq0MIx+fZ3jvSwZRIbWRHMNj7G9NStc+XzI6GpFkqdL?= =?iso-8859-1?q?vXbw9i8iWGenHVzo5uRieIKi0eoHy4DxK9GJ3SXgxcE6e7wpR4LlpolxE0dj?= =?iso-8859-1?q?OTXfjX4brLQjqjIJu5aa9PDABIpglGt9CZdrYVH9VO3idk1ZjkYTiSiJfwsa?= =?iso-8859-1?q?JCDGf3rbmoD29GqtK00Vw4jGmenhb018R17PxTUXAbF+jA3ewPJ79Fb1TkgO?= =?iso-8859-1?q?OB0d5YwrxlBUsIbCSgH3RLqGk/ZBv1SDcKDAcBFULi1R6qylNIzPhgIlP3hk?= =?iso-8859-1?q?++DEWQcYXtL7OwB+e+a1BL5942r8Lm5MjZOCQ2OQFjkXzfCDntrI7iOXFWin?= =?iso-8859-1?q?Ja/HXCbteOMfjwDBIcwM44BDynUQvL9qeC+9raUPmtXUPDAwMNi7ppXhAIVf?= =?iso-8859-1?q?/restQJ4SJrmMslYUMEBogXXRCD+a07TP/Sj1c0f6QGpk3YQh8+ByB9RuLGv?= =?iso-8859-1?q?3dFjCUReIHCiR7ZGWSdJ/AEtuLauMZh58BtJWUpaV7zxZtOS9wX8S5Wjgmcf?= =?iso-8859-1?q?GO9/Pe89KilObx2NbIbgQCZacJSyK1+kmwlc8jDGKWOYUMrrz9nC7xRTw7tA?= =?iso-8859-1?q?dqvl1Bj/VwhJIl3vpRpZMJUl7POnUmvWa8Jw4wMv+JbDcCchJusg4u0XHPVD?= =?iso-8859-1?q?VK66WQAq5AOsaqg+9BRbDcpQuQd+2lxi43M8Tj+E58AdzAT4ckJSQ5hA8FJR?= =?iso-8859-1?q?2kXU1gJ9bsIFUBxs10nlA8NN6BjWcmX55iON08c8iT2+CL38KH8EoD75QFk9?= =?iso-8859-1?q?2/+vXumJTGlG00v+OHvG/AJ8bAqu3lm+NYng79xQjDxfxwMoq0/zKIiSNC+L?= =?iso-8859-1?q?gAumd7xLFfQa7hA3mrY35O5e1fxwkOSrsMPZ/vgtJN+xWYe880Vz6H35yJci?= =?iso-8859-1?q?y5jMcwM9yRtUtkG9AmFD8yGYo6X5ieQkc6GKWZx6VodVkBKcZl/jWCZYdlTs?= =?iso-8859-1?q?LXA1p7QF0FqBt7SWCNVWU3nqMiCekZ+kTran6JOg4zB/WSt967Ejs+azrDWp?= =?iso-8859-1?q?2vOEdPU5L8n6o1EuzLmhiJnKGZpVx1AtDBYxTi213Ostyd5B49+SxV2p8mB9?= =?iso-8859-1?q?TxQ3n55U8FBEvFAby0OTxi4FVGLHjIAzaONOKY4PbdehNPvYBLbqpjQ6j5kk?= =?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: da147a44-d56b-49a6-d08d-08dd3979ba8d X-MS-Exchange-CrossTenant-originalarrivaltime: 20 Jan 2025 17:41:53.9779 (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: jrVysPfP8wFrd1S1JT/uHNItUPDQeSnCZYiFnSJcPVRnTqM30Oq7wkMJ+3+AlRmnjkjfq6Zgp86ClYAJOGgx7bxxOXEmZAlrfeaVivNWCFuF2RSazBwIxSwN/BPLBlQF X-MS-Exchange-Transport-CrossTenantHeadersStamped: DBBPR07MB7548 Received-SPF: pass client-ip=80.78.11.82; envelope-from=clement.mathieu--drif@eviden.com; helo=smarthost1.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_MSPIKE_H2=-0.036, 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 IOMMU have to implement iommu_ats_request_translation to support ATS. Devices can use IOMMU_TLB_ENTRY_TRANSLATION_ERROR to check the tlb entries returned by a translation request. We decided not to use the existing translation operation for 2 reasons. First, ATS is designed to translate ranges and not isolated addresses. Second, we need ATS-specific parameters. Signed-off-by: Clement Mathieu--Drif --- include/exec/memory.h | 26 ++++++++++++++++++++++++++ system/memory.c | 21 +++++++++++++++++++++ 2 files changed, 47 insertions(+) diff --git a/include/exec/memory.h b/include/exec/memory.h index 468b003bf1..042d4ea5be 100644 --- a/include/exec/memory.h +++ b/include/exec/memory.h @@ -148,6 +148,10 @@ struct IOMMUTLBEntry { uint32_t pasid; }; +/* Check if an IOMMU TLB entry indicates a translation error */ +#define IOMMU_TLB_ENTRY_TRANSLATION_ERROR(entry) ((((entry)->perm) & IOMMU_RW) \ + == IOMMU_NONE) + /* * Bitmap for different IOMMUNotifier capabilities. Each notifier can * register with one or multiple IOMMU Notifier capability bit(s). @@ -525,6 +529,20 @@ struct IOMMUMemoryRegionClass { * @iommu: the IOMMUMemoryRegion */ int (*num_indexes)(IOMMUMemoryRegion *iommu); + + /** + * @iommu_ats_request_translation: + * This method must be implemented if the IOMMU has ATS enabled + * + * @see pci_ats_request_translation_pasid + */ + ssize_t (*iommu_ats_request_translation)(IOMMUMemoryRegion *iommu, + bool priv_req, bool exec_req, + hwaddr addr, size_t length, + bool no_write, + IOMMUTLBEntry *result, + size_t result_length, + uint32_t *err_count); }; typedef struct RamDiscardListener RamDiscardListener; @@ -1882,6 +1900,14 @@ void memory_region_iommu_replay(IOMMUMemoryRegion *iommu_mr, IOMMUNotifier *n); void memory_region_unregister_iommu_notifier(MemoryRegion *mr, IOMMUNotifier *n); +ssize_t memory_region_iommu_ats_request_translation(IOMMUMemoryRegion *iommu_mr, + bool priv_req, bool exec_req, + hwaddr addr, size_t length, + bool no_write, + IOMMUTLBEntry *result, + size_t result_length, + uint32_t *err_count); + /** * memory_region_iommu_get_attr: return an IOMMU attr if get_attr() is * defined on the IOMMU. diff --git a/system/memory.c b/system/memory.c index b17b5538ff..0a379a72bb 100644 --- a/system/memory.c +++ b/system/memory.c @@ -2011,6 +2011,27 @@ void memory_region_unregister_iommu_notifier(MemoryRegion *mr, memory_region_update_iommu_notify_flags(iommu_mr, NULL); } +ssize_t memory_region_iommu_ats_request_translation(IOMMUMemoryRegion *iommu_mr, + bool priv_req, + bool exec_req, + hwaddr addr, size_t length, + bool no_write, + IOMMUTLBEntry *result, + size_t result_length, + uint32_t *err_count) +{ + IOMMUMemoryRegionClass *imrc = + memory_region_get_iommu_class_nocheck(iommu_mr); + + if (!imrc->iommu_ats_request_translation) { + return -ENODEV; + } + + return imrc->iommu_ats_request_translation(iommu_mr, priv_req, exec_req, + addr, length, no_write, result, + result_length, err_count); +} + void memory_region_notify_iommu_one(IOMMUNotifier *notifier, const IOMMUTLBEvent *event) {