Message ID | 20250227105339.388598-1-clement.mathieu--drif@eviden.com (mailing list archive) |
---|---|
Headers | show
Return-Path: <qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org> 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 6F807C021BE for <qemu-devel@archiver.kernel.org>; Thu, 27 Feb 2025 10:56:41 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from <qemu-devel-bounces@nongnu.org>) id 1tnbXV-0004Pr-LY; Thu, 27 Feb 2025 05:54:49 -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 <clement.mathieu--drif@eviden.com>) id 1tnbXT-0004Il-0Y for qemu-devel@nongnu.org; Thu, 27 Feb 2025 05:54:47 -0500 Received: from smarthost4.eviden.com ([80.78.11.85]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from <clement.mathieu--drif@eviden.com>) id 1tnbXP-0005o1-JI for qemu-devel@nongnu.org; Thu, 27 Feb 2025 05:54:46 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=eviden.com; i=@eviden.com; q=dns/txt; s=mail; t=1740653683; x=1772189683; h=from:to:cc:subject:date:message-id:content-id: content-transfer-encoding:mime-version; bh=wh3cMx39alzvzvaTyXuf/9jl/rTjE8FC/UkLd7YTZlI=; b=CqA1SNLpVN+Vj50dLZS+tvepUd7Vsk5aqSsRrhfKkVXFHG3X/gA6NOt1 kpBTOWS184zjeIsARMepjfu7f+MgEIbnIetK4mgtIamH8Jm512eyLa+7V H+xKh5HFph4xSol3ckpeVxSfhRUBf7GbAEZr/FeseL6OB1myxyCqh1DpX O6H317M6N+Ps+DBmRBjHaNnWRLluDbnVk24SE1qh9tPz+VfA9xn7OV34h kJNTeyj6Y/kBM83QOrJcHKWOMuoHgJjsOxxyomQpF42zK6h4AFr1GHOgp 6U9LI+yp4TBWVGd4DhBF4LW0ojELJteGGIoPncEafG8H/4wk+7WpCqZ3x A==; X-CSE-ConnectionGUID: dx/fXTreTnCDL3GztpNzeA== X-CSE-MsgGUID: Opx2go92SFu4YZzn/6a4PA== X-IronPort-AV: E=Sophos;i="6.13,319,1732575600"; d="scan'208";a="33331820" X-MGA-submission: MDHZj8sILpgMqet07EYacSfzhnmUyTjVLmxbLGG4Slu6wOMM2zLiejGWUilWtp7MXafKX9uyfvtxNhp0kb4LJ+sRzNgaPd2e1eFINir5S/LU5KCPzVUzyhbzFLqD0A3pOkrbeHTYpnHRgFFuSgh5vWnuPAqtbfD7Zq8JwKruVmvqeA== Received: from mail-db5eur02lp2112.outbound.protection.outlook.com (HELO EUR02-DB5-obe.outbound.protection.outlook.com) ([104.47.11.112]) by smarthost4.eviden.com with ESMTP/TLS/TLS_AES_256_GCM_SHA384; 27 Feb 2025 11:54:39 +0100 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=sN8iKrUNnyzh0lN5ICR60F30gkAFbjnEjM0Lynq1z/dlEc2PQeaSvlOtdvhoCIZicprkxcVGqrdaJq7h0SHDZ4IEyGFg8u4/oWtLyPgs1eIaXK52UReLXfI6mPv6EV7uq7pfc7kw5U7vwIgsHCacgJYa5NvaITsbHuieNR9rp0yoH9U5d3rTouT/kpYng7CW8KJGHul9cGN8wev0DxzZDC+4U5R0M9+2VwCZq22E2cKdaQgc9phnYAYGc37c7M09xIByg3Klq4bHKaR0gShbA9oYk126LE2gTOax7voIGRwrZtiN2R5XOAPdvDPAaPGhffLg3Bx773imvXI6RZlb5Q== 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=wh3cMx39alzvzvaTyXuf/9jl/rTjE8FC/UkLd7YTZlI=; b=m0BhmqkYsodHHxyu+eW0jUynBJDdXtj1yn2k4IdPqCSMpE6Rdh5IPOdpa31DAULxYPlLGThqjZN7ZnOnLB0Vw5f7sB6xgG8x9pOP3fbggX1dnsYx10yQe5+AtnOIyLsahl0rR9il/+Nkh8HvLQocFrqKFSuR5hZH0RlMv4G3GmhNRb7wAWvOuX+D25mjTTplTuje0S0Qk5dw+zgLsuvyqior6DQexvQAm4ciEaNrVnAhBGa0eO2icXKBaT2RkOHArS06959L/5dwjGG4Y61hcsPxSqSEYwToCEG38cIzwOnSF9UR2w663oyjvpXXyz+PcYhhhU9fsLIry80zKpusaQ== 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=wh3cMx39alzvzvaTyXuf/9jl/rTjE8FC/UkLd7YTZlI=; b=qQPewuAx/Lu3JXGgrrMwkGmniaohmUFJX4qcOM9HqNjv7sGYk00zrVQ4kteJGoqMxOXPmEE2NUc4V14buMA2JxssX2+pwf++h19loIivNz0k/VmDi6kk/OikpbTbxeDsloXD3X0x+cA5hiR53H+haGitU0lPhgchW5Gcr8F02baFCMEA3EQDcAW1Vll/dsrUtx7VSdDUwEpABfRj6ZPmfzMKcEAO42ZtojJBqsoPw2KX91JJ2p/7qv5Dk843sJx6MwIsoS6UQYcX/i5lBu6r7LWQ4RqVwB/3nzKTxAP+dFTGvgB5uecuLCKOfyP7noxK4NLckafh7DgUNT78YJheTw== Received: from AM8PR07MB7602.eurprd07.prod.outlook.com (2603:10a6:20b:24b::7) by VI1PR07MB9421.eurprd07.prod.outlook.com (2603:10a6:800:1c0::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8466.19; Thu, 27 Feb 2025 10:54:37 +0000 Received: from AM8PR07MB7602.eurprd07.prod.outlook.com ([fe80::fbd7:ca71:b636:6f9d]) by AM8PR07MB7602.eurprd07.prod.outlook.com ([fe80::fbd7:ca71:b636:6f9d%7]) with mapi id 15.20.8445.017; Thu, 27 Feb 2025 10:54:37 +0000 From: CLEMENT MATHIEU--DRIF <clement.mathieu--drif@eviden.com> To: "qemu-devel@nongnu.org" <qemu-devel@nongnu.org> CC: "jasowang@redhat.com" <jasowang@redhat.com>, "zhenzhong.duan@intel.com" <zhenzhong.duan@intel.com>, "kevin.tian@intel.com" <kevin.tian@intel.com>, "yi.l.liu@intel.com" <yi.l.liu@intel.com>, "joao.m.martins@oracle.com" <joao.m.martins@oracle.com>, "peterx@redhat.com" <peterx@redhat.com>, "mst@redhat.com" <mst@redhat.com>, "tjeznach@rivosinc.com" <tjeznach@rivosinc.com>, "minwoo.im@samsung.com" <minwoo.im@samsung.com>, CLEMENT MATHIEU--DRIF <clement.mathieu--drif@eviden.com> Subject: [PATCH v4 00/19] intel_iommu: Add ATS support Thread-Topic: [PATCH v4 00/19] intel_iommu: Add ATS support Thread-Index: AQHbiQX+B9MRfZMoBUSOGmiWGTEfOQ== Date: Thu, 27 Feb 2025 10:54:36 +0000 Message-ID: <20250227105339.388598-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_|VI1PR07MB9421:EE_ x-ms-office365-filtering-correlation-id: 6462250c-3c78-4273-1cc3-08dd571d20aa x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; ARA:13230040|366016|376014|7416014|1800799024|38070700018; x-microsoft-antispam-message-info: =?utf-8?q?yJbOvtNpYGuytlmih2OQ9d3CEueNZ9L?= =?utf-8?q?pol2KKj6Fgjv5xOjYiyV28LrffJJKfRx0snhuBGwb6xWNQujB3U7oGUGko0f9Mrdx?= =?utf-8?q?AD6AWUJ6YnFxMdho/h0F8uZWriQtzH47Dy4HzMaoJ/N0dY6Ad8Fnuc2/RbV0FDJ69?= =?utf-8?q?k6xEIHGjMo3hw2mnI57n9HZHYM487NutE+J0RQ3T1fteFs3+oXwALPom3kEg7LxIi?= =?utf-8?q?uYgHyV7HVBD/3lsvUI4cDNxbh3/I1YoiEaadqUkt2yWPewq2Nf2RE0EFBBQRwlmb5?= =?utf-8?q?Zp54VJfeDe1UgeHCoaDAI/uahReJ/XJYohObnY1fBBjP+rQ+7x7suC0nLJlb6M5JI?= =?utf-8?q?zvj9r3bOiokW6j4kXF4b7NdFmY+6xPuRwYZKPy2s/ZriMEOaN8DkH9mDeef3RNR+R?= =?utf-8?q?6oYI1z/98fvpfhFuslypwwHoDKokanZWyq//VkowLgE9jBoOApEY76Jfo4g7dlHgO?= =?utf-8?q?+nhhkX0x1JLCxkiClkv0Bra7MTE1li1UECUbi9OtfCekhL3bIVwqrKkXmYN2JQ/MD?= =?utf-8?q?Pfr5Kz2SLBMrCXUPbJrhZrEbZMCB6vy4RnWHH1nHjLr+nr9A2VC/OXoF7cffk9wnB?= =?utf-8?q?sy7lc5zAMR1zpL7RFo2R3vJP64yLxa0YDJsGeogfcOrJsmNBMWeSSaZRKMHjI92eI?= =?utf-8?q?kn9SPbRBQk9IKYUgmccCUTH1undsvTYFMWTV7JgTfT9ywOtDQKj7wxxqlsRubXRhV?= =?utf-8?q?0AKHPNdp4prRhWVfmvukMiAZIjFY/72KcxmQPdq/7b6yPfSIEZsVtXFnkA+y16bIL?= =?utf-8?q?GFfhT1qY46fsnjUdolkdhLyigwuVAWTnLzcv1+lhJzyiEpryHVsa6bEu06Z4l83/x?= =?utf-8?q?zfwHOUiU+UX6o/Qit2gopZuLZqXxYP8csHw406iPzqfEXJFNmjg22UPYJFP2CBzCw?= =?utf-8?q?etIrRiJhAma1MejJ3beNcW17NygTQRHV0LGWNLem6D2EZ3WNjiuO2SE4oRKhJ/RVE?= =?utf-8?q?c9viebv9+9YuV5pimOHb9vQ7xzxOGjuRzc81qK4ijU3lmPpGXjDWCRqJDfYdXZF67?= =?utf-8?q?MfisL7D8oPYO0rKIsLBPYicLo/u9TGgXoVAd2Xw5KTGkPLCiHIr6AhOWS/lkmeZLh?= =?utf-8?q?MakcAnpF6mqa4aldkAqZastA1fAEs5O2Al8d91FohlSNaW7LJo43uZbdniiei7amg?= =?utf-8?q?59Zypo8I226con1mqOhUlCdaCHaxda0Q2bETWJmOQsxKBRTeFP3l6VCKH9UG7hytV?= =?utf-8?q?JY0PaoD5BENEgqM3XVoQZBEyrX8ekh+4x27ysAYi8yx6FKWIFm8iJBi8HJUIf21wc?= =?utf-8?q?5eFllK7McHTIZf9ng8rO8gpkSxrNgfoHsfY5sNYfH7bdaVnVitEVwWAZLAKOqDsof?= =?utf-8?q?8q92dwHVGBYf6ktJ+UwY1u5ogkyoahxiRjutdYUMncm/d9HKZxmbsqpWrJTaWeGlG?= =?utf-8?q?4zsEpTe/+nu?= 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)(366016)(376014)(7416014)(1800799024)(38070700018); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?utf-8?q?TfSpYcx4dJ6GL1xkeS5MuRY5V9xa?= =?utf-8?q?ENPe/D7bU0jJttRuWiNbE7NGk26S0fN1qOIesR7MnyEk291YlET7xyeHfKn6JliJ2?= =?utf-8?q?Q6RD222tiyl9l515O1js14Xp6GHFYG/EMM/eYgUl90C6ZIG7G22uQw1BfhKXQZ9t3?= =?utf-8?q?e+p8X98HD3WSRMqBWTOlgMEHKqR/QqKbXy6cfzWSdlc2RJHt461reTtypv3Rmz6KD?= =?utf-8?q?NU/1Gr8IU2c0x1s/y4m5qA/PlSHDPj5SY8lKDoqOeS/EBVwM7rdxIqsr9bZ+R2AGH?= =?utf-8?q?g/165TP+snDtX9i9FLN9ZuvTMkzGaJwQS08GnxQpnBLlrEYwTzKp2BUHSWBql2sVo?= =?utf-8?q?wD1VulpJP++sXjSoDF8ZgWuqKPA0/WYaTXREYngspyiV5hlwEHjjaxnd894sD+A3C?= =?utf-8?q?VRTsxIwjMvRulRviSe/h6Lk5isWe8364Z6kqdNv5MmgJPtlk9k7MJmpqBqiRq00Gg?= =?utf-8?q?bVAZbHc9YL7a0fzOj609Cd/AADm0uZOcIk0vGFqrR0QHCGYscg5vjJjgdAaIYTK6B?= =?utf-8?q?SakGd6H3je4kDDHKYsn5Vr3ABUik6mNcQseD7SMAx1jBeYgVD0mtXXxvCU+o0zbjw?= =?utf-8?q?Sb3Ux8Wmy/58m1RdP92FbXVaNIgnISDHQw0b9OIsmMgHgYkV3dtmxSQ48b/6Q8Ikc?= =?utf-8?q?lpoQwnBNXv7Wv48S7RLdJIP4cs1zCos8OwlGKz2KcKrC4eclSuhHYd9SHigzfD3v+?= =?utf-8?q?p2Nhh6XNh4M3gljB0iqo4Suv4uSA5Qn+YuTd3U4BVQFb+GWi6vWbHPbWKta9lUJgB?= =?utf-8?q?LRsqC6TQ3iQUVVy3g7602oR+qWRzWUhSxGPI67PdNIf1pyGhRNPCpyv/YsuDF/sHd?= =?utf-8?q?iYeWL2i1ZXtLQx1g/hCOv7k65FbSkQvS9glnFPxctcvgZBaeVzX6g/XZgYQyRgx63?= =?utf-8?q?KGlwuhYNn/ECOYRqCtTP2COl5aXeXybMgIOZXAcR4gBqGZT4NIeqqKpvIJ63fK4/e?= =?utf-8?q?E6ta6IyfuJbf6rJ2t9uv2KCvCmrHfxNb8QfhcWW8YddV5+Tcy7S6G46UrQvH/WrFY?= =?utf-8?q?r4yvvjHqrtDZEzxxSAQgFK2cOioSwsWU9z+Q1C0eDnUs9RBWB4xlYZLr39sb/sOgF?= =?utf-8?q?Jv7FGKGhn7LOd1zw/PXLmY4wVAxBNjd72EveboyGsgN2tItW3NGOKLVEvmzRGwMon?= =?utf-8?q?iwcpik/gpK9wEJNQMYgbRHezf0j8SM7FVogR3CNn855L7BXbUMMOM15oP5j2iA0P4?= =?utf-8?q?uGB2Grz8zOff6UeyFMC+7t3J+iIkClj6v7BWJjnwlHZajZyHUE31R0leig3Rhx6en?= =?utf-8?q?50ifPOmb3pbvctKnDDQ+CjQfVLP/BrrGtxsP7IXttPwtOEi8RDeGilC7ABzVHgsue?= =?utf-8?q?2FpCr6NQZryvT+khpvohIa/IuCQt34Nb6DpjbBGkTRq+1/WWB3tRlowRIwoq1DNf/?= =?utf-8?q?zVuShPdBePszmNGNM4sx3pgoHTTovO9kFaEtS526oTcYOXuV6IUUBds3Ukkf/BbX2?= =?utf-8?q?KUHEAgq6c3fd8+K1xjW3jXN45pB2XO5PnsM6tmarWZUFbV/sWB3H4YC17e7jFo65P?= =?utf-8?q?bYNH7ttIZemI+WUu8uWc8MMYQ89Dywb4ZDXkPPwMvV4RrFGuLjsrekI=3D?= Content-Type: text/plain; charset="utf-8" Content-ID: <808BB05992CFD3438737AAFA1C7AEF4F@eurprd07.prod.outlook.com> Content-Transfer-Encoding: base64 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: 6462250c-3c78-4273-1cc3-08dd571d20aa X-MS-Exchange-CrossTenant-originalarrivaltime: 27 Feb 2025 10:54:36.9571 (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: HwI4pD7flaRCwvOiU0+bzpkUxT2jQDwnZUNmSBlG8R+6gTHr8+ev0wrZRp6/5QaKU+iboBXIlkGoH4L6d1Ml5MFlueJd5IWCOORl76bflQIKA2DVZ8ir1aIe82O/o//C X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR07MB9421 Received-SPF: pass client-ip=80.78.11.85; envelope-from=clement.mathieu--drif@eviden.com; helo=smarthost4.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_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_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: <qemu-devel.nongnu.org> List-Unsubscribe: <https://lists.nongnu.org/mailman/options/qemu-devel>, <mailto:qemu-devel-request@nongnu.org?subject=unsubscribe> List-Archive: <https://lists.nongnu.org/archive/html/qemu-devel> List-Post: <mailto:qemu-devel@nongnu.org> List-Help: <mailto:qemu-devel-request@nongnu.org?subject=help> List-Subscribe: <https://lists.nongnu.org/mailman/listinfo/qemu-devel>, <mailto:qemu-devel-request@nongnu.org?subject=subscribe> Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org |
Series |
intel_iommu: Add ATS support
|
expand
|
From: Clement Mathieu--Drif <clement.mathieu--drif@eviden.com> This patch set belongs to a list of series that add SVM support for VT-d. Here we focus on implementing ATS support in the IOMMU and adding a PCI-level API to be used by virtual devices. This work is based on the VT-d specification version 4.1 (March 2023). Here is a link to our GitHub repository where you can find the following elements: - Qemu with all the patches for SVM - ATS - PRI - Device IOTLB invalidations - Requests with already pre-translated addresses - A demo device - A simple driver for the demo device - A userspace program (for testing and demonstration purposes) https://github.com/BullSequana/Qemu-in-guest-SVM-demo =============== Context and design notes '''''''''''''''''''''''' The main purpose of this work is to enable vVT-d users to make translation requests to the vIOMMU as described in the PCIe Gen 5.0 specification (section 10). Moreover, we aim to implement a PCI/Memory-level framework that could be used by other vIOMMUs to implement the same features. What is ATS? '''''''''''' ATS (Address Translation Service) is a PCIe-level protocol that enables PCIe devices to query an IOMMU for virtual to physical address translations in a specific address space (such as a userland process address space). When a device receives translation responses from an IOMMU, it may decide to store them in an internal cache, often known as "ATC" (Address Translation Cache) or "Device IOTLB". To keep page tables and caches consistent, the IOMMU is allowed to send asynchronous invalidation requests to its client devices. To avoid introducing an unnecessarily complex API, this series simply exposes 3 functions. The first 2 are a pair of setup functions that are called to install and remove the ATS invalidation callback during the initialization phase of a process. The third one will be used to request translations. The callback setup API introduced in this series calls the IOMMUNotifier API under the hood. API design '''''''''' - int pci_register_iommu_tlb_event_notifier(PCIDevice *dev, uint32_t pasid, IOMMUNotifier *n); - int pci_unregister_iommu_tlb_event_notifier(PCIDevice *dev, uint32_t pasid, IOMMUNotifier *n); - ssize_t pci_ats_request_translation_pasid(PCIDevice *dev, uint32_t pasid, bool priv_req, bool exec_req, hwaddr addr, size_t length, bool no_write, IOMMUTLBEntry *result, size_t result_length, uint32_t *err_count); Although device developers may want to implement custom ATC for testing or performance measurement purposes, we provide a generic implementation as a utility module. Overview '''''''' Here are the interactions between an ATS-capable PCIe device and the vVT-d: ┌───────────┐ ┌────────────┐ │Device │ │PCI / Memory│ │ │ pci_ats_request_│abstraction │ iommu_ats_ │ │ translation_ │ │ request_ │┌─────────┐│ pasid │ AS lookup │ translation ││Logic ││────────────────>│╶╶╶╶╶╶╶╶╶╶╶>│──────┐ │└─────────┘│<────────────────│<╶╶╶╶╶╶╶╶╶╶╶│<──┐ │ │┌─────────┐│ │ │ │ │ ││inv func ││<───────┐ │ │ │ │ │└─────────┘│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ∨ │ │ │ │ │ │ │┌─────────┐│ │ │ │ │ │ ││ATC ││ │ │ │ │ │ │└─────────┘│ │ │ │ │ │ └───────────┘ │ └────────────┘ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ┌────────────────────┼──┼─┐ │ │vVT-d │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ∨ │ │ │┌───────────────────────┐│ │ ││Translation logic ││ │ │└───────────────────────┘│ └────┼────────────┐ │ │ │ │ │┌───────────────────────┐│ ││ Invalidation queue ││ │└───────────∧───────────┘│ └────────────┼────────────┘ │ │ │ ┌────────────────────────┐ │Kernel driver │ │ │ └────────────────────────┘ v4 - Fix compilation issue on 32bit hosts v3 - Rebase onto master - Fix compilation issue in non-debug mode (Michael) v2 - Rebase on master after merge of Zhenzhong's FLTS series - Rename the series as it is now based on master. - Changes after review by Michael: - Split long lines in memory.h - Change patch encoding (no UTF-8) - Changes after review by Zhenzhong: - Rework "Fill the PASID field when creating an IOMMUTLBEntry" Clement Mathieu--Drif (19): memory: Add permissions in IOMMUAccessFlags intel_iommu: Declare supported PASID size memory: Allow to store the PASID in IOMMUTLBEntry intel_iommu: Fill the PASID field when creating an IOMMUTLBEntry pcie: Add helper to declare PASID capability for a pcie device pcie: Helper functions to check if PASID is enabled pcie: Helper function to check if ATS is enabled pci: Cache the bus mastering status in the device pci: Add IOMMU operations to get memory regions with PASID intel_iommu: Implement the get_memory_region_pasid iommu operation memory: Store user data pointer in the IOMMU notifiers pci: Add a pci-level initialization function for iommu notifiers atc: Generic ATC that can be used by PCIe devices that support SVM atc: Add unit tests memory: Add an API for ATS support pci: Add a pci-level API for ATS intel_iommu: Set address mask when a translation fails and adjust W permission intel_iommu: Return page walk level even when the translation fails intel_iommu: Add support for ATS hw/i386/intel_iommu.c | 125 ++++++-- hw/i386/intel_iommu_internal.h | 2 + hw/pci/pci.c | 111 ++++++- hw/pci/pcie.c | 42 +++ include/exec/memory.h | 51 +++- include/hw/i386/intel_iommu.h | 2 +- include/hw/pci/pci.h | 83 ++++++ include/hw/pci/pci_device.h | 1 + include/hw/pci/pcie.h | 9 +- include/hw/pci/pcie_regs.h | 5 + system/memory.c | 21 ++ tests/unit/meson.build | 1 + tests/unit/test-atc.c | 527 +++++++++++++++++++++++++++++++++ util/atc.c | 211 +++++++++++++ util/atc.h | 117 ++++++++ util/meson.build | 1 + 16 files changed, 1278 insertions(+), 31 deletions(-) create mode 100644 tests/unit/test-atc.c create mode 100644 util/atc.c create mode 100644 util/atc.h