From patchwork Thu May 30 12:24:58 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: CLEMENT MATHIEU--DRIF X-Patchwork-Id: 13680330 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 3CB40C25B74 for ; Thu, 30 May 2024 12:25:17 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sCeqG-0006yO-MI; Thu, 30 May 2024 08:25:13 -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 1sCeqD-0006xJ-83 for qemu-devel@nongnu.org; Thu, 30 May 2024 08:25:09 -0400 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 1sCeq8-00060L-MY for qemu-devel@nongnu.org; Thu, 30 May 2024 08:25:07 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=eviden.com; i=@eviden.com; q=dns/txt; s=mail; t=1717071905; x=1748607905; h=from:to:cc:subject:date:message-id:content-id: content-transfer-encoding:mime-version; bh=WLAejmNexOYMWdJQoLHsWEnPJXI4g56V43scPYPOj6E=; b=fjlW/29PFflcede8pJKMRPRQcvePa/AZBuvoHnWSoUoTj5g0OsVRmuIM jlx2t/BpnxEukGjHvdAxBA5fjUnEUI7pu9/1C2XSdUlrqTXiL4Kt7Cr2f gFBmevHCJiuDFzBQKtqaoRQoezBYCXSs4bx4ECEi8f6v8yOVEXznzDpnn qvECzO6bHclcLZBBXyXSlfTB0nRdc0VyW9z8E8PvwCdb4ur9mDvmKES3M EiTEvA11/hn2KEGkGqKCCo+uzb/dA74TriwJq0f9qyYYKocYh8/TWw+qd uHw1RAFIBAjbazu7h+izDN4saobmyRuRj1tDGWNGm/7Fga3d2lzAbrpNT A==; X-IronPort-AV: E=Sophos;i="6.08,201,1712613600"; d="scan'208";a="13576847" X-MGA-submission: MDG6jPA2z/fHIGw5XRcsUoKjZ+1SptpVvxIwKm3+tDabB6/ooLWQT3YqFrILUTcNupiRYzDp7/gm291bRvp136BiWDJomBgnWOvxfDTb3Af3sBCZ4GFlocG4Xo+4Mzi+nJuJvNzee4S9WRbYWrZ86Jt+1p3ZjRlKbCoGprwwKr5aIw== Received: from mail-he1eur01lp2050.outbound.protection.outlook.com (HELO EUR01-HE1-obe.outbound.protection.outlook.com) ([104.47.0.50]) by smarthost1.eviden.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 30 May 2024 14:25:00 +0200 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=IcgtkSN758MMddZ8yKGbvibKQsPT3o5/zpSjP/KBWVIPjTY2qw3+r+Hqd6MkHGnHv7LdwyIdVtJNpvhCrCyciB4iHWZ0hGw4VDkbKRnwaYzZCsN/Gjaui1lLXCci5I+jzo2FJChJ2ISlVo4FASNOPdi2eUg4Am10jpI3JT6/f3ZHBmX3Gq0IWZMkKmAQCS6+KcKeV+o7OIG3X6K+IOKbV39/SgRXVTMno0hOkrqfb0+u1IoqRVV9OTjaSHeJjuHjCEKGPJX/qHWXidInsng9PHQaFhEOgAuyi7KpJ/KCVaXP5R6NkCK3IHREMz3bDxYAEbfj8Zj+qqQILO6fRKShhQ== 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=WLAejmNexOYMWdJQoLHsWEnPJXI4g56V43scPYPOj6E=; b=XPrtNedTNwNcWKP2G9g7weTXLVeQXd2jRAggUzYB7A4hd8a/cn5t9lWkcH2QNHksXHI9yL1NQiwE7szeUgS5hnHal8ULhlOYoTbZqIBBNdFAE4glSaqVPb0aR4uLbLDvUEoEH/1GrGZ8JzfW8YKcXQW+2YRjhWH8Qnvz6j05+hTVU5iQ2L/FKADDDRbZHrT1+xwfG6fzIdH69fOEmbMgQsHKuVke3YC3hscuqtxXvmu96EJOHA6tiXZ/1ANnQ1nQa0kQErDbkhu4Ukpy8CmJrsV2KwHi3kZATWrQmv8aI1mrJTbX7j4s0eblGeudX7OrisOHc0TnfY8EtPKuiv87mw== 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 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:24:58 +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:24:58 +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" , CLEMENT MATHIEU--DRIF Subject: [PATCH v1 0/8] PRI support for VT-d Thread-Topic: [PATCH v1 0/8] PRI support for VT-d Thread-Index: AQHasoxiO6+dgN7t50iro7G2HPLUFg== Date: Thu, 30 May 2024 12:24:58 +0000 Message-ID: <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: d41d19ce-2cab-4249-8a22-08dc80a3853e 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?q?QCKG2iRMpUIB6h2F2trlxf/eCshGGN4?= =?utf-8?q?RMnyQaIXDK3MWTN0LNzu65UtN7TvyPmsPBoLN1qgHrFLdds4W3bTy5S1J7ECApYob?= =?utf-8?q?eb0tuE2/Npk3kxce1Ddxf7XX0rUwldrkshiSau0Lzv1fJ5rR5737OjWlf5Q8N8S8n?= =?utf-8?q?xWcW88bM0hL3MBvMX3PXkvO4fNJDvtluemx8DCiZbwrCZoSbgf4dbZ+Bt23xQwxHb?= =?utf-8?q?hWOOA4FWZrh3Im73VMO3jgOqLu3xgoF+Cv71QB9VZBZQPXnz/fmz36Ful+PV2oNK5?= =?utf-8?q?SzCoMa3dyvbMMnFv7K42ZN454L6v26kClZnUF/IJVByJiycYzPpvrcGmtXO9WPF2N?= =?utf-8?q?MX1LJkzgTYtFCNunXC72ErrVcml/H5Gkp7vlfjE3n5ybHg4c28gGjEjLfOXJQZE+5?= =?utf-8?q?6w4T8NJVJE8LyU54zlXEDVA+CYy40N5l+8i8dQmPrhA+5/sDyUX7L+/UHS+gQgYfc?= =?utf-8?q?c19DdIPVXinKvweOq95AfU0xYxZ8rK1KtbBW5A+OURXc1gSn3Ba/zM9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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?q?gXJGch85v84ufJVKpheTtZobWe15?= =?utf-8?q?5jxSENMB4OYbBJrKE76tp9AftfhogrKGE0YXiUpU5MOD9tSc2IntwKpBmAVnUKDHm?= =?utf-8?q?J3sp+KKR7QlNwSa8jMYZ1sEeHYlFr+Exj5/yWGysKPszokKHWckUAG1TaytXpzUhQ?= =?utf-8?q?G5m5V6NdDEt1DJ1UT4FryBI07tyq5mrP2x13nZxlSO1f87aJ4zbERSoXfjRgadMIF?= =?utf-8?q?JHKn0/ElxeNw+6zZTWTSXGF5/4Dh5lCvCp/aJyDXLLaI0tJuLoDILu+xiCKEvaLuP?= =?utf-8?q?5Ue1FXBKfG/dPVBWE71NKzVfggNrVke2oUWPIjrMK0sLuTzP6yknkm7ABhTmv8YCJ?= =?utf-8?q?gi2OrlnrutL53MJcmEMVjCgcW2KUGUn680zTRLQON5UtRifvMwGfMbtjil1c4mlqK?= =?utf-8?q?nY3bX0cYqZ2yFvainUkdeyy9wMCSOrK+2u+hroVjTafcKf5jh0bkuC5MP9tcWYsgG?= =?utf-8?q?+9yqyjCqZrO9hGAa8ddbMS6p8xueIEXO5850nCIiatmt1OVPX7yoWhOO8o0J+bBao?= =?utf-8?q?OBxmZ8J1vM5mk8ppzh0W4V18w5UxbYEkHcz6C3EiUI9T6DGlaQw2VYsOq66oXsGzS?= =?utf-8?q?HChlay5dIA9q2S/dB1p3gV/I+E3PVpWT/an0ArmHJIhSq8QPz20TXTYfho3B2A5dx?= =?utf-8?q?FEqimCaqTeddcIMxGu3sKQZrZcYR07CVoxWXAP8TX0vzQuRNsm2jY0XfDjMIn8r4V?= =?utf-8?q?FehCNUluxTdcy9uTA5rYNUhnjDdsket51qnp+upENy2K86WjV35OKfAaXW4L29mLQ?= =?utf-8?q?mr4m0b0q6ab8XeRy8f6njpgryZDIYbNRFlb61S1VDTiTfAMU3bkGkPp+Blww6ttgk?= =?utf-8?q?LRmY14muGkie6Ma5QiAEFFLMM0far1mPa6E+pVAlOjZSV1H6diKF5lI4dxotMuStF?= =?utf-8?q?l/d3GAsT4i9BPjvI5ewxMp1QFpS/c3vb/THdSipGs+LUppwXLzXaUrLQcS+kro/CG?= =?utf-8?q?J3/C8mvUaGmIFgNZnlEtRZj1Rj5tWTNjOY2Gwx8GGROgZFTcsJpVv9APHnSgQX84L?= =?utf-8?q?zbQpBzIK6CoSzipXAirv108hhlhEjRy7CjKan7O3KpDY5089ydX15OWQSIakJBmKE?= =?utf-8?q?iDb1otbqwdd5qiVfBKVggqc2JWWpH+R5nPJTTE+RZFrzZdR+2gQu/9A3M3uGwyOOa?= =?utf-8?q?x8uFKA++0fzYiZtXEg3UMKAp9B0M9fBWNHXxExMgL/sV5eGHoEfZM4Orpo1M7HQez?= =?utf-8?q?mFtziUKnHHBMFa2qSV8kVYHpAC4p0fimiQad2cC9k67zEeg2nFOsjraAKN44Hn+dc?= =?utf-8?q?39UyI8HGZgUJA1TK3TfcFP6RPuaG8mzLFjlNXms8Zswo1Yd0m5lMLSVVwgsBW/s5C?= =?utf-8?q?LFoO0uxojNeBxwVl+WTV2hob4RzTVoJ2MPwZhow9NGuR8K5uBDhy+lH+HS5Z4DunB?= =?utf-8?q?sqH6iyeY+CB7LTf8881qXNOoNAp0FXV6DYi8DpXe/AhUHixPxy0LRhjo2LoDGSV6M?= =?utf-8?q?c0NAi9VawruksJ2ni8rLrWabHtigjHbEZbvCeeuJStXFx/YdA1KEehwA+gxP86+U5?= =?utf-8?q?bzHd6Di6wVcNOtFnqPYhmoNM2lXbMpcs2K015ycludvZUPDXHMiEz2w=3D?= Content-ID: <055F9B6B1CAFB346B3E96C74191F1052@eurprd07.prod.outlook.com> 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: d41d19ce-2cab-4249-8a22-08dc80a3853e X-MS-Exchange-CrossTenant-originalarrivaltime: 30 May 2024 12:24:58.2961 (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: aKa54u4iD1gwyXyfRP0dM8jAiuqKYAn6CbUNqUFtTWW00050fJC1NBY9NYSHgheNesgviYBe4JK2dUBiawv0fzASXARJRBtSoj6St+doSw/2ZMb9CIm2KhGyaMBVVAWf X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR07MB8069 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, 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+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org This series belongs to a list of series that add SVM support for VT-d. Here we focus on the implementation of PRI support in the IOMMU and on a PCI-level API for PRI 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 a GitHub repository where you can find the following elements : - Qemu with all the patches for SVM - ATS - PRI - Device IOTLB invalidations - Requests with already 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 Clément Mathieu--Drif (8): pcie: add a helper to declare the PRI capability for a pcie device pcie: helper functions to check to check if PRI is enabled pcie: add a way to get the outstanding page request allocation (pri) from the config space. pci: declare structures and IOMMU operation for PRI pci: add a PCI-level API for PRI intel_iommu: declare PRI constants and structures intel_iommu: declare registers for PRI intel_iommu: add PRI operations support hw/i386/intel_iommu.c | 302 +++++++++++++++++++++++++++++++++ hw/i386/intel_iommu_internal.h | 54 +++++- hw/pci/pci.c | 37 ++++ hw/pci/pcie.c | 42 +++++ include/exec/memory.h | 65 +++++++ include/hw/pci/pci.h | 45 +++++ include/hw/pci/pci_bus.h | 1 + include/hw/pci/pcie.h | 7 +- include/hw/pci/pcie_regs.h | 4 + system/memory.c | 49 ++++++ 10 files changed, 604 insertions(+), 2 deletions(-)