From nobody Mon Nov 25 05:23:36 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=1717394655; cv=pass; d=zohomail.com; s=zohoarc; b=F2D0PSunjoddfc5zex+m6Vpys2QItQXdEI0vQ+deNKHZdjj21v4yJTFHu6vpm4+dcIV8l/XnjnyBxzIjjTZVDQEYk1Bb+7PmMZSrcbMimcKhSihVQVEsm7qd3ZxuhNS90XZStv+rH8taN5YQGTXus5FVNLuXf8V0eUQCw/ZrdMI= ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1717394655; 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=tdlem/PBmSzX9se9OAGRAEu7sN2rybtDsPNqgzPwTAQ=; b=SPrDtJlOXyp0YurpTXTyO4a+asqGFap248UKVtQx3O+bxgG+TI1ZN22REUSok2U0rIkXIvbf7bFgZGJA4IMhpZQ4BzPaGgQT5wOG8NPV35jgMhqUaWPjxIWqKWMkKZlidfvsMGuHD4ljNz6Ac1dyjZGRVNN6hpItCXJWMSgDBYE= 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 1717394655986430.1247680580242; Sun, 2 Jun 2024 23:04:15 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sE0jX-0006cN-S0; Mon, 03 Jun 2024 01:59:51 -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 1sE0jV-0006bi-VA for qemu-devel@nongnu.org; Mon, 03 Jun 2024 01:59:50 -0400 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 ) id 1sE0jU-00071B-9h for qemu-devel@nongnu.org; Mon, 03 Jun 2024 01:59:49 -0400 Received: from mail-he1eur01lp2050.outbound.protection.outlook.com (HELO EUR01-HE1-obe.outbound.protection.outlook.com) ([104.47.0.50]) by smarthost4.eviden.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 03 Jun 2024 07:59:44 +0200 Received: from AM8PR07MB7602.eurprd07.prod.outlook.com (2603:10a6:20b:24b::7) by VI1PR07MB6238.eurprd07.prod.outlook.com (2603:10a6:800:136::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7633.21; Mon, 3 Jun 2024 05:59:40 +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.021; Mon, 3 Jun 2024 05:59:40 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=eviden.com; i=@eviden.com; q=dns/txt; s=mail; t=1717394388; x=1748930388; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-id:content-transfer-encoding: mime-version; bh=tdlem/PBmSzX9se9OAGRAEu7sN2rybtDsPNqgzPwTAQ=; b=L9fRDNYovOXpuDffxjQhO3afiRvfie65LeNR8IjWY46B0u5o3aafHKSH hki6XB3GH29roxdxN359c/RbU5oKA2ypUMH3Vl4F2iGGC4roAjPWcDDG7 dxfEGniyBnhPJyaYpCyuImcWayxG4diUPwG5Ieo+FyTLMMHSAnvzsMxBd drzLdvizN7jkap5b7zq1SHYuPqWfHPo3yRHeG75wzvJhsbqPmNP71c/Um rr2XaaDJJFqrbUQZIxfd5Wh1Ix/prR5RQ7aWm8m3c11Wsnt+9HRx4zk4w 4GejusI1GlA7mv66R5b8DELsqTVtft2WsE2ji9s9vBT2WidCRk2AAm89t g==; X-IronPort-AV: E=Sophos;i="6.08,210,1712613600"; d="scan'208";a="13815871" X-MGA-submission: =?us-ascii?q?MDFldeXDG5/ZzBI3dHlAZr39yEMq37mNhSwxlu?= =?us-ascii?q?/4KoHb3+NzTZnfu2c5lnNGiOI+BLE2OjLnoBcrBA/yvg+nrEbNkWO645?= =?us-ascii?q?JjA/A3LWTzr55N5gaxVpRsa9UxXfsVaTZHpVSeXL0MG2jL166gEuYThL?= =?us-ascii?q?Rw/CJt3DPGEatehPvIeDv7uQ=3D=3D?= ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=dMC/Kg6IKWl/hqLuocqxX0bLJvUFyEKZmhoUKcflV1d9y6fytatARP0ppLVzkbdJGWkx+rtYsJ6MKPgGMDc+rQDk5qmZZbej/WXO2X641sKPuI1uQmWAL6/NXxre84UOIffOO60yI0hPMfq1ptZxN/IAuskINQBkI46wZemdk7R1ntK05TjbpJglPkEiJaERcILHJHilPVDfQRSnvSPy0D+/OrAWoSLyCC/4x8QEj55hkJBi706WdWL76PRjKZX4fsaQBABUl1E9d3WWrGYDuQd8UErsakCbtvdBYMSe/UVkbV60r/SkZDJdgc94Jt7/929YnoDI0hzwv4tcQOR6xg== 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=tdlem/PBmSzX9se9OAGRAEu7sN2rybtDsPNqgzPwTAQ=; b=dVukMWfGs7O6HclHZL/UUSsjNG5IilH6mWvNbiBlmA/gefEvfoi0OZSAPxSy5tU6JEqfYjjwBZusthcoTzwkT6p7A/ezfgN8JNGgnw1TszcIqDgeaAzc+WXusI//iC/m6LTcV/3Sy5isQvY6vocw8ljTwT2V5kUUANP59SiLcqvkzaYjXzehpPNucxpt6pgzJNXy09VbwWXh9AfesybxYFM2h65C4BxAusPPrt1+G/wB7FwzN43Eauyjp128TWzBBNpXLr1E269SmHpTmQ6tGduHZlC/83BoAtYj2hKkjMh1iuPat0SmplDCsqI/cH0fW7A+74JAgtvUg8QgkASH6w== 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=tdlem/PBmSzX9se9OAGRAEu7sN2rybtDsPNqgzPwTAQ=; b=I+bL7OiMscZ3VDvj2B4hngyv6PZvOS8QItY8cckyuZVMLv9vRRuYG48Vx9fssnouOL2BkKNXBZ3SwpRqFv9+jCtaJckTrVnlMjI2q3dh49ppuvqcF20F0MeB2YB7w4zkauKx4zqS9IOZt7j5JUEL5vSBrwiirc83BP15ThrKd+Xkbb8kxctTztgVs30CQh1dDSGiUWwB1edro2Wr6Q3527mKxW/6hIV1rJ0eeFfcYQ0fDeKmbgzbrJJiJyc2k7jgBZPc+8bHLRIpnQeqJzgTvhExGAME+UeUTvT9fbvAOWLO3gZdQkfDvD7Wtn0Eo7doYV+LjymW4XYknBt1aUCN3A== 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" , CLEMENT MATHIEU--DRIF Subject: [PATCH ats_vtd v5 01/22] intel_iommu: fix FRCD construction macro. Thread-Topic: [PATCH ats_vtd v5 01/22] intel_iommu: fix FRCD construction macro. Thread-Index: AQHatXs5gC5VI2sPeE+aetPJapEaBw== Date: Mon, 3 Jun 2024 05:59:40 +0000 Message-ID: <20240603055917.18735-2-clement.mathieu--drif@eviden.com> References: <20240603055917.18735-1-clement.mathieu--drif@eviden.com> In-Reply-To: <20240603055917.18735-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_|VI1PR07MB6238:EE_ x-ms-office365-filtering-correlation-id: f98125ef-7e50-4ba5-7d44-08dc83925bd7 x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; ARA:13230031|376005|366007|1800799015|38070700009; x-microsoft-antispam-message-info: =?utf-8?B?RCtlVjNwYVNISDIrcjZVWkwyaWpmUXVtOEo2bEpWNHp1V2Z6VktJbVJUWExI?= =?utf-8?B?Z0kvNU1oOURtTVpuT1VYVHpJQTNqbWtKNlJOc0ROdUhpWTcvemVjYVMrN3I2?= =?utf-8?B?c051eWtzOTkwWW9Nd0JkOUlJc3FKbmVnYVJKSXpabHczTXVrelUrUTZ3czlF?= =?utf-8?B?b1hpK1ZFNmdBc2JCbGRKMnY2TndYc0NuajlBU2ZEd3p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wVUxDVkZ0cWxyTjc0VGxrRVkwcVpWcmxBeEFiNzFNNUpvVm1t?= =?utf-8?B?Tm5RcklLUnY1d0tmZllpcld3NEFKWkpYWUJUL1RkTDlwSUxxMVlQMW91bkFD?= =?utf-8?B?SlY1SzhsV3U5Wi8zK20rbERESGp0RVdEVXZKV1R6bllGd3pPTWF6elliRjd5?= =?utf-8?B?S0d3V3FnakR4YzAwUnZ2WC9HdmFmd2pFR2YzOWlYRWl2VmNXeWpBcU1jN2tj?= =?utf-8?B?b0tUbGJCM0QyOGRuZmJnWUdxUjNrcGhDQTFDMHlKUDhrU0RadWxnRkZWZlFQ?= =?utf-8?B?MnVZZUk2SXFXOEJPQTFQZGlSaG93OXNsMFlCZGRES3AwTFFOOGo1Zkc4WTMv?= =?utf-8?B?Tk94MTZSOUgzTG9UNkNwY0pyTTFWcEsvUEhKbHJ4M2s4T2pDaFRKZWhmZk93?= =?utf-8?B?U1hOa25Ua0ZjMmZKRW5rU1ZKTmRrYXRxUDYyR3dxZW9qTU1NMk5nRllPWVIv?= =?utf-8?B?WUJCMUtNWWgwdWNDcWloSXVhT0s5NWc0OTdRYm9xOXJFdzV4WW5YTXZMa0c3?= =?utf-8?B?K01NTkNyZ0ZyWDBhdVdQMFFXQW9BdnM3Um5ldjRtbTNmcklFdTZmOW5iaXJE?= =?utf-8?B?ajRqcVRQbmxOREY1cGZMbThKelkyc1BkYmR2cUw3V1YyZ3lDb2YzdU9CY3di?= =?utf-8?B?L3VZVXVSZU45NnNlZGZKajJiZDFTTGxXRWdiazRHRnlpZTBSaHNzdzdmZ2U4?= =?utf-8?B?YzVGQ2RhaWFmSUZUK0pSdz09?= 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)(366007)(1800799015)(38070700009); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata-chunk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?utf-8?B?UVhPd09nMVAvK2U1Tk9lRndMeGNRaW45NlNsb2VwUjdHREZsQUI0enJFcnlK?= =?utf-8?B?MERPeTlGeGwvNmFmWlcrNDhvYVJuaW1vUEs1UGhmU1h4MnZMN3RhZkpOQTB4?= =?utf-8?B?ZmI3ejhqOUpYZ2lsZFlsSlJJdjJnVGtiYWY2NjgyL3RqKzR1aXMxZkFSei9r?= =?utf-8?B?bG9lMUFxTUVwMXNSZ3BYUHV1eHNoZ0VHZ2ErVmpSUmtzYTdMN0RLbURoQWNH?= =?utf-8?B?SFJicG5UOEt1TGtXbUp6b29nVzZFbWFFaEVTZDA5THFOOWhqRWJEWE42Rlh5?= =?utf-8?B?TEI3Z2ZYUndFVERUMXJhd3VnQ280a0dwTFZiNEN2bkU1MlllUlJHdGR5Rlp3?= =?utf-8?B?VHo4MVVTQ0lUZVJaTkQ5U1IyZmdBVmxPYzZERk5QbnNHd2VpNmF3QTJwT05W?= =?utf-8?Q?HMTeX721KzKIlNYXuV4zPBY=3D?= Content-Type: text/plain; charset="utf-8" Content-ID: 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: f98125ef-7e50-4ba5-7d44-08dc83925bd7 X-MS-Exchange-CrossTenant-originalarrivaltime: 03 Jun 2024 05:59:40.8659 (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: 3VMocovnmCy/RjDKBpX85DeVZHBo5sgeV/Y4HKSi3C/Bef6cIVBHBCNgkO0cRwKao+4uaFN23QqZa5ZPMmBDcbEz2wIoGByKyEtWjXshn16t62Br/Qi4l3Y2hfMeLClg X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR07MB6238 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.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, 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: 1717394657608100002 From: Cl=C3=A9ment Mathieu--Drif The constant must be unsigned, otherwise the two's complement overrides the other fields when a PASID is present Signed-off-by: Cl=C3=A9ment Mathieu--Drif --- hw/i386/intel_iommu_internal.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/i386/intel_iommu_internal.h b/hw/i386/intel_iommu_internal.h index 7d0420e15d..1e37b98c65 100644 --- a/hw/i386/intel_iommu_internal.h +++ b/hw/i386/intel_iommu_internal.h @@ -272,7 +272,7 @@ /* For the low 64-bit of 128-bit */ #define VTD_FRCD_FI(val) ((val) & ~0xfffULL) #define VTD_FRCD_PV(val) (((val) & 0xffffULL) << 40) -#define VTD_FRCD_PP(val) (((val) & 0x1) << 31) +#define VTD_FRCD_PP(val) (((val) & 0x1ULL) << 31) #define VTD_FRCD_IR_IDX(val) (((val) & 0xffffULL) << 48) =20 /* DMA Remapping Fault Conditions */ --=20 2.45.1 From nobody Mon Nov 25 05:23:36 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=1717394665; cv=pass; d=zohomail.com; s=zohoarc; b=WD/iHVW9TmC01oMbaa3QKixvS9pIrebPcT8SdoARRyfUa/V804BA0YOGknEo3IOdoyDSpiBtZkWhMwUpFfhzzIG7RabMmYw/bin4TNoBoj3baMgNvkyJjO4GiIWvPQLDd8RT2IvASYmPipBZh49NMAOl/vwSOsMTjy6nVj7XWf0= ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1717394665; 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=S5v2LajcwCAxqit1K5GGaK+F/ETgt7e1xSPiPh6VS/s=; b=ljlmKbc/jzxhyN6OALRSKsZ82pgCF71XJdjVIQTDP2vrRFPXHdVQOrXJlzBgp/mwk453A9D+BSne7kI7CFqSQkNbGsC56C5NRTFYhGQ8AJ0wjK5zPyHF+W0BpE2PgvQjZgJy6eMqsRY+rhauXZHIy0OeZmWD4L1yURPtmuHIsbU= 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 1717394665726916.1466070165378; Sun, 2 Jun 2024 23:04:25 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sE0jX-0006cL-9i; Mon, 03 Jun 2024 01:59:51 -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 1sE0jW-0006bj-1J for qemu-devel@nongnu.org; Mon, 03 Jun 2024 01:59:50 -0400 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 ) id 1sE0jT-00070x-KQ for qemu-devel@nongnu.org; Mon, 03 Jun 2024 01:59:49 -0400 Received: from mail-he1eur01lp2050.outbound.protection.outlook.com (HELO EUR01-HE1-obe.outbound.protection.outlook.com) ([104.47.0.50]) by smarthost4.eviden.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 03 Jun 2024 07:59:43 +0200 Received: from AM8PR07MB7602.eurprd07.prod.outlook.com (2603:10a6:20b:24b::7) by VI1PR07MB6238.eurprd07.prod.outlook.com (2603:10a6:800:136::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7633.21; Mon, 3 Jun 2024 05:59:41 +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.021; Mon, 3 Jun 2024 05:59:41 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=eviden.com; i=@eviden.com; q=dns/txt; s=mail; t=1717394387; x=1748930387; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-id:content-transfer-encoding: mime-version; bh=S5v2LajcwCAxqit1K5GGaK+F/ETgt7e1xSPiPh6VS/s=; b=sNlNfVGiHXqUHVlp/kMH0CtBUbC6YJZNzflDVlshgkdAaa1Xi8H307/c t6FJgGpG2og+e/NwFiwbwC86gEXIMO+BP/8K4jNjo+u+wpjHWo9PInZND Sg0Jd1vtLVKLL/hEYiCG9rS4PPfVQmpJJZI2n742iCPJJ5NceFRXB7QZk 9kgPDUYovCMtmGsXpgC7elTBYw7frvl6yY2GMp4k51St6gahduhzNslkk h9GntLdZpR4UaYE1rZxFivaXp/yYBxWOxAdEW4kjzuZFWXp5ve6eWSugz rN6uL6iNdjd0/k5ZMoY+6BqiKpkyCjhG1nK65V4fd+l/bOnGVVWTL89gP g==; X-IronPort-AV: E=Sophos;i="6.08,210,1712613600"; d="scan'208";a="13815870" X-MGA-submission: =?us-ascii?q?MDGllue0+6Hs+LKhCB7wXGGRUxeGB/JfQNCbpI?= =?us-ascii?q?qQX3u0wDfrUSmnlyrc6+8/BTxDp5+AX5yb+y5d3VMkiHBJJaUKEpiMIB?= =?us-ascii?q?YQnSg4EjYCsDWidNt8THWSnTRHIxgtwqpz2d6X5lUFjQ+NDW6ShKCeWf?= =?us-ascii?q?uCnVKtZBMhSnZ7cXVNKVLwbw=3D=3D?= ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ZYlB7NXk5mWmgipxECiLj3rmkPqj1j3bzjlIg0UO60OrWLRD/UXtfUbdz3LJ0XMfXX4EMoH6EhuwF2Ftd3vfN6rj7bsks5a046+D9XLzPUvINJrhw9AxK4WbIfBb+NGDyBmN/9UsJ2wBuGFa+gfZZmZ3nTGafbhqSPRpaLjJYlYBfc7IYVgQvpsz8nXkTjBFXSrvVQwu/wxt5K/HlaM2Jz8FUrbaEjqvSnNLLvK5Pqgf0Kgaq+MOpP/rNQHjgx//5r8Ma9/z8/0UwI5IsK81B/0jozovdHZEGQzLHlXG7Vz74cCYc+2KlW+k/ANehXr9xivXL78tOUL257V16/tz9g== 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=S5v2LajcwCAxqit1K5GGaK+F/ETgt7e1xSPiPh6VS/s=; b=GZ02WCig/skTNIC440oWDEfxePnpo3A+531x/Xr2cB9RB3ocHbV+6PmoYESTswOsbtzQHVlC9Gx4T6Bs++Lpn6NJaRSjD0GdPiIpcN2Z13TtuvmEiLQM1RSQy17qlMT/rqhV4Fgz4/1qr4BkkbeOTNv1eRoArie2LvnUdRoVkS6iQZhb9SthUt4DQgHpNbt/3IjpHnkkJauPDPsj/YnsTPoEiV4Ff4EB7uoDCCpS3IVsaC0wgdVn4ZbNGTQdd6p3GsxPbebNhUAPZFlw8EXDpNO8G09ZjaoXZMaB5DEWG1Py38NeIA48EEEpSckpx+smfU5NJYeq6PH9M1lEv0ASLg== 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=S5v2LajcwCAxqit1K5GGaK+F/ETgt7e1xSPiPh6VS/s=; b=A+oAs6mk/u7QyYmDpT1FKli+gZq0gfIf0IMt9pkxOLa1VEhQAoxmpOVXLK/QVwMF9nBfYXRdnSmR96I8dhO1Hr+IybyZCNsExWD9ZmsjiMWrEgaibQQ6FR2BsIGBgPMbMD2nptWRYmwRmyCtEW4DstMHM8JROr4N5BvdNLgwbg9JaavD9GHXHGqCSYVJc908IoR7v/f6oJFKcA8EOwrQnKx+pg+MCoffS94u3eZfqNNXi2C5OelBZGg9Jkjg7JI0vd3QoOekQiHHhV3H2NGaH5Mft/cLuI0KzHanjXfCfjgtYtkUZZeVu+JT9cFrU/JEPcrqQmL8hO3+GBTSBwKdjQ== 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" , CLEMENT MATHIEU--DRIF Subject: [PATCH ats_vtd v5 02/22] intel_iommu: make types match Thread-Topic: [PATCH ats_vtd v5 02/22] intel_iommu: make types match Thread-Index: AQHatXs5E6voFkhgJ0eF3xAba32ANw== Date: Mon, 3 Jun 2024 05:59:41 +0000 Message-ID: <20240603055917.18735-3-clement.mathieu--drif@eviden.com> References: <20240603055917.18735-1-clement.mathieu--drif@eviden.com> In-Reply-To: <20240603055917.18735-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_|VI1PR07MB6238:EE_ x-ms-office365-filtering-correlation-id: 9b99948a-8874-489e-53bb-08dc83925c4c x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; ARA:13230031|376005|366007|1800799015|38070700009; x-microsoft-antispam-message-info: =?utf-8?B?NUxGNFdjQVZXREhiZjFqRndjaTZUL3o0MjFNNmovbTcraWpFaTlwTGdiTGZ3?= =?utf-8?B?Q1lKZnBoWDBjY0YvSzlFMDJrVmtsZ2hZTXpzT1UzeWozQlFYM0VOV2V5NEZi?= =?utf-8?B?WmRPQXpxeDI1di9XY3g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T:NONE; SFS:(13230031)(376005)(366007)(1800799015)(38070700009); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?utf-8?B?aFlUcVdOdFZQYzV6M0d3c0pXWE41MUwvTnJIZEVWM21vVFI2ZUNGUml5NXJ2?= =?utf-8?B?em1CVG1sQkFqVi9oVUEveFM5c3lmVFN3NE9BZzJFOXZ5TWI2NDkyeUZOOFFq?= =?utf-8?B?UzBpYWhGZkxRZFoyMFNVdDdyb0tMSk1kZ1lSYm5idkpNcStCUENDZGFTSU1Z?= =?utf-8?B?Y0tNT2pzSm9aVTBrRHNxWHRyN05QaTZ1TDI3Q2pnb0YydHI1L1BoU25YYjFu?= =?utf-8?B?VlZSc3hyT3hYOTBaMzl2a1JHOTIyM1ZydFJNSFEvRTdFZ3ptdjVUUmJWT3Fi?= =?utf-8?B?RFlhTWRZVHo5ZGI1ckZNOWNDRlRJK3pMWFZkTVNkdDNIcTBsNDhOOWhxVUJL?= =?utf-8?B?SFB6bGZGR21nU2ZzTC9ycm9BMFNLcENEUHlOK2hpbndSclZXdG0zOWZJWGZm?= =?utf-8?B?dXJMeTJocnJnRWQ2ekdCZW5jM3B3Tzl4S0x2dER3Tkl5cDJGUmdDcEk2aHVO?= =?utf-8?B?eDJib2l2MGEzSlVrc2NhUGFWWCtROTAzMk81YlQzUXlyTk9uSUhDZkRXQTg5?= =?utf-8?B?MXg2Vkd4T1F6QUI2TzJScU1xb2dBNlB6RmpqZkZLQ2NRM0xjTGtEVnRtYS9Z?= =?utf-8?B?YXNvMERwbTkxUmZuR0puVWk5TURJaWlGV1Jacm9GNVkzUkdkN09JckYzajM3?= =?utf-8?B?Z2R6ZHE3SitwQkZuU1NPVWlZQXh3b0k3UlNUK05KTzJudnZNOHRmWlkxdkUw?= =?utf-8?B?S1M2bDJuSDBzbzcvQlE3b1l0VG00M25GdDczaXA3WHdPNGt4ZlVuV0pHSVZX?= =?utf-8?B?M2l6Zn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ZT?= =?utf-8?B?RldFdElDRHZjL1lFSXRvcjRXMXBQaEN2MExpQU1sM3dSU0hFcCtDSTZLOHlt?= =?utf-8?B?dXBYSzk4TVQycFJkaHZNMXRvZThnNU1uNmpES0k0WnlMVmdqWis4S3NJcmVN?= =?utf-8?B?cFQ1QnJFZVNCN0VkRkZCaUYzWEdEL2dOVGdtQmVIRjdjWDlDcElVc29TaVlh?= =?utf-8?B?ay9INXRaWEc3a2dydDg0ZDgraUgvZFhkQXRqQklwemtuYm1TRWhhTVJ4bXB0?= =?utf-8?B?SW5uMFRlN0hvQ09CWEVPdXF5Z0JsU2JHTklDd1IrdE9PcEtXdTB0MXZ3ZzV6?= =?utf-8?B?Nkx3Wmt4bDFncnZneDRzRTFwY2c5NmxLYU5YTW1iMnhERTl3am9DTndISGxH?= =?utf-8?B?YWRCVUtuWmZ1Q1lVRVhHMXhkVmE0SW5idTVibE5vbzJwNkN2eWU2SHVEZ0Ir?= =?utf-8?B?MkRTQ0dTTWNBaUhmNVN1OTZndnVaV3NzdTBlVlJaUWFYNmRRVjJSNnBLNW0x?= =?utf-8?Q?Hy08hdBMV2ghGcfnEhNzsmQ=3D?= Content-Type: text/plain; charset="utf-8" Content-ID: <9141EAFAE0DE124FA6CAA1FE14C67B81@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: 9b99948a-8874-489e-53bb-08dc83925c4c X-MS-Exchange-CrossTenant-originalarrivaltime: 03 Jun 2024 05:59:41.6296 (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: m3x0ZFedFXNSxXwXimWw1GqAFyfZvF/RrFfbBINmdleISVK3QfJNngN3lNpAiVvvta/4+XKCXPc+d9vv0CEF3Tcn/c+7U/bOpoytpRmebWKqe+t/pYJAi9r+6iZs7cjI X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR07MB6238 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.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, 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: 1717394667666100001 From: Cl=C3=A9ment Mathieu--Drif The 'level' field in vtd_iotlb_key is an unsigned integer. We don't need to store level as an int in vtd_lookup_iotlb. VTDIOTLBPageInvInfo.mask is used in binary operations with addresses. Signed-off-by: Cl=C3=A9ment Mathieu--Drif --- hw/i386/intel_iommu.c | 2 +- hw/i386/intel_iommu_internal.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/hw/i386/intel_iommu.c b/hw/i386/intel_iommu.c index b4bbd839d9..908486c953 100644 --- a/hw/i386/intel_iommu.c +++ b/hw/i386/intel_iommu.c @@ -395,7 +395,7 @@ static VTDIOTLBEntry *vtd_lookup_iotlb(IntelIOMMUState = *s, uint16_t source_id, { struct vtd_iotlb_key key; VTDIOTLBEntry *entry; - int level; + unsigned level; =20 for (level =3D VTD_SL_PT_LEVEL; level < VTD_SL_PML4_LEVEL; level++) { key.gfn =3D vtd_get_iotlb_gfn(addr, level); diff --git a/hw/i386/intel_iommu_internal.h b/hw/i386/intel_iommu_internal.h index 1e37b98c65..c9a673585f 100644 --- a/hw/i386/intel_iommu_internal.h +++ b/hw/i386/intel_iommu_internal.h @@ -488,7 +488,7 @@ struct VTDIOTLBPageInvInfo { uint16_t domain_id; uint32_t pasid; uint64_t addr; - uint8_t mask; + uint64_t mask; }; typedef struct VTDIOTLBPageInvInfo VTDIOTLBPageInvInfo; =20 --=20 2.45.1 From nobody Mon Nov 25 05:23:36 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=1717394500; cv=pass; d=zohomail.com; s=zohoarc; b=LWkwZwM3rlrHOfr7wHbSK4dMZroUHnYrWeoAPFPwlDbSl8kufbZxF1dDSY0oL8n/FLItUTtOj6BF7B4X1Q08sdymtjlHnmBAQqepaxFbzo/eW3iIYLcHC1mDVvhCQ1KsNA/UWe/qWGePtcmJ9PZUMyCwkXykbqnQMWAr/rjQAdQ= ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1717394500; 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=ssYVGgT6YAfemmInJATGdFE5/0e9B+YWWRi3BUUYCtk=; b=VHM1NdH/mT1JekFIPe3YPVgXvlRqafMTVMSLGvotLw4cMmHz7thuXct8rDeGqV5lAy/qrqhJ6P45QIg3N9YOEGi/8Ee+q7TQ/btUFBGt35E1fS6f/4aa7OSGAdSPDL1JJJzfs1cWw52K25QFQQknG7Hi/LeBsZ3SejdN7+jnIik= 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 17173945006311.870006829530098; Sun, 2 Jun 2024 23:01:40 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sE0jg-0006iv-2m; Mon, 03 Jun 2024 02:00:01 -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 1sE0je-0006gJ-D2 for qemu-devel@nongnu.org; Mon, 03 Jun 2024 01:59:58 -0400 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 ) id 1sE0jW-00071B-Ax for qemu-devel@nongnu.org; Mon, 03 Jun 2024 01:59:58 -0400 Received: from mail-he1eur01lp2050.outbound.protection.outlook.com (HELO EUR01-HE1-obe.outbound.protection.outlook.com) ([104.47.0.50]) by smarthost4.eviden.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 03 Jun 2024 07:59:45 +0200 Received: from AM8PR07MB7602.eurprd07.prod.outlook.com (2603:10a6:20b:24b::7) by VI1PR07MB6238.eurprd07.prod.outlook.com (2603:10a6:800:136::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7633.21; Mon, 3 Jun 2024 05:59:42 +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.021; Mon, 3 Jun 2024 05:59:42 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=eviden.com; i=@eviden.com; q=dns/txt; s=mail; t=1717394390; x=1748930390; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-id:content-transfer-encoding: mime-version; bh=ssYVGgT6YAfemmInJATGdFE5/0e9B+YWWRi3BUUYCtk=; b=RGqnhSpQcOk+e7fEyHk6q91/qIf208vCuENO9TOmGQfek/vV6J81Wa35 kAFlQBgqSCXeQwg2dYLB/LH7gnKh3+LfHxnyvIE4TH04YEZSEbuGe/X0z h98uiMY+Tk5j/2EhoWdUUlzhWToXeI6EYyxGGbJuRSL+QPjUHLWwu0ArL vHUADef3ih5Pb3eIYr/o8bSUXgK9l0s4XrrRyethxlqaWn0bs0QxLM9Ma XMrx/4ce7Kj3hN5tSJgPeDx/aliNxbD9UvM/Hu3qJ0KqRViU8+VfKlLOf QQrKGYJSpAa7eNXGPIvKB2jcbsjPkCLnczRjE4Svm8FcvRX/ENBOAllQ+ g==; X-IronPort-AV: E=Sophos;i="6.08,210,1712613600"; d="scan'208";a="13815873" X-MGA-submission: =?us-ascii?q?MDHfSbrvnbd48m/Ss7v6xjYUltpWFNnXtgddWs?= =?us-ascii?q?ji2kQW0JiSYiVTL32+xwkV34i5rjS4FpeEE/lL2O0yl3W/y3lc+ZBSZU?= =?us-ascii?q?ZBHChkbuyMoLCRYe3sY1XjKhQbwOhlU/4z1U9d/p8Xs/oXV8HZRO62fM?= =?us-ascii?q?iXK7zw9H2g0DtIGoF1dVzr4A=3D=3D?= ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=d6wgPdRBzoxgEDeKxsmq40MCSIMG0psYu26U0v5iMit6ZbAdvxbVNKBkH27xzG4uD3LlQEp4deqOxI6hOuIZ7X64qFPkurzjBlxM/b0DcKXLn1eg9AGjTzaq82TjbHk84C8zqrcT7tbB/bBePVEIAfTn3VlNaurShyNjVqY5ym8eSFOlojR8sZThTN26qrkyFeVCxoeidhjEWcHGp54I2jk0vl5mPeidICTBj13HNT3MToqwlnTiCYwv27HN7KkZIGs50t7Lki2UUK1n8d1dmRBsxBZAmMIr++4q8rtXHs6+b4jFjPKbZ78VUdTLzA8onNUNKdI+GqA4Jx/LhELkxA== 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=ssYVGgT6YAfemmInJATGdFE5/0e9B+YWWRi3BUUYCtk=; b=VSFhTvIZHUnXAzqQYlEUkJUnFVToBnLZYX5nLL4xKVyYbPUKXzKzaVHx+OFbq99SAeGVOEDWzXWVEQgw5nnDDuSb/mhGCt0TaphZY0LNByNcX3pFcpee+TnCqc0Z8yKw7u0xVbtxx92IJoBJqLLcfdcuVKGuaqOx0jEAf1WATeCnxLvBrwwdDrJTskF4vZFt8wp/sNQAer9FMgMyC/ulsay8mH7ryTg8//Fl+6M29+drRg5N7W85HwutIDB8T4BkbzpofSYTPRaZR/5ihHYSWzAq56e1ZGU+aa6gdJZgx8xUROTrvLYwbJFIZBPGrAvgxsMhS7gReZEXjZx8iMJUgA== 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=ssYVGgT6YAfemmInJATGdFE5/0e9B+YWWRi3BUUYCtk=; b=OgcYkzT3TYUQgW3hlC8YkvcvVVuU2vqxvB+vUDSxLlQFBPoIPhSFfFpIm9bX+XIl7JZcL+dkjlmeq2iTj0UEWXdabU5iqwoCI9Le5Zu8zshjtKJ1+rQTcCkrAV5MBIaRG0NF+sVIBQRL7ZYsvIoF/NSKIL6xc/lUxW+btLG6aPaTBnE0hB5BNTP7dEZIj1R9inJcxCOepW/tnE9NPggurVKzlOh+RDoXFxiyHrueRNN8259sqbyPLCswS1KuJeL1Xea3Aiy40F3Cjovr6nIA998YhrBfhrSgCy8bzsugfeTMkOfKXAbSiRbnLgj2Z0piauHaU0royQx8OlGdmZfJBQ== 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" , CLEMENT MATHIEU--DRIF Subject: [PATCH ats_vtd v5 03/22] intel_iommu: return page walk level even when the translation fails Thread-Topic: [PATCH ats_vtd v5 03/22] intel_iommu: return page walk level even when the translation fails Thread-Index: AQHatXs6q1IKL+LfFkqNMBSZnISegw== Date: Mon, 3 Jun 2024 05:59:42 +0000 Message-ID: <20240603055917.18735-4-clement.mathieu--drif@eviden.com> References: <20240603055917.18735-1-clement.mathieu--drif@eviden.com> In-Reply-To: <20240603055917.18735-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_|VI1PR07MB6238:EE_ x-ms-office365-filtering-correlation-id: 9c6b18b7-aef4-4151-add5-08dc83925cab x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; ARA:13230031|376005|366007|1800799015|38070700009; x-microsoft-antispam-message-info: =?utf-8?B?c2UwTFpzNjZaM0lOQ3Z3STRUdzQzd0RZUjJVU3BIdUlZOU1XaGNtMmtpSktF?= =?utf-8?B?RkFWNStwN2szeHJhZUxIdmJaYzNMTDBWVnhsalAyM0dKVlJjb0RoMVhKaUE0?= =?utf-8?B?YmtnajhZTDhTSmhIMkMwWkdEdk91UkxXaTBJbTgvTXNkTnJKREllRGhiN3Fx?= =?utf-8?B?NFIyYTZtRHJKVHNpZm5sbnBRbWJtbzV2aWdvYUU0Sk1UOVdxbGtSMXFsRkw0?= =?utf-8?B?SnlkZWJZZ0U1Yy9JVEVEVnpCYXB1ZDdxbjJhdU43MlRpYzJ0MmJBeGNtVm00?= =?utf-8?B?SjRsV01RT3poUVFKbkM4S1NpdkdWNEduc0VQcVg0QS9SUDlZUWwyRDQ3RGdU?= =?utf-8?B?K3R1MWJUQ3ZoYnBwVmtvUmVqOEplMFBabHVSYUF3U2dvcnU3b0YreEEzOFZO?= =?utf-8?B?WEo1Q2ZKbERJL2hrNkNjNFNaUjliYVpvR0FmV0F4TjhVa1dyQ2xyeVpmQmQz?= =?utf-8?B?NittcktDMDZTRjBCMHY0dTFOYnhNckZzbCs1MHVhL3pQK25OaDRhU2xOZTd1?= =?utf-8?B?VFp0MEhzUFVKUlpBVGNVVHpIdi96K040dDhJZ2dUZkltQU9kTWpUWk9rcFpu?= =?utf-8?B?aWNWbFYxOVNUQ2VWdVJ3YWFKbnB3NjM4MTZwQnRwVTBBMHFXdnBsdEhKM2ty?= =?utf-8?B?aCtyb1pySzRKcWRueG03VDFaY1M4a3dzdVkrZ21jNE1sbm5aNjZ3Z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TDdLajFlUkFhajBRaXVmNTNC?= =?utf-8?B?WjZKK0VZK3JMcXE2bjVqaHpNSmMwOEZNQzN0WUdORkpSdVFWOUkzZ2lXS1BL?= =?utf-8?B?ZkNlNFR3enFxMDBacWFPU243MEVDcjVyclBKOHRTb3lrRnJ3S2RXdXpSK3Qr?= =?utf-8?B?VVVvTkJqZmVYOVRjNzNBTFovRkNiNHFZRnF6ek1TRFBuR1VqcWtjWUE0c01r?= =?utf-8?B?a3FtSDhDdm9pUGt3S21Edz09?= 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)(366007)(1800799015)(38070700009); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?utf-8?B?djFIeGVnbHUyZUdHMWlUTHR6QWx4YnpJUnZMK0o5dWVjS1psZ3h4bUVLMUc5?= =?utf-8?B?NWFzeGVWdHFKcnM2cko3NlNJeTJCb2FNT041K3UvcGRzMjZqelJlQkVNTzFw?= =?utf-8?B?aXN5anpRREtqY3B1YmJLa1VaSEphcFJGRXlJOHRSVGE0MkNSTU1zWEowMXV4?= =?utf-8?B?cTBSZ1JQRUJkQVdJOHEyN293ZHpmdFdSQkJsUUowSzVWaDgxWE1HYVZPdkJP?= =?utf-8?B?U1E3cmdTWkZ4Z3B0bFNNSXJ3M2R6V1pCT3VUMGFJNW1NV3l4VGtPZHRxK2dB?= =?utf-8?B?d0xWUXdaS2lKN2hGZUFSWWpLd0t0YnRubDVPZ21McDNuRlNWWWRpaGkzQWhH?= =?utf-8?B?SjdKMWRJMUx3YlpGeU14eFhzZXZUSnhqbVpzMTBGcmZDRTdkeGJKTTNKL2Uz?= =?utf-8?B?b2pDSTdQSHVmRk9aczR1RndEeUZNN3kxRnYxTEcyTzUxTml0Vm5pV3k2OXZl?= =?utf-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MVjFt?= =?utf-8?B?QmYrZEk2dG9Cbm5jSkxSUWcrN3dOTXZOeW1BbDhwTHljZEpUWTA4UzRRUG41?= =?utf-8?B?NTE0cGdDc1pEMEdlYVhsa0JIT3FRdFJ1SDA2YVgrcWtwWXhRSkxEWkpWMEJj?= =?utf-8?B?UVc0TjZDQWVOZU0xOUZPc0VIWGdVVlZ0eWJEZXVaQVBHaFdFcHUzamZsemw0?= =?utf-8?B?Y1h5S2tQTDJ2cGpYQ0NlVW1wdFNlLzJNQ2VWd3JjZUJIU09kM0lxZUx1bUto?= =?utf-8?B?QXVYa3RnN1lsQURIZ0RVd2tnK3ViMXVsWUcwUHlNR3B1bERiZUk1NDNMYmJh?= =?utf-8?B?RnVyN29BaUI2U2FYVGlQTnRiSmVuVStzV0srTlJPUzRXcFB6bnRuMVJpd2xJ?= =?utf-8?B?L1htY3BtWHU0TVpPUDg2TzF0TlVRU2ZySEJEamw1NnFWYjUyc0ZkT3U0cVM2?= =?utf-8?B?aU9ic1lIM3B2eitHZDJTUHdjQmNDQVRRMEZmTjkrZE1HcHZBUVhRaUgzdEE0?= =?utf-8?B?YzkxZC9HWUpuMGkzVVZSVEZnQituMy9sc2lXTDI4N1h4Rno1cVFPSGY4RWJ6?= =?utf-8?B?bHlVN0gveFBBSWUrSFAvdU5BWmdxaVl1V21IZjZ0d0JEN29tUTIxUGdDNlhu?= =?utf-8?B?Q0RmWkxHNUtaN29GUzl0MVV6QXZ0MkdGL3VIckJvbTFjbU16bHJJWDRRcllR?= =?utf-8?B?dFYwdzYzTmNjeHZkMDlJekFDemlOeW1tZDAyNDd1ZlV2aklLTGJKRytHVkwz?= =?utf-8?B?eks1RWFVSnBmR09iZ1ljY0ZObDZTRVhneDZPOW5Kem1ra1dCVno5dnNLenp5?= =?utf-8?Q?XUZPwndcJDLT9S8VPBMf8ac=3D?= Content-Type: text/plain; charset="utf-8" Content-ID: <4924BB57B0700C42A4271F75288EE2AB@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: 9c6b18b7-aef4-4151-add5-08dc83925cab X-MS-Exchange-CrossTenant-originalarrivaltime: 03 Jun 2024 05:59:42.2675 (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: NsG1U/Jt6YJ2Du8zFivDMbk7SyFPJG4VylDmW03X5mCWi88xNPJ29XedPSanEaL042rTSN2ZURJN5Ra7Kb8g/L9EUMx5Ik4Tizx2i+CttXlKHQbTMQTY/Xnf85KVXX4Q X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR07MB6238 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.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, 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: 1717394500975100001 From: Cl=C3=A9ment Mathieu--Drif We use this information in vtd_do_iommu_translate to populate the IOMMUTLBEntry and indicate the correct page mask. This prevents ATS devices from sending many useless translation requests when a megapage or gigapage iova is not mapped to a physical address. Signed-off-by: Cl=C3=A9ment Mathieu--Drif --- hw/i386/intel_iommu.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/hw/i386/intel_iommu.c b/hw/i386/intel_iommu.c index 908486c953..772b1cea88 100644 --- a/hw/i386/intel_iommu.c +++ b/hw/i386/intel_iommu.c @@ -2078,9 +2078,9 @@ static int vtd_iova_to_flpte(IntelIOMMUState *s, VTDC= ontextEntry *ce, uint32_t pasid) { dma_addr_t addr =3D vtd_get_iova_pgtbl_base(s, ce, pasid); - uint32_t level =3D vtd_get_iova_level(s, ce, pasid); uint32_t offset; uint64_t flpte; + *flpte_level =3D vtd_get_iova_level(s, ce, pasid); =20 if (!vtd_iova_fl_check_canonical(s, iova, ce, pasid)) { error_report_once("%s: detected non canonical IOVA (iova=3D0x%" PR= Ix64 "," @@ -2089,10 +2089,10 @@ static int vtd_iova_to_flpte(IntelIOMMUState *s, VT= DContextEntry *ce, } =20 while (true) { - offset =3D vtd_iova_fl_level_offset(iova, level); + offset =3D vtd_iova_fl_level_offset(iova, *flpte_level); flpte =3D vtd_get_flpte(addr, offset); if (flpte =3D=3D (uint64_t)-1) { - if (level =3D=3D vtd_get_iova_level(s, ce, pasid)) { + if (*flpte_level =3D=3D vtd_get_iova_level(s, ce, pasid)) { /* Invalid programming of context-entry */ return -VTD_FR_CONTEXT_ENTRY_INV; } else { @@ -2117,19 +2117,18 @@ static int vtd_iova_to_flpte(IntelIOMMUState *s, VT= DContextEntry *ce, return -VTD_FR_FS_BIT_UPDATE_FAILED; } =20 - if (vtd_is_last_flpte(flpte, level)) { + if (vtd_is_last_flpte(flpte, *flpte_level)) { if (is_write && (vtd_set_flag_in_pte(addr, offset, flpte, VTD_FL_PTE_D) != =3D MEMTX_= OK)) { return -VTD_FR_FS_BIT_UPDATE_FAILED; } *flptep =3D flpte; - *flpte_level =3D level; return 0; } =20 addr =3D vtd_get_flpte_addr(flpte, aw_bits); - level--; + (*flpte_level)--; } } =20 --=20 2.45.1 From nobody Mon Nov 25 05:23:36 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=1717394541; cv=pass; d=zohomail.com; s=zohoarc; b=ZwnUBUS1PtfanFdpF5+VyhxjqvpUE/eynKpkDzXQlN3eRQ4JxS69sdw7jFfXART3kc/jh3Zf6OBHfsCvwQEOrJpHEpc+t4AJoqZ6t8l0hk9P7AhUYyEWSlEXz1T+N/o0O1MN4MhfiCCFI8RnCoXsM4R2Ei1/ErEm2LjQ7vbTP6U= ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1717394541; 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=9V+ITKOwivB3WpSM4vWz06iTWbCEdI4Pz9nZEsLjbws=; b=KGaD+RFIVlpH++i+Ehqf3LfBlIXG6o3kAVmHcp+r6Anf4lNRInDMmZmDBeG/FG/0p05zYFC0xG/kJG+LjiVPgfgPDujEZ/eXiFUWsY0dMG/Ht5kzdCe6tVTqHDOvMCPmCn5WP4azMlAr9935ZpIR500vaAjGOcEWZmVOu55xRkA= 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 1717394540911607.7518694396531; Sun, 2 Jun 2024 23:02:20 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sE0jf-0006hF-34; Mon, 03 Jun 2024 01:59:59 -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 1sE0je-0006gC-6o for qemu-devel@nongnu.org; Mon, 03 Jun 2024 01:59:58 -0400 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 ) id 1sE0jW-00070x-Ck for qemu-devel@nongnu.org; Mon, 03 Jun 2024 01:59:57 -0400 Received: from mail-he1eur01lp2050.outbound.protection.outlook.com (HELO EUR01-HE1-obe.outbound.protection.outlook.com) ([104.47.0.50]) by smarthost4.eviden.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 03 Jun 2024 07:59:46 +0200 Received: from AM8PR07MB7602.eurprd07.prod.outlook.com (2603:10a6:20b:24b::7) by VI1PR07MB6238.eurprd07.prod.outlook.com (2603:10a6:800:136::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7633.21; Mon, 3 Jun 2024 05:59:43 +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.021; Mon, 3 Jun 2024 05:59:43 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=eviden.com; i=@eviden.com; q=dns/txt; s=mail; t=1717394390; x=1748930390; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-id:content-transfer-encoding: mime-version; bh=9V+ITKOwivB3WpSM4vWz06iTWbCEdI4Pz9nZEsLjbws=; b=fQyUQHs6lHUEv6MAlu7eA3GtqLvBzOu0ul5NTTJreL2DMCq9wkO1vCb8 RVFcTKgIkst14uvL9HHwYcbf6AmvQ/ngXCB5+WeyrGQpSPF2oOOXcBqld dlG5mXP9k4ShSe5JttdWOFx7wTvTNWVCldT6Q0eR0qEYOw7c8pbFLD24y YCzSXn8dRxS/m6QCJPJIY4bKzxWcUQzfu/DnbOt/N89fZ7uaHckj5N5Mp KCH4uYquaCEusHbDvCKSCTDSNbrtXoGAtSMohUzWTh7tdWamilfjshgxD +6JFEVTJGIjCu8Sdd6kyVtPQbII0bI+ZNNqOLwNBEDe8rL0jzd2wOxA1a Q==; X-IronPort-AV: E=Sophos;i="6.08,210,1712613600"; d="scan'208";a="13815874" X-MGA-submission: =?us-ascii?q?MDELUMXNaR2qJvNM0/e37gNaiSptRUUWZN0GwV?= =?us-ascii?q?CrHdFUcuzEt0oR83a8u63WxHV7QipxBHPBGxaBiy6dSDD3gmIgj0TdP2?= =?us-ascii?q?IBzZqWV8MmA7PGUg8/AF1tHlpjIEPiOBkgcmuEH21RjX9MgL65q1vCCG?= =?us-ascii?q?ZrCmzsGXxUs73LCOOXxzodXA=3D=3D?= ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=giQ5aXmPZbSAoSVQrSL5TVHWLBVWW6fw55foRzab4T/jABOCFCkIpQCokSXNwq+LB3P1nezsKyNIrgD+RGIkArM8rtW3qDCu9PLr2kEQO/DGnHoom+aUQHDKVrMSgXiglqnAZWxmzBpVtKDT9IKZVd6uuq2mqdh+lnqgGqtWrIMFY/qPXAGQXeFvBTvpy1/ZAfbsL6BBsXdSbirdn9AFu23qHdM3sYThF2cmbyVTzw8m3dZxUgD0HwVBaCBVrTZCC/v1aYkxF9LiG/JAmeBH7l59OZu8b6vVPrFMO3QRxcWRhDP1qEPVDqVHVNbsfGhVF+FucJlBjgC1pAX5f17J+Q== 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=9V+ITKOwivB3WpSM4vWz06iTWbCEdI4Pz9nZEsLjbws=; b=MrVqWE52W6ZZx11tEuNsUcc3SIk+mIquKqoSZXsX+BmoCIb26ESnjQDffxStIEh33CG42/+FhZctaIWvAxidifjb7R9N0/dd53w3eXPp1eO7T+IM7j5t7tqcga2HO43A9Q5F9ayPx2ZJUAtVKI77OyWEtEaXzSZVDqgLnxTIdNm2QVGyQRauvBENDbJxtx41B3wQ/UEodYGCMykPJke3yNjKqgh0HoLogjU2b0o8v1gjyaJQcWcN+S9MBOAEA9aHvN9ZAoQcu9cM/3v94+m/PvlJVRWub6Zjnj37Ldsn9HPKFtUSaHORhtd04TpDF2FprlnETzmDELtKoSDD9uRQ+Q== 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=9V+ITKOwivB3WpSM4vWz06iTWbCEdI4Pz9nZEsLjbws=; b=FfZQrfF6M20UpTIoWpeKY7Eif9AeRxWiX2TM9mrv5n3ODp8TEjOI17DOq+1YjcdPPxiO9QHmiuP2Jq+tJmZB7q5NeYWBeR9Wk9haeSe0C/+6ipksLESsMTOiEg4ArRcC0uknW+w3Kfkt3W6xQk4Wzc3jLucuZSGoSpgSJZ+IQPeZ4btMtpmDd53f72YtTay1qcznJsU/jsOVzCof87DEehfnjcvDkLl/6uxfpjuqDXsikYPEs39o97NApJjalFBsmaex/czB4qwt22mAjiBw/WfgP413tiM+R2gbiZ6nQQyF+9Ss/NaCHyF0BXJYOF4hR7NvLdAF8kAg+3vMzgaAsA== 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" , CLEMENT MATHIEU--DRIF Subject: [PATCH ats_vtd v5 04/22] intel_iommu: do not consider wait_desc as an invalid descriptor Thread-Topic: [PATCH ats_vtd v5 04/22] intel_iommu: do not consider wait_desc as an invalid descriptor Thread-Index: AQHatXs6STwkuNSoKUS08HQc0nMsEw== Date: Mon, 3 Jun 2024 05:59:42 +0000 Message-ID: <20240603055917.18735-5-clement.mathieu--drif@eviden.com> References: <20240603055917.18735-1-clement.mathieu--drif@eviden.com> In-Reply-To: <20240603055917.18735-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_|VI1PR07MB6238:EE_ x-ms-office365-filtering-correlation-id: 9d9d7125-07c9-4199-9b58-08dc83925d14 x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; ARA:13230031|376005|366007|1800799015|38070700009; x-microsoft-antispam-message-info: =?utf-8?B?VGxOUEVPbEZLSkZNKzh2a29EdU1hM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RY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:AM8PR07MB7602.eurprd07.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230031)(376005)(366007)(1800799015)(38070700009); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?utf-8?B?TlN2VU8yVEZEZk5xa3dDOGFxNU8vQ2d0aTR2SzFyd3M0bDZrTkdXbDVGcytk?= =?utf-8?B?UWlLdDE1VHpuL2dkZk92c0N6ZVJ3My9TMUUrSnJVMk5TMVFDOG9xVmJJQTM0?= =?utf-8?B?aTJaMEt4VDg0Z000WmVDV3pQanY3d25yYjh0U3lZQVZIU3B2TUlCN0Q3UWNo?= =?utf-8?B?eksyTU9MUVA3cmZwVmx3enNjbVMvZWgzUDI3cUZYUkpaQlpOOERkSkZUN25r?= =?utf-8?B?Umtoby9DbEN1NWxEd0U4RzVuNG5kT3I3TlI5NHM1VE1VWnBJVXpMZnk5YnNs?= =?utf-8?B?QmhZK09lREF0WWx3SXhIODROQ1NRd0VDU3hoUW0zREdzWkthODN3SnZWQUxn?= =?utf-8?B?WGRFNlgxVENZbE1LR3J3dGJZckF5cWtPWjc3TVExZFo4eDNGWlBURVJWM2RS?= =?utf-8?B?Rm9NdE83bDE3OUZuVkJoYjFXeVkvakF2NklDN3FlOVFnL2gxWEFSc2tjdWNa?= =?utf-8?B?S0VqZHlhNDE3cFNVdzVWdmt1QWpQU2x3YndtMmoxWHd1dU1WODVzazlhNFVL?= =?utf-8?B?ZGRjQmRYVEVqN29QNU9UVUhMUmVBMkxWTGs4S3ZFZlJZOVo2NHdSVTNscFFv?= =?utf-8?B?L1FaT1ZZMnJpZVF5SkgweUJSMkZKYkY4ZW85SDFpM3hKNEhMaWFBRnk4a0Ev?= =?utf-8?B?VWxMVjBSWjJUU3VEL1BRdCtJV0ZBQStLemo3aVM2Z1JJNjloNHJuUVdtL0ty?= =?utf-8?B?R3B3UklHOUtGZUJr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ZEgydElWdWFJZGgxV0JqVjVQTTNsV0I3aHgwY21FM0FmVHBYYkUwWUo3NEVx?= =?utf-8?B?ZzZabW9GYnlPaXJCd0xyZkNEMFdlc3VWNlc5bU5KSTVQWWZaTnBtTk1Rd1E1?= =?utf-8?B?VUZhTjh5cnlRVXQ3T1dSaW1IeEpSS29XNklPc0I4Y1VNOFpGK29IT2ZkVktw?= =?utf-8?B?V25SWVhzRnUzR3E4RWtnb3NXTkF6TjUrc1FrMWk1UitFQ0NjWjJiVGY4VE9I?= =?utf-8?B?YWhmbW9la0xtYkIrS0x2TzNxYnhJRHdhQUdreTNKaWV6cWVDR0RweDM4WFZB?= =?utf-8?B?WlJFOGJHTTNQbU5YaHNjSGdrNm5JOFA1bUJVWCtlNHhCL004dVVFcGs0dmJw?= =?utf-8?B?YVZrU0hiTXZldHV5R250UG1GQ1ZKNDlRcjNrSEd1dnNDM2l2c2VDSzZxWFZU?= =?utf-8?B?aVJaQmxrYldKbk5nN1JPZ1hucSs1R1VFd2ptWlJHY3k4Wkx0TEhNekF6cWJP?= =?utf-8?B?TE04VUsxM1Q0VlZycXhDQ05RSk04cFRLUDAwM2hGcUErTFdJU2t2R3dDTkM5?= =?utf-8?Q?XSBAIT7a61HHCrYKuGj+vLU=3D?= Content-Type: text/plain; charset="utf-8" Content-ID: <769C54D3776AE84C8A333583ACA9E0FF@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: 9d9d7125-07c9-4199-9b58-08dc83925d14 X-MS-Exchange-CrossTenant-originalarrivaltime: 03 Jun 2024 05:59:42.9674 (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: 4iEgP0XEJorF9sd5+TCKOKmVE1BN6QdfOQVChRXZe6Jq2pLsRqPVpaUEhPGQaCqqzBhxnmKhuzUoZcd4jGP/B4ln2jZOFWB8SYSaeIjfC0h8BbXwGktlFdgZzlLmwtfV X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR07MB6238 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.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, 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: 1717394543080100007 From: Cl=C3=A9ment Mathieu--Drif Signed-off-by: Cl=C3=A9ment Mathieu--Drif Reviewed-by: Zhenzhong Duan --- hw/i386/intel_iommu.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/hw/i386/intel_iommu.c b/hw/i386/intel_iommu.c index 772b1cea88..7b0c22fc07 100644 --- a/hw/i386/intel_iommu.c +++ b/hw/i386/intel_iommu.c @@ -3476,6 +3476,11 @@ static bool vtd_process_wait_desc(IntelIOMMUState *s= , VTDInvDesc *inv_desc) } else if (inv_desc->lo & VTD_INV_DESC_WAIT_IF) { /* Interrupt flag */ vtd_generate_completion_event(s); + } else if (inv_desc->lo & VTD_INV_DESC_WAIT_FN) { + /* + * SW =3D 0, IF =3D 0, FN =3D 1 + * Nothing to do as we process the events sequentially + */ } else { error_report_once("%s: invalid wait desc: hi=3D%"PRIx64", lo=3D%"P= RIx64 " (unknown type)", __func__, inv_desc->hi, --=20 2.45.1 From nobody Mon Nov 25 05:23:36 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=1717394479; cv=pass; d=zohomail.com; s=zohoarc; b=T6qSGL/lLcd2+FT+3KvZrY5wDSH9Ns/Bhr/M5hUN3MY7I3W7uUJoxFE1B161sydJQle3TPNIzgj2NAZAbJ/jbnVqzsS9CVrunFVhWdO5e1kZWlitOiqnan73Mx0ok65XOcCvxTPd7cHuO33oX7KhLxfCI+gl7s0BmaKfl8ISoFk= ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1717394479; 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=203ROX01K1oZ6NurPajI+Um1ICvecqjwliaqm20TbZQ=; b=EDTVOg/iAXoEKvqEZ/iVeI49UhbAT3w7CQ2b86XeRqWomeKPq0+15xBDEJjYyFYEPJEAYS2Wm7BqdoKn5evBMNLBgAsaSNHs8jTQQlTXtvtUuNPYuWOF23JjIceWNtJW6C/AShWsd1KDuwXDUvb0UpOCEswYUn6aKA1TJbAnOIk= 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 1717394479618641.6453900950637; Sun, 2 Jun 2024 23:01:19 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sE0jj-0006jO-Rm; Mon, 03 Jun 2024 02:00:04 -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 1sE0jd-0006fp-Dd for qemu-devel@nongnu.org; Mon, 03 Jun 2024 01:59:57 -0400 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 ) id 1sE0jb-00071T-K4 for qemu-devel@nongnu.org; Mon, 03 Jun 2024 01:59:57 -0400 Received: from mail-he1eur01lp2050.outbound.protection.outlook.com (HELO EUR01-HE1-obe.outbound.protection.outlook.com) ([104.47.0.50]) by smarthost4.eviden.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 03 Jun 2024 07:59:47 +0200 Received: from AM8PR07MB7602.eurprd07.prod.outlook.com (2603:10a6:20b:24b::7) by VI1PR07MB6238.eurprd07.prod.outlook.com (2603:10a6:800:136::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7633.21; Mon, 3 Jun 2024 05:59:43 +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.021; Mon, 3 Jun 2024 05:59:43 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=eviden.com; i=@eviden.com; q=dns/txt; s=mail; t=1717394395; x=1748930395; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-id:content-transfer-encoding: mime-version; bh=203ROX01K1oZ6NurPajI+Um1ICvecqjwliaqm20TbZQ=; b=mOSCSaXANm2TviAb3Od1PoQLxyUuJYIwnTFHAo5FdhvXEDwiRbscsDii 1nCpvS7EUpkFxXDzaZAhlHvrZ33LucWd4lTm4bKO1c+s9EbuGvo12zpjD 9IMprGeKPU4g0emeEpxs3gQJMcDlDkIQLf4TVrq0GnUjp98aYHjxoKx/V ccx1eD5FIs5Qn96xwk7ieXyCUE+06kNDS5rvnb6YWHQ1HDIBYvoACEFrR VouwQPMfTVKK2/xiK/fzsgCR7N7NoxCRW6+5sXkCAm4/CnEKNJhexlRMN pAX0RffUAPt6bZ4Zbz8X8K4J6CrDqzqrMQA/2dw4GetClh8lQ/GD4HSgn A==; X-IronPort-AV: E=Sophos;i="6.08,210,1712613600"; d="scan'208";a="13815876" X-MGA-submission: =?us-ascii?q?MDFIMSir7WyOvmNlNCMWQuHO8ua305Yft/0rJt?= =?us-ascii?q?q9gCn1w9wUj6Iiev3w7qwllUExa2KV3cbDPJ6jnSbIX9P2onjK5XE1iz?= =?us-ascii?q?3Rtjs5vfUgF9Jy4jK8fU4XQdIodyC+eom0DUsDCFZeay7DK6EdkrT1n4?= =?us-ascii?q?VxgtmpdmAZ3IwpJmwfVO8QvQ=3D=3D?= ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=F3jFefsWBXGpD4A1LnlZUIHkdHhLE0YQEnOHvrLh9UFYfa37LK9zSvyZOuzJ00wi/5HcOkwSR/f6/tqtZNPrAqCQgOcPdarAlj7DaBAU+mTQFwYCryLtIeNesjKthFJnSFfsHHUKlM62BveRZUfJOjfpu7V3N4EzbmLfkEuOEmrEqsbYhyOWF/cEEKr+IuFNmO8CSH+rs+TC987mqu0kASyHMXTS3gNppfJoifjP/h3Svm26mw1kNBm7FBnRbVoj+JwFZp5sArqVHTv4DOdWF/2YdiQ7JdM/ZoVB9OjTQKRvaA8oR6Bkgl+GE1Ut5OsTN91Wx20qFXrKfqHTYKznJw== 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=203ROX01K1oZ6NurPajI+Um1ICvecqjwliaqm20TbZQ=; b=LwmKp2KAwidt8A728pxyBtBMNsx7j0r18ZW7YTP7uo/3ccArOUQiISUxHhSyUHaUDNW0S15uZ2AZASJq5jscFaQ/HpHC/llV32DOfdWTYvn9uAhMbjA8Yz1h6Ct+6vSDLheYBRIYCaCDxMoKdQrFdAnD7/jwG8jWE3kcLnpZX3XIJfKD0thmF6JawT4KAP/pzfIRXki5NYgxHPZ0grnCuCq/hAGSMp+3l4uzOnOAMwoIsCf+B6Ypp03TZB8IRUBxbLrVatNLv+mcAZgdR1r5HuDoeBvxLbdTu2SfFbmpEfSzwyW2A6Fa6GnYsCWkSCbegDK3PmeGIyI9dar599QP9w== 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=203ROX01K1oZ6NurPajI+Um1ICvecqjwliaqm20TbZQ=; b=mEcGzkFjwBbzDT2BGhGxaWYu/vplKbeYj18gSXYuAYLNF3QzNf2w7QtEhuQ2vcMOXfc+3MhoD0EetEIKF1h4k38lHMoLsTIH4sMPNbMcJs4q3NAoMn7H3LeT9RV/03YU7kXoLmLRiw5XzrtYaCOHHWiyNkruhQ0FBjMTmdrdA1mqxp90VGXNiHTqh9+z/vPmqTW7RTYorixyPvsIZOgOga+ZKWr/kE+IxfduiHGQ8aYGJE5R1TuXusSJRXEVRoKJAq4ryKDgIGkohvhdtNZlMgp+RQ+WFRdbMmlcuw1QE5zQbQDMq/79dQQN7FyxbyigxHvLGuoSkOSt+/ecMHNA9g== 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" , CLEMENT MATHIEU--DRIF Subject: [PATCH ats_vtd v5 05/22] memory: add permissions in IOMMUAccessFlags Thread-Topic: [PATCH ats_vtd v5 05/22] memory: add permissions in IOMMUAccessFlags Thread-Index: AQHatXs7UOkkuRjbokmLCeDI0yIErQ== Date: Mon, 3 Jun 2024 05:59:43 +0000 Message-ID: <20240603055917.18735-6-clement.mathieu--drif@eviden.com> References: <20240603055917.18735-1-clement.mathieu--drif@eviden.com> In-Reply-To: <20240603055917.18735-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_|VI1PR07MB6238:EE_ x-ms-office365-filtering-correlation-id: 804830d2-5778-415c-d827-08dc83925d87 x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; ARA:13230031|376005|366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?= =?utf-8?B?ZW5xNllyS0NvNnZjODdlc28vVmF3dTNZMXg0ZUsrZWIxMzZFTGNFYWpSYnpI?= =?utf-8?B?VzNqN3JGRlh1dzNlY1YrZz09?= 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)(366007)(1800799015)(38070700009); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?utf-8?B?eEtEYmpZa09Rc1hQZGNrNUR2YnVkbTRibWkrMUNlajl0YmZSQU1PalZIWGJx?= =?utf-8?B?Myt4cTBUV1h1STJZQWhpa0t5NHVCd1NSWGloclphaWRzS1pZVE4vZmZhQURj?= =?utf-8?B?M3dKTEUvTnRPcGREZGtKL1AvZWNtWnF2VHVoQXkvUWJmcDNtOFEvRWw0K09u?= =?utf-8?B?OXh2cHhtMDlyUG1rcXEwN2hnKzMzWHRrSzJFY0tSeUMzaGNlOE1NMFg4RGNQ?= =?utf-8?B?UEgrWUJ2ZU5wTWFRVWJTMUxPeVk2M2JkdGhraFBqRFU2NmVBN1ZER0RrNlF0?= =?utf-8?B?Y09yWXpWWlpCWnJ2cXpHTkh2SzF1ZFpxckVkUGhtRUZVRVh3S3ZjcGZvTlJZ?= =?utf-8?B?TzFOeXRpTVF3YzNIT0E5cEtnOVJPYkFHdzJWTU83dERwN0lRSnpmVThOSkla?= =?utf-8?B?VlphNzY4dlpOdUZ0L1RxYlZ0NTRzc3RwZ25TKzk0MzFWUCtPMEFXcmt4TjBh?= =?utf-8?B?aTFWYzJBMFVlR1NvSS9hbW94NkNJQzE5UHVjRmx2WHE1Zm1nUGhxVTdFQTRk?= =?utf-8?B?ZkxPeTE4Vm5MeFBuQ1VoNUhUQktQN2xWVm9ja0JJMGhhT1k0WUJ2RWptbzZp?= =?utf-8?B?UzA0cTFvW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=?utf-8?B?Q3h5RlBnc2wwSDdFY21VbHhUaWZaMC9XK2ozSEFJMlg4QlErcjdCY3Vta1lF?= =?utf-8?B?b3FieWNhUVJ6WTV0OHFtd1NBajFQVkt5YlptblNLYnorcWlaem5CRmQ1eEJW?= =?utf-8?B?T2JYQzh4dTdpaWVnWXJhb3M1ZWRCTXRpOFdrdUhBUWh3bzJBczNoQkRDQjdv?= =?utf-8?B?TzFMN0loWTJEMS9nQytnRjMyWGlsakxTMWZvakJmT3FUd1dYQUI4blhZM3Vn?= =?utf-8?B?NHVUbGl4TEtxK1NBcjZaWDB1L2pvVVlFWjhicDloQS9rTFRJY3F6QXA4ZFJl?= =?utf-8?B?bWJUaTNNaHVlKzlSc0w4bDhvQWVzVjdXSThIbWh1ai9GaWpHc2FTS1IvZ3BK?= =?utf-8?B?MFBWK3F5K1FPV0FoR3pSMWw4bEdXV0xQdVdSTDZ2MG1WR0NjWWh1RFJKaERo?= =?utf-8?B?NFI3cEJOOGp3TC84UjdqczlaV3FxRWF4RnNieXNZQ05YZG9yMTRQSm81SzhH?= =?utf-8?B?VW1saWhsR01USWl5VjlCbFY3VXNGMGZsSnhLMllyT0RsY2VNdVB2U2duSlVw?= =?utf-8?B?QUNIT2RpcmVUayt5ZXp2VXIwZEp1UzZ4Y1U2SXB1b1JucHNEYjVieTVPR3NI?= =?utf-8?B?d0M5bmVMSDZYaS9ITm92cXArVWpRSXJYMDRhQkFYUktOKzNvd3BwTWtGeGk5?= =?utf-8?Q?Vc7U2PrHQSrQussPLl7whtA=3D?= Content-Type: text/plain; charset="utf-8" Content-ID: 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: 804830d2-5778-415c-d827-08dc83925d87 X-MS-Exchange-CrossTenant-originalarrivaltime: 03 Jun 2024 05:59:43.7160 (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: Xm9QNxmm6BXizoxGNq4C8Tx0XYtxcDWPhwYAmOYhkU5MYnRZHcVENnmi50RtvPP/5lefcetgQiewf2KXEzYA0Rdhp1q8pB1rSSt+9AOjAX49RB9VDjHVTRJjlDjpuFVF X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR07MB6238 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.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, 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: 1717394480945100001 From: Cl=C3=A9ment Mathieu--Drif This will be necessary for devices implementing ATS. We also define a new macro IOMMU_ACCESS_FLAG_FULL in addition to IOMMU_ACCESS_FLAG to support more access flags. IOMMU_ACCESS_FLAG is kept for convenience and backward compatibility. Here are the flags added (defined by the PCIe 5 specification) : - Execute Requested - Privileged Mode Requested - Global - Untranslated Only IOMMU_ACCESS_FLAG sets the additional flags to 0 Signed-off-by: Cl=C3=A9ment Mathieu--Drif --- include/exec/memory.h | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) diff --git a/include/exec/memory.h b/include/exec/memory.h index dadb5cd65a..0067b2266a 100644 --- a/include/exec/memory.h +++ b/include/exec/memory.h @@ -110,15 +110,34 @@ struct MemoryRegionSection { =20 typedef struct IOMMUTLBEntry IOMMUTLBEntry; =20 -/* See address_space_translate: bit 0 is read, bit 1 is write. */ +/* + * See address_space_translate: + * - bit 0 : read + * - bit 1 : write + * - bit 2 : exec + * - bit 3 : priv + * - bit 4 : global + * - bit 5 : untranslated only + */ typedef enum { IOMMU_NONE =3D 0, IOMMU_RO =3D 1, IOMMU_WO =3D 2, IOMMU_RW =3D 3, + IOMMU_EXEC =3D 4, + IOMMU_PRIV =3D 8, + IOMMU_GLOBAL =3D 16, + IOMMU_UNTRANSLATED_ONLY =3D 32, } IOMMUAccessFlags; =20 -#define IOMMU_ACCESS_FLAG(r, w) (((r) ? IOMMU_RO : 0) | ((w) ? IOMMU_WO : = 0)) +#define IOMMU_ACCESS_FLAG(r, w) (((r) ? IOMMU_RO : 0) | \ + ((w) ? IOMMU_WO : 0)) +#define IOMMU_ACCESS_FLAG_FULL(r, w, x, p, g, uo) \ + (IOMMU_ACCESS_FLAG(r, w) | \ + ((x) ? IOMMU_EXEC : 0) | \ + ((p) ? IOMMU_PRIV : 0) | \ + ((g) ? IOMMU_GLOBAL : 0) | \ + ((uo) ? IOMMU_UNTRANSLATED_ONLY : 0)) =20 struct IOMMUTLBEntry { AddressSpace *target_as; --=20 2.45.1 From nobody Mon Nov 25 05:23:36 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=1717394639; cv=pass; d=zohomail.com; s=zohoarc; b=kkUAC2CTY2IsmYOT9ZZoNxWT0SH/ysRYXwrU1mjNBYrpoyRQnKYRONXwY9x29FqFcVZjoqT5QjtsdsN+e3bI0/b0H1/xZpA1hkOSAq1wCmnQLBrM1g41rnsz1vfLGksTPqu/dNdikHl05b+LDNd6OR/8rwYcqeJtL1Rvfxs1NfM= ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1717394639; 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=ey8tYT5sCKUkGtrJEMnAddjrE5No915u2Azs6R/nCDY=; b=kY4kOOiYjje7xoaD+VkycKpQQUWJIwtciy3DunbfSHPuyPVAWSnePOcdCOLxOvtjp53Wqv9T/5yOgvK9DBG67t2ZTmGQLQMLppDUuoVHuOo+G287xeLYLFOpVM9Y9vUz3bL0zlKowFgg79NvxiPjbBwi18UV4LEc73JJvWlFaVg= 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 171739463939542.78313666592646; Sun, 2 Jun 2024 23:03:59 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sE0js-0006qz-C1; Mon, 03 Jun 2024 02:00:12 -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 1sE0jf-0006in-Si for qemu-devel@nongnu.org; Mon, 03 Jun 2024 01:59:59 -0400 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 ) id 1sE0jd-00071T-OS for qemu-devel@nongnu.org; Mon, 03 Jun 2024 01:59:59 -0400 Received: from mail-he1eur01lp2050.outbound.protection.outlook.com (HELO EUR01-HE1-obe.outbound.protection.outlook.com) ([104.47.0.50]) by smarthost4.eviden.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 03 Jun 2024 07:59:48 +0200 Received: from AM8PR07MB7602.eurprd07.prod.outlook.com (2603:10a6:20b:24b::7) by VI1PR07MB6238.eurprd07.prod.outlook.com (2603:10a6:800:136::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7633.21; Mon, 3 Jun 2024 05:59:44 +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.021; Mon, 3 Jun 2024 05:59:44 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=eviden.com; i=@eviden.com; q=dns/txt; s=mail; t=1717394398; x=1748930398; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-id:content-transfer-encoding: mime-version; bh=ey8tYT5sCKUkGtrJEMnAddjrE5No915u2Azs6R/nCDY=; b=HsFrMHGgdnvktfB1HLPLErWMFZwvDXsvGfuFfdethNjKnN/9J6tpjXfH G8y2yIoLW7+LrMlzqcInX7i5zmFkJUp+DQJyiQqxGvh72tlLppmK7WruS RPvqo5+MqscxskVTR+HceHKQgCKkLkERADprSyghfvRdwvnZMS8/9OCNG Qy8Q3ZdQBXz3M5CGUo/lo7BkKIErQ8J9JA0Y3b37t31dc5CFOf9X8kmIQ UhE0Y0MZzrFUrfHDwBC6pVGuA9DhbyC5j5DLo9CRSNpEYqD37yYbLi8dM bDsVKwfNvylpyNlTx4OLiWC2cQ+a6EBS7DhqUpyJfAYyq59mWzyi0zUJz Q==; X-IronPort-AV: E=Sophos;i="6.08,210,1712613600"; d="scan'208";a="13815877" X-MGA-submission: =?us-ascii?q?MDHPB3uxTsU0FTN3hc/He/pMVu92DkVcNj7oAl?= =?us-ascii?q?90C6y60heWDtd8llBA8wG7IHnJC/tykY1RGLeKF0br0dMny9s0G/hK+D?= =?us-ascii?q?FgfeK9I8gN/4/rds6+qrdCTEPgRhCKQN3fsn3flFHD2Pkh2AkBwQ1MsJ?= =?us-ascii?q?YA2yhmQjsItIWMjC412BiS9w=3D=3D?= ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Bmi0sx8CULh6aemUQcQO0ElMtJCUnTzsosJvX2tYlk5CdnxJR0QvsCWuBXw5Cs7JCevpY813M93fvGORi8DmwzORK2zE273Ftzbw1qaSNP9gj90nVaAuNW9EUAM8Zwe86qEKdzBHCkiVXqdWO03R8apqee6hcH56dvQnCIeLaOaXklFdbFAK6pF8QkvyMECXWlNUy6iIyANop2MXjULqGpU4VWhNcaTmDQWpf7G+uk81SPoi1FMDLhasvsOwi6Dfq2ynLjdKrB8PtTHiL2tIG35oeqcbWOwJSykVovA536oy07aKPpZgyxhHjsyyG7WVvsdLRPTZUpC3HR4VH8edgw== 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=ey8tYT5sCKUkGtrJEMnAddjrE5No915u2Azs6R/nCDY=; b=Ntor+Cw/FQT6lKAOps3T8qlrkMQzPVnFULBeIHNIM1h+HZWM6IMh4UFpgOMpy44mltIwcedu/oyxQ7WpgJHHNhBF097f80wifyLxpUCWANRt4Rz4v8sI37fRYOATb6/OzvHoBljbdLp0LSP+8C9NymEtcXMpkjdEzUIkky16sezVNriqRX67i0iosbuqm7cenPd/wuWMMDaDV55J8kY52FWhY3TmXPRYPUhcCjMBxUuKhdSVcX4tKHkIY4eTkttmNxRcriG3G0kqOsJIxyHJp2CyAfCDY3lMh5s+pmITLMr+vaYhqQNLyRELv+frkrmhc/SS8PttuOG6Hlt7r7ixdg== 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=ey8tYT5sCKUkGtrJEMnAddjrE5No915u2Azs6R/nCDY=; b=qJWAVcpm/lpTNxDTpkoRUlR+f0Xpgkgn9OKsmNt0OxXZ39bohOZNam1ECHTIYPHxMwcFH7H8quqVC+WUFqYT0T1qfWkyYawjQ4Bz+aJplIdXqsY1arC8h+sxpOJQZ9zTs59obhkZI7BxGu9yxeyjuC22b2s650jT4SgJG+4xDWD4knaRtMqjcy1JpVtDOwO+spJX1vf/SUm6yWF1RVu6b0g0jP6LVk3unqpYLLZSUBatouppxT4NrQuEot4eVa8a09hLMXQCw/2zLMPKzRY8isBcTdDOodIdLVQ2wzyGQU0qSfBLdhjnWDzqNn2GyfXobOzVOMrfUQBnL3QYv+8W3w== 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" , CLEMENT MATHIEU--DRIF Subject: [PATCH ats_vtd v5 06/22] pcie: add helper to declare PASID capability for a pcie device Thread-Topic: [PATCH ats_vtd v5 06/22] pcie: add helper to declare PASID capability for a pcie device Thread-Index: AQHatXs7fkIAOjQiy0K665R5BPGZQA== Date: Mon, 3 Jun 2024 05:59:44 +0000 Message-ID: <20240603055917.18735-7-clement.mathieu--drif@eviden.com> References: <20240603055917.18735-1-clement.mathieu--drif@eviden.com> In-Reply-To: <20240603055917.18735-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_|VI1PR07MB6238:EE_ x-ms-office365-filtering-correlation-id: d5d6cd20-3be4-40e5-0487-08dc83925e03 x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; ARA:13230031|376005|366007|1800799015|38070700009; x-microsoft-antispam-message-info: =?utf-8?B?cFFuNU1Hb1BISWJYVDc3bmM4WXZ2bUUyRG1tOExvZ29uWUZOY1BEdkhEZGlS?= =?utf-8?B?THRpWE5LNzhiQ3ZtaHRDVDZUd1pEYXpOM0N6a3N2UW5OaXN6VHdONWpKaThF?= =?utf-8?B?Y3pxdXVGdUpHZnFETTF1bWhoUEpZbjVIRktsVjIwTk1sazQ0VUhocWZNNkts?= =?utf-8?B?Z0RvUGRRcXVWY1g1SVVtVS9Uc2tnUHhkbDFOS21WNU5pS0MxQWZkTDd0dnVV?= =?utf-8?B?NHY0ak42RzNEL0FPY2xpKzhhVEFpcGQvMm5mNU9tdi9YTTRRQXFjZG4ydk9I?= =?utf-8?B?Mit1SVZUUnR5WkpaN3h6TkVkOTNOOWwv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SlBUckkzckJOdWw3UDhYMXQveVorNTZBYlAxekFyM09TWDVa?= =?utf-8?B?OGdtMktCMzFuaHlYTllBc205bkdGMnBaQU5lQ0RJMzlBOExGQ1pLWnc4bERi?= =?utf-8?B?YjBxS01VSDVVa2o3dkpRbWtEcmFESi9UY0x1eEQ3UVY2NzlXR0lCV3ZmUjl0?= =?utf-8?B?bkx4TmNWWmhkbWZRK256b2U5MWNISzNSNXR0Z3VzQzFZaHZLSjhHVWVZdkUv?= =?utf-8?B?U0lMVklWdDJ6Umk1ZkxMQ0NzT2NBeDAyakFUNDdESjQxMjkvMVQ2OS9SSEFG?= =?utf-8?B?MHY0N0NvSzJQT2xCSGVqendRTFdjVlBXak9hQnJZK1NYNm51UFB6VThhUVQ5?= =?utf-8?B?QWp5V1c2Ym4xV2lac1d0QVMvQUUrUGd3WFE3alBrUDdDOGFYRTA1dERIUFF5?= =?utf-8?B?RC9oNm9WUzJOSW9IYlcwL2JBc2dzWU1HajhjMzJkcFFtWmJyVXJZYTgzMGxp?= =?utf-8?B?UDdnWXVGc3cyc0pVOWRIeVBYYWpmTUdjWUIzVkNFalcwMUkrNzBnS05PZkxj?= =?utf-8?B?V05laHJSWGk0ZUFISGxFN1lDYTBydEtuQUhKTUJGSmR2U1B0azF3SUlLWGg0?= =?utf-8?B?czFuNy9pdGxlWG5UdmdYUT09?= 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)(366007)(1800799015)(38070700009); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?utf-8?B?QnJSWDFiMXZHWWVIRjFCYmJPelN4K2c3NGV5RitYNFB6QmNDRkhBdDJaTGRr?= =?utf-8?B?dnlpNFJEV0U0bi9HZ2gyNFNCR2F2V280TlU1TTluVFE3QjhoZU1pYn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UDJxTnlPZFZBa015cnZ4RVdHNnlheFRWM1dXZS9zWDBsZ0NvWm9oWXFn?= =?utf-8?B?OXdyU3hCbDVHOEFmYkNaMFp1VzBoa0locWdoMFVueWhGWThCeitNM3daTStl?= =?utf-8?B?enBndnBlbkgyMW5JVVpWTFVwQWRVbFlYVEJaSVZxM3BscGxmajRCd25GQ0Nz?= =?utf-8?B?QTloWUhVTUxjZ3JoRWJ4bzNIYS84SmVwT2M3cU5vaGpGYjBJRVBkVmVIRXdE?= =?utf-8?B?RXBpTS9OYmxGS3lxaWQ5TXpXeSthdmpwTzF5M1JhQUtaS0lwaG9pZ0xDSkgw?= =?utf-8?Q?sKGbEHRgseoIqlzwMH1uL+w=3D?= Content-Type: text/plain; charset="utf-8" Content-ID: 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: d5d6cd20-3be4-40e5-0487-08dc83925e03 X-MS-Exchange-CrossTenant-originalarrivaltime: 03 Jun 2024 05:59:44.4939 (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: 4c8N9YAUsKDQvguNVVBmuJVmF7xsvXWVky5+l+ga3CSdau8zuWz79LxhqLndk0Td/FpyxGCEj5tuOkgETUn9szryxtzBpa+D0qfCVVzTzM4gqKNPnusqptQVNtW8VxK/ X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR07MB6238 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.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, 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: 1717394639611100001 From: Cl=C3=A9ment Mathieu--Drif Signed-off-by: Cl=C3=A9ment Mathieu--Drif --- hw/pci/pcie.c | 24 +++++++++++++++++++++++ include/hw/pci/pcie.h | 6 +++++- include/hw/pci/pcie_regs.h | 3 +++ include/standard-headers/linux/pci_regs.h | 1 + 4 files changed, 33 insertions(+), 1 deletion(-) diff --git a/hw/pci/pcie.c b/hw/pci/pcie.c index 4b2f0805c6..d6a052b616 100644 --- a/hw/pci/pcie.c +++ b/hw/pci/pcie.c @@ -1177,3 +1177,27 @@ void pcie_acs_reset(PCIDevice *dev) pci_set_word(dev->config + dev->exp.acs_cap + PCI_ACS_CTRL, 0); } } + +/* PASID */ +void pcie_pasid_init(PCIDevice *dev, uint16_t offset, uint8_t pasid_width, + bool exec_perm, bool priv_mod) +{ + assert(pasid_width <=3D PCI_EXT_CAP_PASID_MAX_WIDTH); + static const uint16_t control_reg_rw_mask =3D 0x07; + uint16_t capability_reg =3D pasid_width; + + pcie_add_capability(dev, PCI_EXT_CAP_ID_PASID, PCI_PASID_VER, offset, + PCI_EXT_CAP_PASID_SIZEOF); + + capability_reg <<=3D PCI_PASID_CAP_WIDTH_SHIFT; + capability_reg |=3D exec_perm ? PCI_PASID_CAP_EXEC : 0; + capability_reg |=3D priv_mod ? PCI_PASID_CAP_PRIV : 0; + pci_set_word(dev->config + offset + PCI_PASID_CAP, capability_reg); + + /* Everything is disabled by default */ + pci_set_word(dev->config + offset + PCI_PASID_CTRL, 0); + + pci_set_word(dev->wmask + offset + PCI_PASID_CTRL, control_reg_rw_mask= ); + + dev->exp.pasid_cap =3D offset; +} diff --git a/include/hw/pci/pcie.h b/include/hw/pci/pcie.h index 5eddb90976..b870958c99 100644 --- a/include/hw/pci/pcie.h +++ b/include/hw/pci/pcie.h @@ -72,8 +72,9 @@ struct PCIExpressDevice { uint16_t aer_cap; PCIEAERLog aer_log; =20 - /* Offset of ATS capability in config space */ + /* Offset of ATS and PASID capabilities in config space */ uint16_t ats_cap; + uint16_t pasid_cap; =20 /* ACS */ uint16_t acs_cap; @@ -150,4 +151,7 @@ void pcie_cap_slot_unplug_cb(HotplugHandler *hotplug_de= v, DeviceState *dev, Error **errp); void pcie_cap_slot_unplug_request_cb(HotplugHandler *hotplug_dev, DeviceState *dev, Error **errp); + +void pcie_pasid_init(PCIDevice *dev, uint16_t offset, uint8_t pasid_width, + bool exec_perm, bool priv_mod); #endif /* QEMU_PCIE_H */ diff --git a/include/hw/pci/pcie_regs.h b/include/hw/pci/pcie_regs.h index 9d3b6868dc..0a86598f80 100644 --- a/include/hw/pci/pcie_regs.h +++ b/include/hw/pci/pcie_regs.h @@ -86,6 +86,9 @@ typedef enum PCIExpLinkWidth { #define PCI_ARI_VER 1 #define PCI_ARI_SIZEOF 8 =20 +/* PASID */ +#define PCI_PASID_VER 1 +#define PCI_EXT_CAP_PASID_MAX_WIDTH 20 /* AER */ #define PCI_ERR_VER 2 #define PCI_ERR_SIZEOF 0x48 diff --git a/include/standard-headers/linux/pci_regs.h b/include/standard-h= eaders/linux/pci_regs.h index a39193213f..406dce8e82 100644 --- a/include/standard-headers/linux/pci_regs.h +++ b/include/standard-headers/linux/pci_regs.h @@ -935,6 +935,7 @@ #define PCI_PASID_CAP_EXEC 0x0002 /* Exec permissions Supported */ #define PCI_PASID_CAP_PRIV 0x0004 /* Privilege Mode Supported */ #define PCI_PASID_CAP_WIDTH 0x1f00 +#define PCI_PASID_CAP_WIDTH_SHIFT 8 #define PCI_PASID_CTRL 0x06 /* PASID control register */ #define PCI_PASID_CTRL_ENABLE 0x0001 /* Enable bit */ #define PCI_PASID_CTRL_EXEC 0x0002 /* Exec permissions Enable */ --=20 2.45.1 From nobody Mon Nov 25 05:23:36 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=1717394492; cv=pass; d=zohomail.com; s=zohoarc; b=ZxhVIdv9C4wPJELAR33rCj+MwKOjr58HgQyyk1Gg27RkRf7lOxuR4IhtaLb5iC41VyD5LGWvOibvfhgGOKMHStgfFq+V2AYB429CR6ny2n483glJReYb9cEiXxMLYyRAbjqEYd/pzd2U/GZhs2FR66s6iytxoAmWZKUKTOw6viw= ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1717394492; 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=z8u53u+CM2INsVXAc6uqK70A1lJTTUSaPFDUaxCmfhk=; b=iQWebUvl5WbrlgFUcCJe27Krh3sGgw7Y9xrDMT83whmG2bxu7uNgquF9Spg5o0bsbbLq1wF4ufEtYeOR6F7bF/L5F/x3c/EIz1yaDteSxc/Ri/BNz45l+mXrpN6fK2G7iYqvhTzMx5RydwUJWhjLBnEO0kHXTqMqFDwVzuH8oRU= 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 1717394492418747.5759218090343; Sun, 2 Jun 2024 23:01:32 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sE0jq-0006qg-Cn; Mon, 03 Jun 2024 02:00:10 -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 1sE0jh-0006kN-UY for qemu-devel@nongnu.org; Mon, 03 Jun 2024 02:00:03 -0400 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 ) id 1sE0je-00070x-OD for qemu-devel@nongnu.org; Mon, 03 Jun 2024 02:00:00 -0400 Received: from mail-he1eur01lp2050.outbound.protection.outlook.com (HELO EUR01-HE1-obe.outbound.protection.outlook.com) ([104.47.0.50]) by smarthost4.eviden.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 03 Jun 2024 07:59:49 +0200 Received: from AM8PR07MB7602.eurprd07.prod.outlook.com (2603:10a6:20b:24b::7) by VI1PR07MB6238.eurprd07.prod.outlook.com (2603:10a6:800:136::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7633.21; Mon, 3 Jun 2024 05:59:45 +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.021; Mon, 3 Jun 2024 05:59:45 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=eviden.com; i=@eviden.com; q=dns/txt; s=mail; t=1717394399; x=1748930399; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-id:content-transfer-encoding: mime-version; bh=z8u53u+CM2INsVXAc6uqK70A1lJTTUSaPFDUaxCmfhk=; b=g9fpAuXoAxWCy1NVp5fCKf2z+y3GsWmx9mg7eSW0QQD1nd6mXm21L72C QxxGYMLO62akBsTb8Mr3WH1ObxJtVVpX8gJQ1x7hNpm2fuT9xU5iPlt/N 2kb/P90aakL+SgUySWPwyZSrlXmFFFsDAPyQQ+aWe2jcIVH2/go6ZdUTM sdLmZsZvqB7D1jQTp3hAhQvV39R/HawZ8In5O/dW/GVAjGYSzW6RxiCka vewnM8p0LGPAdOGyl+0IAqY+hEcMmu2/tbd/qiUGzUL+rzg/83QF0iFIl yollvV4LDvpEjRVAfT4Av2Ph3GtSE/KeW05unRj7QwJhoMkL4kFdNYsy1 g==; X-IronPort-AV: E=Sophos;i="6.08,210,1712613600"; d="scan'208";a="13815878" X-MGA-submission: =?us-ascii?q?MDHwQ4j8y9Ip9XSWWpuGa0SkPI1EdSKoxqsbLI?= =?us-ascii?q?2eUzJ38Uw+V6k2EfE5DYgS5oQOA2boD4dHhUHMSc2Z5lJuzP7ibA+PU7?= =?us-ascii?q?HF5Pe5MgojuH0EKzb0NOYTjQuktgKru8+ZqTbf2eAhsvdhctqBdOO/89?= =?us-ascii?q?kRlQ77HA6oHrKQl9R2PkK8jA=3D=3D?= ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=TVz1ZUJsVDTgJb+QflYCPvtVEIslS52AJ/YwESMKac8lK2W2PSe0ygkU1yKDCF0J6N/Nggv60v3Bi6nVFudSGbWGguboHQsCibdHGfqwLzoaNYwNNpMzsjDiYgqCrLTwatjM/AkQTraM6jEyJLIRfjL4jgBl1vEYinNs5w8U9B7X85CAq2ExZkt+z7FXF5kRkcZ4Enf/1gzd99zFcvM7zPhAvr1lGahhpltVgVcYQ4TMbTxWOKHMwGghd1prOknrvUlbzwZmPsV7BAnXKLNfyzY8gJ1DhOOnjEqngVBHoYNJbN9hp0N0KEtNmrIAhcEZ8/t1elpIyVm6XgdVB3PNJQ== 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=z8u53u+CM2INsVXAc6uqK70A1lJTTUSaPFDUaxCmfhk=; b=UkoRDhx3bYCk6Bsds7HUsaIkbTFv3FLDrGuO5Yt1kdI8Ee+V0sOm74ptTMld1w++QBoMzkkRdI/FOnA0jYTQ5WadkHoye3l08gEm+BX3zvp67SiKW5XYn6vZkpKoZvxFbdImUZrKcCFsOQkal1VhJXPzUE23Ih4dquWRJS5Z63cfVkDMIP6foy4dWnr9SbhZVvQIpAt3KF/nwPkHwgmH8n+3NWyFpYAIV6Wp/NvR1yizJMagquRWhe5g6SyAxjh1G6i1szgBoGx5w52JwYOzxL5lIq4KoszZvKijiGYh9EUM6sPEbPJoxsS9tV4iBeIxFAzTcFKReLfI+yrmv95WqQ== 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=z8u53u+CM2INsVXAc6uqK70A1lJTTUSaPFDUaxCmfhk=; b=Khu4QM2bAp/tJNcIXJJYQrGrJ8677kXM4nsgvJSUGruJFnEeK/vRjiciiBQZxU8VOksCwY0XJOJ/rF11yxYDKDOQah6SsUKeGuon56IVYRBFevGU7DlKC2YWSEJ8/5MoCcC59IkJZ0IfYWoD7f6/ylOu3mljvdqAUWt5I5aQAU16L2yJ8U5uETiZH2noxj1HcL+6Vo1n8/r7DFTflTmi/1oOwN9VPx9duxbMxDnxgWTO5cNFRb9A2w/ZopCA0ARWDZjldTrog+HEOzv8nrNv3Wg2PRtNaVC1CBKg2SIL8XFMvx7JopT+jQZ3/UHDiMZrZPJRtNsjOcCwWatxa87OQA== 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" , CLEMENT MATHIEU--DRIF Subject: [PATCH ats_vtd v5 07/22] pcie: helper functions to check if PASID and ATS are enabled Thread-Topic: [PATCH ats_vtd v5 07/22] pcie: helper functions to check if PASID and ATS are enabled Thread-Index: AQHatXs7XMyQi9yUpEaND2cFURryiw== Date: Mon, 3 Jun 2024 05:59:45 +0000 Message-ID: <20240603055917.18735-8-clement.mathieu--drif@eviden.com> References: <20240603055917.18735-1-clement.mathieu--drif@eviden.com> In-Reply-To: <20240603055917.18735-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_|VI1PR07MB6238:EE_ x-ms-office365-filtering-correlation-id: 1dbe1e5c-04bd-4ad1-7b8b-08dc83925e75 x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; ARA:13230031|376005|366007|1800799015|38070700009; x-microsoft-antispam-message-info: =?utf-8?B?NDRhY3o1NVFEdFZha0JGeUVEZG01NkxkSmRQME8zMjRuTmF1dE9Cb2NHcjBi?= =?utf-8?B?a1VYR2NEQ3RWbHNEZncyWDRzZlVhT3BGbW45YmpqODdrT1VYRE1KZFQwRUNn?= =?utf-8?B?T1ArdlBCTGhPRFY3VzJRZDBURDNsdmNsV0hEamRMVGRZL0dva29XclBOTnpj?= =?utf-8?B?eHNoK2RpTzM4bWVEVGVrTlF3TWowVlo0ZDlteVE3VkRkK2d2eEpYYThtMjgv?= =?utf-8?B?dGdKQkoxcGFZNHRuRDJ4ME13UXV1Vnpac1ducEVTcXJ0OWtRblduMTFRcm1q?= =?utf-8?B?Y0xRYTZES1RwK3AyRXRubXRRYVBaNUxJM0NXdXN4VVA4Ym9waThKZWZ0anBa?= =?utf-8?B?QmVQRU5MOGZuNjdpLzFUcWRlYjRFZklIRlZiNzZROHZoQ09oSDJ2OHJXTDk2?= =?utf-8?B?MzJKMHcyNWtoTEUrREZNTzVyMERzMmc2ZnJKcnl3ZXg0RTdVNzJiMUJyeGIy?= =?utf-8?B?ZFNQNUhqbEM4Wm9GNE1EWDh1NktuSTdzMElydlp0T1pRYzJrTnBCNGdTUHQ4?= =?utf-8?B?SmdUWXpIeHozMkt5ZVQwZm5tK3NQdytCMUg0TTVnaWk5M3RYNmlDSXY0M3NM?= =?utf-8?B?VXVTVHd0cG9LYWdlSkFlcnJzVXB4OHB0RGFwN1VaUm1aY1orNEVCWHhSVGRj?= =?utf-8?B?Rk8rQmJMemxBY2dicVNKTmsxYXc1d1N1N0VRMmRRZ251M0JHbmluR0NzcWw1?= =?utf-8?B?S0VsT1JtNDJwNXk2bGc5ck02MzdSSVYvYllsdklIcWpORUNEWXNCVWFSS1Ry?= =?utf-8?B?aTVBZElERWwxU2JBS2d0OVpIV1lqN3EzbU5zdkN5R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vZmc5aW9UaVI3eVFUb01ycmY1TEUzdnhGUGRl?= =?utf-8?B?RDgxL3F5Uy9JV3pFSEJUSXhIRDFHd0Z6WlZ1QmVpRlVVdEFWaWpyYjVHMTli?= =?utf-8?B?dzhibkdzMVVGS3RuaFRuZz09?= 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)(366007)(1800799015)(38070700009); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?utf-8?B?K0FtbGluVnRTdjBpODFOVXRMWTlLN3pkMTlPRVVpbytSaEtEeW5CSVl4UXNX?= =?utf-8?B?NUR6TEJFRDVOVVFicTB5aFhsbmxCaXJuc0I5REduRGhJa3dHNDgzcnFESW56?= =?utf-8?B?aWVjTjVpbU1Fa2xOV29HTjJyNGtOQVFLb29kNjhLQmlPdy91K1JTODMvK1Bt?= =?utf-8?B?VW5QcWwySmxpcnVNU3IzSFRBYzBGaXlyZVB5Um53bG9TRnJ2V2VBTTBmUk91?= =?utf-8?B?d002a0ZIZ0NjRUViem1ES0s4N3phcFB5NFFXNkpQYk5DNXBTM3ByazcvN04x?= =?utf-8?B?ZmFOOFhSWTJhMDF5YnIrd0x1SFMxTnluUjduckxoeGEra3RYOWdhUzZDMGJn?= =?utf-8?B?MmdnTTBoZ05WNmlkZWFuSmpSamlHdWNNQWROYksyUDQrT282Uzk5UEpVSmFx?= =?utf-8?B?RllFNWJYODZta0NGbXJOTkxnNnlldFd3bHFiTWhVWXhSSzJJTjBNSndTRVA3?= =?utf-8?B?ZC9RclVuZ2dqZzJrRUJKd2lmQ2VTTFozMy80dE4wZFVyQ0dnKzBWQWlZUlNh?= =?utf-8?B?NzZJREsxZ2RoUEhKL1RUUFhuWWZ0LzQ0djBpMXVsbDFYNnBwQ2JIeTkxTVQ4?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NJMXB5cnFuRFFy?= =?utf-8?B?QTRjR1NhSEtBb284NHBrcUxnNHQ4K1dZMTA4WndobGI4MENQMWNvelBXU1FZ?= =?utf-8?B?dXFjWE1BN3dZT1p6N2J5ZVVCWEpta1AySitjTnU2ZjFxQ2Jtc1ByaG16YzZo?= =?utf-8?B?THRNS25ySlhkL20vWkFrUUtxcW1VOWN2Nm5rdm13N3kwWFF5c0w1UjhRd2tH?= =?utf-8?B?QjVPblNMWTloNks1c3JKcVZFQS83akpOWjJxc0J6Sk1BZmJLSlRmOStLZzZQ?= =?utf-8?B?Wno2aXVpSGpxMWJ6dFpnZmgrdldVRWY2NWt3b1p0V0VDdTBFTFpWOW90YUY4?= =?utf-8?B?ZnA3QmtRNGk2djc2b2I5YWY4U1RCRlNuYVgrdittRGNISXNHaGhCam5PMGhm?= =?utf-8?B?VDFIaTR0QTJYbEJick0rSkIwTVhpTCtTWmJWZmY4dXhaRlNjR0JHUW1CREpn?= =?utf-8?B?THViL2crSDdFWGpGQzlJMEpra0swSURYRFZTcjJHVnp1VldYVXZaeEFSd0ds?= =?utf-8?B?K0hpUFJDMXdKVWk2OFFUamZtWGpBNUxybnlxRk1VS2xOR2l2aW1jQnlFWTVR?= =?utf-8?B?VFJ3NDl2WFFJZzhDQzNoejZScWhiUllLelhFZ1hoc1JEVkExeG5zZk1lZ3Q3?= =?utf-8?B?OVRaQjNWSzExZ1htek9qZmVCN2NVMGUrSzZFYmhNdVNWZ1VkdE4wT1hxOS9L?= =?utf-8?Q?7hUxJ7oR91HGmqdK9XTZyJ0=3D?= Content-Type: text/plain; charset="utf-8" Content-ID: <0206B37C22524C4BBD30D199EB16BFB3@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: 1dbe1e5c-04bd-4ad1-7b8b-08dc83925e75 X-MS-Exchange-CrossTenant-originalarrivaltime: 03 Jun 2024 05:59:45.2601 (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: 8VlLlXh6xznQ//jOvLLW1NwqJzkzYoiCgvYrmQzVJ9WHBtFT/W20zjJmxAdPjvhnEqrFVdnyObhDi/dPi58ccPUO4Xywe9ID+5mF+Jm5w3rb5HSBcqChoggRcYC11lVY X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR07MB6238 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.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, 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: 1717394492903100001 From: Cl=C3=A9ment Mathieu--Drif ats_enabled and pasid_enabled check whether the capabilities are present or not. If so, we read the configuration space to get the status of the feature (enabled or not). Signed-off-by: Cl=C3=A9ment Mathieu--Drif --- hw/pci/pcie.c | 18 ++++++++++++++++++ include/hw/pci/pcie.h | 3 +++ 2 files changed, 21 insertions(+) diff --git a/hw/pci/pcie.c b/hw/pci/pcie.c index d6a052b616..4efd84fed5 100644 --- a/hw/pci/pcie.c +++ b/hw/pci/pcie.c @@ -1201,3 +1201,21 @@ void pcie_pasid_init(PCIDevice *dev, uint16_t offset= , uint8_t pasid_width, =20 dev->exp.pasid_cap =3D offset; } + +bool pcie_pasid_enabled(const PCIDevice *dev) +{ + if (!pci_is_express(dev) || !dev->exp.pasid_cap) { + return false; + } + return (pci_get_word(dev->config + dev->exp.pasid_cap + PCI_PASID_CTRL= ) & + PCI_PASID_CTRL_ENABLE) !=3D 0; +} + +bool pcie_ats_enabled(const PCIDevice *dev) +{ + if (!pci_is_express(dev) || !dev->exp.ats_cap) { + return false; + } + return (pci_get_word(dev->config + dev->exp.ats_cap + PCI_ATS_CTRL) & + PCI_ATS_CTRL_ENABLE) !=3D 0; +} diff --git a/include/hw/pci/pcie.h b/include/hw/pci/pcie.h index b870958c99..0c127b29dc 100644 --- a/include/hw/pci/pcie.h +++ b/include/hw/pci/pcie.h @@ -154,4 +154,7 @@ void pcie_cap_slot_unplug_request_cb(HotplugHandler *ho= tplug_dev, =20 void pcie_pasid_init(PCIDevice *dev, uint16_t offset, uint8_t pasid_width, bool exec_perm, bool priv_mod); + +bool pcie_pasid_enabled(const PCIDevice *dev); +bool pcie_ats_enabled(const PCIDevice *dev); #endif /* QEMU_PCIE_H */ --=20 2.45.1 From nobody Mon Nov 25 05:23:36 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=1717394655; cv=pass; d=zohomail.com; s=zohoarc; b=kgn0dvi3FtYjsjBb3GsLFta1+KpObmeyvdFRUxfMujyFpV04j6nLj0rITdQTvRLL0w0FkAwsMwMSU+P5hskgXBV8WL3Z9iHI/d64/TPLeRvjO+WAGm0I816d16uVcHqlYYe4C0qVnFPUuOqgTxG73xW1MLQZwUAhfwsNJOG/ZsQ= ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1717394655; 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=iWMaK1JrTCFHi3BheGFgAXWAS6o9as2GR7+CmB8E6vM=; b=PCcOO2AntwlZoDAq3p4Xta/SVCraDBPoz5pfbu8lz+zWEpPrxCmJJGoUgTUy8RY6WW8x/t7vwCza7UF6ZZCy5PKN+tVI1qID29MhH3ZL/zOp7MfZenHRv2chH0J6K3mBUT0/oWleJMnzH+nckdRLiX9halUq8iD7II9byXYBBgI= 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 1717394655899521.107222832736; Sun, 2 Jun 2024 23:04:15 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sE0jm-0006oW-Pb; Mon, 03 Jun 2024 02:00:07 -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 1sE0ji-0006kQ-1t for qemu-devel@nongnu.org; Mon, 03 Jun 2024 02:00:03 -0400 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 ) id 1sE0je-00071B-Oj for qemu-devel@nongnu.org; Mon, 03 Jun 2024 02:00:00 -0400 Received: from mail-he1eur01lp2050.outbound.protection.outlook.com (HELO EUR01-HE1-obe.outbound.protection.outlook.com) ([104.47.0.50]) by smarthost4.eviden.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 03 Jun 2024 07:59:49 +0200 Received: from AM8PR07MB7602.eurprd07.prod.outlook.com (2603:10a6:20b:24b::7) by VI1PR07MB6238.eurprd07.prod.outlook.com (2603:10a6:800:136::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7633.21; Mon, 3 Jun 2024 05:59:46 +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.021; Mon, 3 Jun 2024 05:59:46 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=eviden.com; i=@eviden.com; q=dns/txt; s=mail; t=1717394399; x=1748930399; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-id:content-transfer-encoding: mime-version; bh=iWMaK1JrTCFHi3BheGFgAXWAS6o9as2GR7+CmB8E6vM=; b=Ht6vv6V614i7/xjiNl2RVoaJHDO5JmzdJ4XjbU6s14/mJ3fJzNFB79O0 79H6bWX53hKsqk2jYs7zmjqiM2C0O06hYOOcAaMy9Zc1SQNO9VllLUXsb iIUbIzIFHEedDk4tcexX+hq0cmmCx3NeUkVj5RPll5e8mVm2tyfdnx3zC IPFDgGLK2l/6LRji+686wlFXr1pVc/dgnVrmnBrlDUvDrP4K/YRGnF3oy m0Y/cJf+seaY0K+thPxPih3eCX7uXVs5F1+hzhtGAfKMq7IE8kqjpCO3E /2slRcGVvrXISy+qu7rSXqDi8DyJ5ouLKIGw0OIlSJQAQn1Z/R8qBWO3j w==; X-IronPort-AV: E=Sophos;i="6.08,210,1712613600"; d="scan'208";a="13815879" X-MGA-submission: =?us-ascii?q?MDHyJ2Ua9jzKmhGJw4TxygAADNa75MbRYLi4We?= =?us-ascii?q?Cr6nU4ItIlwlm6empiFhNjpwm4s1vQfqqclKLwDmRCwnBXh3JxVJx4/W?= =?us-ascii?q?NErlmX13gr8SocXYuHB36+1QqKbaSjxhyU18CK7A6fl5Ay0moFyyvtA1?= =?us-ascii?q?uUnclElyChXYdUbQFbfvjnrw=3D=3D?= ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=BgKK/2utXekTt5TqkA5he8QLEFHT5DjEaeu/PkPop5POZhR6FdjO6ZRqLz4x3hT+/kqjfVeARgPwNohZc12D1Q2J0UGoau4d53CF3D46XB7e8/xWjtNQ6EctmXMD1UdjCDMW1oWtDnPhs82qDj4qRt21f1342W9gDEdYWiSxZiwdGmCO7FrWRKjCckmYvGLwBbgd6sKFw+ilbdrmv/aK4+LNVhCysHNJynPSx9HjyyiBAKhMF/mNHyVFBYC3Ibhq5lMM7g9cZCTJFTFUZMcxE3UJ9MC7lIT0pz/og5rrhLanCWyTMgz8XDaNfXvDXqzkHzj9a+Cm+T+t7ko4vpBH1A== 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=iWMaK1JrTCFHi3BheGFgAXWAS6o9as2GR7+CmB8E6vM=; b=UjMoUCE0vAA/8hVEyasRIJkqIS+3zUi9ordWqQo3cUESlhinu7H3+vXbeWOjGaegGVLvU47nKwl6TE6wncXMlbbgq41d00FYCq17Jej48i9ub5iv4Z0kf5Qf1R+d/uMk1y8XEGsWzlHKSXz3cI4u7vbtUKy/+EL18P+9wrNlkTj67EDQDL4EFIq3W7DNFTE1V/Gq77dEDqoX12M0dgdUmFEojLc18dgbvuQT5FNpqUtE1/qyORd4y12pD3aXkDdN+8KCmfOzGfrO313bAJKbsaem5cgdcWwPVHUUxo4kSms1sbzHSbnH5tCZr1R2TyFpJrZWKUZjvivfSnozfnlS6w== 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=iWMaK1JrTCFHi3BheGFgAXWAS6o9as2GR7+CmB8E6vM=; b=X2corQdqsRJbGXLb+203hLdzdr7/o6T3ykGCHQ0egNqpQQCS+cz13d/5B+rWZZaWMWWhtYK73zzNEPZrm9JbqalfAAcyy0o4qbCm74cR6hHUid7Or+cyy+S+Bqb+UOFrNswYDZBLe1SVw8pHrTda5fBENvRNJoR9Rkr+rDX2oApIhshWbVzh3dPHH5p+WoAyfaOv5sfcTUxy5HNbX+FL9/DSL4Hs0SuqFbWLNbrBJa/YoqGR/eYDip6RIPYu2AD13EQj1E3eU5jR3VS1UyqLJ8kpsL7eG1KfQjrEPpBQqV7u6YXleSMx9mS5Vt1IjCOYBpz2qoqHpLGr2RVvIgCEUw== 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" , CLEMENT MATHIEU--DRIF Subject: [PATCH ats_vtd v5 08/22] intel_iommu: declare supported PASID size Thread-Topic: [PATCH ats_vtd v5 08/22] intel_iommu: declare supported PASID size Thread-Index: AQHatXs86D8amCVVAk2BM7f5OoE+mA== Date: Mon, 3 Jun 2024 05:59:45 +0000 Message-ID: <20240603055917.18735-9-clement.mathieu--drif@eviden.com> References: <20240603055917.18735-1-clement.mathieu--drif@eviden.com> In-Reply-To: <20240603055917.18735-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_|VI1PR07MB6238:EE_ x-ms-office365-filtering-correlation-id: 7082c18c-433f-46fd-622e-08dc83925ee8 x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; ARA:13230031|376005|366007|1800799015|38070700009; x-microsoft-antispam-message-info: =?utf-8?B?ZG0zVmx0aUt2Zno2U0dRdGRUeUZxLzYzM2t1ZC9uc0tleDF6U1Z0LzBETms5?= =?utf-8?B?dnJ0SHZiYUs1QTM1Z0NCSGpZWjcrL3JwWUhlMmpBbG5FVHlJVjdiUzRBZzNW?= =?utf-8?B?U3RBYzA5TDhpOUtPbTRWeFJ6bVJWek5WeGxxVUVwTTh5U2pSRmd2dXIyd2Uy?= =?utf-8?B?MmlySElDUkVjYWZ6VWVJYUQzbVpucEVDZGU4S01sUSszeDZvRXJJOW0zc2ND?= =?utf-8?B?ZmRNS3BhVUR2ekF4OHRHeEgwSmE3WW9UMUQvQXhpb1RmWHVoWjR2ZVAvcWFH?= =?utf-8?B?ZDB1UWxocTNKMVFaeXFWRnJXRnFvaHRUU0hNYTlEZHBrZG5YK296Rk5DK2JQ?= =?utf-8?B?bWJpS01vdTl4cVkwd3doNzF4K2xCWU9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tcGtZQ0xORXA5QkJXR2lpZC96MTF1MzFQdm94TkhGWElnVTFibTVV?= =?utf-8?B?QlFjZ3k1aC9rc2xGQ2c5Wm80WHhoWkVIdGZadG95d0R6SGhPbHYvelF0QjFu?= =?utf-8?B?TS9HTGpkeW92MmFTUWtaMDFaZmE5N3NrR2tCaDJHaGxoVmNCU3YySituU1A2?= =?utf-8?B?aVA3L0dXTjQvWEVBYjZXcEwyMVJoWi95KzhwYld6b2pqbk51NDg0dG9JOWpR?= =?utf-8?B?N3U4enpGNFd0WDNZZEtsTThxWEZjNlhqekREelNyMEZneEZtaVZZUUJ0VzdH?= =?utf-8?B?UmVuVDhkRnhvVEYyKzNzTXBZaktMMTZISnNoZmJGWWV0cXVMazF3OFVIb0xF?= =?utf-8?B?NnF4MWV2T0ozRGZnNDRuY2VMd1JxVHp5ZWJWVHJULzRUa0Yza3owY0NyQjYv?= =?utf-8?B?T3phaFpZZStUYTNNTXRucUxlaklrbThJc3dWaGQxZlZjRE1uYithSGFTQ3BT?= =?utf-8?B?b1ZKNlRFMmhyWG1DL0pOU1RyMk8xV3VMc3RVVTZFQU41SE9NSUliV1U0eDFP?= =?utf-8?B?Vjc2TEpuUEFORGk1dzJKQT09?= 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)(366007)(1800799015)(38070700009); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?utf-8?B?cElmenA5R0QvcjRMb05NSU1kOWx5N0xGc1ZQb2JKQ3BEWnJtbktoZGFTTFlP?= =?utf-8?B?RkZjRGU0cVVYL2dnNk5YM1htaklvV2tZYkFGWlFQcXNBbkVNalgrSEtxN2s0?= =?utf-8?B?bXc5RXVrVDY5aWdoeThUOEpkVEtPaFBMTEhOem0rbmUzSWFWaVpsVlR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5NXJ5M3czRnNyekxhTk44?= =?utf-8?B?alNJTGhENi9TdEVsLzY3aHZIdi9UdWFPZkJpT3JUZW1TT1FyRFpvcEJGM3pM?= =?utf-8?B?VTRhbnR1YjNOajRyL0Q1T0pZb2tlOFlLNWpvb0hzRWRFaTlzTUcvY0dRUHUv?= =?utf-8?B?SnVhQzFOald2RkliWWNyZS9oNmxjS2QrYU1qTzJZajI3VjBSWnN2V3lEUEpQ?= =?utf-8?Q?QhV5k0O19e2/KALzNW81Jwc=3D?= Content-Type: text/plain; charset="utf-8" Content-ID: <4D0B3D6B2160FD4EA6A9FF6316759583@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: 7082c18c-433f-46fd-622e-08dc83925ee8 X-MS-Exchange-CrossTenant-originalarrivaltime: 03 Jun 2024 05:59:45.9895 (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: VSPP8xNVXPqE0FxVxWhOhXNoJpmOimUfgMzU146D3MTig2NKoLA5kLnABt9olyR3YoTR1fhHO0LEbnD1a32rhb3x58iZxBmBmxg19vJQ3rzGTmBR/TN11aEh2WbLWKEf X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR07MB6238 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.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, 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: 1717394657602100001 From: Cl=C3=A9ment Mathieu--Drif Signed-off-by: Cl=C3=A9ment Mathieu--Drif --- hw/i386/intel_iommu.c | 2 +- hw/i386/intel_iommu_internal.h | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/hw/i386/intel_iommu.c b/hw/i386/intel_iommu.c index 7b0c22fc07..fb6c7d1e33 100644 --- a/hw/i386/intel_iommu.c +++ b/hw/i386/intel_iommu.c @@ -5838,7 +5838,7 @@ static void vtd_cap_init(IntelIOMMUState *s) } =20 if (s->pasid) { - s->ecap |=3D VTD_ECAP_PASID; + s->ecap |=3D VTD_ECAP_PASID | VTD_ECAP_PSS; } } =20 diff --git a/hw/i386/intel_iommu_internal.h b/hw/i386/intel_iommu_internal.h index c9a673585f..1b0d8958ad 100644 --- a/hw/i386/intel_iommu_internal.h +++ b/hw/i386/intel_iommu_internal.h @@ -194,6 +194,7 @@ #define VTD_ECAP_MHMV (15ULL << 20) #define VTD_ECAP_NEST (1ULL << 26) #define VTD_ECAP_SRS (1ULL << 31) +#define VTD_ECAP_PSS (19ULL << 35) #define VTD_ECAP_PASID (1ULL << 40) #define VTD_ECAP_SMTS (1ULL << 43) #define VTD_ECAP_SLTS (1ULL << 46) --=20 2.45.1 From nobody Mon Nov 25 05:23:36 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=1717394481; cv=pass; d=zohomail.com; s=zohoarc; b=hKVhnXalnRdsSL6oaJU2Izmsgeojw7GXyzyyItUwInC3OHYJAfnY71sdSG0FXv4pGNpXhdAcDkDdXui/M0oBu3clGl8gRYCnW3Lfmz2edEM8YWfed4FU/onLef9QMPMgXA+kKSUCMn8NQDRvyx6Ffi58tixdC6/NFVgzlOk3Tqo= ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1717394481; 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=hK7styFD7PCpSuTqw2+IHY/14iimk7sPF6ZR7mmO87Q=; b=F6JY+JYxjBp0EhOvixh/qmOKbR06DQA+Jr1NjG6I9IMlxj5Q9fTVqG5RUh8h9VHg8D90zhu+ZcSrewF4ZusCwDzb2O4FovsCqZfULZybeb5i1KJ0gLuTt3KmDMtrAMfSZDguvDXFIQMXnX4hWhp8tbZdGpg2RtENfmsO2sWUDok= 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 1717394481608607.6928808861527; Sun, 2 Jun 2024 23:01:21 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sE0jl-0006nk-WD; Mon, 03 Jun 2024 02:00:06 -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 1sE0je-0006gx-R2 for qemu-devel@nongnu.org; Mon, 03 Jun 2024 01:59:58 -0400 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 1sE0jc-000731-Ov for qemu-devel@nongnu.org; Mon, 03 Jun 2024 01:59:58 -0400 Received: from mail-he1eur01lp2051.outbound.protection.outlook.com (HELO EUR01-HE1-obe.outbound.protection.outlook.com) ([104.47.0.51]) by smarthost2.eviden.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 03 Jun 2024 07:59:53 +0200 Received: from AM8PR07MB7602.eurprd07.prod.outlook.com (2603:10a6:20b:24b::7) by VI1PR07MB6238.eurprd07.prod.outlook.com (2603:10a6:800:136::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7633.21; Mon, 3 Jun 2024 05:59:46 +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.021; Mon, 3 Jun 2024 05:59:46 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=eviden.com; i=@eviden.com; q=dns/txt; s=mail; t=1717394397; x=1748930397; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-id:content-transfer-encoding: mime-version; bh=hK7styFD7PCpSuTqw2+IHY/14iimk7sPF6ZR7mmO87Q=; b=dOIZIS5kTGzNLRllhHlXdvajTliOng8eDYPZvpmhUAumRNhJZfwnXkW1 BK0uhcpQIBmaGXlIgCl0NqiT147JPhPpbkKmcuMzvFB+908Q5fynScmeC agUyS8Et8/njHSKAOFDxi8O1FFTrcdty9WaTrC2zyEwjBzA9Gh8Q0hXi5 dzFV+pApBDut3G4K5hANtnZSt41PY74gsgr2HxVmHVX6qZdd3N+oSohSY 9rqzmNtKbIZ7WRVZsuKVsMtoGYHepEkjJ8vqGMn6jK2h6f5NlH6F5VRcS w6Gx+AMd5GCxueJkxbNxGgUSJGBnFUbW/s9XDeVkZbHvj73KWEV4a54BP g==; X-IronPort-AV: E=Sophos;i="6.08,210,1712613600"; d="scan'208";a="13763248" X-MGA-submission: =?us-ascii?q?MDHZAAo1OJOV+Fyug36ems18i4MkrNmeAB7tbq?= =?us-ascii?q?gwyCWfnLzNqzmMk1kQbgOMby6oYv/NunlRqpr5LAw18pC+lanF+biuFY?= =?us-ascii?q?ha7ho4mQUh1L9jdRQcVfvUb0/JxFBogU854jiv7tn6Te0n4hPedCIZI3?= =?us-ascii?q?K9q8ZIb2wZMC+w5NfQq2x7TA=3D=3D?= ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=hf8DfcDxL9a3rhILDOvWp9Mj5ABtwXZo+apzN+9zUem/xsXAMa9YKgvwhI5CyWNrLwwWqfLR/1WgtIHF98c6fhWCwY+GZwnsMUue+GiWa9itfyVubpG6FkBngWjzlrXOtz52lwGDztr7zU9bf9Ig9SMatC75L0+/yZ/moNZ4wXNcgBhqRGkzNDHdyc9Ot3pU8Myn6lyfMep1qojDLMpVBOJB1JDXnlnl7vL9VIbhdcMDqB0anmrC3BTYWFWOehEaVSJir030GQZjmmPdhbt6PKzb740XL4CkkEP4BOOkD+fO1Gmypy8gY+ow0AKYVluaxTOToUgfoM9De0k36jtA8A== 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=hK7styFD7PCpSuTqw2+IHY/14iimk7sPF6ZR7mmO87Q=; b=dPNjoMUR7C93kgROOsPpfFz2oOf4i5ePQ21PjATpcHrfEfxUTdoZ54enYe56H4LBoOH4VuBe6q8W9l1UrbgS31HO7THPBDQafbTTMPbyo2c4bXDU4bvUiARMaO2zKXUNVsv8a7WgfBzseBronB7bXeseKS6uLdlkBKZx6x+7O4EP8LmS++9cmtfHH9yV7OWSaKwgbpUFNXNwzOoqnMgzHWy5bBXMKqIswXt17vm5PDjE/0txaJVdPJGhIJde8VwZioinJ4UZXbdj4WLFA1qki7eiHOr9PscuKcjr/1oVRYbzzUKfD1BrynWs5IB7RZKxddzifRbgOhDk2duBLAD6Ag== 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=hK7styFD7PCpSuTqw2+IHY/14iimk7sPF6ZR7mmO87Q=; b=TGFxeGK/TNshkWUxHgW0ClDD7vIW3WmEWU236nFJabuwwn8HHU01gesKehq6YblpHNKdj6hKWDql/WuBRcW/x3uJXuD4TfTZUa8vMWDaaL+XuRGloUjSInF7f6inZ8H5v+v3gYVGFj2bj96N/YfjGeUytVIwGfiZypYrXI5ALKQrdunpIGHstpOfjBxH+ZB/gEqjjFd5zCz9fhmIfW8Y/XFzXfMpfZKWMSvDb2hSodCFpV+f5ScsNvUqoICy7em7e3stl8cM5AVOQEyX/J43RoaxdEY0Lh8jpLOSxaQwE+Hq6MTgDRzHKuf5Y9PUCfiBxyBxtvS4AJWVE6CFzzB+2w== 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" , CLEMENT MATHIEU--DRIF Subject: [PATCH ats_vtd v5 09/22] pci: cache the bus mastering status in the device Thread-Topic: [PATCH ats_vtd v5 09/22] pci: cache the bus mastering status in the device Thread-Index: AQHatXs8uu4aQUIynkS7hn2PtCehRw== Date: Mon, 3 Jun 2024 05:59:46 +0000 Message-ID: <20240603055917.18735-10-clement.mathieu--drif@eviden.com> References: <20240603055917.18735-1-clement.mathieu--drif@eviden.com> In-Reply-To: <20240603055917.18735-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_|VI1PR07MB6238:EE_ x-ms-office365-filtering-correlation-id: 753f9ba4-419f-404d-c104-08dc83925f3d x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; ARA:13230031|376005|366007|1800799015|38070700009; x-microsoft-antispam-message-info: =?utf-8?B?a1dyT01zaVpHdFp6dDdoRmJ2R0Z2eTNHUkZPL01KV0F2cDNJaElmdWJxUWJC?= =?utf-8?B?dkc4WDNlZUI0VE81YVRUbUFOMUNzSE5IVG14K3RiNFBGRnNrbk5nN3BFbmtC?= =?utf-8?B?Q0Qxd0Z1VGNMdjh0cXNjTE1KbW5ZaDcvc1FsWnZWQzAvZkl0clVQUzlMbzNE?= =?utf-8?B?TlkwMUtTRXYvbmh6QkpDUjJxaGFUMVdFb2lTT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XRU80UjlJYU5neVo2QUlkSGpD?= =?utf-8?B?VVpNM1JBL1R3MzdTU05obEpHeVhEa2dlNkZBZDZxVEo0VlQ0YURuR3FsM1lk?= =?utf-8?B?UnIvOUZOWjFGaG9ONWlKUXZFZ1JtQlh1NWk5N1dyMUtZQkhZVU1ZNVNRRWpz?= =?utf-8?B?My9UN1B6bmdsSGh6Z2xUMFhHZFJmK1BpMVQ0RHEwdVdxdHJVTU9SM3JVYTZ6?= =?utf-8?B?eEVINVVCNlByOGZYak1WamUwVmxDUFE3Nllxay9BdVhISlBTV3Y0MjJ3U1Q0?= =?utf-8?B?dFI2cDUydy9UTW9rNVpnQWl3U0IzT1l2bTZhdkQ1RE1pTDdnRyswQloxaFlv?= =?utf-8?B?UTBPdXRHL2xSUVJwamIybE9Memh0TmZlS1lTeWNIRzJGQ1k0ZjVRNnR2REx6?= =?utf-8?B?NmpJamVOT1VWYm1DM3VGWE56bnJCSnlZRVJOa2RCRHo1QjlaUjl1em5SdHVW?= =?utf-8?B?Nklha2hZL284L3JFRWowbXlDdHBtWGxtRzE2Zy9kcEFZN1N6eDZrb0dyaDlX?= =?utf-8?B?aGpBNk9FY0dodXBEdzQyN1JFWXNyNjNLaVo2K1IxQzZMblI3dHNzYzZLbTY0?= =?utf-8?B?WUczMUhnNGd6SjdrUUpGVnAzK1ZackFZRXJSNlRsWDZCTUZuK1d1L2kyVlBH?= =?utf-8?B?ZURXS1hERkN1d1lRSGlZcnYxRW5FeXc0d3ExSHBVSURPNlVtWTltUjZ6cTEv?= =?utf-8?B?blFuL1l4SHF2Tk5NeFZDdz09?= 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)(366007)(1800799015)(38070700009); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?utf-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dkRFpORnJIM0VWanBxbXR0V3diaDBhaEVI?= =?utf-8?B?WXRVK3BUQy9vOUZIOHpXZUpyTWUyUDQ3MlhaczFEbmtST0ltYUFjSHo0dm9z?= =?utf-8?B?U0IyS0kxZlBSdTRDdTZWbUF0bW94TUNxd3pBUHBJdTVPMDdNNTR6RCtZM0M4?= =?utf-8?B?c0ZNNmhPcHlveSs0TkFuU2thWjh1UzJxSTBIVHBUQzFXRG5nMmdkOHh5ajJY?= =?utf-8?B?dFg4YkIzMUZ2aW5UTy9pKzk1MWNGOURlQ0FVSi9JaFlxRENBbFVDSlEvWS9n?= =?utf-8?B?Q0JhWkhtREZCMjNDaWVqQTF5SG0vNDlDSDVMOWdtUGJQT0trTFJiN2tKaHBr?= =?utf-8?B?UFhSZFpTL1JFSWQrSWtnUENlYndSTFB0Y2h2a01mRGN5NmxvQnlaZ29ienZK?= =?utf-8?Q?zXDOGODgzUgJarng+cfk2Y8=3D?= Content-Type: text/plain; charset="utf-8" Content-ID: <0330FBE49A40324C94D980484758CC6F@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: 753f9ba4-419f-404d-c104-08dc83925f3d X-MS-Exchange-CrossTenant-originalarrivaltime: 03 Jun 2024 05:59:46.5829 (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: 2itEcEgfnG1v3AXPuYUhWBqBPtGIjUCpg4LB4WRs4iiMqBaGzPFpUXBZzD52DQSJExhxLNJEfhpaJmwYa4KaiXo9oaMqP8z0wrC2nw4M87f13fp3n0qBSVLhIg2+DKJK X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR07MB6238 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.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, 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: 1717394483084100009 From: Cl=C3=A9ment Mathieu--Drif Signed-off-by: Cl=C3=A9ment Mathieu--Drif --- hw/pci/pci.c | 24 ++++++++++++++---------- include/hw/pci/pci_device.h | 1 + 2 files changed, 15 insertions(+), 10 deletions(-) diff --git a/hw/pci/pci.c b/hw/pci/pci.c index c8a8aab306..51feede3cf 100644 --- a/hw/pci/pci.c +++ b/hw/pci/pci.c @@ -116,6 +116,12 @@ static GSequence *pci_acpi_index_list(void) return used_acpi_index_list; } =20 +static void pci_set_master(PCIDevice *d, bool enable) +{ + memory_region_set_enabled(&d->bus_master_enable_region, enable); + d->is_master =3D enable; /* cache the status */ +} + static void pci_init_bus_master(PCIDevice *pci_dev) { AddressSpace *dma_as =3D pci_device_iommu_address_space(pci_dev); @@ -123,7 +129,7 @@ static void pci_init_bus_master(PCIDevice *pci_dev) memory_region_init_alias(&pci_dev->bus_master_enable_region, OBJECT(pci_dev), "bus master", dma_as->root, 0, memory_region_size(dma_as->r= oot)); - memory_region_set_enabled(&pci_dev->bus_master_enable_region, false); + pci_set_master(pci_dev, false); memory_region_add_subregion(&pci_dev->bus_master_container_region, 0, &pci_dev->bus_master_enable_region); } @@ -657,9 +663,8 @@ static int get_pci_config_device(QEMUFile *f, void *pv,= size_t size, pci_bridge_update_mappings(PCI_BRIDGE(s)); } =20 - memory_region_set_enabled(&s->bus_master_enable_region, - pci_get_word(s->config + PCI_COMMAND) - & PCI_COMMAND_MASTER); + pci_set_master(s, + pci_get_word(s->config + PCI_COMMAND) & PCI_COMMAND_MAS= TER); =20 g_free(config); return 0; @@ -1611,9 +1616,9 @@ void pci_default_write_config(PCIDevice *d, uint32_t = addr, uint32_t val_in, int =20 if (ranges_overlap(addr, l, PCI_COMMAND, 2)) { pci_update_irq_disabled(d, was_irq_disabled); - memory_region_set_enabled(&d->bus_master_enable_region, - (pci_get_word(d->config + PCI_COMMAND) - & PCI_COMMAND_MASTER) && d->has_power); + pci_set_master(d, + (pci_get_word(d->config + PCI_COMMAND) & + PCI_COMMAND_MASTER) && d->has_power); } =20 msi_write_config(d, addr, val_in, l); @@ -2888,9 +2893,8 @@ void pci_set_power(PCIDevice *d, bool state) =20 d->has_power =3D state; pci_update_mappings(d); - memory_region_set_enabled(&d->bus_master_enable_region, - (pci_get_word(d->config + PCI_COMMAND) - & PCI_COMMAND_MASTER) && d->has_power); + pci_set_master(d, (pci_get_word(d->config + PCI_COMMAND) + & PCI_COMMAND_MASTER) && d->has_power); if (!d->has_power) { pci_device_reset(d); } diff --git a/include/hw/pci/pci_device.h b/include/hw/pci/pci_device.h index d3dd0f64b2..7fa501569a 100644 --- a/include/hw/pci/pci_device.h +++ b/include/hw/pci/pci_device.h @@ -87,6 +87,7 @@ struct PCIDevice { char name[64]; PCIIORegion io_regions[PCI_NUM_REGIONS]; AddressSpace bus_master_as; + bool is_master; MemoryRegion bus_master_container_region; MemoryRegion bus_master_enable_region; =20 --=20 2.45.1 From nobody Mon Nov 25 05:23:36 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=1717394630; cv=pass; d=zohomail.com; s=zohoarc; b=i+9t617kbcE81lf0xSGCBDKyUi6tboOaXldrH4n5IFOYnCHDqukQxXCFCmxnDvYBFKlVTt4sl5cUUniarbV4Ej4wy9609dSbT37NtvVJARLc/p7p6/YRr+T6MYS4tnsulnlUm6OPYTcJ5TLHpI97qFrXuA1gIuP1qln+8pVXSxU= ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1717394630; 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=acc0XnlBTdWdElPteZmm/CA3s/ptFk3pV/0xf9UxvH8=; b=dlqa2XFIz7Ometw/dv3YCe4M5Mr6kSHn+8zm2BniM1kRcQUMglZDd/4BOt/YLDnshWoCog2zqK5v8QG75qRGkJftQetp2mKeEAxtQuwCTPxc2aJQKVuyWd+T6DDf6iLjauUEOtkHDI1NGTPFX4TqoNBQL1YN9fMAQlgJ4F14l9U= 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 1717394630309265.9052318341062; Sun, 2 Jun 2024 23:03:50 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sE0jd-0006gA-SK; Mon, 03 Jun 2024 01:59:57 -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 1sE0jb-0006f7-Qu for qemu-devel@nongnu.org; Mon, 03 Jun 2024 01:59:55 -0400 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 1sE0jZ-00072M-RV for qemu-devel@nongnu.org; Mon, 03 Jun 2024 01:59:55 -0400 Received: from mail-he1eur01lp2051.outbound.protection.outlook.com (HELO EUR01-HE1-obe.outbound.protection.outlook.com) ([104.47.0.51]) by smarthost2.eviden.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 03 Jun 2024 07:59:51 +0200 Received: from AM8PR07MB7602.eurprd07.prod.outlook.com (2603:10a6:20b:24b::7) by VI1PR07MB6238.eurprd07.prod.outlook.com (2603:10a6:800:136::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7633.21; Mon, 3 Jun 2024 05:59:47 +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.021; Mon, 3 Jun 2024 05:59:47 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=eviden.com; i=@eviden.com; q=dns/txt; s=mail; t=1717394394; x=1748930394; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-id:content-transfer-encoding: mime-version; bh=acc0XnlBTdWdElPteZmm/CA3s/ptFk3pV/0xf9UxvH8=; b=uKMPl2HqthknXeq+41F/P47bM9xcsfjrUTJOe8H5GdZZyzSaV1gR6obH H6AgP1k145Ac9v18HSFTh0UtrRHPFFKWvWlwb8QId6e72KJu4Lo2qTIER Wo7bUCWOjlEvVrpfCAztm4erId+9Ixy0GmxcRiDU3QIC1WU/drTwtD5Mz g3wgkjF6dOOMjsFafgwJvCLjVSMKLPXqu3yrJx3rceTovOkgj3UERtUTT lpBGfAogx6rh/wN0u3ZfenAK1eYz9uVhtaoPdMdRJu2xsr/OThjzdfOyd j/QZc715R/TrZKc8AJ5F2iQNtgz1SDC/kVwuHeNvPK9LN1P3mQVZFQ9Lp g==; X-IronPort-AV: E=Sophos;i="6.08,210,1712613600"; d="scan'208";a="13763240" X-MGA-submission: =?us-ascii?q?MDEyFvRha8IsJXlP/gqwAblC3FzKbidQSdwk4F?= =?us-ascii?q?uY/W+YTr+9/S5wsLs3Pod4G78HrdyvwOaDLAHPrHq6bqM6W8yM0WmzQx?= =?us-ascii?q?ZflNEaL8my9Z21PcOtEO2nI++nCHQ8HK8Kx39qyevVBVMUptqBjJuTJ7?= =?us-ascii?q?gDT6xeQAfkR1g7G1WUkFO+JA=3D=3D?= ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=OkQcw5RavQjBkbVsa9pUSQoKwU4NJkUFs9jlh9857EgE0Z/3l4zC0EMYFkmFvCKwvWilSP3eoYpIGxSn+lJxg1cfhNAe+SW8YMiSE6NZ2lMF3kC4FlxUig4yKtzlKO8UkfNS0Wjl29WMQpK99JnLCBsUfN9g2yYo+eb5rF+VTMnSHq+scQGvoejtMQvmhqxEfENzn6+8++v4eCOTosI726L+M0mhdyh0LiGmarf8TDP6yokH0c7b02ofBNBkcbsldCZn6egdy9nqOwDmj2IJNfXeREvINUDE9Pqov8Vf9mNCJ1/LyC+lb3qqrAjcKWrof+Dxl98wn0vxWb5es6ow9w== 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=acc0XnlBTdWdElPteZmm/CA3s/ptFk3pV/0xf9UxvH8=; b=hraPycEsjMYjNMcn5APBafZv8x7gjyEsXUJ76NBqVK9e/Bju3HnBwfkUQkax5bnLPMIN9GZsc00m37yGomJaSZYo5mcVylZ49u18yCKyiGeZgdOrm/xQyV3c8yptYqgkr27hgrnaAWdH8Ae2CPLhnU5BmCjJqN+q9GVK5s/+w+CH6ZnGrnuac4Mx2SlbCJL2w2R3PQH0JXc36oLKtbKOPeear40x/sWfbKqEpqidPUG7fwjNYbFsSaFInU2KiEUnFkABP8aXICLiNXzmaUW6+a6z1nVB5XsWZattQ+MR9WQ0fqtGKGvMat8qIXBmNSqfEjPESwHi7RrjIZD6wXQI7g== 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=acc0XnlBTdWdElPteZmm/CA3s/ptFk3pV/0xf9UxvH8=; b=pH0ijjeEtBmx0o8UJavljH+9OaRocCk1rX21rAN+ERWliuNkXLsILrKt4uYfio2vC6+eYWyd1zmFZfwqyumrjYG9RRfcoHUTs5Md1o7iEjLR1GhThU41xtss8uHVkTloj1ysMFgQmxNa9CPgp9EBuT3hgYtG690P/Iq7o0LLSYxbzvw2dhMF777brLcaddiMilkwDYae/EHvLli+U2w8f+yEIK4H0haWYeiW6OQLhHbsrftLIUEIrsthxhokQkIrhiWJUBbNC+gufDrB2SvfTcBXPJYPeAl3z/MiLzuTc9N8Jai8m/phhmbXnizsIAUU/3ePOtDy5k2po35f7J5+BQ== 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" , CLEMENT MATHIEU--DRIF Subject: [PATCH ats_vtd v5 10/22] pci: add IOMMU operations to get address spaces and memory regions with PASID Thread-Topic: [PATCH ats_vtd v5 10/22] pci: add IOMMU operations to get address spaces and memory regions with PASID Thread-Index: AQHatXs9KwLmXjyVvEupV37REpL8HA== Date: Mon, 3 Jun 2024 05:59:47 +0000 Message-ID: <20240603055917.18735-11-clement.mathieu--drif@eviden.com> References: <20240603055917.18735-1-clement.mathieu--drif@eviden.com> In-Reply-To: <20240603055917.18735-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_|VI1PR07MB6238:EE_ x-ms-office365-filtering-correlation-id: d5d58363-0ddd-4808-2a04-08dc83925f9d x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; ARA:13230031|376005|366007|1800799015|38070700009; x-microsoft-antispam-message-info: =?utf-8?B?QlAvb2plUjRnZjNUNnVMMEtITU1tOEYxdHhPUEpZbkVjdExVMXJXODhLUGU1?= =?utf-8?B?QUM0RkI1ZFBIMEU4cmVZTWhPbktrOXRiRSt1Q0xjL3JSVWRCZTBWZEV1ak0x?= =?utf-8?B?T1BEREd5cFVDd0VEc05ZYXlCKzdHeFdOSXd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lYY2pHaHRBRHp6LzJTM2JBblhWYnNENFlHdkUxaFhi?= =?utf-8?B?QnZBc0ZRbkFmKzJ5dmY0dEd5WEMzVXdzakVEN1VpVWEwWkpLSis5V3ZRb3F4?= =?utf-8?B?K3pmR2NVZ3R1emF6UWRtZmZIaU1mNVNYTld3a2x3emUzTkc5UkRUWThMdXEx?= =?utf-8?B?elo1blRhcUFYVGRzY0JTT00vMzgzS2p3NitSLzFHTFpvdzBUMmFyUUd2VnZs?= =?utf-8?B?S3M1dVVFQ3JTakpkdUIxUEFLZHRqUlJlTDQwUXJncXdjNHVNa0VoekFCOEJV?= =?utf-8?B?bzh2b0pnT3Ric2lLY2JKM1pNcnlML3dLSEg0cUwrakd5NHh4MXpLaTZsRUlG?= =?utf-8?B?dXhzcDZuTzhCeC9TU0Z0akRENks0WjFWcnVuMUgxLzVCYzN1cnNGRW1OUFoy?= =?utf-8?B?TkpHc2FJNDVVaHdXWXl4S2pzdDJqZW9xakJuL25xUit4VHkzM25YazVGc09Z?= =?utf-8?B?TVQwRjdQdFROd0ZyWmxGdm01cForNEJqdXhjdGFzV3dKVFdJZ1E2M0drVGFH?= =?utf-8?B?WGxOYzNka3VSSUhLS2RvR21lYS92dXlPakE0YTZGM1BOU0lVbXNEY3UwK1pR?= =?utf-8?B?Y3NkMitacEdqRTRoelhwNE5UR2RJTEFyTm5FVk1nOHo0RS9TYXUrNDVUdmEv?= =?utf-8?B?UE5Qb3BvWnZubFZ5dXdkQ1EwYmdlVnlaVWJrRlRtd0tGcnZYODNLa3oyaUNt?= =?utf-8?B?eEJ0TzAzOUZuVENJQzZCOThUcDkvNWJqNXo4QitHQXNwQVE5VXlCbmtkVHZL?= =?utf-8?B?YVlieC80SUE2eFdKNjdEQT09?= 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)(366007)(1800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NCd1NkanBNajBpblBTdVp5SmkxUlZlOW56ZlhwbmZ2?= =?utf-8?B?NncvWUxacy94cTA1M2pVYTdxd29iM1Zmdjk5TWlMRnc5dXg2UWFVbjBTU3Bx?= =?utf-8?B?OGhma1k0b0w3a25ZbmJzT0Q5SktiME5wTnVwd3JsUnJ1bGt2OHZQV056bzNz?= =?utf-8?B?NjdEeHcxNDJnaXR4L0hSZGNKVHZaY3RTeVRjSWhtWmlST2dQRmc3Ti9ZaG12?= =?utf-8?B?SFUyN1Bwd2JqcUhjNitRSGtuQ1NnNEIzSm1kcHdhUUtVU0d5dUlyaGpmQmhh?= =?utf-8?B?TGV6T2tJWGlpK29tT1ZCR1hEaWNlWXFrZVl1b0g4dWZ5QW1PVGw2RkZkdFVh?= =?utf-8?B?c09DVlVrZXRQT1ZpMjNjM0N1bHRyVUNnazlka0FaMExwQUZjZEF3SktLZmRa?= =?utf-8?B?QjZJeUNxYjViNnpUeWJZdDVHcy9ReUY3Z1RuZFE5VmptWXl0TUcwN2RDZ0xn?= =?utf-8?Q?Gjyu9lt6Zq6/4nn9ddDFH88=3D?= Content-Type: text/plain; charset="utf-8" Content-ID: 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: d5d58363-0ddd-4808-2a04-08dc83925f9d X-MS-Exchange-CrossTenant-originalarrivaltime: 03 Jun 2024 05:59:47.2109 (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: WEQYzi64BlfSRPu6wgbsZVHKXZ/3l6qV8P5qxjCIiTfILRGCeU2Dqr8U574cFQu/+EfVk2j9MEn3a5AmeTDOJMh/r86tar59iOHeBaRtsyf4FTfEgIWhYC0DbjeC1bCm X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR07MB6238 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.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, 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: 1717394631507100001 From: Cl=C3=A9ment Mathieu--Drif Signed-off-by: Cl=C3=A9ment Mathieu--Drif --- hw/pci/pci.c | 19 +++++++++++++++++++ include/hw/pci/pci.h | 34 ++++++++++++++++++++++++++++++++++ 2 files changed, 53 insertions(+) diff --git a/hw/pci/pci.c b/hw/pci/pci.c index 51feede3cf..3fe47d4002 100644 --- a/hw/pci/pci.c +++ b/hw/pci/pci.c @@ -2747,6 +2747,25 @@ AddressSpace *pci_device_iommu_address_space(PCIDevi= ce *dev) return &address_space_memory; } =20 +AddressSpace *pci_device_iommu_address_space_pasid(PCIDevice *dev, + uint32_t pasid) +{ + PCIBus *bus; + PCIBus *iommu_bus; + int devfn; + + if (!dev->is_master || !pcie_pasid_enabled(dev) || pasid =3D=3D PCI_NO= _PASID) { + return NULL; + } + + pci_device_get_iommu_bus_devfn(dev, &bus, &iommu_bus, &devfn); + if (iommu_bus && iommu_bus->iommu_ops->get_address_space_pasid) { + return iommu_bus->iommu_ops->get_address_space_pasid(bus, + iommu_bus->iommu_opaque, devfn, pasid); + } + return NULL; +} + 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 c84cc9b99a..6c60f7a7c5 100644 --- a/include/hw/pci/pci.h +++ b/include/hw/pci/pci.h @@ -385,6 +385,38 @@ typedef struct PCIIOMMUOps { * @devfn: device and function number */ AddressSpace * (*get_address_space)(PCIBus *bus, void *opaque, int dev= fn); + /** + * @get_address_space_pasid: same as get_address_space but returns an + * address space with the requested PASID + * + * This callback is required for PASID-based operations + * + * @bus: the #PCIBus being accessed. + * + * @opaque: the data passed to pci_setup_iommu(). + * + * @devfn: device and function number + * + * @pasid: the pasid associated with the requested memory region + */ + AddressSpace * (*get_address_space_pasid)(PCIBus *bus, void *opaque, + int devfn, uint32_t pasid); + /** + * @get_memory_region_pasid: get the iommu memory region for a given + * device and pasid + * + * @bus: the #PCIBus being accessed. + * + * @opaque: the data passed to pci_setup_iommu(). + * + * @devfn: device and function number + * + * @pasid: the pasid associated with the requested memory region + */ + IOMMUMemoryRegion * (*get_memory_region_pasid)(PCIBus *bus, + void *opaque, + int devfn, + uint32_t pasid); /** * @set_iommu_device: attach a HostIOMMUDevice to a vIOMMU * @@ -420,6 +452,8 @@ typedef struct PCIIOMMUOps { } PCIIOMMUOps; =20 AddressSpace *pci_device_iommu_address_space(PCIDevice *dev); +AddressSpace *pci_device_iommu_address_space_pasid(PCIDevice *dev, + uint32_t pasid); bool pci_device_set_iommu_device(PCIDevice *dev, HostIOMMUDevice *hiod, Error **errp); void pci_device_unset_iommu_device(PCIDevice *dev); --=20 2.45.1 From nobody Mon Nov 25 05:23:36 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=1717394529; cv=pass; d=zohomail.com; s=zohoarc; b=d7WFPdlkiQkmb2SaeuKr8ePoD2VaZ9BRj72yTSxXmEdROkob+7bonKcmP9IoqSyjJx5UFye/tbggK8dUnft6cfKjwNeKYd1rAxC7OMemK+lUgLNlpwAuC0KHQg68H91HZez6Us7ihzGoVVdevOAZqx+MPuRQeI7AW71+PnFpVIo= ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1717394529; 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=G2BzbSny39P4fdizLrh6jG4JjEQ07fIWBaaifb3U2CM=; b=cHMcpyHNAO6AJQmPBZVCEhYnnJkZe+1BB4WJoGHd8ZNEXxMYdw39PBLrmpgpOihNTSAM7yPfYxOcWdNnMSA3DSLwzLnC0Up5Af21ACABqf9nqElsSRdC5GfHnr4Hp65tnPXRQKpr1enRX9drDmm3eHtRB6uPxINr17h2dFZlTN0= 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 1717394529236238.54784696816432; Sun, 2 Jun 2024 23:02:09 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sE0je-0006gN-EZ; Mon, 03 Jun 2024 01:59:58 -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 1sE0jc-0006fK-L6 for qemu-devel@nongnu.org; Mon, 03 Jun 2024 01:59:56 -0400 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 1sE0jb-00072f-46 for qemu-devel@nongnu.org; Mon, 03 Jun 2024 01:59:56 -0400 Received: from mail-he1eur01lp2051.outbound.protection.outlook.com (HELO EUR01-HE1-obe.outbound.protection.outlook.com) ([104.47.0.51]) by smarthost2.eviden.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 03 Jun 2024 07:59:51 +0200 Received: from AM8PR07MB7602.eurprd07.prod.outlook.com (2603:10a6:20b:24b::7) by VI1PR07MB6238.eurprd07.prod.outlook.com (2603:10a6:800:136::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7633.21; Mon, 3 Jun 2024 05:59:47 +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.021; Mon, 3 Jun 2024 05:59:47 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=eviden.com; i=@eviden.com; q=dns/txt; s=mail; t=1717394395; x=1748930395; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-id:content-transfer-encoding: mime-version; bh=G2BzbSny39P4fdizLrh6jG4JjEQ07fIWBaaifb3U2CM=; b=F9Jssn0O0FohCKPT7FPC8C7VW2R065u4P8xNNmkMHOFxFopNeNRfpXPq VJf3nl7+dKrxt8x4pcb2dGbJyGf8R0hwyn1ggiTCxHNxOom1gZ1AuFoFE EVMbnOuGz/gscXuLM9S8HsMDzkWLivA08apuD4Y4RhvOjcrty8JB5YAn/ whFxP5DLU8ZHJm2inMVDSWHdkxQSxl95efnrJcMbGOqIALCbkKy9UHAy8 vs0IcjBd0qx3Eh1z/NL3CvCOQK5JqxGIzKC//1PjH0b9wlxkHIX/WuktJ 0u6PG31hvA5+n6IjOqYD55BZ/wE4btDo3bBM7FwXrR1BohYaoDl3sjkWl Q==; X-IronPort-AV: E=Sophos;i="6.08,210,1712613600"; d="scan'208";a="13763242" X-MGA-submission: =?us-ascii?q?MDHDuGsePGGpHY0LolPAAzzNi8OQip5sUk7vwK?= =?us-ascii?q?Vn0NV55XhkoKpXBEnAe+PCifj2WISdn0H3YUus4ESrGGtmccvy/1XGlI?= =?us-ascii?q?35hVDVybIdDNw18i7c3cHCiPdxPgpIvtrSsQ73MokrXzSRmLZJCbrU+W?= =?us-ascii?q?OztL4KaWKLB1GaADj9BvuG7A=3D=3D?= ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=CX1szg+U0Hc3UHbICwpj0c7kt5V+uACviTHPB7Bd0Gzps1i0aYgYFby7we5HdZTTnujTuOCEBtMr0X6HAD3+QwH9FDaHzhDJqWX3DrIt2fGZTOOMxCyqWVTCuM7e/v/snwAoP8Iv1d0jbKIlaTnU3Z/p4f5eBXMYOB/rHc5O0b8kUurlLfcv2MuZpK/bewsDaIsd4yBVEezc2umErcPAAqXSYW+gf0keO85Lz01PCZbpOFM6CphcLJoqEyc8C84LT5TVbTbFGpQddRmpRBM2LaLJuwjfxanLaKECcxUICN2o1/YEJs6zjESQKi8uCOsEBI+RG/n6BF3vSdXm/uTvBA== 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=G2BzbSny39P4fdizLrh6jG4JjEQ07fIWBaaifb3U2CM=; b=OuCfMYeu/AImqpTjRpfmMKvOACGmLd8n3aoXfrfVJ2O5khF1rrGROovcrmfWvbSoWgRw7BgFQkB0ePacsMJNcrg5yyXQ0ZHCmc9gF0ooeCNiiAd0w49uv5N74VGracex4HGlyZgVR4CSbYtvPjj15J1obLONaUz4hpx2C/yXWLXGafvoXvdkEuOMIgyvMMahSlGA2Jmuw82fT3REAA0IVOVIFRvhvXurJqRWS3JlNr0ReTobw7YjYnFvu+iyXlt9RyKvA/MPHqN5w5eVU6F4ULjYcIoczE6OL+pR9amOodzaSCQJ2OCtas1ngL6dzZhozMEkGYL3BM+lt2IhuldQ5w== 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=G2BzbSny39P4fdizLrh6jG4JjEQ07fIWBaaifb3U2CM=; b=OzHF/z9BRGkpq2P4zM1V6gCT/AaNwJ9TM9rp4Vj8ux0IQ44VbATb5Rof+bVxy6DE6Ikn/iHmjplfRfuoq8FDeM0Q8MHqnz3C1lEh6Df3bLKXlu6G2aHM4KbEE+lx+h1iUhwWuQmPyU/ZZto9TL3sRVXvYHTUtxWz9lDFnUN9dZpZD7bs7W5jnGiqoyQkyRPtiM8xn96cpA/ecEiOyDSyt8CVA+mxaTf7MRmn2CKZTL2GTNTNQD/BRApHG1ZalmdMX0xODAFvtDdiTtRO8SDLM3lLK1vSZZfOaH870bR3/IN+B0e4Ny6hPRoC2IQ6W2jXhgSMURuejxR05yegP2EkiQ== 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" , CLEMENT MATHIEU--DRIF Subject: [PATCH ats_vtd v5 11/22] memory: store user data pointer in the IOMMU notifiers Thread-Topic: [PATCH ats_vtd v5 11/22] memory: store user data pointer in the IOMMU notifiers Thread-Index: AQHatXs9nZh6lgkWUUu4ORXkPadJwA== Date: Mon, 3 Jun 2024 05:59:47 +0000 Message-ID: <20240603055917.18735-12-clement.mathieu--drif@eviden.com> References: <20240603055917.18735-1-clement.mathieu--drif@eviden.com> In-Reply-To: <20240603055917.18735-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_|VI1PR07MB6238:EE_ x-ms-office365-filtering-correlation-id: 552f9079-c994-4d11-7d45-08dc83925ffc x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; ARA:13230031|376005|366007|1800799015|38070700009; x-microsoft-antispam-message-info: =?utf-8?B?bUdaZTVOMEIyeG5vNGsxRktpTDR5ZUlpWWVyR1RrckJ1U3lNR2cyUFhQZC90?= =?utf-8?B?WFhZRkVUMWtiMkcyNFQydEtOamhqbFlKYlo0YjNCaEx6cU9oSFF1bEcwRlRJ?= =?utf-8?B?cXJVT2ZKbW9mKzcyeWFSLzlTelNGYitabGIxVmhOZms5TUd3ZGswdEZQZTYy?= =?utf-8?B?cXZSQkRITmoxY3drTFBLT0o0Q0lVTElucEV5QWF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mo0bm5rTnd2dUxyM29QcjVRN2lKMmlid1Vl?= =?utf-8?B?R0pvdGdPbG9PbU1iQjVKOU5BMlpWWlJ6YURQeEF4SE0zRWRHMkJHOVFhZ0pG?= =?utf-8?B?MW94MjR4V1AvUE9Ic3hvRFR1MkthZHBROVBkOHdTN0tNaHFjUGpnMnoyN2Ex?= =?utf-8?B?N2hKY2ZVOFZZZ2tSbU15ZWlkMWVOWG9Rc3ZXdHloSEo0RjljRlF2VlRvT1lv?= =?utf-8?B?YWFBVUg2cUFTcWV6cEk1MUFtbE5jWVh4eFBMR2pUdFYyeDZuRU5EZHFoQXp5?= =?utf-8?B?QVJBUy9ZMzR2UDVTMTd0MEZmcUN0anN0R1N3T2pmcUlEVVU0Ynpoa3dvTHhj?= =?utf-8?B?RStockoyRXNMNmxPOUR3NksrQTNrTzM2bWJLWlJGUGt6dTVXR1NVdzFXbm43?= =?utf-8?B?RUI1eks4V004UHBiUXBPQTFWUVJVZFRsbmRnTTZvcWdnMFJpRVMycm5xWjIw?= =?utf-8?B?d0Z3YVJySkl3bGJrQW9vbCtDcEl6Zm5lcGZ4WTlFbHlKZWVDWkEzdU50cVMy?= =?utf-8?B?blJjeGQvRVBoWGUrWG1EVnh3dlkweEZVSVA1QVdGbk5Cb0taVDBodmtqNWVi?= =?utf-8?B?bWxJaDJOcllpQVpKRU8yb2thcTFsWTdBZVZUVVc1VXprOHFVcW1zRkZhVWhi?= =?utf-8?B?NTdSTmkxWWpkNXd4Z0M4a2dqcjZUdTJhaVB5cUI3Umd0Vm1BUGRwN2gxMlV1?= =?utf-8?B?SlY1UThRMzFDM25nOXZ0UT09?= 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)(366007)(1800799015)(38070700009); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exch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1SdW1aUmZWSGhsYWNoNVRCcFQwS0dtSTRyN0sxWHNYSXoy?= =?utf-8?B?TWV4OUVsSXdGSXdTOWJCV1VHc3lMWUZ1dUJZbkNUUWxuTGR3cDhCSUxMZ2ZM?= =?utf-8?B?VHlVdWFpMXhZbUtBdCtIQ29hS1Z6eWsrS2hrVndJMzhyQzhxa09OWGFvbVR3?= =?utf-8?B?L0Q3UkRZbmpGNnlNM1lYS2NLTnB6M1BZeG5ZZWhXeTd0bXJmVkhmaDhOVVA0?= =?utf-8?B?QWlVTi82Rm1acFdUb3I0RnZHK0tpY013U2pKbjdrU0N5RXN6MnBSUWpUS0wv?= =?utf-8?B?WWdtNEN0L0VsUnpobElHR3prYjNCMDlSUEJLd3ZmZTVOSy9rQXdnMlYvTy9N?= =?utf-8?B?TlR2YUVVaG1KRmZmbTc1UFZ0R3JwQUdaRTJheTQ1K3dFcHROQmpqbXA0OExI?= =?utf-8?Q?fKQSIQ3VPIS/mw0bvbEY3Xs=3D?= Content-Type: text/plain; charset="utf-8" Content-ID: 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: 552f9079-c994-4d11-7d45-08dc83925ffc X-MS-Exchange-CrossTenant-originalarrivaltime: 03 Jun 2024 05:59:47.8062 (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: 87vwKN3yfrL0OM1Fk73HaFaVCHbEz38u3kcwiswO4iY6C5ZF1LDHBB74uOIMx91AG/67eYSPPlOqpJPTb7BJDT7O5F/OCmnuR+xUMrbNKGMs961sizfPn85CatU+15FA X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR07MB6238 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.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, 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: 1717394531095100001 From: Cl=C3=A9ment Mathieu--Drif This will help developers of svm devices to track a state Signed-off-by: Cl=C3=A9ment Mathieu--Drif --- include/exec/memory.h | 1 + 1 file changed, 1 insertion(+) diff --git a/include/exec/memory.h b/include/exec/memory.h index 0067b2266a..359bca2ae2 100644 --- a/include/exec/memory.h +++ b/include/exec/memory.h @@ -203,6 +203,7 @@ struct IOMMUNotifier { hwaddr start; hwaddr end; int iommu_idx; + void* opaque; QLIST_ENTRY(IOMMUNotifier) node; }; typedef struct IOMMUNotifier IOMMUNotifier; --=20 2.45.1 From nobody Mon Nov 25 05:23:36 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=1717394659; cv=pass; d=zohomail.com; s=zohoarc; b=VEiNu3oOAjxFPkjUEyHzZyh1MVQpBQn0gmft02NAFnC7aCj7WVChY/lEYN0wuBdgv0lJRfvhKaRMGknQDl18LtGNsZpxPfR7swVPIlCXW8umCEjDoILWnZsFzd+WxipXysNeKgbvkZ0E4f7PUciOgMIwWGjc41lVVdHKii3vISI= ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1717394659; 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=3iGn8iTNBgQPofEUaGJboBsdoJafrIzD0MJJvX9ZvNk=; b=MXsfVM0tixoaNoKt6SmmlBUVlcBTzQY5Cr2FLNrUCD57UMYL9nDJniZVg8mPU8lyCeZb2K456ps5YSWZkD0umYGZTmLAFxwNqYl56Zg0TmzCDKNHZy0++PLwk/mskR3isZsHdk0Jfp4S+Z2psKflfiaCblXvhniSeJwDF2W2g3o= 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 1717394659076225.9151034795716; Sun, 2 Jun 2024 23:04:19 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sE0jm-0006oV-Oo; Mon, 03 Jun 2024 02:00:07 -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 1sE0je-0006gB-5p for qemu-devel@nongnu.org; Mon, 03 Jun 2024 01:59:58 -0400 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 1sE0jc-00072M-6L for qemu-devel@nongnu.org; Mon, 03 Jun 2024 01:59:57 -0400 Received: from mail-he1eur01lp2051.outbound.protection.outlook.com (HELO EUR01-HE1-obe.outbound.protection.outlook.com) ([104.47.0.51]) by smarthost2.eviden.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 03 Jun 2024 07:59:52 +0200 Received: from AM8PR07MB7602.eurprd07.prod.outlook.com (2603:10a6:20b:24b::7) by VI1PR07MB6238.eurprd07.prod.outlook.com (2603:10a6:800:136::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7633.21; Mon, 3 Jun 2024 05:59:48 +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.021; Mon, 3 Jun 2024 05:59:48 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=eviden.com; i=@eviden.com; q=dns/txt; s=mail; t=1717394396; x=1748930396; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-id:content-transfer-encoding: mime-version; bh=3iGn8iTNBgQPofEUaGJboBsdoJafrIzD0MJJvX9ZvNk=; b=jvGMQsa072dGf2LQOUtoyh9n0IRX0MY/CqBJksFor2+SDVxoeyuns5bY dZILWau2ZxL0qBVUiJdJlgbFgvUgfNKu2WrrG6yHfuq9v2XbbaELD5YoN eDTi9urBa6jd9xoFAE8tB5Mv1qa6ay+vg+favYSLHxKcdDAWCpY9wETvq uSYOhz7cTrtifP6Ye8j+/0DXRV9W8uvc1u8jr+QzDpd+iWWqh1a7YxBOu gFCdoYu+6hv3xLhmv5NYhN4sjG2r8ig5ZU/tuQIAjp6gMQy+XhYYEaiSY MvTyINKAR2wVdwiKEbAeO9Ri/AvhYJE+Hj69E9I6lttmZW+3u9/JVCPX5 Q==; X-IronPort-AV: E=Sophos;i="6.08,210,1712613600"; d="scan'208";a="13763247" X-MGA-submission: =?us-ascii?q?MDGKF2e07mPGcTeH995K0EDXBeG5TS+uvNrQv4?= =?us-ascii?q?gEJbQZctbhJgnT6zdAdoslSNR21fpvMsa5fAaOM/jRz3dmTw3TopwqHb?= =?us-ascii?q?NzFCfFrl212+B+jA/krVtGXINjbOqzhkXZZIxboPnrJCTP1YEWyMxeig?= =?us-ascii?q?/ySoJ4YzcIFdv/0K0cFJydBA=3D=3D?= ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=VQvut47cWXXHlJUP1FR6d7m6TI+UqefBobnlz53wfVQREZAWfse+KU+eunVW1oALOUKD/7J4W2aZj337hgZJ4EQQlET2A9UUte9h/QC9T4gm6Y0LDLm1xOWzsTptd6BWPrD1Y0SWSB+BIx+C1pzuLmekK7wZUbaoTl/Zu6EZLJf8Md1eUa2F6rQ/pBWl50vUO5+GxUWiJRuhtwrq+UTpPnldNhKEHvlZgoyr0ZPyBPML1HLTtGQsc5yzT96VwZSCY1ExsC1nHu7NRO1jDmmsV0/1YaBO2j3hI6TU0wCBtitiD0spXP16mHJ3pPiJlBX0oUQKzIln/2KaE/fPH/C0Sg== 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=3iGn8iTNBgQPofEUaGJboBsdoJafrIzD0MJJvX9ZvNk=; b=WBYV69HMqPL93JhI5fvq8PyBXeJF7EqSlBPqC2vnPPXTbtvVbTx2iTVrnkPbIDc8QNg9ZUUdMCnNaTSnPXOmLR5Rdg8+lXHreEHlObAArGSOa+FFIXqXnLwym7kaQIoYkDPxpjmXFShjePG2KFgOXp1tJDOMtLOZgMM23AD6+Y33uNRcE9nYo2KsGRvyDlj0YxPXprybcWtUOmMOxUsHy+FvqQZMWfIGvmyutGR+HHfqpLUsaXUWjOH7/NMflH17k7kaK/OAimYvWLrb8QQo+i/wSle91ucM4jEp2LX9YezzlBFxXSvp/MiGe/LntGy8vl9AQO7XA+0krczGE77BOg== 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=3iGn8iTNBgQPofEUaGJboBsdoJafrIzD0MJJvX9ZvNk=; b=B8YyyqlgZo1UJFQYkd5k1jQT2RNBhEWPzLPysUSvOEX9hYjOHURI7hgdW4HnK0lkfX9GA8E8xRJxUKB6SWhKqpstlreSNiCv7z3/lMxj/LyVjW7PhN3pI5C1L3iLlQTEyJXTv3aCfeBZkshIiAFaIaT2jol6rUXL5+QAXaXqYK2gNReJCW2UlNLXyQkMuK/Lx4e0UnpE9eIcdH9hNG/XXTSkmaSLzuSOyOBEBEgGW9w3HcMiSeUpbdrVbNkBttEvn4eUUZ+YfS6DyNDlMzMLfucAtXabLTudvGegVEnpI9Ou2jR8KOVThXExPlBKd86iTOGpuwBjuuPELhhrCNsTeg== 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" , CLEMENT MATHIEU--DRIF Subject: [PATCH ats_vtd v5 12/22] pci: add a pci-level initialization function for iommu notifiers Thread-Topic: [PATCH ats_vtd v5 12/22] pci: add a pci-level initialization function for iommu notifiers Thread-Index: AQHatXs9hOklV2j/n0yx4sycS/sVhQ== Date: Mon, 3 Jun 2024 05:59:48 +0000 Message-ID: <20240603055917.18735-13-clement.mathieu--drif@eviden.com> References: <20240603055917.18735-1-clement.mathieu--drif@eviden.com> In-Reply-To: <20240603055917.18735-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_|VI1PR07MB6238:EE_ x-ms-office365-filtering-correlation-id: bcfc999d-997e-4c64-daa7-08dc8392605b x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; ARA:13230031|376005|366007|1800799015|38070700009; x-microsoft-antispam-message-info: =?utf-8?B?dzVBMG4rV1dhRFlTYzRiWEJyYmppQkZsclhtMXNoV1JTRXRHUWY5NGdKWU9U?= =?utf-8?B?dDJaTnpyM1E1MkdFV2pTQmNrb0xvdktkVThZYURMM1dNa1lpRXc1aFhYYzRk?= =?utf-8?B?NGMrR1FNY01DckdiVGtndjRJYXcrSXNDeVUxYzQ2Tnl5RmJ1U0tCT1Q3cW8z?= =?utf-8?B?Wkx5R05CNURic0VhOGdzWDlzZzVubCt4TTIvM3hodlI3VENUVE1pUGgydzJ0?= =?utf-8?B?NndJeGluVWtVcVA2SWVNTVpHb3hSQkZVSDRrQXc0SmQ1elpqazRYM1ZVY00y?= =?utf-8?B?YVp6NTZOd2VQeFEyaVpI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UEY5WHJnZ2hLUnJxYzVPMEswZ1pwWU5EVWE0dmlsanhxUzZy?= =?utf-8?B?a0R3Mnl4ekRESitTVHdxeHBLc1JQeHdxMmY4RDFsYWJvL0wycHF6aWhNaW50?= =?utf-8?B?L3ZsWWFKbGJEVENkbmtmRFJUZlg0VFdhbCtrQXhDL3ZaNG5FWDRGTmRjdmZR?= =?utf-8?B?eXpWVXc2cGRsTzVGQ3djRWpZd2liSURlS1VucWRVQXB5a3U3cWdqZWROdEpB?= =?utf-8?B?Q1BWS09QeUVNUG5OeGx3WGxNTFUrYTdsYlhsZUIycU1UNkdhR20rMjRYa0VT?= =?utf-8?B?VUd3aFR5TGE0bm41aFVxZ2VCMEhpd0lIZlFTb0EySGtLZ2E2OGNTVzlLbGJj?= =?utf-8?B?ODdlRmdiTExuajUrTVdNcUZCcEdsWkkzWUh6bVh2a3VwYU10MkFHVHFtZWps?= =?utf-8?B?Q1laemVPSGR0Uk45SnJibFVrTEVUY0lTdjNJbXA5b29XSUV5alQzZnUza3g1?= =?utf-8?B?VVNyR2g2SXpTYmpFMjdzbHRGOG93ZHMvb3o5T3g4UHJUYzFjSDRsanJKcS9P?= =?utf-8?B?bVVVbzByd3NYcUVFYytWOTM5ZWc0ZzZwNjZOSjNkVkZiczZ5RkhkS2lZTjVz?= =?utf-8?B?YTJkN2dKNUtOVmpUSm1JZz09?= 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)(366007)(1800799015)(38070700009); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?utf-8?B?TFBCWmQrZFBERGcyYiszS3lDNXhVRVJSakRhbEJNaUZUREpHTGFoVVhkR1Uw?= =?utf-8?B?S01mTWkzZXVaV0k5THpYN3cvMnYwTGhzNnpzeWt4RXpuNkNx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DdLU1NETWJjZ3huZFZiY3ZxL2c2K21D?= =?utf-8?B?b2hxdUxaQTY5K3dwRDZObm5Nd045MHEya0plY25ZWUlpNytMZEQwc3Q3M215?= =?utf-8?B?YXg2YVI5KzFNMkxMTWxwTHhKMXExY0dEcWhTRmFWdTNrSkRFZHB3L3BPVkU2?= =?utf-8?B?NGo4cXo3UnhSQkEydityUmN6aEhpSmZJNEMxblJSa3lpaGNoeGYzU3l1ZUxU?= =?utf-8?B?WVV1TlFLQ01mNlkxSzg1YmkrYit3UXE4dGdxWkI0WXlhempKalZvdnphRFZ0?= =?utf-8?Q?AMHZg068lOaFqiRGQP5vdHo=3D?= Content-Type: text/plain; charset="utf-8" Content-ID: <9EA5EFDC58048A46BFECDF1F9ABB0802@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: bcfc999d-997e-4c64-daa7-08dc8392605b X-MS-Exchange-CrossTenant-originalarrivaltime: 03 Jun 2024 05:59:48.4400 (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: +ujNv+q6SuZMFmReHHzb8cBuuEzNgfQV+UQ/9t9oh6gbzzKZXoWM/FnNCniefq6UK8NskL2ZEZ636tdMaK6r9kGE9uWHwEbkcQZ6RLiCYPIBwbow+fETXdsrMUHAVoTL X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR07MB6238 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.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, 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: 1717394659706100009 From: Cl=C3=A9ment 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: Cl=C3=A9ment 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 3fe47d4002..0e14ef4ab2 100644 --- a/hw/pci/pci.c +++ b/hw/pci/pci.c @@ -2747,6 +2747,46 @@ AddressSpace *pci_device_iommu_address_space(PCIDevi= ce *dev) return &address_space_memory; } =20 +static IOMMUMemoryRegion *pci_device_iommu_memory_region_pasid(PCIDevice *= dev, + uint32_t pa= sid) +{ + 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 !=3D 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 =3D pci_device_iommu_memory_region_pasid(d= ev, + pa= sid); + if (!iommu_mr) { + return false; + } + iommu_notifier_init(n, fn, IOMMU_NOTIFIER_DEVIOTLB_EVENTS, 0, HWADDR_M= AX, + memory_region_iommu_attrs_to_index(iommu_mr, + MEMTXATTRS_UNSPECIF= IED)); + n->opaque =3D opaque; + return true; +} + AddressSpace *pci_device_iommu_address_space_pasid(PCIDevice *dev, uint32_t pasid) { diff --git a/include/hw/pci/pci.h b/include/hw/pci/pci.h index 6c60f7a7c5..2147981423 100644 --- a/include/hw/pci/pci.h +++ b/include/hw/pci/pci.h @@ -458,6 +458,21 @@ bool pci_device_set_iommu_device(PCIDevice *dev, HostI= OMMUDevice *hiod, Error **errp); void pci_device_unset_iommu_device(PCIDevice *dev); =20 +/** + * 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 * --=20 2.45.1 From nobody Mon Nov 25 05:23:36 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=1717394560; cv=pass; d=zohomail.com; s=zohoarc; b=CZpaV/eTP4gXGUmK6mdB2UurKWugaWhnuqtXpqPq6+o+5VcZ9VXXb50wjfUbKKAynb5LeoDOdA4Q3yUfQ2uNmRDq9keVGaAjfocK0g91mcvnqpo1pO8zIWgYYSeXJQlOlpmKqEws26og96q/+3L71fU9G+n1qKMnmmPbG0QNv1s= ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1717394560; 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=gWVNYX/MpMFgcCoU385Nd8NDwrCYBKIzBBh30rldG68=; b=k8se/OXLDoeMh3b8vNmTIUVsUNA9C/E1UY9/qcNnXu8HdcpdHKvmpbbCVGdmMDrPVnJxT4asV3aAyHLhgvV6Cz6uYalil3TqfvbcJNO+OlqQgb1Lt0gHp63IJzPIEYgmIcwvyeTpJylq5IjS+KvCq9gfzTVa1TbuCapAD58mktA= 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 171739456052643.82596432320588; Sun, 2 Jun 2024 23:02:40 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sE0jf-0006ht-B5; Mon, 03 Jun 2024 01:59:59 -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 1sE0je-0006gD-7i for qemu-devel@nongnu.org; Mon, 03 Jun 2024 01:59:58 -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 1sE0jc-00072k-6W for qemu-devel@nongnu.org; Mon, 03 Jun 2024 01:59:57 -0400 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; 03 Jun 2024 07:59:53 +0200 Received: from AM8PR07MB7602.eurprd07.prod.outlook.com (2603:10a6:20b:24b::7) by VI1PR07MB6238.eurprd07.prod.outlook.com (2603:10a6:800:136::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7633.21; Mon, 3 Jun 2024 05:59:49 +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.021; Mon, 3 Jun 2024 05:59:49 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=eviden.com; i=@eviden.com; q=dns/txt; s=mail; t=1717394396; x=1748930396; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-id:content-transfer-encoding: mime-version; bh=gWVNYX/MpMFgcCoU385Nd8NDwrCYBKIzBBh30rldG68=; b=HV9Ce0wRqyk/QlNU/z2+IZAtnnrhs8x8v6LeEcpDEKc2uCGG1LXv4Nir +C+imaVyurRjN0NIFApx0yQ1Dzhm7YG/Rx4/N16SUbI3G/6x/1NQTTUTj c/ikKSlQWkz01z428rV29imbF9RfhrCPpoCeJ70Mfu5kWU6iCb5iVfwQt dDX9vE3b/Q4VhBDhANhswH7mgNS37wVMAr/LbmnAzQJh5/05Vd/0dvUi3 8YA9xn4ejg4eJmdDlowzJcy+zlNRaTA1FN59/tm5oqJx1KZB3o1TWWkPZ A59r8qr9sxcDa1QTegNqOxOf/nv9yD+kOcrh9gKi2ZYpi7CUqqztBve8y Q==; X-IronPort-AV: E=Sophos;i="6.08,210,1712613600"; d="scan'208";a="13756561" X-MGA-submission: =?us-ascii?q?MDHdZn81XFxEB4PHTkmR8O6trXDhmpg6IAkfid?= =?us-ascii?q?2zXxRW30/C57i3cLr3E0F0xZzpT6A4Qt01dtewCnQtV4VcJM5kVugWud?= =?us-ascii?q?tVLDVepg8fBdPykGLdoyLdf9uYFhJgGITdpiDwhneNrcEyn18OyOZUTR?= =?us-ascii?q?nB6juzvyIv+NReFYlIh6YaNA=3D=3D?= ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=a69q8C8ImR+mM2QXFYDzd4WIO4h6gXXteBZnUw0g8Q1X1RJAv9PBPO+XcjfUBuNvvVk5GK2vcDNcW7QJPNyJYfwfbLNynpE4yBcvyTSgtSpoUmtjF3xGesDW3gmLqWuhWI7HRU86fFdImpsdP7LDHJlLTtDKZDX9lEK8NqcBstVSNwdBKvWyNvmNRrnTKTy9zu2RNY1U5Tt26O8XsCD0VWPcm3XGduN2L6m9ApDRBDuWwNe6sDU1X/+yKVUyr6ByikTDjntXPFKZtpAxmR5Ko/PQEhCxvIoFv9SYryEut6l9DUIsK8fcQbMYQ35xhgua4+z9Fd7WR9BwAe0W70I4yA== 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=gWVNYX/MpMFgcCoU385Nd8NDwrCYBKIzBBh30rldG68=; b=aLio07bovCobLuY4ZJYtF6qB0TrtA5SdSCt6cXQyfaqS8nCghttpI5BMTqtL8xXi27X4Vdd6HmqN2/1IAZcC7yKoA16iekVIN7WQCiDJP+49XKRtT19Gn9/OH5Dy3azgsccU67dboSgpLgI+l07Na6eexnjxXdhaRePn5u7G+khEAz7wSaxoMtVUeR0+KiF8oY2yt8KJIkxNf5ZjfQWYmUsCnfQqCcAAsD2FwZXi6W9SrXTHCMR/EleKOvJ2U2lXuV/yHWxlfiuEXljZEOcukzKz/MdDIsDTMQ9lyMVImyLfaGpnz61Jgj3y7nxvNF7j5AyQ/ZqWsl13ceYoLf9TjQ== 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=gWVNYX/MpMFgcCoU385Nd8NDwrCYBKIzBBh30rldG68=; b=jI1sAC1TANdRbgslxjxiQsvV4DQmoFAu1ByAG1SM9iqv6dHPsMhQPqet+D13YW8HZD2Ed8rctbr1BBUtGsL6gqlpm03lJcnzs2sFwIyiBK4xVA9dpyvygQS9/ue/JUsObpl/dN1qf8HWFiya7iHBR8gB8Dq+DjOhk0Vu/AdLDYUnwG5MSh7etkaPQCm3Ahk7NO8pXE4xF3cQoJQmHhT99Dy2Wk61QyEvHlL/q2kINvqz5pbzDR8z2PzbU6Uq0YqgXBOMKcAuFuPvPu/nuWwoanZ564uj1Xuao0qXDBh49AdO6ILoh2yV6coonDrP3ILINeNEJXIl5u+u8OYj9jiNmg== 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" , CLEMENT MATHIEU--DRIF Subject: [PATCH ats_vtd v5 13/22] intel_iommu: implement the get_address_space_pasid iommu operation Thread-Topic: [PATCH ats_vtd v5 13/22] intel_iommu: implement the get_address_space_pasid iommu operation Thread-Index: AQHatXs+h3ISnltAY0KL22WmbHxAlA== Date: Mon, 3 Jun 2024 05:59:49 +0000 Message-ID: <20240603055917.18735-14-clement.mathieu--drif@eviden.com> References: <20240603055917.18735-1-clement.mathieu--drif@eviden.com> In-Reply-To: <20240603055917.18735-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_|VI1PR07MB6238:EE_ x-ms-office365-filtering-correlation-id: 37e77897-2726-47bb-3e8e-08dc839260bb x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; ARA:13230031|376005|366007|1800799015|38070700009; x-microsoft-antispam-message-info: =?utf-8?B?TnNUdzZWcFh1RXNxUTNGWThxOXREeFlVNGthajQvdEJsSHZ1c3Q1V3VLU01i?= =?utf-8?B?QjZIdnFzTXRTYmdNTEw3d05nOW04RkxSNHpGQ3JaeWFlRFo4aUdFTnJSL0Vh?= =?utf-8?B?Y09OOXVGMUlzK0RGRDlUYjA3WU9CV3ZjTWRBRk5lMmM3TWtFUFZRUi9aSmZs?= =?utf-8?B?ckk0M042WXlEckVaTWsvU2l5Nkh4UjZqMzMzMzhIZWhUTEJtMUVSelBqRkJD?= =?utf-8?B?N0g0VXpmaWd4NnZRMFZIVjdSZjRhSG1Xa2FuUnRtUnNNRHdlZFg4VGs4eW9u?= =?utf-8?B?dnAyOX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?= =?utf-8?B?dTYvVk52ZWhxV2RsRTY4eEFRZHMva3FZVjR1d2dtSGpSVUEwNVpoenF5R2dv?= =?utf-8?B?OGc0aUVYeXJqSVJvRXd0VjVrV21HcjkzQU5ZaEZ3Q1VTTFRmNUVacE9weERW?= =?utf-8?B?djZ0VVBTMFVCd0FqazZIS3RhaHVsQXJnelNTNzJqS3hPQTQ5QUkyZmM5VUVR?= =?utf-8?B?NTk3QlNZeHRNMW52M01ZVldGd2dXOForRCszMUc3MzE5WEJ4cDVHb05yOGtr?= =?utf-8?B?SFl2WHlXU3hFOERaQ3hhdS8xS1lhbmE2cXdpLzVtVzlENnV0OHZnYm1QeTl2?= =?utf-8?B?NkNkR2ZIK2NsTkFiR2d3eVB2K0VNMHpWOFNlM1dQNUhKSHhIVjM4THRvV0xm?= =?utf-8?B?S2VRSFpmWER6WTVqb0ZsOHp5cmZTNFgvb0EwQTU3WlRoZ2I0c3dVeWtrckNv?= =?utf-8?B?OFFHT3pjU2M5elZjN1o2cUNYT2hNTnN6eU5NWXFlZ2JlN3hYaVlONTlhNm1y?= =?utf-8?B?SDNGSkJNR255ZFJpWGlIYUp0YnhPTWNML1hEd2dnZ0Z0cXZUTkNjZmlqSHg0?= =?utf-8?B?anVFWGFjTHpkZnVWSlZVMC9BUEp1a29tRE83d2ZhbW5MYkpVR25HUTNHcUdv?= =?utf-8?B?Q0FmRFZDbjlQTnQzNzJxUT09?= 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)(366007)(1800799015)(38070700009); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?utf-8?B?d3hpZDJkOHQ5OE5jdUFac2xhZGdGKzdLUW82a3BOU1pvSllEaG5BMHVZVi8w?= =?utf-8?B?Z3RFUXBTMnNPVk1Y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HWlBwZmJwUVJEaWZpMnRGWndvd3UrRWwz?= =?utf-8?B?dmZyTFAyenRNNHN2cFh6Z2JtZmZpWmM2UG9ldlpmRDNlZzJGRVZIV1lCcGZk?= =?utf-8?B?bEMzbk01ellhSEdlSTduc0RRSG9FOWpXbkRBU2MycDFPTVYxL2g4WXo1bldr?= =?utf-8?B?T09xd28yMnpvV1hHVkJLbTQxRGloaTh0YS9nUzdLTlo5dGdLZjl1eTZ0b0Yv?= =?utf-8?B?OGNLUjhJaGNoR29TdDU5SE5PQnkySkxkV1dBazI1djJLMzkzSGI1dlpnNVpL?= =?utf-8?B?bDhhQ0pRRVFpNnhjNHhHNEZSTnlaN1VpaE1wMGhiZ3pqVTN1WXk3WXVPQjVL?= =?utf-8?Q?ljihmO0VQejxV6SZBWiFyTA=3D?= Content-Type: text/plain; charset="utf-8" Content-ID: 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: 37e77897-2726-47bb-3e8e-08dc839260bb X-MS-Exchange-CrossTenant-originalarrivaltime: 03 Jun 2024 05:59:49.0845 (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: OtgX0c1li+6eRkbZNJM7ZyMA6KpI26GmuzcNXNgzj34+otCbJAWnuxotZhglIUIngIykGY9gdwc+5TuTPyEehTqiJufcHMpSng6EW7/3HECisAHoV7ZajL/YVXAGVtNz X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR07MB6238 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.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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @eviden.com) X-ZM-MESSAGEID: 1717394561227100002 From: Cl=C3=A9ment Mathieu--Drif Signed-off-by: Cl=C3=A9ment Mathieu--Drif --- hw/i386/intel_iommu.c | 13 ++++++++++--- include/hw/i386/intel_iommu.h | 2 +- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/hw/i386/intel_iommu.c b/hw/i386/intel_iommu.c index fb6c7d1e33..6a68df0154 100644 --- a/hw/i386/intel_iommu.c +++ b/hw/i386/intel_iommu.c @@ -5414,7 +5414,7 @@ static const MemoryRegionOps vtd_mem_ir_fault_ops =3D= { }; =20 VTDAddressSpace *vtd_find_add_as(IntelIOMMUState *s, PCIBus *bus, - int devfn, unsigned int pasid) + int devfn, uint32_t pasid) { /* * We can't simply use sid here since the bus number might not be @@ -5958,19 +5958,26 @@ static void vtd_reset(DeviceState *dev) vtd_refresh_pasid_bind(s); } =20 -static AddressSpace *vtd_host_dma_iommu(PCIBus *bus, void *opaque, int dev= fn) +static AddressSpace *vtd_host_dma_iommu_pasid(PCIBus *bus, void *opaque, + int devfn, uint32_t pasid) { IntelIOMMUState *s =3D opaque; VTDAddressSpace *vtd_as; =20 assert(0 <=3D devfn && devfn < PCI_DEVFN_MAX); =20 - vtd_as =3D vtd_find_add_as(s, bus, devfn, PCI_NO_PASID); + vtd_as =3D vtd_find_add_as(s, bus, devfn, pasid); return &vtd_as->as; } =20 +static AddressSpace *vtd_host_dma_iommu(PCIBus *bus, void *opaque, int dev= fn) +{ + return vtd_host_dma_iommu_pasid(bus, opaque, devfn, PCI_NO_PASID); +} + static PCIIOMMUOps vtd_iommu_ops =3D { .get_address_space =3D vtd_host_dma_iommu, + .get_address_space_pasid =3D vtd_host_dma_iommu_pasid, .set_iommu_device =3D vtd_dev_set_iommu_device, .unset_iommu_device =3D vtd_dev_unset_iommu_device, }; diff --git a/include/hw/i386/intel_iommu.h b/include/hw/i386/intel_iommu.h index 0d5b933159..bac40e4d40 100644 --- a/include/hw/i386/intel_iommu.h +++ b/include/hw/i386/intel_iommu.h @@ -325,6 +325,6 @@ struct IntelIOMMUState { * create a new one if none exists */ VTDAddressSpace *vtd_find_add_as(IntelIOMMUState *s, PCIBus *bus, - int devfn, unsigned int pasid); + int devfn, uint32_t pasid); =20 #endif --=20 2.45.1 From nobody Mon Nov 25 05:23:36 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=1717394555; cv=pass; d=zohomail.com; s=zohoarc; b=Y9h8D003kgMo2VBFA9HXpVPYQWqLmFLVblugH19emFs7yp2iFmrxI6pQlpR2tUPtlsm8PJ8zX6WCiD1QTvCYuhtVizkpUpvZZ22MSVp4bhrOZSqt3CBzRlyjbgmitmvn2DSAJNU/nb4xYMnMiLz6mN1A5drfljb63b3MsTonXgY= ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1717394555; 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=PaF1jpNiXIxhEHv7houvHLORN0+AzjnvPV8H0KLGjak=; b=PYF1rFqIMm/EXTN8F/+GwxdG6s9MMzYf9q6BXNE/nht8Nog3zQSge63sLuYdza8WiNArDz1xbkv0Dzu1vip+KQxi7+hlplzkuKwaID7oWcnfrQQvCRkssD63+BP9Ppgvzl7iVP+syyODxUhidJLxtFaiDW1fDbl0m4DiWumJNOk= 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 1717394555160568.7912574675795; Sun, 2 Jun 2024 23:02:35 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sE0js-0006r0-Dq; Mon, 03 Jun 2024 02:00:12 -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 1sE0jf-0006io-UA for qemu-devel@nongnu.org; Mon, 03 Jun 2024 01:59:59 -0400 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 1sE0je-00072f-1A for qemu-devel@nongnu.org; Mon, 03 Jun 2024 01:59:59 -0400 Received: from mail-he1eur01lp2051.outbound.protection.outlook.com (HELO EUR01-HE1-obe.outbound.protection.outlook.com) ([104.47.0.51]) by smarthost2.eviden.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 03 Jun 2024 07:59:54 +0200 Received: from AM8PR07MB7602.eurprd07.prod.outlook.com (2603:10a6:20b:24b::7) by VI1PR07MB6238.eurprd07.prod.outlook.com (2603:10a6:800:136::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7633.21; Mon, 3 Jun 2024 05:59:49 +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.021; Mon, 3 Jun 2024 05:59:49 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=eviden.com; i=@eviden.com; q=dns/txt; s=mail; t=1717394398; x=1748930398; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-id:content-transfer-encoding: mime-version; bh=PaF1jpNiXIxhEHv7houvHLORN0+AzjnvPV8H0KLGjak=; b=SfdeZq2lzx7odD7PogofDUtKkY9Xjeux92n/LqvZBzOtTKzaTBb4e4hT +6zZoKWS9g7vVn2KA4xNmtlKlIT1l/ncFgTkGTj8hh1HHo2jfed/WOMo3 j7xmsXSKbSXjnP2UI3fZzAG84ThYBTUlskjI55YGEc9YAkdegkepv3i88 8c7ismJllWXBS5ir60o0Sovixz/uXiMInEKDMxbXP0Ch0c+AJueFo9h2d l2FTNQ6xZWRtPEoAH3KgFR4ATQhYyY6tWwYZGE5UyYZ/xbjYPCBZmWWdg 7Kv3u5Vcy48ZYmDYw1OhREOqfFoYDRWa4NqW6V3NBJcmHoCL5ZUVQkOft Q==; X-IronPort-AV: E=Sophos;i="6.08,210,1712613600"; d="scan'208";a="13763249" X-MGA-submission: =?us-ascii?q?MDH9/EM0uA47Z5iTqrPJktTNnXEoVdPDxPLTNA?= =?us-ascii?q?mdU2MNkbrMYYOz25F0JVjCucDMDXzDpo7ubXl4Guvi8FmWacw/8jDHBC?= =?us-ascii?q?9JPoUH7InMC8sykaTpd3G+naGRPE7zqmeWJlFPrWOXTEEonLQEuo+bKc?= =?us-ascii?q?YyzVmgxzpc39A7q15qZTBeFw=3D=3D?= ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=e4hrMpKpsYxawJUHBdxw/6uZRXs4xzzFgzE3kwk3QwDZD4u9CGmwcJBL7oJTo825Vp0z0T/f+N7n2zVSFOM7Wa8c9VEpTE0Z40pGH/NQKZvgHcvV2KKnm7v8lp9qR0jcLb/JepVzD1VD0hdAgIDTsknhV9CX4Cprzh4s4fV2tbiMHHy44NPz4YiEd2YUQkNYuRYxr2HMPMhXrFKvC28OxYRmp9AIGKBqD71Ee5WB7MK/9qxwl3v3l7glchlKqbI7Onwy5m2TnAFNKECIWP4eXLeHAt4hipzM1P2TJUIhx43tNrWey+7HjmWXP2FMTEOvODSRJnI2je7rrA4aCV/4cA== 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=PaF1jpNiXIxhEHv7houvHLORN0+AzjnvPV8H0KLGjak=; b=DXG9aGivBdzSS8WOw2L1jjOfgvxwqAaOaSERd0jA6JT8ChqMDWoUv/VgK3c2RD16jk1ow3cdT8bBS5BS5wSipNQx6d3OA43J5jX/vJ6odDpWefdLjD2wwXvX3Pv868/S1HEIjrgFbYZPXBOHGI3z6tBqoaOLEfZZHWl0GIXCYJcYMuWe5D0okkK3Qq4NUIm7qiYoKcY4zk3nIx9A4NGp4JvgNww8jcdHVkdn8u3QmfmkM8T9gWJJ3vzJ2I1WOFny0Xb0wYZsEWqL3R3X+ZwNknufiiQpzKtPbR356Yx2AZ1WhXxJG6zN3iJsaMob9mn3PNOKhNjvT7M4GdD16S10kQ== 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=PaF1jpNiXIxhEHv7houvHLORN0+AzjnvPV8H0KLGjak=; b=e1OctJ2GpU6oUQCUum6j57jxrhD0YhTdjto1OpYoEsaDbuM+iN12gRPcbFKja5r1bMNl3vWnbEcLjkqoyJsnybY/GUeTUOyecyofUf9UzkTa1QEESm/O66m4l5xh+rEYfrbYOpHnojykn05UjdJPRDjISHKb5j4wRBc9a/6PbX5/M1R0mkCu4dLYtOqR5nMSSS74atsEatK106HbGrBCN0m5V+8uqqllet7eObVBfZJKRemlpH6XjRcMW+50Ov5W0fjMYnidhCaPoWJKomreZVdLQgNFw6I41Q0VxyvtNQ0pODyPX4N7ItsW8kX2VOSIMBv+Tu042SQx/aV69iFL7A== 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" , CLEMENT MATHIEU--DRIF Subject: [PATCH ats_vtd v5 14/22] intel_iommu: implement the get_memory_region_pasid iommu operation Thread-Topic: [PATCH ats_vtd v5 14/22] intel_iommu: implement the get_memory_region_pasid iommu operation Thread-Index: AQHatXs+MAXYJyAioUmyLyGhw2C/bw== Date: Mon, 3 Jun 2024 05:59:49 +0000 Message-ID: <20240603055917.18735-15-clement.mathieu--drif@eviden.com> References: <20240603055917.18735-1-clement.mathieu--drif@eviden.com> In-Reply-To: <20240603055917.18735-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_|VI1PR07MB6238:EE_ x-ms-office365-filtering-correlation-id: 40c55032-d11f-43d0-9c61-08dc8392611a x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; ARA:13230031|376005|366007|1800799015|38070700009; x-microsoft-antispam-message-info: =?utf-8?B?MUtRZmxrUHUwRlYyRHYzUWZ2c2JodWVsU2xGcnR6R0pwSjhrcGdwNFJkZFVF?= =?utf-8?B?RDdHWUN6dkxLTW12dHZFc2ZBUG9vTG4yc0g5SHVpU04yNW51cVlITzYrVHV6?= =?utf-8?B?UWF0VHVXN1dVdC84dGZLOFJ2YXJEQ25DY2RSZk9PSlk1WENzakU3MzlRbFRi?= =?utf-8?B?aTVGbnN6Yit1L1Z6YVF2MkVZZVpTNWVxdTVwdUlJenY3UFpVY3hNRTB0WVRP?= =?utf-8?B?cERVWCtiWERXbGpBVFMzVmRBRlhpVTlCRU9LWjRxUCt0d2tDQWljbFhTY3Bq?= =?utf-8?B?Z1FER0VnUUdsZGQ0TjIyUENFbDh3UEZIcnF2UzJqb1FYelcwYWttaHVEWTZK?= =?utf-8?B?eWx6WmlQaHc5bGxpaXNvYkZyZ2tYS2Rodmx4Si9lMzZwV0QvbHRaOXh3dU96?= =?utf-8?B?eVJ6SVpMZ1FsRU9Dam5jcW5CeGdtNm1qMEsyaHVYZHU4cnh4TjZFclFIK0lq?= =?utf-8?B?UzhVblE2U2pIc3d5K2xVajNNNzc2dDdZZlFlWENHdDBIUlNzQUdwdklXdE5D?= =?utf-8?B?VTZWQUJtem9Vb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=?utf-8?B?NGw0cVFjOC96dmQzOGNvSndyMEs1dDhvK0V3Nmc5RFJ1NHNRK3kyZzl6ck5O?= =?utf-8?B?emlSUzdkN211S2dWQ3RZUFdDZ3NzY0FPMGxWWVpWejg5SGdNK0dRMWQvckJj?= =?utf-8?B?VXV1NEp0TWkvdXZyNjNJcVpOcmVvNmR4RWU0NHM0bHpLcUtBbXAxWlJQc3Uy?= =?utf-8?B?Y0xZNXh2Q29TSmNwK3pvUDVkbVVFRkZYSUhEVTBadm16YXJ6K0Z0RUdSVmNN?= =?utf-8?B?YTUySnhqR1pMSEdDZ2hWRWl0NEdxcTZpVkpQcmw4T2Y1WWw3dlRQNUdRQ09s?= =?utf-8?B?WVpycUJEUDA2R3VvYXE5MkNZNm9wZFN1VllQMGlEM0RNb1owS3pnVHROSjM4?= =?utf-8?B?S2ZWK2EyWTR4cU16dm1qZz09?= 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)(366007)(1800799015)(38070700009); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?utf-8?B?VldYN0lOa3I1TVR5Y21hL1hNend6QTdxS1piMVA5RnRLa2U3L3E3clhyRnVV?= =?utf-8?B?VnEzN3hWaUZydzNlVDFhbHZDRlNCUTBidmNMWUxQaXN6bGN2RkpVVFVjYXJq?= =?utf-8?B?ZCtzUXlQVHdGbkYzTXREMjRsdWY2M2pFNzh1cFVmeGpjRFZtc2ppN2ZzanBp?= =?utf-8?B?aUgrMUlQQWJyN205V0EzWG1XQ3FyNVp1TEZubkFKNnNIRzdKUEtDc1Z6c1Nj?= =?utf-8?B?Mit6RTZsaGNkeGVWL3JnR2MrcjJmcCthd3Nrb1JQM1poTGczamR4ZDNMT2Qz?= =?utf-8?B?RGwwZ2JnTWdFRWx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RStBcHJkRlVKa0RO?= =?utf-8?B?VEp0RGNLOG1pNDJZQ1pqYUQ4QWYrNm5COWxnaXY2S3I3SEZSTU9HQUR4UGJQ?= =?utf-8?Q?BKOYclNWNjTPOfcr5t2gJko=3D?= Content-Type: text/plain; charset="utf-8" Content-ID: <65A60D98503C274F85AC23DE05819053@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: 40c55032-d11f-43d0-9c61-08dc8392611a X-MS-Exchange-CrossTenant-originalarrivaltime: 03 Jun 2024 05:59:49.6871 (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: j/fGCMZmCF8sDiQ90fg4Lt+UuwEfO/ZselZYk8NvGN8IFtqM11c3GYXUcaGpWlHlgMI3weR98N/cqITqVhu6ugKm6dgdINgB87OAfPZz7hmtU2RwdY8bqiRvJKd2anaE X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR07MB6238 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.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, 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: 1717394557149100003 From: Cl=C3=A9ment Mathieu--Drif Signed-off-by: Cl=C3=A9ment Mathieu--Drif --- hw/i386/intel_iommu.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/hw/i386/intel_iommu.c b/hw/i386/intel_iommu.c index 6a68df0154..d607562de2 100644 --- a/hw/i386/intel_iommu.c +++ b/hw/i386/intel_iommu.c @@ -5975,9 +5975,24 @@ static AddressSpace *vtd_host_dma_iommu(PCIBus *bus,= void *opaque, int devfn) return vtd_host_dma_iommu_pasid(bus, opaque, devfn, PCI_NO_PASID); } =20 +static IOMMUMemoryRegion *vtd_get_memory_region_pasid(PCIBus *bus, + void *opaque, + int devfn, + uint32_t pasid) +{ + IntelIOMMUState *s =3D opaque; + VTDAddressSpace *vtd_as; + + assert(0 <=3D devfn && devfn < PCI_DEVFN_MAX); + + vtd_as =3D vtd_find_add_as(s, bus, devfn, pasid); + return &vtd_as->iommu; +} + static PCIIOMMUOps vtd_iommu_ops =3D { .get_address_space =3D vtd_host_dma_iommu, .get_address_space_pasid =3D vtd_host_dma_iommu_pasid, + .get_memory_region_pasid =3D vtd_get_memory_region_pasid, .set_iommu_device =3D vtd_dev_set_iommu_device, .unset_iommu_device =3D vtd_dev_unset_iommu_device, }; --=20 2.45.1 From nobody Mon Nov 25 05:23:36 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=1717394560; cv=pass; d=zohomail.com; s=zohoarc; b=LtZmM9GaYgH8hWrbFyUBv+wfNIZkb3bpKlbxVm1QWKqMGD4p1JECw1kZu0Fj7773LReFIgYSmQ0FvXdFv+WbWlKAyDMlnYYb1t10b6Wb/ots6yXiRdn96GDLhUQowrZXBXX3U4ofxJGcJsr4CWWecWfoybxjpdFsIsfGaVFc+Jk= ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1717394560; 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=W33qgJlj8867w6c1KTEAjJW0x8cQ2o+WdwuKiyAF9N8=; b=ZA8EsuT9D3ezfLr8HeAa2uhigZE38+QxoL2W69diDsTYO7NiYWuxlWnE2g65am3HjVEeUvSXCYSjm3Q20SCPnv8XnvqRVLt8EMQoLoigztjfdd0GwuNAFmHYIWYNHW8IFL1KYLjg/4ObTJDZnX2PIEsKR/fC3H2YdIlPZAUdnl0= 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 1717394560643382.971103153536; Sun, 2 Jun 2024 23:02:40 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sE0jp-0006p8-BI; Mon, 03 Jun 2024 02:00:09 -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 1sE0jh-0006kO-Vv for qemu-devel@nongnu.org; Mon, 03 Jun 2024 02:00:03 -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 1sE0je-00072k-Io for qemu-devel@nongnu.org; Mon, 03 Jun 2024 02:00:00 -0400 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; 03 Jun 2024 07:59:54 +0200 Received: from AM8PR07MB7602.eurprd07.prod.outlook.com (2603:10a6:20b:24b::7) by VI1PR07MB6238.eurprd07.prod.outlook.com (2603:10a6:800:136::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7633.21; Mon, 3 Jun 2024 05:59:50 +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.021; Mon, 3 Jun 2024 05:59:50 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=eviden.com; i=@eviden.com; q=dns/txt; s=mail; t=1717394398; x=1748930398; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-id:content-transfer-encoding: mime-version; bh=W33qgJlj8867w6c1KTEAjJW0x8cQ2o+WdwuKiyAF9N8=; b=v8q7SbZ3+WkDuoa03x9MHm80ssyPn2MFwGjujP7HY1ji5up7HEdGZkph Nrjc+PcYzBLUp+A+hhFHUqJi7z/lkVPCR88MrR4zaQvFA9JbDkG0433SV OL2BBD60DiOOWcG8c8baTq1e1IkqAedYoQKYJbnI5vG51M+WBcveWvgy6 QnC+InYDC9rxULSPpjZ0nLeM2//yAtiLgzDTU4oPfLgyu/dckwG0UeM62 aLhNAv9zunymU1fULX552NsuL7y8BlOXxb+DUbvtiiglhhA9XfZF2K9t6 ncUTgtFgYfn3zaFaZsjV+NtbkwWfAEWbUqflxVX4r6bdFbvNtMdzRcnAf w==; X-IronPort-AV: E=Sophos;i="6.08,210,1712613600"; d="scan'208";a="13756562" X-MGA-submission: =?us-ascii?q?MDEQtAu0EWTMmskPRTfUuDFJb2evkVjPw1FlVz?= =?us-ascii?q?hIiyNFP7TFTPJ/AI0bFHI5XCyKps3UgXvMN2HNiE/2Ju1dN5nAvh/3OG?= =?us-ascii?q?7CvTxbqJTuxowuxuyO1T6wnbd+90TLXjKI+Mxl3t9Fi3txKg7LKkul0t?= =?us-ascii?q?fi7FiZV7p47+Dzgb9TAP1p5w=3D=3D?= ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=TWg6OAHQ2ZAh56+HtLikYtObw0dqWaFUmmr4D7AKQ6qdvNGmmgi61GmVz+CnvgXYua6DdTlqT4mKVmW5XaXodHAbeDFdzidvNJ3/BN0Is4/+uIBJZQ43CpfSwThbD7K00WzJFi+g/PvtRFMMblvNJyMB6CSnd/EG9Fv45ZCMTd6vYX8xgg1hIFNSE4jq480zvrdUn2btJYzcZJtnEMVjMP+Qy6uxIdvztwa3M7+vgXv6dONWubOdAFDDyVWCLMLaiqEtJKHHJdmIF+igasqxmcWO+FHE9ueWiptLelBkTlcxliNFT6veC/uSvMuIbtjOrzKPrRSFMnCP0XVyBNATmQ== 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=W33qgJlj8867w6c1KTEAjJW0x8cQ2o+WdwuKiyAF9N8=; b=eVEAD5R27b35OwYkX16RxdjInOl7VXJtW5Fm6tcgaNWuuw3uMlRcUC3qhNNli1n0a6LuzRT4EK+MLAA0jtDNDtdw/puAirfzMHtK5xm79Nx1PBpg87zZV+h2ISACgrikpEhJC0JHe3mv3AW7g3V841NZ77iEGzymHte3L4j74H4lLLAV0LBHnwx6KqPnucjPs14r+wxFahtXGH6L6GlCI5Au+EfUCRQmBPGmNMLO2tHjxeSmOZsMcjdXiq84x4EyXZJCazuS37yMCh2LI/vvfwCI/NoRpvSRY6OAbm/+2DNG7rstoMG8K1oVJT9cS5sIdS98I9KRin9wpO4T5MPG2A== 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=W33qgJlj8867w6c1KTEAjJW0x8cQ2o+WdwuKiyAF9N8=; b=MkzGHw5cl8GfghcwP+BhhGVq64dgBY3U9zpkfVimpf4Oo8dPdZndcSIxmpJo2Yg4mTO6SP65pgHR3L8DMhUcu5/BfnThHGqVNggsukMC0oSpF91BWKbekG7gQsMU9+rk/1XvDCGBXqjbtf/auIkWkkDDDIUU9hmuClbLqCUH2HohBbHkwYIr7csxlBcsofCY6O1DPaYOoO9GpCU1YjWXkK6/r5CtnYj04goQmWQb8cH3sHZwWq5rY7jMBXpMaqlnBgk/UDkOzji3kzWG41tkBneSKrBQkAgLVwd045DiGEW62nAlt9RAmj6zeftM0oC3ZakKKsteFfbnWKi1pYI5kw== 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" , CLEMENT MATHIEU--DRIF Subject: [PATCH ats_vtd v5 15/22] memory: Allow to store the PASID in IOMMUTLBEntry Thread-Topic: [PATCH ats_vtd v5 15/22] memory: Allow to store the PASID in IOMMUTLBEntry Thread-Index: AQHatXs+/LPVl7uy7UyWTgdb2IXfNg== Date: Mon, 3 Jun 2024 05:59:50 +0000 Message-ID: <20240603055917.18735-16-clement.mathieu--drif@eviden.com> References: <20240603055917.18735-1-clement.mathieu--drif@eviden.com> In-Reply-To: <20240603055917.18735-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_|VI1PR07MB6238:EE_ x-ms-office365-filtering-correlation-id: 186f3082-8130-4d64-3765-08dc83926175 x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; ARA:13230031|376005|366007|1800799015|38070700009; x-microsoft-antispam-message-info: =?utf-8?B?Q3pXRkQrREE5Qmo5SmhLZzhEYVZLRUtxRVNweVJpd2E2RUZXOGV0NXkyaUlm?= =?utf-8?B?T2hBeVhmOVRyMmVLWVlPd0xaV3NXZEdLdHRhZE1GTEpTa2wzS3hBYTJIMzdB?= =?utf-8?B?Nk9GQU1JVHRtNXJRZ1kxRnlVeStLTDBEeHdrMytoV1hPeGplR1FIejBZbEdO?= =?utf-8?B?ejJWZ3d3TzZnVTFYTWpCVUxWVjlMK0ltQlFuT280eWxOTkZwNVpuY0JlN1BE?= =?utf-8?B?L0dIZlpVeDE5TXlmOUszbHJvbTgraS8xRmdEakJqemtwRTBETWJxeEZiQ0Fm?= =?utf-8?B?RD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?= =?utf-8?B?VW1nYVJ1ZWNwam9pWEdCcXByOGxCcVFoalFUVkErUWROb2xva3ZPNXI1aCt6?= =?utf-8?B?cWlmQmFpZVlvRThhc2dpUm1kSUxCSWM0YUFCM0hmcUJyaGRyQVRnRGR4czhP?= =?utf-8?B?Q3ZqR25sRFJVL2d5bTFIUjNhWUdLeEFwVTVSYU9od0oreHk3VEl1ZkQ3TnZ1?= =?utf-8?B?bVdHTGJFR2I4ZEVHZVZoODhqRmoxaW9IZUFkWElmNytnTk1LaGQ0UGJZbDhs?= =?utf-8?B?SHBhOWx0TlgxWURqeGlwY1doVDZWd2tUL1Erd1lEZXR1ODdhbE9xNFFXT0pF?= =?utf-8?B?U1VBOUJWemgzWEVUU2FlYkxsaXNrZUdKWTJDMG5ZT1NBWEpKSTVoRVFxdWhj?= =?utf-8?B?NDNVRFY0VWJXajluRVUyWFJ6RjZpTFIxWXhqUHNyMnpqWGtmNnRyM0dQNUNJ?= =?utf-8?B?elFrUENCcm1OSGpnL0lLN2tqT3hMcTNKdTY1TWRvdWdXbTI3WHk3clRFVURB?= =?utf-8?B?L2R2UE1hbXpBZ1NTUDR1K3BPK21mTlVGWkhDUnJCRVB5RWtTNk1EYXoxcmI5?= =?utf-8?B?VVh6M0JPbWVlYWRSM1FSOWU0Q3plVFNzM21iZzJ0MmZ5REUrSTRsbWM0djN4?= =?utf-8?B?UEM1REJSZGluUGZuR1FiZz09?= 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)(366007)(1800799015)(38070700009); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?utf-8?B?UzlJdy8xYUdJUlJvMXIxUG5jSFBUZjhvSzk5OWZBaEdhSUZkODJ2MmNQSjNo?= =?utf-8?B?YXhwME1EZEFvdFIy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yQ2U3?= =?utf-8?B?dHZGU3hveDREMTVFbWdlUGpVZG0wb0tOaS9TN3QrMHhoZWs1SFJ3a0R0YnZ5?= =?utf-8?B?SG42MGY0S3ovYllxcXBrUzd4bWtUNlJqeFllYXY3L040b2YzTU1sVy9maE1P?= =?utf-8?B?NHpsZXJLRTQ5Y01TRTdJYUpRM3lhVnArdEIrWWJKd290dFJSK0MrVUU1WGpR?= =?utf-8?B?Tm9jSlhWNmtLanZ0WFZxRnptYXpPZk5KZVY1a1dzcW5zbVc1dTlLNU4wWVJV?= =?utf-8?B?SjJDQThwNjd6MkRPL0N0NUxvU01nL1crZ3dTejJVSDQxVWV2RDgzeXRKK0g2?= =?utf-8?Q?TkLbfubleKUnisWMjl2194c=3D?= Content-Type: text/plain; charset="utf-8" Content-ID: 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: 186f3082-8130-4d64-3765-08dc83926175 X-MS-Exchange-CrossTenant-originalarrivaltime: 03 Jun 2024 05:59:50.2894 (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: 5A6JQRibUCuaCvsdXAIni/wtgTkAXrEJE0g3Ii/H2cwdkfJNGJKGl8kdYo7N3NCLw3bjWzpRyS09gKq5MwCLWzKnaMt6PKgPiKU/tkIw3XV92y/1FITZWQrFOAUnC39a X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR07MB6238 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.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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @eviden.com) X-ZM-MESSAGEID: 1717394561226100001 From: Cl=C3=A9ment Mathieu--Drif This will be useful for devices that support ATS Signed-off-by: Cl=C3=A9ment Mathieu--Drif --- include/exec/memory.h | 1 + 1 file changed, 1 insertion(+) diff --git a/include/exec/memory.h b/include/exec/memory.h index 359bca2ae2..56ef48780f 100644 --- a/include/exec/memory.h +++ b/include/exec/memory.h @@ -145,6 +145,7 @@ struct IOMMUTLBEntry { hwaddr translated_addr; hwaddr addr_mask; /* 0xfff =3D 4k translation */ IOMMUAccessFlags perm; + uint32_t pasid; }; =20 /* --=20 2.45.1 From nobody Mon Nov 25 05:23:36 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=1717394602; cv=pass; d=zohomail.com; s=zohoarc; b=KYO02WPK3bhsDpPi2KjpXuYaWjoHYWMnqUklMa3SbzOFiu0JXkb8N3d6gkFYeX7T832sibd4QDUw0Swm8rAughm+nXSZ9ueqAk8PQTGaKAARfH481ZSysF/ZP+3a+H1dvCwyDcbPOjTDbzLaNufOuP2ip6Extzii5FVIOMXAPqk= ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1717394602; 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=+TK6Zle7ulmJBALlSA1cDnHgI2mELoDDS5fd5A1y8gs=; b=CfPLrGu8aUqJPhDVR1ctQosqxlO3oea+5XYNhFScza7lpk33QbXCS8LHp2yviT1mwsZHQdZA8CiNfcpHx9HjciRIwOk52rpFEA+UuqA5eAdb4hYrb8bgo5WjBlK7F4heFODeXQ8onrKXgcqlxvkKeEAUkNAPl2Oa7PQrRqATiB8= 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 1717394602430926.8083027018968; Sun, 2 Jun 2024 23:03:22 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sE0jn-0006of-BT; Mon, 03 Jun 2024 02:00:07 -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 1sE0ji-0006kP-1C for qemu-devel@nongnu.org; Mon, 03 Jun 2024 02:00:03 -0400 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 1sE0je-00072M-OW for qemu-devel@nongnu.org; Mon, 03 Jun 2024 02:00:00 -0400 Received: from mail-he1eur01lp2051.outbound.protection.outlook.com (HELO EUR01-HE1-obe.outbound.protection.outlook.com) ([104.47.0.51]) by smarthost2.eviden.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 03 Jun 2024 07:59:54 +0200 Received: from AM8PR07MB7602.eurprd07.prod.outlook.com (2603:10a6:20b:24b::7) by VI1PR07MB6238.eurprd07.prod.outlook.com (2603:10a6:800:136::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7633.21; Mon, 3 Jun 2024 05:59: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.7633.021; Mon, 3 Jun 2024 05:59:51 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=eviden.com; i=@eviden.com; q=dns/txt; s=mail; t=1717394399; x=1748930399; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-id:content-transfer-encoding: mime-version; bh=+TK6Zle7ulmJBALlSA1cDnHgI2mELoDDS5fd5A1y8gs=; b=JNyOITLC0bZ+QTJ+l03gofKKYHBCA/Tjvgsykmvwwc/dYKZcn9xLxSZo 5zJrplUU3+qs/zuOTHyqQyiVxUmt9EvKrYkESxN3ps2IIc62eVKNjAXYQ lnLoq0jHUNb4kwGB1Z9nFAHVGD8G0CYqNKMVj1HbQIH1OwG6kxxvbMtNm EJkupvf/Nrlm7LxILB8TavGo9E50g+Vns4NxsTSiTlPRUiDUE10OM+t+Y I/MNPUNxuPNjdx7EEsXiXNjvR5XqA4+dRfvCG3By2jIYvm5nsLSS1k4TS sMRMASv7hhZjhKugUDcK8bIw9O+Xf6RzATONMguMQwRG/Gups3AlqOQ0N Q==; X-IronPort-AV: E=Sophos;i="6.08,210,1712613600"; d="scan'208";a="13763250" X-MGA-submission: =?us-ascii?q?MDGgMixguMerjGSqACX2X+IceTYMDiJGIqif+Q?= =?us-ascii?q?3u+lMLNyNRURuoF0d1J5IbktCy2nxRfZXjBCqODzQB1+/9d8VRgbrEw+?= =?us-ascii?q?1Y56/b8BzJBuXTCFEIvpLiGfyLymiIhjkZuwNjIK9APNX6zm0qmCtpeo?= =?us-ascii?q?c68rZHSvFDVhMGzl2nxnNbOQ=3D=3D?= ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=YtJlj6X3Kj7KHifMbMtP+ngMwfpLuf+ZtOiB5wnVemqXqudE0pp0JE0pCFkI6vF1f/61RdDmqYjwPGnBaJsy96klGspqf1cmEJZTLQmLoL0lLOx1z4I1hM+DLIevEoESmD+5Re7JCoSB3YCrlZ3dtIpeGCOef8/dz7/DNKNB9rVPoPNuACOtBW4jVtvhLObmO8K+HjZ9Wag0kotu+9ii8LYWZuyHcZiHBoDEP00gdJcN2dc5l1M1K6cWsEquWDxnigO3irE4Pw79YRH91yJISlz15khmtFL58JncY1nbR+2hRUCdXVye6Ski96xEhGs6qLFfE9WKObTSs0o/GOI2rg== 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=+TK6Zle7ulmJBALlSA1cDnHgI2mELoDDS5fd5A1y8gs=; b=T0d77YRi/PJJVvcWxfo2jGOlAYp0edqVlh7D3M3rJPgni1WUzUgMZLxVoEGeqwupSG/6gFNxnlynizSJk6wM/UQfqO2RzqsHmqTApzMcomFb2IdFzDhrypKRRNozKvDQGzH68J0UNXF+Gv9lG3rcaT7YgeZ7tlbcp/QIovfbttai2clUuJMQk86uBetsxGcL637eC6uc1ZYv+8edFiKCoWxoOZZqcGB5agrLYrKVI3MdLpLh756si2T6NfW8rxGvwMs9tXMO0v5bsEAbfxSjf71b4LNHbxNDNkwJSPdf4UpWxK/l8XkzAorXDpxu37kNnD6bZr3MVDmoTX8kLnO7LA== 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=+TK6Zle7ulmJBALlSA1cDnHgI2mELoDDS5fd5A1y8gs=; b=QA+t+cJcWJbTgvjg+FWc9Z821Td57b0LO2kXL76pbzO97ybXKT8jOQE8Pt0/+RzV2KtNaI3+jxYR1uX0ZsnKLOKpsrmveX5ishqjDZ7TCdFtFb5NlT/sFmibUuxYaBYB4SZvyM9G4lU7cKe0jL86eW59GkEVkb1PwOroAwyGy/3PbHNWfqbjvpVlpKeyYZB+F453sGzWvnRO2G4FdRS+pTRpnUNyCV+AJjGeEGVkTkLrgCMude9JOG3oefUPoO7BTyb6Kvs9CNUHmhcs3+RB2C5xFQeeO8MDxp6wUK9mP9DXPrsbxv7Zq0ZQoQbYDKd5gzHWpazXqyq8uPpaH78vbA== 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" , CLEMENT MATHIEU--DRIF Subject: [PATCH ats_vtd v5 16/22] intel_iommu: fill the PASID field when creating an instance of IOMMUTLBEntry Thread-Topic: [PATCH ats_vtd v5 16/22] intel_iommu: fill the PASID field when creating an instance of IOMMUTLBEntry Thread-Index: AQHatXs/2Kth/K+aAEGM/Noyd0IfWQ== Date: Mon, 3 Jun 2024 05:59:50 +0000 Message-ID: <20240603055917.18735-17-clement.mathieu--drif@eviden.com> References: <20240603055917.18735-1-clement.mathieu--drif@eviden.com> In-Reply-To: <20240603055917.18735-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_|VI1PR07MB6238:EE_ x-ms-office365-filtering-correlation-id: 7fbee4b7-c0b5-4672-2239-08dc839261de x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; ARA:13230031|376005|366007|1800799015|38070700009; x-microsoft-antispam-message-info: =?utf-8?B?YVp5YVNMUkNlMVVBOWhJTzh6bnUyMlU3Z0dsUzhXY3p4MTA4TWVvcy9xMWZ2?= =?utf-8?B?OVFXVFI1MGdnT2Vob25ydEs5YzlwZ0tQenZMcC9Bd3R3c2R5clpDT1dzQWZl?= =?utf-8?B?TUR4dEF3V1hQRGsrdkhDNTJQa1ZyWXZTK0ZNc25BNjZHNkQ5aDFRNUNYRHdM?= =?utf-8?B?ajRBbmNIOU5UZ3FVZ1AycWJIUUc2S1BxVThuT2Qrai9jOGljK2RHNTVXcEdy?= =?utf-8?B?SFovcUVaeC82Q3VjMXRQNzUwSUUrWVd2eU9zYkJYdG5pSDBtNDZqVDEyM1RW?= =?utf-8?B?MXhmSmdEVTU3WHlzeTE5MzFVR0dmSTlpUWJxR0hHamgvNEFaRlk3Y0FqY1hj?= =?utf-8?B?M3FwVGhiSjdMVUljZUVCaStPaGNubkxSb2J3amg0QmVBZUpNajRh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oeGg3L1BDTjRGYmZW?= =?utf-8?B?ZGNlc0dyYzk2bzJGaTZSY2RzOE8xcE55SWs5eGRxVlByTCs2VlBHcnBJdmRy?= =?utf-8?B?cFc1ajlyZDh0YjRqM1lRenBJQ2ZzWjBnWWljT0h4VnF6eEtxYU5TUFRybDZV?= =?utf-8?B?dGFVL0RKMG1NV01OUURNS1M1VjhBVFV2WkozVVdQM1U5ZTlqc3RmZ2FkR3lJ?= =?utf-8?B?MjlKRmdOWmEzd3lVSXhOQzRBb0RFZzM0TVJtM0ZWUHFDR2ZCZGtnYmtoRm1C?= =?utf-8?B?bE5WcGFYbzFTS2tzRTdySkZkcjBQRXBiUERscDB4a1EwVEo2cGhOZDdWNXRn?= =?utf-8?B?WWRJdFl5N0t5eGpmd0pCRDlSbWpOTk1SSFNoMEVlVElhOU1Lbmo3OVQyMzRH?= =?utf-8?B?YVVNNE5CejJwazg3NkhLZXk4bmMvcGZDVzNScWNFQ3lqZlpLa1pMNjI4cmN1?= =?utf-8?B?dDlBT0RURXlFZXBscUZoMW1ZQU90MUt2RkdSTS95OVZ4QUsvb0FYaG1VRzNk?= =?utf-8?B?NFl0SUt2SDNlKzViY1dDZz09?= 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)(366007)(1800799015)(38070700009); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?utf-8?B?bkJEWGMxZWlUbnYxbzBYYmhTQkdObUp1UzFENXdmaEd3cWZma2F5YVpZdFkr?= =?utf-8?B?VndyditLbnlHbmhONlRjT2tiZVZXVmZFd1pDRlZTeWdLcjY1L3QxSGEreTVR?= =?utf-8?B?NDB4c2h0cTVXTkNKejBoR1lzK2d5d0R2ckZtSmFVVisvY2FGSVkzM2t5ZTli?= =?utf-8?B?YXp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xQemxiSE13?= =?utf-8?B?NWcyUUs0S2hCRElHZkZJVytERC9DdDk1aEpoTml3c2wzWVFzVWtyOHpoemxD?= =?utf-8?B?S2dGRVV3VDFZaUxaV0IxU1FOdFBoT2tFZXhBb0lIWkhFSXRMSHV0OUxYWjF2?= =?utf-8?B?MUo4Q2lvSTNBK2RqM3VBTVVoR2xNMnpqRXplU1hpM1dUQVQ4WitJSzgxTHlJ?= =?utf-8?Q?ohDnubiTKYJ0VI0ma7CClWo=3D?= Content-Type: text/plain; charset="utf-8" Content-ID: <75FDCE7FCD68974EB147B07684E386D3@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: 7fbee4b7-c0b5-4672-2239-08dc839261de X-MS-Exchange-CrossTenant-originalarrivaltime: 03 Jun 2024 05:59:50.9736 (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: t34jhuhY3EBOzJzT+sibbaNyxgFyteWcy8wOzizkDvu49sKdCtPrZWQY9LKf48cCLrqNQbawJWQ6c4KZCODYhC+pksesYx+yWi85yt0WpHSBjaMRlwWSOmPXX3Goi+6I X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR07MB6238 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.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, 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: 1717394603378100001 From: Cl=C3=A9ment Mathieu--Drif Signed-off-by: Cl=C3=A9ment Mathieu--Drif --- hw/i386/intel_iommu.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/hw/i386/intel_iommu.c b/hw/i386/intel_iommu.c index d607562de2..0f3bd5978e 100644 --- a/hw/i386/intel_iommu.c +++ b/hw/i386/intel_iommu.c @@ -2187,6 +2187,9 @@ static bool vtd_do_iommu_translate(VTDAddressSpace *v= td_as, PCIBus *bus, =20 vtd_iommu_lock(s); =20 + /* fill the pasid before getting rid2pasid */ + entry->pasid =3D pasid; + cc_entry =3D &vtd_as->context_cache_entry; =20 /* Try to fetch pte form IOTLB, we don't need RID2PASID logic */ @@ -2304,6 +2307,7 @@ out: entry->translated_addr =3D vtd_get_pte_addr(pte, s->aw_bits) & page_ma= sk; entry->addr_mask =3D ~page_mask; entry->perm =3D access_flags; + /* pasid already set */ return true; =20 error: @@ -2312,6 +2316,7 @@ error: entry->translated_addr =3D 0; entry->addr_mask =3D 0; entry->perm =3D IOMMU_NONE; + entry->pasid =3D PCI_NO_PASID; return false; } =20 @@ -3673,6 +3678,7 @@ static void vtd_piotlb_page_invalidate(IntelIOMMUStat= e *s, uint16_t domain_id, event.entry.target_as =3D &address_space_memory; event.entry.iova =3D addr; event.entry.perm =3D IOMMU_NONE; + event.entry.pasid =3D pasid; event.entry.addr_mask =3D size - 1; event.entry.translated_addr =3D 0; memory_region_notify_iommu(&vtd_as->iommu, 0, event); @@ -4320,6 +4326,7 @@ static void do_invalidate_device_tlb(VTDAddressSpace = *vtd_dev_as, event.entry.iova =3D addr; event.entry.perm =3D IOMMU_NONE; event.entry.translated_addr =3D 0; + event.entry.pasid =3D vtd_dev_as->pasid; memory_region_notify_iommu(&vtd_dev_as->iommu, 0, event); } =20 @@ -4896,6 +4903,7 @@ static IOMMUTLBEntry vtd_iommu_translate(IOMMUMemoryR= egion *iommu, hwaddr addr, IOMMUTLBEntry iotlb =3D { /* We'll fill in the rest later. */ .target_as =3D &address_space_memory, + .pasid =3D vtd_as->pasid, }; bool success; =20 @@ -4908,6 +4916,7 @@ static IOMMUTLBEntry vtd_iommu_translate(IOMMUMemoryR= egion *iommu, hwaddr addr, iotlb.translated_addr =3D addr & VTD_PAGE_MASK_4K; iotlb.addr_mask =3D ~VTD_PAGE_MASK_4K; iotlb.perm =3D IOMMU_RW; + iotlb.pasid =3D PCI_NO_PASID; success =3D true; } =20 --=20 2.45.1 From nobody Mon Nov 25 05:23:36 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=1717394501; cv=pass; d=zohomail.com; s=zohoarc; b=S5N+IA3Rznpa4PMOfTql7nMtjCY43D6ejqTO88WTx8AzTNFHf2jYfOEPeYEjgwV7JttxfoJ/DhCYE+PnqEQD0eIVL1BX0itsZNGjXOAO67SFC+jwZcpdGmjS+O9mp72PU1OA0nDfIWMaYui1ZPiWfZjc6VAibLb9qkyBQefBX5w= ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1717394501; 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=89kz2uZWAOgE5eTvYbbmfDZ+DOtI2Rb/PyJY5T5dams=; b=Y+aPLgQJFGyJIj7y0Xh3A2fggTM7SoMISs2xttk/AMfd+2+dPg8L+cpEaGTiO/y1v5+9+0LDEggyu8SzAYrSZuw/tGXGPnkhOz6jwFl+iBVg97DeUUN05BEJoLwco10OEk4xHxnwFk27+ZzRg389x6QQV3aYFxWDxoFCQ7/lGOc= 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 17173945018849.456391907258421; Sun, 2 Jun 2024 23:01:41 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sE0js-0006ri-KG; Mon, 03 Jun 2024 02:00: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 1sE0jl-0006nM-Nf for qemu-devel@nongnu.org; Mon, 03 Jun 2024 02:00:05 -0400 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 1sE0jf-000731-69 for qemu-devel@nongnu.org; Mon, 03 Jun 2024 02:00:01 -0400 Received: from mail-he1eur01lp2051.outbound.protection.outlook.com (HELO EUR01-HE1-obe.outbound.protection.outlook.com) ([104.47.0.51]) by smarthost2.eviden.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 03 Jun 2024 07:59:55 +0200 Received: from AM8PR07MB7602.eurprd07.prod.outlook.com (2603:10a6:20b:24b::7) by VI1PR07MB6238.eurprd07.prod.outlook.com (2603:10a6:800:136::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7633.21; Mon, 3 Jun 2024 05:59: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.7633.021; Mon, 3 Jun 2024 05:59:51 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=eviden.com; i=@eviden.com; q=dns/txt; s=mail; t=1717394399; x=1748930399; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-id:content-transfer-encoding: mime-version; bh=89kz2uZWAOgE5eTvYbbmfDZ+DOtI2Rb/PyJY5T5dams=; b=eE6NLiXShQbYKTcjWrepu0P+HSLv58AjZo9igwC/ONh8HlmF2Uhazx0J pB/9Mn9HRfC1zMckoO4VAOR/KVsPNwgctRLUjfDHb/zAegjCArq5WlIXq 2TV82A9cIMfZnUY4fXgrmdunOW2Wz3DGombqyK79OXWmx6qu/nu6+BeGV ohRjZ5CB8gNPtvW+ugIt+Ws44QTD0uA1EMWsfCAotwB5uvzz4jXSUptd8 z8mZ5Xx8pEe4RPOmFU/kKkmQH6CUVYsKompl/qho8M0E9JcRWjiqXdbiU bxX3CulNEZqv1qnH2myJDyC7PMoUSsPEU4n9EKkoO7L5C4c0KejhTqn8Q g==; X-IronPort-AV: E=Sophos;i="6.08,210,1712613600"; d="scan'208";a="13763251" X-MGA-submission: =?us-ascii?q?MDEhRueoPZ2SneOXDWaF/qVCmIZ0XWUWVw1hUB?= =?us-ascii?q?5jdhvWYDvS0uPLOPBUo4PH2MRNk5hX4umsRpb++0oVsS1qxFGCuPHke7?= =?us-ascii?q?BzkraSCcvPV04U28mH+Pok2QZKLnuxAP9jissimZ2f1T9fecroIBsKkT?= =?us-ascii?q?pcYW86i9AslOVvbVjkrYxXig=3D=3D?= ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=j443M289D2aWD46oV8TJcANoImizt/UgWRlOpdOfGqApYYi3UYiPvBn5Z7R34/Y1JJooQTyOVVfkb7QH16wc4NPx2XrDacT+Ju0QB9a+Veje/GfiJdFGPh3+XysbcfiYEx+pZG9KGMLCIGhCd2PuR+NUx1+6WcMF6lQ0wl0bFE1dh1PRYoz17wE5GxA62zP4goE4RC+RvQhomoFnSbaFSpMA+ndXcnF9NzT1P4LNHcYSOZaNssTg3cjrFgvPxdZkRnCisMpOEcgfrlbRpj2eZ79BohI24W2j1lfX/jGcAtD/KEb4o2b7n4H3xJ5egiQ/P4twchaPWrooJ33vRWbpdA== 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=89kz2uZWAOgE5eTvYbbmfDZ+DOtI2Rb/PyJY5T5dams=; b=LNzkzm3oLnQSrNPGIRKwnf905za1e/RKw3TW6RMWusRq4weL4UkYHuzwbF66FPCh5DfyBkA7K+fLVfw8CL1e0/BzVWjDc9XFr9PoRBfe3HncAgcIaKod9uXr+HvvtDQt+2FIiavlm1DLYfBbOeETuHxMnxItQi19cQUrqlHOLZ16GcQVnvlfaaE/Gd3aLu5T60sfDMjVhNzgHNfj3cm2ayqcjAgSn5D+iaqX8XhLv44CQML6dcKkNz8kSmdI/uxs1Hhz4gUS/D19XO6KmRuJazgs5K2Osey6gk/pxekd0KkawSE/YJl0K1sbc24lDu5/6ZWbro+/xjpRWrdVJe0DYg== 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=89kz2uZWAOgE5eTvYbbmfDZ+DOtI2Rb/PyJY5T5dams=; b=q+6A0GylRHReocXIdZuG+m6pX7uk75h6aJnRK3rtnHNvlVwRvwkkY8VuZeWbL/i3+HPnWHdQqLZUFAOknnjzCffXdbilfosOZU2VDPwYKWAnIIzjsHpI+tDDVCZVECFRVNbWOj/HXbppyAtHRuX2m24zOkZI6R7GZcIyTkcP5+BUc2b4ZshJttrXKcPbvAhj63g/tk9b9tkn+Ilqk3OEhZhHj+vDRLkCdcyTQiQJKWwWT+1vluEOJMU6Sq+KBW6Na8M1KnQXePMVNL6xPkOS/QvAJ2/5yM1btOU+WZXzVqmce9WvlcmbxeXu5uwND0vBQCp5QwTRd5X6kDW05UG6Xg== 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" , CLEMENT MATHIEU--DRIF Subject: [PATCH ats_vtd v5 17/22] atc: generic ATC that can be used by PCIe devices that support SVM Thread-Topic: [PATCH ats_vtd v5 17/22] atc: generic ATC that can be used by PCIe devices that support SVM Thread-Index: AQHatXs/4cl8uzc3D06D64WXq8wIGg== Date: Mon, 3 Jun 2024 05:59:51 +0000 Message-ID: <20240603055917.18735-18-clement.mathieu--drif@eviden.com> References: <20240603055917.18735-1-clement.mathieu--drif@eviden.com> In-Reply-To: <20240603055917.18735-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_|VI1PR07MB6238:EE_ x-ms-office365-filtering-correlation-id: fbb2d89d-1f7b-4ec4-9b67-08dc83926250 x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; ARA:13230031|376005|366007|1800799015|38070700009; x-microsoft-antispam-message-info: =?utf-8?B?clZxSFJYTktlWnk2dnpjSEkzYXoySC9hNG5hUzFxT21TOTk2d3h0YkpibWhr?= =?utf-8?B?R1JZR1dzNlY3cktaU3RKdE0wUUpvc2tWc3FYR28zdm01SlZxUzJFYVppdGRP?= =?utf-8?B?NmY5c1dGdDVqWWU1Rk90ZFFPN2k5am9lU2RFdVVCd0l2SzEvaVh0STVKUlVz?= =?utf-8?B?b3VVZlBEWC93M1A0VlRNVkJtcHh1ZkVFQTlHY25RWFl6SEpkZjBGa3Z6ZzBQ?= =?utf-8?B?Nzc0YnZ3ZjZRZmFENUpRTmpnYURWUlQxYjBET0pNN2FkOXZpOVI3eG1iYTJE?= =?utf-8?B?TTdLVGdMRVRjWit1WGF3Y2RQeXoxMStZQmg5Q1FTZ0VuSm9kNG5rSzZKbHI5?= =?utf-8?B?QlBFdTNkckQ4VzlhVnZtdHVEK1lQSUNNL0c2TnhIQkZreHJucW4vTG1CYjVL?= =?utf-8?B?OVdITk1GNjFsc2FVRFhyN3RVVytySEVJMGVaOU9IKzltRGh0YkF6SFVIbUdI?= =?utf-8?B?ek9SMVMxUktKMFNKMjVLdHQyNEl6TFphRGhSV1h1TlBnejBadHlQS3BiZEM0?= =?utf-8?B?dVBMZ01qeDFP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c0dxd0xia05MMXdhNWNDWlpua1F3OXFpUUhBbGpyeDVwai94Nzc2?= =?utf-8?B?dzdpNVdpck5PdWNnU1pucXkvN2d6cEZ2WUJGQ1lFYTZraTV6WE9rQi9oNkgw?= =?utf-8?B?TjlqZm9pdDBkaEl4akFFeG5BTTNzR2ZTWmg5a3IzLzJVYWtPR01DUStDanM0?= =?utf-8?B?c3dtZjBpbmQxb3M2bEV1NDZTUDUyT05WcTkwb1lmUTRZcjRFMmJsTUY5Mmlq?= =?utf-8?B?MStncm51eSs1ZFhVcGQvS3NDNSttY0ZmdlM5LzJWRU9CQ0x6eDZzZ2oxUGRR?= =?utf-8?B?aXArMHpmLzBpNDFMSG9PTU1TdW5PUDJRblg5VElZVHFyNmFEdTJaM3NWRVhi?= =?utf-8?B?SEtQSHphYXprTFJTdWZOUT09?= 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)(366007)(1800799015)(38070700009); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?utf-8?B?blFoSDB4cWE1NDJxVHZ1SUwrakNPblRiQWpqdGMzVlNURkFkUDRzdVRxNjgx?= =?utf-8?B?dURFY2NCQmk1MytySU1jbnN5OS9wYy9zYzBQNjdqLzc4UHlnc0RCaEtsQklT?= =?utf-8?B?MFZDVlNnVitzdk1EV0Z2dWVtRWNxM0t5eU5xWVREa2xpbWlaWTd1dE1tYUYw?= =?utf-8?B?VSsrWUxqN2VWbUkvK0Z6ajJsZSs3YjE3Mk1QM0UvUXJKV25SWXVNUCtWUWxo?= =?utf-8?B?MVREb3NsdzJuNTR3QlFDaFp6MWFyUHdENW0rT280ay80YVNYRHRqdTdmejJj?= =?utf-8?B?T0ZMWWM4QXIzMCtxc2xHQS9qdlZpbXZvVG9zMTBFcHp1ck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G1PWGt6Vm44MGRIK1puL2NXNXhsSm5iZVRwL2k5N0NKYzg0WEkyM09S?= =?utf-8?Q?W9/UEy4ero30/B9qgy6M/jM=3D?= Content-Type: text/plain; charset="utf-8" Content-ID: <5374C1BC3E978640B7878E39204C3407@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: fbb2d89d-1f7b-4ec4-9b67-08dc83926250 X-MS-Exchange-CrossTenant-originalarrivaltime: 03 Jun 2024 05:59:51.7273 (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: HFbuudPL7muZupEHCkkhNpiOAjAdELDiiiHsgKJla74lTSmTDq9daS3qwD0SNepGGz2m48bIVpYaxyrGEsOACCTgWFs9n/QxnJjqQSQeJPzMbPCHvcGgSkxicu8NlWAC X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR07MB6238 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.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, 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: 1717394506996100003 From: Cl=C3=A9ment Mathieu--Drif As the SVM-capable devices will need to cache translations, we provide an first implementation. This cache uses a two-level design based on hash tables. The first level is indexed by a PASID and the second by a virtual addresse. Signed-off-by: Cl=C3=A9ment Mathieu--Drif --- util/atc.c | 211 +++++++++++++++++++++++++++++++++++++++++++++++ util/atc.h | 117 ++++++++++++++++++++++++++ util/meson.build | 1 + 3 files changed, 329 insertions(+) create mode 100644 util/atc.c create mode 100644 util/atc.h diff --git a/util/atc.c b/util/atc.c new file mode 100644 index 0000000000..584ce045db --- /dev/null +++ b/util/atc.c @@ -0,0 +1,211 @@ +/* + * QEMU emulation of an ATC + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + + * You should have received a copy of the GNU General Public License along + * with this program; if not, see . + */ + +#include "util/atc.h" + + +#define PAGE_TABLE_ENTRY_SIZE 8 + +/* a pasid is hashed using the identity function */ +static guint atc_pasid_key_hash(gconstpointer v) +{ + return (guint)(uintptr_t)v; /* pasid */ +} + +/* pasid equality */ +static gboolean atc_pasid_key_equal(gconstpointer v1, gconstpointer v2) +{ + return v1 =3D=3D v2; +} + +/* Hash function for IOTLB entries */ +static guint atc_addr_key_hash(gconstpointer v) +{ + hwaddr addr =3D (hwaddr)v; + return (guint)((addr >> 32) ^ (addr & 0xffffffffU)); +} + +/* Equality test for IOTLB entries */ +static gboolean atc_addr_key_equal(gconstpointer v1, gconstpointer v2) +{ + return (hwaddr)v1 =3D=3D (hwaddr)v2; +} + +static void atc_address_space_free(void *as) +{ + g_hash_table_unref(as); +} + +/* return log2(val), or UINT8_MAX if val is not a power of 2 */ +static uint8_t ilog2(uint64_t val) +{ + uint8_t result =3D 0; + while (val !=3D 1) { + if (val & 1) { + return UINT8_MAX; + } + + val >>=3D 1; + result +=3D 1; + } + return result; +} + +ATC *atc_new(uint64_t page_size, uint8_t address_width) +{ + ATC *atc; + uint8_t log_page_size =3D ilog2(page_size); + /* number of bits each used to store all the intermediate indexes */ + uint64_t addr_lookup_indexes_size; + + if (log_page_size =3D=3D UINT8_MAX) { + return NULL; + } + /* + * We only support page table entries of 8 (PAGE_TABLE_ENTRY_SIZE) byt= es + * log2(page_size / 8) =3D log2(page_size) - 3 + * is the level offset + */ + if (log_page_size <=3D 3) { + return NULL; + } + + atc =3D g_new0(ATC, 1); + atc->address_spaces =3D g_hash_table_new_full(atc_pasid_key_hash, + atc_pasid_key_equal, + NULL, atc_address_space_fr= ee); + atc->level_offset =3D log_page_size - 3; + /* at this point, we know that page_size is a power of 2 */ + atc->min_addr_mask =3D page_size - 1; + addr_lookup_indexes_size =3D address_width - log_page_size; + if ((addr_lookup_indexes_size % atc->level_offset) !=3D 0) { + goto error; + } + atc->levels =3D addr_lookup_indexes_size / atc->level_offset; + atc->page_size =3D page_size; + return atc; + +error: + g_free(atc); + return NULL; +} + +static inline GHashTable *atc_get_address_space_cache(ATC *atc, uint32_t p= asid) +{ + return g_hash_table_lookup(atc->address_spaces, + (gconstpointer)(uintptr_t)pasid); +} + +void atc_create_address_space_cache(ATC *atc, uint32_t pasid) +{ + GHashTable *as_cache; + + as_cache =3D atc_get_address_space_cache(atc, pasid); + if (!as_cache) { + as_cache =3D g_hash_table_new_full(atc_addr_key_hash, + atc_addr_key_equal, + NULL, g_free); + g_hash_table_replace(atc->address_spaces, + (gpointer)(uintptr_t)pasid, as_cache); + } +} + +void atc_delete_address_space_cache(ATC *atc, uint32_t pasid) +{ + g_hash_table_remove(atc->address_spaces, (gpointer)(uintptr_t)pasid); +} + +int atc_update(ATC *atc, IOMMUTLBEntry *entry) +{ + IOMMUTLBEntry *value; + GHashTable *as_cache =3D atc_get_address_space_cache(atc, entry->pasid= ); + if (!as_cache) { + return -ENODEV; + } + value =3D g_memdup2(entry, sizeof(*value)); + g_hash_table_replace(as_cache, (gpointer)(entry->iova), value); + return 0; +} + +IOMMUTLBEntry *atc_lookup(ATC *atc, uint32_t pasid, hwaddr addr) +{ + IOMMUTLBEntry *entry; + hwaddr mask =3D atc->min_addr_mask; + hwaddr key =3D addr & (~mask); + GHashTable *as_cache =3D atc_get_address_space_cache(atc, pasid); + + if (!as_cache) { + return NULL; + } + + /* + * Iterate over the possible page sizes and try to find a hit + */ + for (uint8_t level =3D 0; level < atc->levels; ++level) { + entry =3D g_hash_table_lookup(as_cache, (gconstpointer)key); + if (entry && (mask =3D=3D entry->addr_mask)) { + return entry; + } + mask =3D (mask << atc->level_offset) | ((1 << atc->level_offset) -= 1); + key =3D addr & (~mask); + } + + return NULL; +} + +static gboolean atc_invalidate_entry_predicate(gpointer key, gpointer valu= e, + gpointer user_data) +{ + IOMMUTLBEntry *entry =3D (IOMMUTLBEntry *)value; + IOMMUTLBEntry *target =3D (IOMMUTLBEntry *)user_data; + hwaddr target_mask =3D ~target->addr_mask; + hwaddr entry_mask =3D ~entry->addr_mask; + return ((target->iova & target_mask) =3D=3D (entry->iova & target_mask= )) || + ((target->iova & entry_mask) =3D=3D (entry->iova & entry_mask)); +} + +void atc_invalidate(ATC *atc, IOMMUTLBEntry *entry) +{ + GHashTable *as_cache =3D atc_get_address_space_cache(atc, entry->pasid= ); + if (!as_cache) { + return; + } + g_hash_table_foreach_remove(as_cache, + atc_invalidate_entry_predicate, + entry); +} + +void atc_destroy(ATC *atc) +{ + g_hash_table_unref(atc->address_spaces); +} + +size_t atc_get_max_number_of_pages(ATC *atc, hwaddr addr, size_t length) +{ + hwaddr page_mask =3D ~(atc->min_addr_mask); + size_t result =3D (length / atc->page_size); + if ((((addr & page_mask) + length - 1) & page_mask) !=3D + ((addr + length - 1) & page_mask)) { + result +=3D 1; + } + return result + (length % atc->page_size !=3D 0 ? 1 : 0); +} + +void atc_reset(ATC *atc) +{ + g_hash_table_remove_all(atc->address_spaces); +} diff --git a/util/atc.h b/util/atc.h new file mode 100644 index 0000000000..8be95f5cca --- /dev/null +++ b/util/atc.h @@ -0,0 +1,117 @@ +/* + * QEMU emulation of an ATC + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + + * You should have received a copy of the GNU General Public License along + * with this program; if not, see . + */ + +#ifndef UTIL_ATC_H +#define UTIL_ATC_H + +#include "qemu/osdep.h" +#include "exec/memory.h" + +typedef struct ATC { + GHashTable *address_spaces; /* Key : pasid, value : GHashTable */ + hwaddr min_addr_mask; + uint64_t page_size; + uint8_t levels; + uint8_t level_offset; +} ATC; + +/* + * atc_new: Create an ATC. + * + * Return an ATC or NULL if the creation failed + * + * @page_size: #PCIDevice doing the memory access + * @address_width: width of the virtual addresses used by the IOMMU (in bi= ts) + */ +ATC *atc_new(uint64_t page_size, uint8_t address_width); + +/* + * atc_update: Insert or update an entry in the cache + * + * Return 0 if the operation succeeds, a negative error code otherwise + * + * The insertion will fail if the address space associated with this pasid + * has not been created with atc_create_address_space_cache + * + * @atc: the ATC to update + * @entry: the tlb entry to insert into the cache + */ +int atc_update(ATC *atc, IOMMUTLBEntry *entry); + +/* + * atc_create_address_space_cache: delare a new address space + * identified by a PASID + * + * @atc: the ATC to update + * @pasid: the pasid of the address space to be created + */ +void atc_create_address_space_cache(ATC *atc, uint32_t pasid); + +/* + * atc_delete_address_space_cache: delete an address space + * identified by a PASID + * + * @atc: the ATC to update + * @pasid: the pasid of the address space to be deleted + */ +void atc_delete_address_space_cache(ATC *atc, uint32_t pasid); + +/* + * atc_lookup: query the cache in a given address space + * + * @atc: the ATC to query + * @pasid: the pasid of the address space to query + * @addr: the virtual address to translate + */ +IOMMUTLBEntry *atc_lookup(ATC *atc, uint32_t pasid, hwaddr addr); + +/* + * atc_invalidate: invalidate an entry in the cache + * + * @atc: the ATC to update + * @entry: the entry to invalidate + */ +void atc_invalidate(ATC *atc, IOMMUTLBEntry *entry); + +/* + * atc_destroy: delete an ATC + * + * @atc: the cache to be deleted + */ +void atc_destroy(ATC *atc); + +/* + * atc_get_max_number_of_pages: get the number of pages a memory operation + * will access if all the pages concerned have the minimum size. + * + * This function can be used to determine the size of the result array to = be + * allocated when issuing an ATS request. + * + * @atc: the cache + * @addr: start address + * @length: number of bytes accessed from addr + */ +size_t atc_get_max_number_of_pages(ATC *atc, hwaddr addr, size_t length); + +/* + * atc_reset: invalidates all the entries stored in the ATC + * + * @atc: the cache + */ +void atc_reset(ATC *atc); + +#endif diff --git a/util/meson.build b/util/meson.build index 2ad57b10ba..e6ca37a4b1 100644 --- a/util/meson.build +++ b/util/meson.build @@ -93,6 +93,7 @@ if have_block util_ss.add(files('hbitmap.c')) util_ss.add(files('hexdump.c')) util_ss.add(files('iova-tree.c')) + util_ss.add(files('atc.c')) util_ss.add(files('iov.c', 'uri.c')) util_ss.add(files('nvdimm-utils.c')) util_ss.add(files('block-helpers.c')) --=20 2.45.1 From nobody Mon Nov 25 05:23:36 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=1717394479; cv=pass; d=zohomail.com; s=zohoarc; b=QikWVBhUZ/imZB3jjLa44o9eEbmXaU2o7uYuvQH3JjScqK8wUzAnHouHXXYEiiMDdzjyRuELdObviA39crOUHkYaoDoGwpD13G9jhrDX9Vkn7stGCpeq8jMJPh6JjTdBvhPJKpiiljlJvFx3CDkLlVLmL2AVr31xvqzDjV4X3OE= ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1717394479; 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=NDvmTaxDzYjsRZ3EF+zbL5RdaMiNQK17KHNCW8LJaoM=; b=DT3mhK/6+X+WxaFHAvwysuj7jCJoBeHiIQmSoJOHTxSwPBnNM0Nc8AXT4wShg+kGnQS8hbnKq/HS3gHmDuKKnWHYnOoOEWT7jijKBKgZUDllobs0bPiXswsfEqLK74QzbKMzXG2DNiqnhdrvLDwS4TE0A7hjGMNCWuo/FFUOnSk= 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 1717394479747166.80618827337935; Sun, 2 Jun 2024 23:01:19 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sE0jw-0006te-W2; Mon, 03 Jun 2024 02:00:17 -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 1sE0jm-0006oX-O5 for qemu-devel@nongnu.org; Mon, 03 Jun 2024 02:00:06 -0400 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 1sE0jg-00072f-TR for qemu-devel@nongnu.org; Mon, 03 Jun 2024 02:00:04 -0400 Received: from mail-he1eur01lp2051.outbound.protection.outlook.com (HELO EUR01-HE1-obe.outbound.protection.outlook.com) ([104.47.0.51]) by smarthost2.eviden.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 03 Jun 2024 07:59:56 +0200 Received: from AM8PR07MB7602.eurprd07.prod.outlook.com (2603:10a6:20b:24b::7) by VI1PR07MB6238.eurprd07.prod.outlook.com (2603:10a6:800:136::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7633.21; Mon, 3 Jun 2024 05:59:52 +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.021; Mon, 3 Jun 2024 05:59:52 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=eviden.com; i=@eviden.com; q=dns/txt; s=mail; t=1717394401; x=1748930401; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-id:content-transfer-encoding: mime-version; bh=NDvmTaxDzYjsRZ3EF+zbL5RdaMiNQK17KHNCW8LJaoM=; b=E4GXZFZAv0nGhEHSEK0MUemfcjD+naWn5SuhAy748WOJqbcXBKSnAbEB TKzK7gac3X3nV8YdpWcC9hZUPzCsmfrf4RXkQWSUQ6x7H900HqD9rGTUk EEGaOM+V46hRDrySExDQg9pxGQ/8YwwxbMQ/6yRN9GDfplv7t5iGOHx8k cSAgPxJrDuxyTxErJJAvNoa8oJeJ5Zyyz+hPDBhxTEJYGiW9T2Gd5fRLV NE12PrdVBUpuQ1NhBise5r0HrmC/nASpUIeOsMvYVaIkaZ+BfM1C/HAvB pLV5tsWzHRWI8f1N3nmljzL6/2IeeGCDA/Mhy2xtxyn1ULJgQgoo58rvO Q==; X-IronPort-AV: E=Sophos;i="6.08,210,1712613600"; d="scan'208";a="13763252" X-MGA-submission: =?us-ascii?q?MDED4qULRP8Bq+zqwY8c4DqSEmxZ1bZhR7UUkn?= =?us-ascii?q?6AiyIx4SGelyFpxDANqd/CU+AFSE3rFDAOisfJHzsouF1QeJ0adTyREN?= =?us-ascii?q?ZGDvkoQoXhU23ZdgkGU0zhUO9yRkhn2/qD/SM/gOzCT+dlwE0izf4+2N?= =?us-ascii?q?CIdZsHaJrMsh5ODwEC3woepw=3D=3D?= ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=hekcvG4Hmgz0f4WST6Y9R/fQOh+T3ddKlSWK12ejU1njpBG4tzAK7DbiOlwlWPlpR9NSqBDN/jMaFW45d0Xg0J7cg2wvBfEwIS5S01vCWVmei+8jmoRvnOlbOxCKXal1KOMUweL8iPoBJQqJwYXc/6aoB6YmfuDNHfd4T3bE63y0J5Ml9JCniSJuLwKCkv2XSeGR7uSgDOxS6Pwf1ZQbEe2Mkjf35m6eq9X22Huh13teeJwSzAxRyx0fc4oNxzx8T9biq5I+iu2lP5DUp9GDvvUrEFBvHyiXlgxv016Bj+NQAV39O1obGLu+2636GjaU/4giWUHd6p1TWw/feXxUGQ== 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=NDvmTaxDzYjsRZ3EF+zbL5RdaMiNQK17KHNCW8LJaoM=; b=U4Y3SXvx9gYpkVhdl/dNKvHFtooHBmRmFjtezFeGcVR4uiymUbO3axyJn3JXEFEH6/3+TFu1G9qe9nparGcoiFSw6JAWI8ENYbsRw8RDBb4lK6EiWd+rx1pB8qtnNeTJMdB/Vj71DK2K0fz/efYmfm91ksFV1RvRWTXDCE3DH3jO6XJWCJUdmZ73UTnOv2eQ+BeP2X2Xni/JB7zsfBbbR3ymxEdUFRPPbJbnHNvvifqtYSI3oX8qmyMkDyyGaeBeTrVBWX7w24XSmrLPc6v2WBWuYBF1BOucum7Hc/k1kB7EncKJnHIUyOQw6qOzovqANJdw2Y3krwjJIiC0saNIOQ== 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=NDvmTaxDzYjsRZ3EF+zbL5RdaMiNQK17KHNCW8LJaoM=; b=YdJ4ccqjcsR3HwdhyBxU1+wVOSbCGCe/F5bdVZWQSe16cvmZD/u0k6S8L9kg3GRFnN7UfAk2lLF2uL4yJ+GBMalbGFgI1FDtpLAEHbmjRaSRgGqVT89vTqD0HvH45ZrMvVBs/zYGUTqxOLN0GFBJS6DiHfXMrmvZdMj007QrHTwXaV7MG16KTIdoos1I9egWI6dj6wxM5Y/pcYX8W9uwmE7eEjO80gI9xg1ERdmg3KBNm0bc5cEWDBCxRluIr18fghawTVhvQtoM73REf4NM18hiPVFE39pNFz6X/G1j8W/X9tCRJgIZhE6tvDxY3p9xPRFoBdH1VYfScDMosDUzSg== 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" , CLEMENT MATHIEU--DRIF Subject: [PATCH ats_vtd v5 18/22] atc: add unit tests Thread-Topic: [PATCH ats_vtd v5 18/22] atc: add unit tests Thread-Index: AQHatXtAHjZRSkrQhE2gCr0Vvwwm6w== Date: Mon, 3 Jun 2024 05:59:52 +0000 Message-ID: <20240603055917.18735-19-clement.mathieu--drif@eviden.com> References: <20240603055917.18735-1-clement.mathieu--drif@eviden.com> In-Reply-To: <20240603055917.18735-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_|VI1PR07MB6238:EE_ x-ms-office365-filtering-correlation-id: 798fca15-90e4-4fac-789d-08dc839262b9 x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; ARA:13230031|376005|366007|1800799015|38070700009; x-microsoft-antispam-message-info: =?utf-8?B?NFNWekphakxFcTI5TVVXcDdyd3JwMzQwTVpWb1V6Rk1qeTJ4d0plK3BkMWRk?= =?utf-8?B?MEYzUkJiL2xiSWtDY0VmbEsxWUNjMGhHOVI1YnVTMDNtRmlPSU4yRXpVeXdX?= =?utf-8?B?Z2VIeXdEY3Zad3oxU1dsV1ZpNmtjUFBkV2lLcUhFWkRxSzU2ajZ2QjE1UStq?= =?utf-8?B?OThOUTNlbDNLMjFvWlBtcDRJbVk4UFk5blBTaHg3Q3h0ZkVCdHBLcGtEeSt1?= =?utf-8?B?VE9WaHE3YmJxczVvV2U0ak03czBDWHJDM09wN2hNaHk2MXVySHlCOGNnV1px?= =?utf-8?B?bFVDRFJQTFVRNmkrVkI1aFJwN2JBSTJoVkdVdDM2d1puWGl2YjNrRXR4RThu?= =?utf-8?B?eFhIbW80Qk9YVjV1V2U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V?= =?utf-8?B?cE43V0JadTBhMlduVjlCS3hqTW1kTnQ5dVV1Z2NIeSs1cU5ZV3V4MUFQVG5O?= =?utf-8?B?RnJzMVBBZ0I4Y0lqU0xib3ZhRnRHTzhJSjVZckpJQXBxTmFBb2M2enZmVjRG?= =?utf-8?B?WkVta0o2L0thYXZaaTFvZ0JmT1RDUjJXL0s5TGxPdmYwTUNFLzFRcTBOa3lN?= =?utf-8?B?SWdPc0w4Y3JjaUMxM1p2OE00S2RyaGpMenFIcTJxeFRBc3ovMHNLVUF5ZHdT?= =?utf-8?B?T0FsU0VJekRJVE1mS01aWkErZ0JQQzFCK0prdHJuTjV3VGlkSUxSQzVsK3VJ?= =?utf-8?B?bUhLZDNwOWpHdmNMZmZyanV6aE1sZE5UU25SUEVPN1lXN3R5VVBaUzdaYkIx?= =?utf-8?B?cjFmVGQ2Y0tEbnFTOG5wa0NjbkxTcy8xV2Y3YTV2TU9FNCtXcnlVZmZnSFlZ?= =?utf-8?B?bDkyRmI2c3U3M0pDRkYxMmdIdDd5MVZaZU50VmZwQkJlK3BPQ0dhWnowS2NY?= =?utf-8?B?SGQwTGNXMGMwS2dpalhhU0hlV1lLSG1iS1dJMG94dmRrNXB4dFZ2ZXU2YU4w?= =?utf-8?B?aVVyTWdPZEMraExudWdMUT09?= 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)(366007)(1800799015)(38070700009); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?utf-8?B?ZU1mbE95K0lJNlFaVU9Pa3hpcE1selJ2bUFTV1k4dkVYd1g5bS9YUmllL0pp?= =?utf-8?B?eldWMzIrUXEzNm9Ca0lLOWpIY05wWHM3d1pOYUM0alRjWWI3aEUyRUZYb0g1?= =?utf-8?B?MUhmR2FFd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RlI3bGZZSGZRYmp4?= =?utf-8?B?dUZndkJYVnllb3BFMzJoQlFkOXlmSmRTNUVINi9lMGN3bFRRMEt4VHN1T0hr?= =?utf-8?B?UUlpRlVKRVVRZ3BJcUJJdk9tblFyWnUxS0JlVm15Q2F3THlLbkRyaWxLTzdw?= =?utf-8?B?SmorZ254a3ZYYWVVdTRRRGtUWUkzMGVpanA3eVMzUlZnWmdkN3NBQVlTZVNr?= =?utf-8?B?MGtKWlh5aTlQejdCU3pXd3laNGpLWHFNUXhtTk03YStvWElCcDQxVHA1Z0Ur?= =?utf-8?Q?6aMRTl2zrftPMuTgUiq3EwQ=3D?= Content-Type: text/plain; charset="utf-8" Content-ID: <325765F4E6859F44889687663EBFD776@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: 798fca15-90e4-4fac-789d-08dc839262b9 X-MS-Exchange-CrossTenant-originalarrivaltime: 03 Jun 2024 05:59:52.4223 (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: tZd44VXWHtBQMYDQPIpF7QZzep/LPWTXQ6KZf98iuHkjSrQhGfEDZdlLFwJtzWiXhVj3FTI3IOXbaOHpfWJnC15VGj4rYXqYm1znO2OmAyl/UUIsoPapMXsCJsejQHBh X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR07MB6238 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.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, 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: 1717394481140100004 From: Cl=C3=A9ment Mathieu--Drif Signed-off-by: Cl=C3=A9ment Mathieu--Drif --- tests/unit/meson.build | 1 + tests/unit/test-atc.c | 527 +++++++++++++++++++++++++++++++++++++++++ 2 files changed, 528 insertions(+) create mode 100644 tests/unit/test-atc.c diff --git a/tests/unit/meson.build b/tests/unit/meson.build index 26c109c968..d6c6c574de 100644 --- a/tests/unit/meson.build +++ b/tests/unit/meson.build @@ -47,6 +47,7 @@ tests =3D { 'test-logging': [], 'test-qapi-util': [], 'test-interval-tree': [], + 'test-atc': [] } =20 if have_system or have_tools diff --git a/tests/unit/test-atc.c b/tests/unit/test-atc.c new file mode 100644 index 0000000000..89378f7f63 --- /dev/null +++ b/tests/unit/test-atc.c @@ -0,0 +1,527 @@ +/* + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + + * You should have received a copy of the GNU General Public License along + * with this program; if not, see . + */ + +#include "util/atc.h" + +static inline bool tlb_entry_equal(IOMMUTLBEntry *e1, IOMMUTLBEntry *e2) +{ + if (!e1 || !e2) { + return !e1 && !e2; + } + return e1->iova =3D=3D e2->iova && + e1->addr_mask =3D=3D e2->addr_mask && + e1->pasid =3D=3D e2->pasid && + e1->perm =3D=3D e2->perm && + e1->target_as =3D=3D e2->target_as && + e1->translated_addr =3D=3D e2->translated_addr; +} + +static void assert_lookup_equals(ATC *atc, IOMMUTLBEntry *target, + uint32_t pasid, hwaddr iova) +{ + IOMMUTLBEntry *result; + result =3D atc_lookup(atc, pasid, iova); + g_assert(tlb_entry_equal(result, target)); +} + +static void check_creation(uint64_t page_size, uint8_t address_width, + uint8_t levels, uint8_t level_offset, + bool should_work) { + ATC *atc =3D atc_new(page_size, address_width); + if (atc) { + if (atc->levels !=3D levels || atc->level_offset !=3D level_offset= ) { + g_assert(false); /* ATC created but invalid configuration : fa= il */ + } + atc_destroy(atc); + g_assert(should_work); + } else { + g_assert(!should_work); + } +} + +static void test_creation_parameters(void) +{ + check_creation(8, 39, 3, 9, false); + check_creation(4095, 39, 3, 9, false); + check_creation(4097, 39, 3, 9, false); + check_creation(8192, 48, 0, 0, false); + + check_creation(4096, 38, 0, 0, false); + check_creation(4096, 39, 3, 9, true); + check_creation(4096, 40, 0, 0, false); + check_creation(4096, 47, 0, 0, false); + check_creation(4096, 48, 4, 9, true); + check_creation(4096, 49, 0, 0, false); + check_creation(4096, 56, 0, 0, false); + check_creation(4096, 57, 5, 9, true); + check_creation(4096, 58, 0, 0, false); + + check_creation(16384, 35, 0, 0, false); + check_creation(16384, 36, 2, 11, true); + check_creation(16384, 37, 0, 0, false); + check_creation(16384, 46, 0, 0, false); + check_creation(16384, 47, 3, 11, true); + check_creation(16384, 48, 0, 0, false); + check_creation(16384, 57, 0, 0, false); + check_creation(16384, 58, 4, 11, true); + check_creation(16384, 59, 0, 0, false); +} + +static void test_single_entry(void) +{ + IOMMUTLBEntry entry =3D { + .iova =3D 0x123456789000ULL, + .addr_mask =3D 0xfffULL, + .pasid =3D 5, + .perm =3D IOMMU_RW, + .translated_addr =3D 0xdeadbeefULL, + }; + + ATC *atc =3D atc_new(4096, 48); + g_assert(atc); + + assert_lookup_equals(atc, NULL, entry.pasid, + entry.iova + (entry.addr_mask / 2)); + + atc_create_address_space_cache(atc, entry.pasid); + g_assert(atc_update(atc, &entry) =3D=3D 0); + + assert_lookup_equals(atc, NULL, entry.pasid + 1, + entry.iova + (entry.addr_mask / 2)); + assert_lookup_equals(atc, &entry, entry.pasid, + entry.iova + (entry.addr_mask / 2)); + + atc_destroy(atc); +} + +static void test_single_entry_2(void) +{ + static uint64_t page_size =3D 4096; + IOMMUTLBEntry e1 =3D { + .iova =3D 0xabcdef200000ULL, + .addr_mask =3D 0xfffULL, + .pasid =3D 1, + .perm =3D IOMMU_RW, + .translated_addr =3D 0x5eedULL, + }; + + ATC *atc =3D atc_new(page_size , 48); + atc_create_address_space_cache(atc, e1.pasid); + atc_update(atc, &e1); + + assert_lookup_equals(atc, NULL, e1.pasid, 0xabcdef201000ULL); + + atc_destroy(atc); +} + +static void test_page_boundaries(void) +{ + static const uint32_t pasid =3D 5; + static const hwaddr page_size =3D 4096; + + /* 2 consecutive entries */ + IOMMUTLBEntry e1 =3D { + .iova =3D 0x123456789000ULL, + .addr_mask =3D page_size - 1, + .pasid =3D pasid, + .perm =3D IOMMU_RW, + .translated_addr =3D 0xdeadbeefULL, + }; + IOMMUTLBEntry e2 =3D { + .iova =3D e1.iova + page_size, + .addr_mask =3D page_size - 1, + .pasid =3D pasid, + .perm =3D IOMMU_RW, + .translated_addr =3D 0x900df00dULL, + }; + + ATC *atc =3D atc_new(page_size, 48); + + atc_create_address_space_cache(atc, e1.pasid); + /* creating the address space twice should not be a problem */ + atc_create_address_space_cache(atc, e1.pasid); + + atc_update(atc, &e1); + atc_update(atc, &e2); + + assert_lookup_equals(atc, NULL, e1.pasid, e1.iova - 1); + assert_lookup_equals(atc, &e1, e1.pasid, e1.iova); + assert_lookup_equals(atc, &e1, e1.pasid, e1.iova + e1.addr_mask); + g_assert((e1.iova + e1.addr_mask + 1) =3D=3D e2.iova); + assert_lookup_equals(atc, &e2, e2.pasid, e2.iova); + assert_lookup_equals(atc, &e2, e2.pasid, e2.iova + e2.addr_mask); + assert_lookup_equals(atc, NULL, e2.pasid, e2.iova + e2.addr_mask + 1); + + assert_lookup_equals(atc, NULL, e1.pasid + 10, e1.iova); + assert_lookup_equals(atc, NULL, e2.pasid + 10, e2.iova); + atc_destroy(atc); +} + +static void test_huge_page(void) +{ + static const uint32_t pasid =3D 5; + static const hwaddr page_size =3D 4096; + IOMMUTLBEntry e1 =3D { + .iova =3D 0x123456600000ULL, + .addr_mask =3D 0x1fffffULL, + .pasid =3D pasid, + .perm =3D IOMMU_RW, + .translated_addr =3D 0xdeadbeefULL, + }; + hwaddr addr; + + ATC *atc =3D atc_new(page_size, 48); + + atc_create_address_space_cache(atc, e1.pasid); + atc_update(atc, &e1); + + for (addr =3D e1.iova; addr <=3D e1.iova + e1.addr_mask; addr +=3D pag= e_size) { + assert_lookup_equals(atc, &e1, e1.pasid, addr); + } + /* addr is now out of the huge page */ + assert_lookup_equals(atc, NULL, e1.pasid, addr); + atc_destroy(atc); +} + +static void test_pasid(void) +{ + hwaddr addr =3D 0xaaaaaaaaa000ULL; + IOMMUTLBEntry e1 =3D { + .iova =3D addr, + .addr_mask =3D 0xfffULL, + .pasid =3D 8, + .perm =3D IOMMU_RW, + .translated_addr =3D 0xdeadbeefULL, + }; + IOMMUTLBEntry e2 =3D { + .iova =3D addr, + .addr_mask =3D 0xfffULL, + .pasid =3D 2, + .perm =3D IOMMU_RW, + .translated_addr =3D 0xb001ULL, + }; + uint16_t i; + + ATC *atc =3D atc_new(4096, 48); + + atc_create_address_space_cache(atc, e1.pasid); + atc_create_address_space_cache(atc, e2.pasid); + atc_update(atc, &e1); + atc_update(atc, &e2); + + for (i =3D 0; i <=3D MAX(e1.pasid, e2.pasid) + 1; ++i) { + if (i =3D=3D e1.pasid || i =3D=3D e2.pasid) { + continue; + } + assert_lookup_equals(atc, NULL, i, addr); + } + assert_lookup_equals(atc, &e1, e1.pasid, addr); + assert_lookup_equals(atc, &e1, e1.pasid, addr); + atc_destroy(atc); +} + +static void test_large_address(void) +{ + IOMMUTLBEntry e1 =3D { + .iova =3D 0xaaaaaaaaa000ULL, + .addr_mask =3D 0xfffULL, + .pasid =3D 8, + .perm =3D IOMMU_RW, + .translated_addr =3D 0x5eeeeeedULL, + }; + IOMMUTLBEntry e2 =3D { + .iova =3D 0x1f00baaaaabf000ULL, + .addr_mask =3D 0xfffULL, + .pasid =3D e1.pasid, + .perm =3D IOMMU_RW, + .translated_addr =3D 0xdeadbeefULL, + }; + + ATC *atc =3D atc_new(4096, 57); + + atc_create_address_space_cache(atc, e1.pasid); + atc_update(atc, &e1); + atc_update(atc, &e2); + + assert_lookup_equals(atc, &e1, e1.pasid, e1.iova); + assert_lookup_equals(atc, &e2, e2.pasid, e2.iova); + atc_destroy(atc); +} + +static void test_bigger_page(void) +{ + IOMMUTLBEntry e1 =3D { + .iova =3D 0xaabbccdde000ULL, + .addr_mask =3D 0x1fffULL, + .pasid =3D 1, + .perm =3D IOMMU_RW, + .translated_addr =3D 0x5eeeeeedULL, + }; + hwaddr i; + + ATC *atc =3D atc_new(8192, 43); + + atc_create_address_space_cache(atc, e1.pasid); + atc_update(atc, &e1); + + i =3D e1.iova & (~e1.addr_mask); + assert_lookup_equals(atc, NULL, e1.pasid, i - 1); + while (i <=3D e1.iova + e1.addr_mask) { + assert_lookup_equals(atc, &e1, e1.pasid, i); + ++i; + } + assert_lookup_equals(atc, NULL, e1.pasid, i); + atc_destroy(atc); +} + +static void test_unknown_pasid(void) +{ + IOMMUTLBEntry e1 =3D { + .iova =3D 0xaabbccfff000ULL, + .addr_mask =3D 0xfffULL, + .pasid =3D 1, + .perm =3D IOMMU_RW, + .translated_addr =3D 0x5eeeeeedULL, + }; + + ATC *atc =3D atc_new(4096, 48); + g_assert(atc_update(atc, &e1) !=3D 0); + assert_lookup_equals(atc, NULL, e1.pasid, e1.iova); + atc_destroy(atc); +} + +static void test_invalidation(void) +{ + static uint64_t page_size =3D 4096; + IOMMUTLBEntry e1 =3D { + .iova =3D 0xaabbccddf000ULL, + .addr_mask =3D 0xfffULL, + .pasid =3D 1, + .perm =3D IOMMU_RW, + .translated_addr =3D 0x5eeeeeedULL, + }; + IOMMUTLBEntry e2 =3D { + .iova =3D 0xffe00000ULL, + .addr_mask =3D 0x1fffffULL, + .pasid =3D 1, + .perm =3D IOMMU_RW, + .translated_addr =3D 0xb000001ULL, + }; + IOMMUTLBEntry e3; + + ATC *atc =3D atc_new(page_size , 48); + atc_create_address_space_cache(atc, e1.pasid); + + atc_update(atc, &e1); + assert_lookup_equals(atc, &e1, e1.pasid, e1.iova); + atc_invalidate(atc, &e1); + assert_lookup_equals(atc, NULL, e1.pasid, e1.iova); + + atc_update(atc, &e1); + atc_update(atc, &e2); + assert_lookup_equals(atc, &e1, e1.pasid, e1.iova); + assert_lookup_equals(atc, &e2, e2.pasid, e2.iova); + atc_invalidate(atc, &e2); + assert_lookup_equals(atc, &e1, e1.pasid, e1.iova); + assert_lookup_equals(atc, NULL, e2.pasid, e2.iova); + + /* invalidate a huge page by invalidating a small region */ + for (hwaddr addr =3D e2.iova; addr <=3D (e2.iova + e2.addr_mask); + addr +=3D page_size) { + atc_update(atc, &e2); + assert_lookup_equals(atc, &e2, e2.pasid, e2.iova); + e3 =3D (IOMMUTLBEntry){ + .iova =3D addr, + .addr_mask =3D page_size - 1, + .pasid =3D e2.pasid, + .perm =3D IOMMU_RW, + .translated_addr =3D 0, + }; + atc_invalidate(atc, &e3); + assert_lookup_equals(atc, NULL, e2.pasid, e2.iova); + } + atc_destroy(atc); +} + +static void test_delete_address_space_cache(void) +{ + static uint64_t page_size =3D 4096; + IOMMUTLBEntry e1 =3D { + .iova =3D 0xaabbccddf000ULL, + .addr_mask =3D 0xfffULL, + .pasid =3D 1, + .perm =3D IOMMU_RW, + .translated_addr =3D 0x5eeeeeedULL, + }; + IOMMUTLBEntry e2 =3D { + .iova =3D e1.iova, + .addr_mask =3D 0xfffULL, + .pasid =3D 2, + .perm =3D IOMMU_RW, + .translated_addr =3D 0x5eeeeeedULL, + }; + + ATC *atc =3D atc_new(page_size , 48); + atc_create_address_space_cache(atc, e1.pasid); + + atc_update(atc, &e1); + assert_lookup_equals(atc, &e1, e1.pasid, e1.iova); + atc_invalidate(atc, &e2); /* unkown pasid : is a nop*/ + assert_lookup_equals(atc, &e1, e1.pasid, e1.iova); + + atc_create_address_space_cache(atc, e2.pasid); + atc_update(atc, &e2); + assert_lookup_equals(atc, &e1, e1.pasid, e1.iova); + assert_lookup_equals(atc, &e2, e2.pasid, e2.iova); + atc_invalidate(atc, &e1); + /* e1 has been removed but e2 is still there */ + assert_lookup_equals(atc, NULL, e1.pasid, e1.iova); + assert_lookup_equals(atc, &e2, e2.pasid, e2.iova); + + atc_update(atc, &e1); + assert_lookup_equals(atc, &e1, e1.pasid, e1.iova); + assert_lookup_equals(atc, &e2, e2.pasid, e2.iova); + + atc_delete_address_space_cache(atc, e2.pasid); + assert_lookup_equals(atc, &e1, e1.pasid, e1.iova); + assert_lookup_equals(atc, NULL, e2.pasid, e2.iova); + atc_destroy(atc); +} + +static void test_invalidate_entire_address_space(void) +{ + static uint64_t page_size =3D 4096; + IOMMUTLBEntry e1 =3D { + .iova =3D 0x1000ULL, + .addr_mask =3D 0xfffULL, + .pasid =3D 1, + .perm =3D IOMMU_RW, + .translated_addr =3D 0x5eedULL, + }; + IOMMUTLBEntry e2 =3D { + .iova =3D 0xfffffffff000ULL, + .addr_mask =3D 0xfffULL, + .pasid =3D 1, + .perm =3D IOMMU_RW, + .translated_addr =3D 0xbeefULL, + }; + IOMMUTLBEntry e3 =3D { + .iova =3D 0, + .addr_mask =3D 0xffffffffffffffffULL, + .pasid =3D 1, + .perm =3D IOMMU_RW, + .translated_addr =3D 0, + }; + + ATC *atc =3D atc_new(page_size , 48); + atc_create_address_space_cache(atc, e1.pasid); + + atc_update(atc, &e1); + atc_update(atc, &e2); + assert_lookup_equals(atc, &e1, e1.pasid, e1.iova); + assert_lookup_equals(atc, &e2, e2.pasid, e2.iova); + atc_invalidate(atc, &e3); + /* e1 has been removed but e2 is still there */ + assert_lookup_equals(atc, NULL, e1.pasid, e1.iova); + assert_lookup_equals(atc, NULL, e2.pasid, e2.iova); + + atc_destroy(atc); +} + +static void test_reset(void) +{ + static uint64_t page_size =3D 4096; + IOMMUTLBEntry e1 =3D { + .iova =3D 0x1000ULL, + .addr_mask =3D 0xfffULL, + .pasid =3D 1, + .perm =3D IOMMU_RW, + .translated_addr =3D 0x5eedULL, + }; + IOMMUTLBEntry e2 =3D { + .iova =3D 0xfffffffff000ULL, + .addr_mask =3D 0xfffULL, + .pasid =3D 2, + .perm =3D IOMMU_RW, + .translated_addr =3D 0xbeefULL, + }; + + ATC *atc =3D atc_new(page_size , 48); + atc_create_address_space_cache(atc, e1.pasid); + atc_create_address_space_cache(atc, e2.pasid); + atc_update(atc, &e1); + atc_update(atc, &e2); + + assert_lookup_equals(atc, &e1, e1.pasid, e1.iova); + assert_lookup_equals(atc, &e2, e2.pasid, e2.iova); + + atc_reset(atc); + + assert_lookup_equals(atc, NULL, e1.pasid, e1.iova); + assert_lookup_equals(atc, NULL, e2.pasid, e2.iova); + atc_destroy(atc); +} + +static void test_get_max_number_of_pages(void) +{ + static uint64_t page_size =3D 4096; + hwaddr base =3D 0xc0fee000; /* aligned */ + ATC *atc =3D atc_new(page_size , 48); + g_assert(atc_get_max_number_of_pages(atc, base, page_size / 2) =3D=3D = 1); + g_assert(atc_get_max_number_of_pages(atc, base, page_size) =3D=3D 1); + g_assert(atc_get_max_number_of_pages(atc, base, page_size + 1) =3D=3D = 2); + + g_assert(atc_get_max_number_of_pages(atc, base + 10, 1) =3D=3D 1); + g_assert(atc_get_max_number_of_pages(atc, base + 10, page_size - 10) = =3D=3D 1); + g_assert(atc_get_max_number_of_pages(atc, base + 10, + page_size - 10 + 1) =3D=3D 2); + g_assert(atc_get_max_number_of_pages(atc, base + 10, + page_size - 10 + 2) =3D=3D 2); + + g_assert(atc_get_max_number_of_pages(atc, base + page_size - 1, 1) =3D= =3D 1); + g_assert(atc_get_max_number_of_pages(atc, base + page_size - 1, 2) =3D= =3D 2); + g_assert(atc_get_max_number_of_pages(atc, base + page_size - 1, 3) =3D= =3D 2); + + g_assert(atc_get_max_number_of_pages(atc, base + 10, page_size * 20) = =3D=3D 21); + g_assert(atc_get_max_number_of_pages(atc, base + 10, + (page_size * 20) + (page_size - 1= 0)) + =3D=3D 21); + g_assert(atc_get_max_number_of_pages(atc, base + 10, + (page_size * 20) + + (page_size - 10 + 1)) =3D=3D 22); +} + +int main(int argc, char **argv) +{ + g_test_init(&argc, &argv, NULL); + g_test_add_func("/atc/test_creation_parameters", test_creation_paramet= ers); + g_test_add_func("/atc/test_single_entry", test_single_entry); + g_test_add_func("/atc/test_single_entry_2", test_single_entry_2); + g_test_add_func("/atc/test_page_boundaries", test_page_boundaries); + g_test_add_func("/atc/test_huge_page", test_huge_page); + g_test_add_func("/atc/test_pasid", test_pasid); + g_test_add_func("/atc/test_large_address", test_large_address); + g_test_add_func("/atc/test_bigger_page", test_bigger_page); + g_test_add_func("/atc/test_unknown_pasid", test_unknown_pasid); + g_test_add_func("/atc/test_invalidation", test_invalidation); + g_test_add_func("/atc/test_delete_address_space_cache", + test_delete_address_space_cache); + g_test_add_func("/atc/test_invalidate_entire_address_space", + test_invalidate_entire_address_space); + g_test_add_func("/atc/test_reset", test_reset); + g_test_add_func("/atc/test_get_max_number_of_pages", + test_get_max_number_of_pages); + return g_test_run(); +} --=20 2.45.1 From nobody Mon Nov 25 05:23:36 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=1717394492; cv=pass; d=zohomail.com; s=zohoarc; b=d3H+3z3bn+m7NDraI1PgLc5Z7O0Qp5YrViPLd/pSnamnK7riPveouowgrGv1wvah+2dnu7aQ+oew3A4mUKMUVQ3X9HxlDh+OQEFt2cWUDt1EAAiKO7d/51Tp7mUxZ5CIK3gG8VNRI0omLbNKcfJjj5FXVyvCANH9t/8HOlMBKTI= ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1717394492; 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=uUNdQjejwD19GDvGqzTWmxMIvWgcJeiOCFc/IfPyiss=; b=LgN3yHCgHQmII0z+7jxA7OyeRjq6lB/dMcCnYAlpFvdsE2WJxfjxVq0gnT2ONXIpuIZrjEpGFolWHj0Odb0uBPij+7iFsxeK9DpyvOJEZ4QnWi98XurwIi92vLv7g2aenS0IHufzhek7TIwHadNT4WqCM/aoHMj55riBhf4wtX4= 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 1717394492172588.9172291500181; Sun, 2 Jun 2024 23:01:32 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sE0jt-0006s6-FU; Mon, 03 Jun 2024 02:00: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 1sE0jl-0006nT-PV for qemu-devel@nongnu.org; Mon, 03 Jun 2024 02:00:05 -0400 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 ) id 1sE0jh-00071T-NQ for qemu-devel@nongnu.org; Mon, 03 Jun 2024 02:00:05 -0400 Received: from mail-vi1eur02lp2041.outbound.protection.outlook.com (HELO EUR02-VI1-obe.outbound.protection.outlook.com) ([104.47.11.41]) by smarthost4.eviden.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 03 Jun 2024 07:59:55 +0200 Received: from AM8PR07MB7602.eurprd07.prod.outlook.com (2603:10a6:20b:24b::7) by AM8PR07MB8192.eurprd07.prod.outlook.com (2603:10a6:20b:323::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7633.25; Mon, 3 Jun 2024 05:59:53 +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.021; Mon, 3 Jun 2024 05:59:53 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=eviden.com; i=@eviden.com; q=dns/txt; s=mail; t=1717394402; x=1748930402; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-id:content-transfer-encoding: mime-version; bh=uUNdQjejwD19GDvGqzTWmxMIvWgcJeiOCFc/IfPyiss=; b=OmdIp0zVqbNxZ6IcYNenGGrhRbe/FdgV3oTNLHCqpk+xjy+XwmBSD6Lx Q6pRrQVScBtB2FRbLE1EmY0UWopn0zOKMLsJOVd/1f8FwLXAuHNII9vTM CL9rPSP2j49ksVDym+iVsjLQsIEglptqx1hZJ6Uvap4ER/hzUWfVoA7FZ vGadUlDJ7qbGtCWPEUWbZbYuU5Za2ungGBdaEvLLgKXZUyufwVWodhPvB MMZYL5Z6FL9lXSKevXqCCBCRQcqFhbvVmuZl0hFdEkyfEW6wNZm+9Ay0e ZVsZEfzLPlduD13X7XHiKXJ/1XxWLyr1brNS6H5qOtEJ5t5jVHz4t6wz0 A==; X-IronPort-AV: E=Sophos;i="6.08,210,1712613600"; d="scan'208";a="13815889" X-MGA-submission: =?us-ascii?q?MDGKsKxKnEJsFH9MhGljupOGHWmH15QFEyM+F0?= =?us-ascii?q?Yv51LXdZ/9zUIZNZUxNEAvKk0cIOnynLg0aZd7fIS/8J16a2Zjiz9kHV?= =?us-ascii?q?djZzP4AibrNjUv5BtAVBMxstwqzJPY0mTFuTrpmWnNRho1ncc9GnhM4I?= =?us-ascii?q?N+OdzAndV6OXxoSX1u7QVcNw=3D=3D?= ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=WenOiXZXwxTSFuI+R8QUz2YuFH+2CwuwgnuY4Mrmy1lAR7q+MA3pl2I6H/j6bnNtlcgYji28o1pAUUapBg5LrIMCOF8FG5NFwf38BMSWU6OCm7OzpHu/AL5ZROUPw37I89HR6Cmi+nmy3XYdoHRSr6qhid7GOrk8QZmK5fpoxJzU06p4B+VnZ6y9Id53uA7qz1zpLHWkhLcoB/XkJ2wnsac8rs2RFIqPfNEmGk7haG+RhYH2i1MBawaU9PUuD6J1feikXhrCOCRRPmVr4p7vxUw0y1i4skp64xF8soRD0Uq6s4GPDPt8A1aOO0IgpKfqA+Jo4V32L7XI4ZNzwXYxUA== 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=uUNdQjejwD19GDvGqzTWmxMIvWgcJeiOCFc/IfPyiss=; b=dphmP0iGw+zpgoVjxHQnUZOvcivUi2F1GoPP9iWRSNrDZMkUYbwbKUroogJBdrXHRL7eUdmZjm+jEk9GeZbssnuMAnR9fNv9QuO+hupJqXF7850Q52f6AKhbK1F9b5HLp+Xp8wYLWABcvck0Y0gdUJR7PIc26RUiE+7Tw/eOVzzBRp4w0kUnblOactxcVt2QS0xdzPmIbkBApiK/BMTX7MnQ5LcBgkbxoKLnDwDJVDsX6iTJaKb+iYw/cOnJIe2fwEJnXUnVeumN+LDceFSSNrkKg7iGTctt5DqYs6Tj0DYYXnh56Y/8RjbWrh5OPvQ01GE/in789jRJHX1H0Ly9xQ== 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=uUNdQjejwD19GDvGqzTWmxMIvWgcJeiOCFc/IfPyiss=; b=cgVQ8/VNtfIjJ1ol0kZuq2QZ9Zot24BqEr1eLCuY2ekee60rTBtUlPyHTJhbPFDpqLNJdUdR4mL5MWxyW+pt2IAOeTFWVNFh2NFEROm4HSQQ4qlMHp+UVmOqdi5bFxCO1GIa7RR+nH8g8iev+2vUx2aKvUW9thBQwuyCEL3zSQ51aEud4SYkFkWDMPjXGyiWKrDQ7j24S9T5RQmOTqv6nXZyOPMZbYgWtq4ltu+4+wdJHNoptmvfC98r4T9q/4317pnwYT1P7Unh7Oa0/mjSYgP4qrgChvgXgbiYm7WGlYvE1n+8f8oHYQBizYFU7hsXayVUdWFwtSqIFV1PaDpXKA== 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" , CLEMENT MATHIEU--DRIF Subject: [PATCH ats_vtd v5 19/22] memory: add an API for ATS support Thread-Topic: [PATCH ats_vtd v5 19/22] memory: add an API for ATS support Thread-Index: AQHatXtACltASpuAL0qCo+7Ga8q92Q== Date: Mon, 3 Jun 2024 05:59:53 +0000 Message-ID: <20240603055917.18735-20-clement.mathieu--drif@eviden.com> References: <20240603055917.18735-1-clement.mathieu--drif@eviden.com> In-Reply-To: <20240603055917.18735-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_|AM8PR07MB8192:EE_ x-ms-office365-filtering-correlation-id: 29129a78-1818-429f-bd51-08dc83926324 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?QXo2dU5MbHVVcDUxWWpOMnBxQ0QxdEtBdE11RVhIS2VDd2tqRkxSMUVQWUpw?= =?utf-8?B?L3M2MDdRVWV0dEp2c2RNajdTdE5JNzRDc2JFUTdQN0pmSDRtd3JPOXZ0a2tx?= =?utf-8?B?RFhOR2J6RHU1eFpNd084WjNhM3ZESXhIcUh2Szd2UjBqeUpUOUVUNnZ1YnF4?= =?utf-8?B?MjNySXNqUHBIOWRCVmV3OUdxdUZITEMyUFYwVzQ5MWIwZW1tSGJLdy8wR2hi?= =?utf-8?B?V21weW1qNEx1ZXltZWcyU3RQaCtEMVZGcWUyejA1QlVKampXVD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mhLYW1raTlkY3BETzFVcDg0SW5tOUgx?= =?utf-8?B?Q1Njdk5IeTZTa2toMUJ2UXlJL1Rzakt4U0hpSnVjYkZGdnZ3Ryt5NWtlK2ZX?= =?utf-8?B?NnZvSnNhc3hETzcvTzFlZkUxSWlYSVkvOTB0bkVVRmp6UXJZK1M5NmYvbGJB?= =?utf-8?B?V2doUkswSE5laTRCbUdyaC9WY0VLdC9IcTU2a0JlM2FhRzVaSGxBYkpjUFJL?= =?utf-8?B?L3p2Z2tWNEkwakFycU9RcW8yS2VBNGwxSDcvMjVGL3FRcUhFaEY2YkJteGJN?= =?utf-8?B?RkF2M2tOd2ZkMFhJdVBjUmRIWmNEV3RseUgwc3ErOStUVitzNmVQaGNJeUVw?= =?utf-8?B?dDNUcjlJWnpETFhad2V3RzRVS3JmUDJ5aStONkhVaU5WTVRuTWFhZ0RMbzVz?= =?utf-8?B?cGl2eEo1QU9uS25oVE1xdDVqb2lMT1ZjSmxzbGFGbWV1Z1d4ekZ2enFjMnM4?= =?utf-8?B?ek92cVFLT0E4RDNnZmwzTXEvak93UDZSQ04yWm93ak5ySW0wQWM4aUNHdnIz?= =?utf-8?B?S3Rub3lYNHh1aU9GZGlhbmIrQW1aV0hsdGk3c2VDaE1OUm0zZjJvbmJIbDFB?= =?utf-8?B?OFU4T1FYN1o5QTFLS0pyVWwzZkJrcWVpS3BSVHVmbmVxOTRCbk1MYnVHM0pr?= =?utf-8?B?cHYyZ2FFakt0NUlibEtGUT09?= 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?VnRJbmZTSEtIWVE3aVFaQmxRUHh5UTlxbjZBWkl5MXRNT0Q0YlNHR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TmxER1pGMk5zTlZyUUIyMGVlYmE3MTZSL0cyaG8xa21UYis5enBwVVFJ?= =?utf-8?B?bWY5Mll3Y2k2SE91em9zWFYydmtiNGNzZE4rTjB3SlpJWk1CcHRKblNLMS8y?= =?utf-8?B?dXVaZTVRREI2cE5TbWlaa21FaXhOKy9jQlgzRVgvdGkxclZIUHlTNHJXV040?= =?utf-8?B?WVFRWldFVFRldnQ4aDFKWlFxdzI4dFJ1aFJYUHJLUFR2YkZaOU9oYS92dXRE?= =?utf-8?B?TlNRSFlGVEZvTG15a0c3RTNQQ0wyN1ErdjVNbzFUSGdMTDkzWE9XSk9laXhF?= =?utf-8?B?NmV2ekxSSUkvRGU3WEJUTHFQYlRicURiSU8wMVZqOFA2ZFRaSFpjMEFadDRG?= =?utf-8?Q?PYE5VmDG7pUojKiw9Q5xyQY=3D?= Content-Type: text/plain; charset="utf-8" Content-ID: <63288BA5FA2A9F4DA5AD9E1A135B4E08@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: 29129a78-1818-429f-bd51-08dc83926324 X-MS-Exchange-CrossTenant-originalarrivaltime: 03 Jun 2024 05:59:53.1208 (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: O4fKFbPblmN1FNJ6P1n16ZzKebr1t6vP8P4ScWmWModbTa0VpTHyAqZn5sdMJLw4Yj9UMcS+sU8I5gycDl1bMcYi4PohCXwfxrueedvwIIpybmi+4r5hm1jQ9h7C69zk X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM8PR07MB8192 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.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, 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: 1717394492916100002 From: Cl=C3=A9ment 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. Signed-off-by: Cl=C3=A9ment Mathieu--Drif --- include/exec/memory.h | 26 ++++++++++++++++++++++++++ system/memory.c | 20 ++++++++++++++++++++ 2 files changed, 46 insertions(+) diff --git a/include/exec/memory.h b/include/exec/memory.h index 56ef48780f..0ced7c33b1 100644 --- a/include/exec/memory.h +++ b/include/exec/memory.h @@ -148,6 +148,10 @@ struct IOMMUTLBEntry { uint32_t pasid; }; =20 +/* Check if an IOMMU TLB entry indicates a translation error */ +#define IOMMU_TLB_ENTRY_TRANSLATION_ERROR(entry) ((((entry)->perm) & IOMMU= _RW) \ + =3D=3D IOMMU_NONE) + /* * Bitmap for different IOMMUNotifier capabilities. Each notifier can * register with one or multiple IOMMU Notifier capability bit(s). @@ -571,6 +575,20 @@ struct IOMMUMemoryRegionClass { int (*iommu_set_iova_ranges)(IOMMUMemoryRegion *iommu, GList *iova_ranges, Error **errp); + + /** + * @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); }; =20 typedef struct RamDiscardListener RamDiscardListener; @@ -1888,6 +1906,14 @@ void memory_region_iommu_replay(IOMMUMemoryRegion *i= ommu_mr, IOMMUNotifier *n); void memory_region_unregister_iommu_notifier(MemoryRegion *mr, IOMMUNotifier *n); =20 +ssize_t memory_region_iommu_ats_request_translation(IOMMUMemoryRegion *iom= mu_mr, + bool priv_req, bool exec_r= eq, + 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 49f1cb2c38..d9d66ae2e1 100644 --- a/system/memory.c +++ b/system/memory.c @@ -2005,6 +2005,26 @@ void memory_region_unregister_iommu_notifier(MemoryR= egion *mr, memory_region_update_iommu_notify_flags(iommu_mr, NULL); } =20 +ssize_t memory_region_iommu_ats_request_translation(IOMMUMemoryRegion *iom= mu_mr, + bool priv_req, + bool exec_req, + hwaddr addr, size_t le= ngth, + bool no_write, + IOMMUTLBEntry *result, + size_t result_length, + uint32_t *err_count) +{ + IOMMUMemoryRegionClass *imrc =3D 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_re= q, + addr, length, no_write, res= ult, + result_length, err_count); +} + void memory_region_notify_iommu_one(IOMMUNotifier *notifier, IOMMUTLBEvent *event) { --=20 2.45.1 From nobody Mon Nov 25 05:23:36 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=1717394517; cv=pass; d=zohomail.com; s=zohoarc; b=Ddu8y4mIszCES/pnPL+8GNN+yIMiyooEuvl0N0LIaNAWBfIeqejfclr0egt7SYzrkyyv9xzA6Z/RKT/i3Cq9qyn2V5DcQQEjQQgGrRvpAhVOWG9Dub1rb4D2QCQRJHkvEKCbY98qjzLSidLc9YqEAZDqoj/TOM3/l5yMBN5UPuU= ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1717394517; 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=4eokjYkt7nIttPX3M6XueVLBousvJ2ZkPb0CEz6nEXc=; b=hR/AIuvVmxZVWbQF+Nw4Kp67eIdKRUUMQcRjcy8BUcwSnSg4cJ/GSBUegY9lJTiYab0V4Og+LhrHZaY87aYJQf/L32YDz30AJvyKzpVmdpFXKeSzaCHjQpi4k4LzGDmjNymLuQini99AnbOTyshQ+qKRTgt5Ghk4XChAM2AvQJc= 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 1717394517337580.08310125604; Sun, 2 Jun 2024 23:01:57 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sE0jq-0006qj-QM; Mon, 03 Jun 2024 02:00:10 -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 1sE0jn-0006oq-LI for qemu-devel@nongnu.org; Mon, 03 Jun 2024 02:00:09 -0400 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 ) id 1sE0ji-00071B-DE for qemu-devel@nongnu.org; Mon, 03 Jun 2024 02:00:07 -0400 Received: from mail-vi1eur02lp2041.outbound.protection.outlook.com (HELO EUR02-VI1-obe.outbound.protection.outlook.com) ([104.47.11.41]) by smarthost4.eviden.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 03 Jun 2024 07:59:55 +0200 Received: from AM8PR07MB7602.eurprd07.prod.outlook.com (2603:10a6:20b:24b::7) by AM8PR07MB8192.eurprd07.prod.outlook.com (2603:10a6:20b:323::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7633.25; Mon, 3 Jun 2024 05:59:53 +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.021; Mon, 3 Jun 2024 05:59:53 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=eviden.com; i=@eviden.com; q=dns/txt; s=mail; t=1717394402; x=1748930402; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-id:content-transfer-encoding: mime-version; bh=4eokjYkt7nIttPX3M6XueVLBousvJ2ZkPb0CEz6nEXc=; b=sa7h+GYSzQcpRashY1+231sKn3MT9hqdcq4lcrWYtvzEv0PNLznlyE8E NxVk0GIiz1Eh3s3d13j3ylqvvelFaDZeEljLYWzbjlpyrUbMHT9VcmHgU 15aoicW2K3p4N7/btplpiNnW1Mz72L+LxcTowOO/tJOI6eTVn9tepoR2g 3dzVvyNWkbzUjigHB1lWrJsPlVd/T4PE4Wz7LnlQ7DP4FxcNV6M9q7Q/1 TyMiWoq4nM+FVGFTyr4q0sqHECPnHxqUquG/dDimkdXLeZ08Klio3bvlT pP6k8nH2skDg7qhRY4+3ESYMRblAKUJU6hh4GGKySCAFF/EPIQKu+8WUJ Q==; X-IronPort-AV: E=Sophos;i="6.08,210,1712613600"; d="scan'208";a="13815890" X-MGA-submission: =?us-ascii?q?MDG+EJthOwb2PohCC+um530FvvMiF5mgbkxk0f?= =?us-ascii?q?ie/XrQhZQNUGCCzLKwh4OYzC8jYf9+xCa+anXeeSsQ51sVHBX10Fk+yp?= =?us-ascii?q?trDLVmjmm0kjjovVJFEkQn3MS2pdv2i0Q3rM+GqGh3EQEWmCEqRgr38d?= =?us-ascii?q?oNGQxHZjHp/co65zyneX4kuA=3D=3D?= ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=FKDbkDko1A2bzBomWKQl7LyAIOjXyV4zI9weQ4Q2MoMVuVW7JBsklgEHelF3wUXu6ojzHNHFNSPFHfFK/qkcn5rmhv+2OC50oOhbaFMYPif63qqBydcHAxNGFL2SN8PD2iHZdimi3P6Al0CPMk62C8EYgmZ0hXdSK6Nnajuy7Lin4n/K6Prym0k72KK+65zL4aywPBbQkcW9y+P8gDp5iXj1rT9GB2Hc/gnr/Wp3rADdAXb1VTWFyBvZUe7d3ny8AsEICfJ6nsXaHwN9Ah+ut/joQr0dHE2Gh+0OzZOtlCeUIvvWC7WVQPt3PenilenQ18vPk4xEHAk1JKHXAxAOMA== 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=4eokjYkt7nIttPX3M6XueVLBousvJ2ZkPb0CEz6nEXc=; b=baJBP7cfPGt3bM4L5sGMirw8bpR1SZYm75mGK+MXxyvt7G0nz1MeqgrzBVVQYECB3Q9fyoUwtdSPaQa2OJzV/jAgT/ffoGobPZE6bhjQuJaJRjUde5cfm+iPEFpUwNh5F4zcJwS+SSQ3D7KM3M4C+grIWRnwWBbUk9SbXaQNIasf9Azv4QeafWltBKoGZmDC+HZpNu7qxRwPwEZ3fjdcytpfbz79raVCRGOGt3N+L9EV40p1iyR+4wZv5VeHRFvjH72WF6PT4QxNgK4zinBlmZ0plD9Yl0tg+k+XHGsuL9l03yc3s+LO7WOB61Y3PWEsHHUVnuC231vOGQ7k62itbg== 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=4eokjYkt7nIttPX3M6XueVLBousvJ2ZkPb0CEz6nEXc=; b=ItikILNt/r0S+WZ+q+S/SSoH3Ot+16jj0XcvflnEwVWVHYvCBgE7g6oKdms68Xbd6kQNdSye9XIDkXBvNOmigdqfoogdvNw0k5HVEkLAFX4iVxWlk7FJEGOfYflHuTNGIgZJBUFpbomIgAdp2ikJ63gXZ+iux5+AaFF7BwE0AB54OgL4p3oGgCutTdzzbNtAYH1i6LFq8d/Vv6AYbPHbFz0Rb09BAxersmH3MQfI4oYbMIZLgZa/SqFGBLHgkIJWffylr2d+x0MVJvXDrtuCAIyGyaxwAELytDE+03tIQqGyfHtunrZMahriouuwGslcThdxx9bIH1JB8eLDNtQ2Zw== 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" , CLEMENT MATHIEU--DRIF Subject: [PATCH ats_vtd v5 20/22] pci: add a pci-level API for ATS Thread-Topic: [PATCH ats_vtd v5 20/22] pci: add a pci-level API for ATS Thread-Index: AQHatXtBWfzK4X3MW0619Cac8t7GQQ== Date: Mon, 3 Jun 2024 05:59:53 +0000 Message-ID: <20240603055917.18735-21-clement.mathieu--drif@eviden.com> References: <20240603055917.18735-1-clement.mathieu--drif@eviden.com> In-Reply-To: <20240603055917.18735-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_|AM8PR07MB8192:EE_ x-ms-office365-filtering-correlation-id: dc3b9bbd-e9a1-4fb1-addd-08dc8392638d 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?M1cvY3ZRRFdhSi9VODFiaDNpSldLbmlybHIya0ZCbHRvTHZJMHN3eGlLbVdI?= =?utf-8?B?Qy85K1RFUWhFbktXMDVKUlZLbGN5YTd6NXZLTS9CT2Q4RG9IU3ZJVlFIcVV0?= =?utf-8?B?S25JRm44SG1wU2hvSWg5MTBsd0dEYk5NMVlxQU9waGh2OGRzNG9XcXlsaXBW?= =?utf-8?B?THllNmluQjY0bF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-8?B?bUx3SitoNjFuQ2syU2t4OE1DWFhLcFhmSm1xZGdvalRTQ002T25qL0FSOEds?= =?utf-8?B?MnVkU25ESFZWMXVLQ3hFZjArLzcxSHN5clJxc1E3cXJ1ODZSMlI5ZDU4MURu?= =?utf-8?B?Z280TUNTVEtKZ1creGhJZ0pFdUp2dmdzYktjTm44dUVlM2VGYzZ6cEsxQWVx?= =?utf-8?B?UkRxMWVaVW1Ib2dFcGpNRzZ6ZFFLVTI3LzFoM29Ga2ZvRnk2ZnNwaC9tT1Bs?= =?utf-8?B?aWMwbHY4UGNtVktRYmU2QzJFcW5PZTBlNm1RMkpJMUh4b0hZM0ROU0JTbzlV?= =?utf-8?B?L3JOOTdwU29jWEJEVjJ3UW9Ta0IxQU1TREo1S2t0amtBMjhLNjQ2dGJMNWpq?= =?utf-8?B?endkNzRnQkRzY0p2a1hSUW10OWZRRlFjY05oblFBZTBsK0l4SlFGbUVSaDBV?= =?utf-8?B?M0tWcmNNbmM3WlI4WGFUZWdjeDR2L0xqaXRwQm5CMWVLWk83TWpzbDFwaE5J?= =?utf-8?B?Z3I5cy9MN3NYczgwQnd2MlpxQzZJNFFObWhGVnNkd2RsMlgybEkrUkFTNThx?= =?utf-8?B?dWRMc0ZiK0FHUCtJRVlOWE94c1dLby8wOWVqenE2V0xVNzN0K2t3bFFRWTNi?= =?utf-8?B?aGlYSVAxYTc0TmpUZGxQeVhhSUYvZlplVzFIS2h2alhYdlgxOVltUFVFUW5p?= =?utf-8?B?OHVNdDNWOUFSaGl4TXBqaU9kNjFuRWIxUjBKOTc1Z0s3dllodFlCd2ZoNWUx?= =?utf-8?B?WXI5QlFHaERidFZ1NURDZz09?= 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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h1VkwrN3Jz?= =?utf-8?B?OVlSdVd2Q25hNmlMcXN2dHZzOVZoVEd5eDJXa0VhQzNjUk11VmErM2ZEazdW?= =?utf-8?B?WnFmVVVKNGdWTzFBbXVMODVabXBIZ1ZhcU5FN0VYSWJwRG9oSkoxeUdKQnV4?= =?utf-8?B?VnZlS3hraFE3cmRMd3F3M0dIYzB1elZKL0UwbVUwT3M1TXBhT0RIVDdEZlQ4?= =?utf-8?B?SjB0UkRrM1E5eXdMQlkrdTEvWmtqcXVmTmk0YVIxa3UrZ2diRTNHNzJ4SStG?= =?utf-8?B?SkN3alVQNS9FN24wN1RtUFM2VWlTczgwVGU5YVlyTXg5YWxUbWxmK2R3NDl1?= =?utf-8?B?VGpGL3YzMllQY2FOdThCN1ZrZjFvUGcrU2pYL0ZHVWdMT0w3ZzdTelVRdXdH?= =?utf-8?B?NURTbjZTQXFwOWZ3T0h5M2w2UWdFbEtwTkZVZllaR09DRmtJcXlKR2FhS01z?= =?utf-8?Q?v9QoEBHKIDM1f+rVvGxI1WQ=3D?= Content-Type: text/plain; charset="utf-8" Content-ID: <9AD7886A24DF7B4BA0ED300DEC7558B0@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: dc3b9bbd-e9a1-4fb1-addd-08dc8392638d X-MS-Exchange-CrossTenant-originalarrivaltime: 03 Jun 2024 05:59:53.7936 (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: Da1YmndRksTMrJicfV5wVD31Ew6SC6+u+WTRCfFyT2Msbbyq1uGfWKVEU0zP3dIKPkMb1Ag1fRQ1bI8VH5sh/gniaIYxHjF4sH2qvz0bWM1Unu7bYqp7d286gFARHxw0 X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM8PR07MB8192 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.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, 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: 1717394519007100001 From: Cl=C3=A9ment Mathieu--Drif Devices implementing ATS can send translation requests using pci_ats_request_translation_pasid. The invalidation events are sent back to the device using the iommu notifier managed with pci_register_iommu_tlb_event_notifier and pci_unregister_iommu_tlb_event_notifier Signed-off-by: Cl=C3=A9ment Mathieu--Drif --- hw/pci/pci.c | 44 +++++++++++++++++++++++++++++++++++++ include/hw/pci/pci.h | 52 ++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 96 insertions(+) diff --git a/hw/pci/pci.c b/hw/pci/pci.c index 0e14ef4ab2..10b0708130 100644 --- a/hw/pci/pci.c +++ b/hw/pci/pci.c @@ -2833,6 +2833,50 @@ void pci_device_unset_iommu_device(PCIDevice *dev) } } =20 +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, + IOMMUTLBEntry *result, + size_t result_length, + uint32_t *err_count) +{ + assert(result_length); + IOMMUMemoryRegion *iommu_mr =3D pci_device_iommu_memory_region_pasid(d= ev, + pa= sid); + if (!iommu_mr || !pcie_ats_enabled(dev)) { + return -EPERM; + } + return memory_region_iommu_ats_request_translation(iommu_mr, priv_req, + exec_req, addr, len= gth, + no_write, result, + result_length, + err_count); +} + +int pci_register_iommu_tlb_event_notifier(PCIDevice *dev, uint32_t pasid, + IOMMUNotifier *n) +{ + IOMMUMemoryRegion *iommu_mr =3D pci_device_iommu_memory_region_pasid(d= ev, + pa= sid); + if (!iommu_mr) { + return -EPERM; + } + return memory_region_register_iommu_notifier(MEMORY_REGION(iommu_mr), = n, + &error_fatal); +} + +int pci_unregister_iommu_tlb_event_notifier(PCIDevice *dev, uint32_t pasid, + IOMMUNotifier *n) +{ + IOMMUMemoryRegion *iommu_mr =3D pci_device_iommu_memory_region_pasid(d= ev, + pa= sid); + if (!iommu_mr) { + return -EPERM; + } + memory_region_unregister_iommu_notifier(MEMORY_REGION(iommu_mr), n); + return 0; +} + void pci_setup_iommu(PCIBus *bus, const PCIIOMMUOps *ops, void *opaque) { /* diff --git a/include/hw/pci/pci.h b/include/hw/pci/pci.h index 2147981423..8adba6af97 100644 --- a/include/hw/pci/pci.h +++ b/include/hw/pci/pci.h @@ -473,6 +473,58 @@ bool pci_iommu_init_iotlb_notifier(PCIDevice *dev, uin= t32_t pasid, IOMMUNotifier *n, IOMMUNotify fn, void* opaque); =20 +/** + * pci_ats_request_translation_pasid: perform an ATS request + * + * Return the number of translations stored in @result in case of success, + * a negative error code otherwise. + * -ENOMEM is returned when the result buffer is not large enough to store + * all the translations + * + * @dev: the ATS-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: start address of the memory range to be translated + * @length: length of the memory range in bytes + * @no_write: request a read-only access translation (if supported by the = IOMMU) + * @result: buffer in which the TLB entries will be stored + * @result_length: result buffer length + * @err_count: number of untranslated subregions + */ +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, + IOMMUTLBEntry *result, + size_t result_length, + uint32_t *err_count); + +/** + * pci_register_iommu_tlb_event_notifier: register a notifier for changes = to + * IOMMU translation entries in a specific address space. + * + * Returns 0 on success, or a negative errno otherwise. + * + * @dev: the device that wants to get notified + * @pasid: the pasid of the address space to track + * @n: the notifier to register + */ +int pci_register_iommu_tlb_event_notifier(PCIDevice *dev, uint32_t pasid, + IOMMUNotifier *n); + +/** + * pci_unregister_iommu_tlb_event_notifier: unregister a notifier that has= been + * registerd with pci_register_iommu_tlb_event_notifier + * + * Returns 0 on success, or a negative errno otherwise. + * + * @dev: the device that wants to unsubscribe + * @pasid: the pasid of the address space to be untracked + * @n: the notifier to unregister + */ +int pci_unregister_iommu_tlb_event_notifier(PCIDevice *dev, uint32_t pasid, + IOMMUNotifier *n); + /** * pci_setup_iommu: Initialize specific IOMMU handlers for a PCIBus * --=20 2.45.1 From nobody Mon Nov 25 05:23:36 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=1717394534; cv=pass; d=zohomail.com; s=zohoarc; b=j985CDsqZIDaifv7ZZmAIYa2mil+fuAfz8zPbg3+Ee0nmCc1SX0rqYIR1lpvQ9ryb7ck2EfZBcf7o/Esgjuuh4tVyrWYB/Wm2rwE+abVqT2sNS0SV21eAARTliazlPS5fEkJbzvHRzkFD4rpgF6D8liC6GZcGFUMGC2dfuRNKDc= ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1717394534; 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=13GG35/z+g2/tSV3v8gmuukZxQXF5OOXbQi15tZoJ9g=; b=Lp6xeZtN+W51UUjrGUcJASCCXh4qlh++m5DLa6iUApoWUMh/RoSNqNy737ct6MzDIQnAft73JDRE6vbGQYCgFJU+zCQbNScgsgZvXKX6DbdU5w8vmZqN1+lrAZ9ytroDUKrFFKN5h7QbaHrmp/OkKXW1bRgZEpMdcwhaP80zziI= 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 1717394534034946.207160832138; Sun, 2 Jun 2024 23:02:14 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sE0jz-0006v8-2i; Mon, 03 Jun 2024 02:00:19 -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 1sE0jx-0006uI-MH for qemu-devel@nongnu.org; Mon, 03 Jun 2024 02:00:17 -0400 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 ) id 1sE0jt-00070x-Ss for qemu-devel@nongnu.org; Mon, 03 Jun 2024 02:00:17 -0400 Received: from mail-vi1eur02lp2041.outbound.protection.outlook.com (HELO EUR02-VI1-obe.outbound.protection.outlook.com) ([104.47.11.41]) by smarthost4.eviden.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 03 Jun 2024 07:59:56 +0200 Received: from AM8PR07MB7602.eurprd07.prod.outlook.com (2603:10a6:20b:24b::7) by AM8PR07MB8192.eurprd07.prod.outlook.com (2603:10a6:20b:323::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7633.25; Mon, 3 Jun 2024 05:59: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.7633.021; Mon, 3 Jun 2024 05:59:54 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=eviden.com; i=@eviden.com; q=dns/txt; s=mail; t=1717394414; x=1748930414; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-id:content-transfer-encoding: mime-version; bh=13GG35/z+g2/tSV3v8gmuukZxQXF5OOXbQi15tZoJ9g=; b=tuP/ANJDo2OvMnNRNz6N+9RNwECzEo3QOE0XaaE07Riw+WoaS7xTRTIl MG0HsTJeWyannTxbgy6C9n5WBdUcc5liT6GDripeusRhIRTjdJ2vqU9w7 D6gTsIM/oix9E8sU0wPPFWZl9FXul6U9cA0wkpqXMRvo+DENgFR6EhqI0 e2UZlialFuSsYxE0qWojlb367VpUiSyT6Ml9PUeSEEamnb0aI/IwF6MDC y4cwsNTD1tAYbeC8ufWw50W2OJSgWzzOqWK/mi6aWhvhkqZ4niq972byD 9UJpSoCzhXvxE3T+Xwb157QTpQ0BzRwVfhimg4MKmeqFl9eqLRmmFlwJv Q==; X-IronPort-AV: E=Sophos;i="6.08,210,1712613600"; d="scan'208";a="13815891" X-MGA-submission: =?us-ascii?q?MDHyzdw5o6BKIpHUr10JNFBkkkSXiJ0e8seXGH?= =?us-ascii?q?55dTtPCVuTCef4FjXtrMW+lEZ3a579Il/V+aPmZmycfeJiPs+blvEocV?= =?us-ascii?q?f2FrTpKPFLaiR/anZMcV7a9hyYNwqxzoPt0e2OJ9dCfw5seKcju1Rg3u?= =?us-ascii?q?e032zZUMHJufrg6EorRCgguw=3D=3D?= ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=AcPo2qQHQKFm6FBZ6Fa6gt9bs9bodcV/PP0vImgG6KqcO00L+f/gRa4ADNdhz0c1bTzi64M/DctfTJIwdbTTVF7Rr2nDTgsENGH4wWOjck8sw5wAdvsVmGFTWIN6fG1xmYHh5YCnJPhsErVMWM7vYSBJ/V8vmEnP39eU2vbw5/jSitb9R53U90Fb3VBMXP6FlXtysXUp5K+5rkIDz8VUNCnBTl2evtXfKxHlVPFy2J8n1NntVskFrUF2WZHLS5i9ZFLeV1pvqf4HoExKBS5jMfvMRdxDZsJ6K7ag1tfxBcF0dhLZi/uxtXwFJKrPBcDRLg0Meqk8neRDoOQs1HY51g== 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=13GG35/z+g2/tSV3v8gmuukZxQXF5OOXbQi15tZoJ9g=; b=hIhb9qGVt9/X7ZYkZ/gjlGB8qv54HF87zfRA+2acl9OpplpvtnBxUl6Dy0tnjR6JUt+ox2CTXntJKj8TW4JOPswRsXMYs9p99AgtS0U94nrv+d1HFDOzu7NqnuxBm0G6jgrjPHJzKA48fzG/Es5trq1KvsowNXZApCH7IUQBLB/FrF94XzwDe++IfSuMxPtf30p3r3ObJtYLy8fbIvfcD3vFV9Y73swGaQnvn0gtCuXkca9nkA2hpIHx8exF/O26TeaNvQc+EGSM/xiSKI0FA4XLWbzcdIpnuVFOFY1j6wgi6zaccd+fmVvZTDdHe7iXlzw1SDDM9JVmgTsm8GvKJg== 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=13GG35/z+g2/tSV3v8gmuukZxQXF5OOXbQi15tZoJ9g=; b=TJ2pv8gtPTY7v0M1dfMBA9ZHm3rpnxcSELXrymP2T0vrmcRVbRi5VSKl9SCXI+B2mo5lJu+OPVVsidWbNW4nxWivItlb78Yslsmxtv0Clv3XMqSwBF1VaEWAyOFWF81znIDyl7rMaqK1gV7kA2FVfGBi7tg6V0OwSs9bGK+0N3e2e6Cdcfxw0/arN9YRg4IwZUNq7nusIQZiGxeYE+tOQA6ewBwMTTDpO7+GWktD1Yr4+/Kkc+9QwheX57B4r2CRE2OokrkTlA6C5PS83xv1dlmq4yvsFFp8aQZZtdHVZNpUE3q+S+DGNeWD4nrj+/teCIFvvnXAL6FEgqSUftxQ/A== 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" , CLEMENT MATHIEU--DRIF Subject: [PATCH ats_vtd v5 21/22] intel_iommu: set the address mask even when a translation fails Thread-Topic: [PATCH ats_vtd v5 21/22] intel_iommu: set the address mask even when a translation fails Thread-Index: AQHatXtBNNesc+UKhU+lHqhLQmHLjA== Date: Mon, 3 Jun 2024 05:59:54 +0000 Message-ID: <20240603055917.18735-22-clement.mathieu--drif@eviden.com> References: <20240603055917.18735-1-clement.mathieu--drif@eviden.com> In-Reply-To: <20240603055917.18735-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_|AM8PR07MB8192:EE_ x-ms-office365-filtering-correlation-id: 8d04933a-0418-44d9-9c37-08dc839263f6 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?R09SUVFIbExicGdnRExYeldHVnRJOWVhU3dnbm8ySW1qNE1PK1laa3ZUM2s1?= =?utf-8?B?NkdVaHZhTkduOUcxbmhNclNVYU1tRWgrbU9rZ0oxeEt4RWtpZkFkNThrSTEz?= =?utf-8?B?ZW1pVHhVZXN0Q0RtUkxOdlZLZDd2VlRnMXVZRytFVTNHRmEvT0xXQVJNRVZy?= =?utf-8?B?cHJzNlQ4Vy9kSzVBblFwcVMwRFV1QnZmV0k2Z3hrMVFWdVNsNFRSVUplbWE2?= =?utf-8?B?Mk1CTmpueHpTM1A0NHVKUmpHalcwc25xRndKekdrYVgvWGxaMy9vR1FIR1RV?= =?utf-8?B?dnlVT3REWTNYZCtNNUdEaDlzM1hDMXBSN2ZmeUdLejYwRlNIUUU0S3JwMkVw?= =?utf-8?B?dFhYVGJzTGNGVGlCQVA2VGp1ZTAwbkZSS3ZqWUEyV0IxUEVHTDdUaURtL1Ir?= =?utf-8?B?bytUTm10YW80eUlLUjVnaWpXNTViMEtkbUwxUWM4UlhlTEp3S2RQS3RFVW1t?= =?utf-8?B?ekg2OS92cVhZUGxORWFGQlBxT0tPR0t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aEoyRVF2RnEzVjdmUlRORkxSbmZIY2ZN?= =?utf-8?B?Nlc4YUFNa3lTbFNiNG8yNUxvM3h4NE1BUzhxVE5ldHlZOXRhakl2YmxoaHgy?= =?utf-8?B?d0drT0xNUFJhT01tUnpGelU4aE4vSndKU00ySFRCSWg0NGVTalY5NURWVHdS?= =?utf-8?B?UThKUDRlSWJCaTRkNHFMNHZWRnBUdWp6aDd6VFc3cWNvVlNLY1F6eGZRejBP?= =?utf-8?B?MVZGYmhDbVRLUTZzM0lIMWxxaGxCeFhuYTE5eFMyOE1NOTI4T2tBMHlOaWEx?= =?utf-8?B?ODRvNFVrYnR4Nkt2SUFWbkdERktWeDlrQzJxcHFhM255U2dZejV3aHVCMEUw?= =?utf-8?B?T1JyL3JyUzFIQm83TGMvcVlCdEZsUmNTcnJEMFJ2d0xJejAyUWQ1OGxpaGtY?= =?utf-8?B?NW9RTTNwS0NadWxId0lDdz09?= 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?ZXNKVVNOV0pKWTlMYTNCT3FqelBhcHUrRFdWTGpUNnlRRnBDam0yTndVTEZu?= =?utf-8?B?SEJybGZoOEZkRFhUUWU1eHlBTHp5QmtSY1FSb1VUelBnTVhSZ1VEMnRrL25r?= =?utf-8?B?eW9hdGJ1bmJZTkttbTNDVFk3T0hQbG1CbnYweW5TREdOWXNWdHoxcHY1WG1V?= =?utf-8?B?Z2xNTWtSQnMxeUxOTWRwWmh1dko1VkY2VGljM2ZxZmZUL3VIbzM4K1F1akpV?= =?utf-8?B?aE9ZSHlXUzhUOHA5UXZ5SlVVUzMrWXg5R1Rqbmk1ZTBJVFZhT21JdW16bVMr?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hTZWd4TlJFKzRmbmxGUTJwNXI0ZmdTZXBBZUdzazN4aUlr?= =?utf-8?B?bEthbCtKMXpOUHhVdzdnQ0pPeGFka1dyOS95a2lyVlBaZlRqSU0vb3RXZStk?= =?utf-8?Q?zDJAaPI3wDAUrZXT8N/oigk=3D?= Content-Type: text/plain; charset="utf-8" Content-ID: <004ADB066C57CA4993F77BA78EC6E000@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: 8d04933a-0418-44d9-9c37-08dc839263f6 X-MS-Exchange-CrossTenant-originalarrivaltime: 03 Jun 2024 05:59:54.4871 (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: ktrGHM2nKjhCJa2F3S2gq9NNAhU0bpnFFhW1sfVviDwjT79bjUnLNICVaozwidC+VqhPextJ6xf/kMR7CXySSw87dnhwucky7/1ApQ1892+s3q5kJjAG7Giwjlip2FUM X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM8PR07MB8192 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.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, 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: 1717394535063100001 From: Cl=C3=A9ment Mathieu--Drif Implements the behavior defined in section 10.2.3.5 of PCIe spec rev 5. This is needed by devices that support ATS. Signed-off-by: Cl=C3=A9ment Mathieu--Drif --- hw/i386/intel_iommu.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/hw/i386/intel_iommu.c b/hw/i386/intel_iommu.c index 0f3bd5978e..1ba43f59b5 100644 --- a/hw/i386/intel_iommu.c +++ b/hw/i386/intel_iommu.c @@ -2169,7 +2169,8 @@ static bool vtd_do_iommu_translate(VTDAddressSpace *v= td_as, PCIBus *bus, uint8_t bus_num =3D pci_bus_num(bus); VTDContextCacheEntry *cc_entry; uint64_t pte, page_mask; - uint32_t level, pasid =3D vtd_as->pasid; + uint32_t level =3D UINT32_MAX; + uint32_t pasid =3D vtd_as->pasid; uint16_t source_id =3D PCI_BUILD_BDF(bus_num, devfn); int ret_fr; bool is_fpd_set =3D false; @@ -2314,7 +2315,12 @@ error: vtd_iommu_unlock(s); entry->iova =3D 0; entry->translated_addr =3D 0; - entry->addr_mask =3D 0; + /* + * Set the mask for ATS (the range must be present even when the + * translation fails : PCIe rev 5 10.2.3.5) + */ + entry->addr_mask =3D (level !=3D UINT32_MAX) ? + (~vtd_slpt_level_page_mask(level)) : (~VTD_PAGE_MAS= K_4K); entry->perm =3D IOMMU_NONE; entry->pasid =3D PCI_NO_PASID; return false; --=20 2.45.1 From nobody Mon Nov 25 05:23:36 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=1717394538; cv=pass; d=zohomail.com; s=zohoarc; b=D6qfw3azjTJ+1unI6GsXihrvtCQs1+KzzzPoHFXrAkbusg1x81DZ3+9qxz5gvrh5VmUWj9t5DuKhvSMRHYQrYWY3PO8Mo2MvyUkokJoe14O/b3zjvPKUqPQ4rOm5cUc9A2+J//oeiW1w26op5zDrfo8Nw+nf9mrJGdIj5hk2q3Y= ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1717394538; 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=0lj8izfHYem3sgTsQJtxLtGdzGMHztq4df66p0nIbd0=; b=OwQ3k/+gRDERcqMVYzSHBw1RO9me5bFm6JaZbGWf/2U2Fdmo8W1/e/CgnIZoo4EDDOAcmW2AgAJy68uHesa4TfRcNex0JcQ0s3nymTDfM5SlEeU0seE3hRngj70mh8BDx3IlBw3COOgAoQhaMoWQNZqkp7f6cruETCAyIJ981+c= 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 1717394538565615.1382684378465; Sun, 2 Jun 2024 23:02:18 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sE0k1-0006wm-3Y; Mon, 03 Jun 2024 02:00:21 -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 1sE0jz-0006v9-54 for qemu-devel@nongnu.org; Mon, 03 Jun 2024 02:00:19 -0400 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 ) id 1sE0jx-00071T-7Z for qemu-devel@nongnu.org; Mon, 03 Jun 2024 02:00:18 -0400 Received: from mail-vi1eur02lp2041.outbound.protection.outlook.com (HELO EUR02-VI1-obe.outbound.protection.outlook.com) ([104.47.11.41]) by smarthost4.eviden.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 03 Jun 2024 07:59:56 +0200 Received: from AM8PR07MB7602.eurprd07.prod.outlook.com (2603:10a6:20b:24b::7) by AM8PR07MB8192.eurprd07.prod.outlook.com (2603:10a6:20b:323::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7633.25; Mon, 3 Jun 2024 05:59:55 +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.021; Mon, 3 Jun 2024 05:59:55 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=eviden.com; i=@eviden.com; q=dns/txt; s=mail; t=1717394417; x=1748930417; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-id:content-transfer-encoding: mime-version; bh=0lj8izfHYem3sgTsQJtxLtGdzGMHztq4df66p0nIbd0=; b=VfhILN9JaX3HmJIiiGPzp5W9rHdTQedknny/dHE7aDsT8hnVx6AC4YNx 2ifTRReGDqLhV2BCe96KsoLIR13oKGHg/rO3AQYNjViuN9AyEJNDk+sUQ PYOsijKxWDQJvZuuqm3A1Bvber8HVcE32dFuxwuyrkqL6atf+ie5gjjSf tgSvRlE7ob8JrvSyJFkBgr7/EHTqpGrlB/QKWIhFxeex4a1xS9Ln+Pmaj f0r/E5rD1ofFNmYpnbCh5X+WNd8JTBtCjvp80dZkE7bcrc8OlPZ293Nh/ aM23vhkuo46pqvzFirJNaGYkEynKUpFwgtvB9hGjyGb/y+Oq36Ht/HC1X w==; X-IronPort-AV: E=Sophos;i="6.08,210,1712613600"; d="scan'208";a="13815892" X-MGA-submission: =?us-ascii?q?MDEChmrP99g/INWBO2XY1sgCHxeEV/KiqAxell?= =?us-ascii?q?Q6koXuX9T/M+mhJk3lpgc2+ffTSwFoJvBDS1z7IDFOjntZ3PKDhQBxFm?= =?us-ascii?q?8S6m2wWW3uCbTuELFnM6a6M3HKawDEsmH1fOa+VrFt2JxqC/0k84Ml7f?= =?us-ascii?q?lAP2nj9nUB04FXClUlNHF4+Q=3D=3D?= ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=fAFPidFNeuMP0ATQYweNjavejAtT4wOdEUivUQbDdllDHcY2I9w2x1T4y1MMbHYkHGz0OO6U7Vy2g6v5gAXITyxybm+ISS973BynU00OKyUsEHExjx7LgcZYTtYJqu3IQh3A1+SW8aBTF+ppt4yib+nVdZavQ+bRelL3M7wDr2E6P5c3+6freExlqs+cC6EjLvNxIOD6vEymhUZgsKxR0SBvwBXli0a7NQErp70gnd5LEVeHeuASB/C0aHwYhowP7NW/aKGNaZd16Z6r846/BX1IiVTTDS4Q5VF1vTVcX95g4UuF/BmD9sygTkGV7/IGX3h0TwjxcSoHNGgSGnsM5w== 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=0lj8izfHYem3sgTsQJtxLtGdzGMHztq4df66p0nIbd0=; b=TmlDkJotorBTBDG2rX2dI4goXFAOc+1jW3oE9MkQMxstyoZQvHJDaDgcKW7379r5JSmxYy7/SVxMQRq2UTpn4X9CtD1IfPknJ++15NKvwc4AaaaGst101dkvo2Q9N80Pm65yB0+QVAw56qxAIxK/63egK/Aep7AkJj0UD6OyesE3egzMSG15yURd3qfhnsbN4Vh1aQZ+qYo00xCy0OyWWLVKc7Q+lMbQksD4fT8+TDcNAjEqysPA9kTfhyHKsSIk6k/U8Ri97/ZG2bBrJK1EH6h2RRUUejGXgtDaWCklR7SwiZHzd0V73OcagM/X1wZ3KcmjGEWg8GDewO45apkbNg== 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=0lj8izfHYem3sgTsQJtxLtGdzGMHztq4df66p0nIbd0=; b=Y/KCOXre9s/dwJPiFOQeubG2FEQppvCQhRqxqw/ViAzM56dH0MOLpg6EQU5CiIFYJvZ9kBZ9socp4FLhWeSGizpS446ecvCYmkFmqpmL93Aq1eXlHusD/xXRUChahEdgI6F2Ix2IAMIOSKTYYH0v0AOkVVWYfec0QLogbiZpJi0pnXKYS38GzAEp+BMaAcmyJAoLzHzBbJMxsBwXZRplIcs0s1K9EkxTX3lefIwHEOx8CCox5lavGn1qX+UivNkA5QnnavEDFDPzZ7ql/Fq0rSExMAfCp7iySOKSLB3lCdZbQkIfgHA4ZXRgumSLrsAHOUcwcEz1rccQ11ieteBs5Q== 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" , CLEMENT MATHIEU--DRIF Subject: [PATCH ats_vtd v5 22/22] intel_iommu: add support for ATS Thread-Topic: [PATCH ats_vtd v5 22/22] intel_iommu: add support for ATS Thread-Index: AQHatXtByK+MPvyRxk6nyjnkNV88Ag== Date: Mon, 3 Jun 2024 05:59:55 +0000 Message-ID: <20240603055917.18735-23-clement.mathieu--drif@eviden.com> References: <20240603055917.18735-1-clement.mathieu--drif@eviden.com> In-Reply-To: <20240603055917.18735-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_|AM8PR07MB8192:EE_ x-ms-office365-filtering-correlation-id: eda0d791-07dc-4726-05fd-08dc83926469 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?dUhWUjd4QzdVQzRGQ2ZiYXM2NnhySlVia2p5cUJqS3p4Wk8xTEcrQ09jb0Zx?= =?utf-8?B?aGt6Z2FsckdHbkdWYlMySDVxVEVIUDNENjhqN2pZQUVUcDd2ek9oWk9IT0N6?= =?utf-8?B?UmZxWkZDZGtpbWI5L1F3dnJ5c0hydkZQZEdEaENvT0JmU2cwVW9zZnliN3Ri?= =?utf-8?B?WGJuaCt0dnFjcjY5TEF4eFJFd296blg1dlR4c0FRTmtpSjJqWWRvNlFsSUkr?= =?utf-8?B?RVM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?= =?utf-8?B?ODF6MGFpd0Zwc1AydGZ0QkU4T0I4VG5ucTY2VFFSajlwcm9IY3ZGTXdTRG0x?= =?utf-8?B?VWM1bVl4WmU2a2JvbXMvSjlyUDJkU3NYbHhqVE53anI4VUhpeERwdUo4YXBv?= =?utf-8?B?cE1FYjZ2YXhhR1lodHhCS1kxcG1ubjAvOXByTmV6dDRHVU1rM2NwdXZDQjVa?= =?utf-8?B?Z2R1dmFvTXhnUjVKZHRYNlZpTTRrbHF4ZDBNS0pMa1dvQ21lMDB6UWZOb01v?= =?utf-8?B?b01DOTFlemhsUjJSVXM0eHRUL2U5ek94cHNVWUlGbzgyVzE0T1A3SDkzZ2J4?= =?utf-8?B?YS9uc0hXV3o4QlgzbEtsSi9ubmdYS2NtU0FjT0JyWGNENVhyM0dTVURoV05n?= =?utf-8?B?UkZoVkpLeHZsYzZGRnpZUUN4ZTZiYlNUWitJSmdNSFBqVXlCZWFpdVRSSER2?= =?utf-8?B?VnBOKzFKZUhwSlN0NlZ2eUk0YXhMMFZaWWNIUWJoYkRCTGxqZDJTS1pCYkVP?= =?utf-8?B?RDVubUhraE9HRTMzaEYxMG1mdHozN2djbkxCdDc2aCtnVm81c0RnZHJYRklr?= =?utf-8?B?bUQ4WGtRaFRqUzJrZUo4bjU3bllDUkRIbGZtNWNwd2VuQVJGTjBJV2tlNEV4?= =?utf-8?B?WnlhSTYrbVcvZEY2VW10SHJzekpGWTlCd0E1NFNqenBWWUJ3UGI4QkhWZUVT?= =?utf-8?B?UEp2RDcxMWVwZHA3ZGdqQT09?= 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?U0RNLzRMSytSb1BUV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aNFQ4TEZhVTgwUThO?= =?utf-8?B?ak5rN0V6R1dqZjdWZEdTNUtyMzlYdnZ2MzdCRWQ2cWhSRWxyUmxsZ0NSS0k0?= =?utf-8?B?NVRHTjQ2NXBEUWxHQnFsY0FkYWZQZjZBbFY1aGJFMUdsVllOanNHNDlJVGtx?= =?utf-8?B?T0lJZ0N6RE9ZVnUrVEdHZGo0MGZDVFUwaW8xSHRIVkRwS2gzak1VTWljTTk1?= =?utf-8?B?T09QdHU1T2MxcTVGZ0hUVm9VMmMzMmt5ZEYrNkZyVU9CRU1YaVZBUUozZnp6?= =?utf-8?B?V1JwREorL3F4UmpsTFJyTkZGZzBTNStldnhqU1FwaXlLSDFWa2Jlc0tCaCtm?= =?utf-8?B?QlRMNHU2NzBHMTN1TDY3RStTbnFuK25Eck1leiswUTcvZE4wSmVCRHdDMVdv?= =?utf-8?Q?h2K/r51H1oW8IhiGvhQNyJo=3D?= Content-Type: text/plain; charset="utf-8" Content-ID: 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: eda0d791-07dc-4726-05fd-08dc83926469 X-MS-Exchange-CrossTenant-originalarrivaltime: 03 Jun 2024 05:59:55.2314 (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: zQ0kj8z+50QyRfBBuGdWuMiV/eMp3evroqOVu2sVtX6ozEHDk4SnKxUalWnkT7IXDM4vI7mJjCW1ZoPiEHb2RY7RtoAKmXrfx9sCkHKdOibwAR+XSWUYVtMOhktMdcuP X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM8PR07MB8192 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.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, 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: 1717394539069100001 From: Cl=C3=A9ment Mathieu--Drif Signed-off-by: Cl=C3=A9ment Mathieu--Drif --- hw/i386/intel_iommu.c | 75 ++++++++++++++++++++++++++++++++-- hw/i386/intel_iommu_internal.h | 1 + 2 files changed, 73 insertions(+), 3 deletions(-) diff --git a/hw/i386/intel_iommu.c b/hw/i386/intel_iommu.c index 1ba43f59b5..d12441430f 100644 --- a/hw/i386/intel_iommu.c +++ b/hw/i386/intel_iommu.c @@ -5381,12 +5381,10 @@ static void vtd_report_ir_illegal_access(VTDAddress= Space *vtd_as, bool is_fpd_set =3D false; VTDContextEntry ce; =20 - assert(vtd_as->pasid !=3D PCI_NO_PASID); - /* Try out best to fetch FPD, we can't do anything more */ if (vtd_dev_to_context_entry(s, bus_n, vtd_as->devfn, &ce) =3D=3D 0) { is_fpd_set =3D ce.lo & VTD_CONTEXT_ENTRY_FPD; - if (!is_fpd_set && s->root_scalable) { + if (!is_fpd_set && s->root_scalable && vtd_as->pasid !=3D PCI_NO_P= ASID) { vtd_ce_get_pasid_fpd(s, &ce, &is_fpd_set, vtd_as->pasid); } } @@ -6004,6 +6002,75 @@ static IOMMUMemoryRegion *vtd_get_memory_region_pasi= d(PCIBus *bus, return &vtd_as->iommu; } =20 +static IOMMUTLBEntry vtd_iommu_ats_do_translate(IOMMUMemoryRegion *iommu, + hwaddr addr, + IOMMUAccessFlags flags, + int iommu_idx) +{ + IOMMUTLBEntry entry; + VTDAddressSpace *vtd_as =3D container_of(iommu, VTDAddressSpace, iommu= ); + + if (vtd_is_interrupt_addr(addr)) { + vtd_report_ir_illegal_access(vtd_as, addr, flags & IOMMU_WO); + entry.iova =3D 0; + entry.translated_addr =3D 0; + entry.addr_mask =3D ~VTD_PAGE_MASK_4K; + entry.perm =3D IOMMU_NONE; + entry.pasid =3D PCI_NO_PASID; + } else { + entry =3D vtd_iommu_translate(iommu, addr, flags, iommu_idx); + } + return entry; +} + +static ssize_t vtd_iommu_ats_request_translation(IOMMUMemoryRegion *iommu, + bool priv_req, bool exec_= req, + hwaddr addr, size_t lengt= h, + bool no_write, + IOMMUTLBEntry *result, + size_t result_length, + uint32_t *err_count) +{ + IOMMUAccessFlags flags =3D IOMMU_ACCESS_FLAG_FULL(true, !no_write, exe= c_req, + priv_req, false, false= ); + ssize_t res_index =3D 0; + hwaddr target_address =3D addr + length; + IOMMUTLBEntry entry; + + *err_count =3D 0; + + while ((addr < target_address) && (res_index < result_length)) { + entry =3D vtd_iommu_ats_do_translate(iommu, addr, flags, 0); + if (!IOMMU_TLB_ENTRY_TRANSLATION_ERROR(&entry)) { /* Translation d= one */ + if (no_write) { + /* The device should not use this entry for a write access= */ + entry.perm &=3D ~IOMMU_WO; + } + /* + * 4.1.2 : Global Mapping (G) : Remapping hardware provides a = value + * of 0 in this field + */ + entry.perm &=3D ~IOMMU_GLOBAL; + } else { + *err_count +=3D 1; + } + result[res_index] =3D entry; + res_index +=3D 1; + addr =3D (addr & (~entry.addr_mask)) + (entry.addr_mask + 1); + } + + /* Buffer too small */ + if (addr < target_address) { + return -ENOMEM; + } + return res_index; +} + +static uint64_t vtd_get_min_page_size(IOMMUMemoryRegion *iommu) +{ + return VTD_PAGE_SIZE; +} + static PCIIOMMUOps vtd_iommu_ops =3D { .get_address_space =3D vtd_host_dma_iommu, .get_address_space_pasid =3D vtd_host_dma_iommu_pasid, @@ -6210,6 +6277,8 @@ static void vtd_iommu_memory_region_class_init(Object= Class *klass, imrc->translate =3D vtd_iommu_translate; imrc->notify_flag_changed =3D vtd_iommu_notify_flag_changed; imrc->replay =3D vtd_iommu_replay; + imrc->iommu_ats_request_translation =3D vtd_iommu_ats_request_translat= ion; + imrc->get_min_page_size =3D vtd_get_min_page_size; } =20 static const TypeInfo vtd_iommu_memory_region_info =3D { diff --git a/hw/i386/intel_iommu_internal.h b/hw/i386/intel_iommu_internal.h index 1b0d8958ad..461158f588 100644 --- a/hw/i386/intel_iommu_internal.h +++ b/hw/i386/intel_iommu_internal.h @@ -194,6 +194,7 @@ #define VTD_ECAP_MHMV (15ULL << 20) #define VTD_ECAP_NEST (1ULL << 26) #define VTD_ECAP_SRS (1ULL << 31) +#define VTD_ECAP_NWFS (1ULL << 33) #define VTD_ECAP_PSS (19ULL << 35) #define VTD_ECAP_PASID (1ULL << 40) #define VTD_ECAP_SMTS (1ULL << 43) --=20 2.45.1