From patchwork Mon Jul 8 11:39:55 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: CLEMENT MATHIEU--DRIF X-Patchwork-Id: 13726440 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 5C856C3271E for ; Mon, 8 Jul 2024 11:40:57 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sQmj8-0003xq-4B; Mon, 08 Jul 2024 07:40:14 -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 1sQmiy-0003o4-Py for qemu-devel@nongnu.org; Mon, 08 Jul 2024 07:40:04 -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 1sQmit-0007s0-L3 for qemu-devel@nongnu.org; Mon, 08 Jul 2024 07:40:04 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=eviden.com; i=@eviden.com; q=dns/txt; s=mail; t=1720438800; x=1751974800; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-id:content-transfer-encoding: mime-version; bh=la8b6EsER2myyyqfK0mnc02PBu9H7RQtt1F+MmsewQc=; b=T6KvGj3TxAFbywoEmYhS0j7j853W4cShUvu39047MthFVx+/jyl84yN0 FbpywVZK54SM3+z/YAqf6m8L5J/oBiV1XzEvU/RCJNXEmaB4r8bNPLOte Uwtvtv2PMrKXeyY5fauvcnCQxvjDm6MxVKSPHZDZmuE2dJPKVnqu4icaL x2Ck3fv9aLQfGlLiV9GQGcSAGsciikFoe0HW9aOF7K8LzuMtGjEP6gb9d 8hEPNTfXh0qmL1+q9z4Z0nsxiY2tik68vkQ2smGGnZZKqB4x7w+j2hWfs oEKpTvTiq+hSyj2fTG0NjVRZAY+zMJMbl3WVRlAnZbNuBGnp1uLILLfoM A==; X-IronPort-AV: E=Sophos;i="6.09,191,1716242400"; d="scan'208";a="16192496" X-MGA-submission: MDE9xd9uTUWmHiN7aWnKyofv+/EfU5l1GT2n1yRzwB/e/6YnwfwGVB+yWSORsoa+c0U62h0prL0amYIaaJHaOS2nLwq84tRgpx5rwlDqw6nY6RQ2WJ/uW3gn9xNW+dy67NTivPN2WNuVXJaOet2FEmsF1yekdewnIuxAg9bb63tz/w== Received: from mail-vi1eur03lp2109.outbound.protection.outlook.com (HELO EUR03-VI1-obe.outbound.protection.outlook.com) ([104.47.30.109]) by smarthost4.eviden.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 Jul 2024 13:39:57 +0200 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=k7Kla+nNF/f46vNEiFUQDvOm68hTMGOo+5/AEtTo9faqofYlbyI+P8+wq+FAt+UBQH9BKPt5d5eFUpcRL3iYfIzWY1bvRXrLaUaUWOTHdyTrryuKMlRGYA6AAlLfe0aMbH9/yAbucZF1JNGP8AthPeR/u4BNlBCUq2XhlMIpsTIlAjqGjZ56RnzgeOhmsHCJoBg6Sq2jefS2eyIlAYTVNqkfSUgHMnd15eBga0yhdMp1JdW8RwzyNGv0vwqNgX0gpB4UadLkHsXQ3m2wHR4tt5MVXw+Z9XGZL95zq5lAMPx4bZUYZjhw2/+Cjz1oY2MHnLJdVxW9bGXnrCMkv+BInw== 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=la8b6EsER2myyyqfK0mnc02PBu9H7RQtt1F+MmsewQc=; b=UScYjwVMItxfY+L79p8u7YUaDHb4PYXbXNxtMeiOmcoWvWVzdLyMzBZPGmhF7D9noZXuvLJ5eHqQ2LC7jLq9TrMpuG90fZoNHHc2TsV3GIlf/WmJ+gKuWD7qJzWer4CVW4GHhw8V2GfSCFULJ+aXJ+sOTuWK5RSnD1KGt0Wb9LpCGdaoiSIogt26RfqKwCNDCdGnP5/Y/X9qyKREF48WjYT+0T0R4xXaoaXi6kc9jcGu33Ux2VP50HCJhOMUqIZbCYLA0UAJscCyxzVgxqGlWW7JegW14pEE1B+NPmUEyf0jzAJuQ48Yn4wUkUzJ1y3pvU8oGmfvZnUgroa02b3kBg== 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=la8b6EsER2myyyqfK0mnc02PBu9H7RQtt1F+MmsewQc=; b=bv5WYFmFDfrDsx3mtcXq+iJgM5ywqlsHegyI0ytxXLgWtsW4nZEbq675LQKLZ7YUKa+o2KTLb9oL2wF0Mp7YxTWOnuVYNILC5FvbkPVEG8amYbyjLRsTAHbBYlEDZ6f3td5E0qFAYZDjYau16lT9dEMWsODkokdUThakqO3kE5bh2Q10CUR6YDJGlOREuoTcTeuoRU7KuKp23gBiRI03IIzG5QPjx4g5/S16savCBK7XWGSJbjNGBA0gKOIJHoRMNRIXvdfDMyjPAlcuQoc9mJxM5KitJcq6AAUajQAc1Eco4GwXibkAgh+ZstvgIXVb+/R7A+6kGEatFbHxjAbaEQ== Received: from AM8PR07MB7602.eurprd07.prod.outlook.com (2603:10a6:20b:24b::7) by AS8PR07MB7400.eurprd07.prod.outlook.com (2603:10a6:20b:2a4::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7762.18; Mon, 8 Jul 2024 11:39: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%4]) with mapi id 15.20.7762.016; Mon, 8 Jul 2024 11:39:55 +0000 From: CLEMENT MATHIEU--DRIF To: "qemu-devel@nongnu.org" CC: "jasowang@redhat.com" , "zhenzhong.duan@intel.com" , "kevin.tian@intel.com" , "yi.l.liu@intel.com" , "joao.m.martins@oracle.com" , "peterx@redhat.com" , "mst@redhat.com" , CLEMENT MATHIEU--DRIF Subject: [PATCH v5 4/4] intel_iommu: make type match Thread-Topic: [PATCH v5 4/4] intel_iommu: make type match Thread-Index: AQHa0SuOE0rt69ReTEOYvhH3NMq2QQ== Date: Mon, 8 Jul 2024 11:39:55 +0000 Message-ID: <20240708113908.19535-5-clement.mathieu--drif@eviden.com> References: <20240708113908.19535-1-clement.mathieu--drif@eviden.com> In-Reply-To: <20240708113908.19535-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_|AS8PR07MB7400:EE_ x-ms-office365-filtering-correlation-id: 87fce5cb-fd61-46b8-300c-08dc9f42b092 x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; ARA:13230040|366016|1800799024|376014|38070700018; x-microsoft-antispam-message-info: =?utf-8?q?Dk4IQDE958nmfHNsYL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UnRbIjeVTD4YFk7HCBgYyxE?= =?utf-8?q?DypYp5Vzuh6nDYwl8LZEmGx2XuAYwB2dWyV6u4cmzUhOuMStcucnjEB+NZevIh/10?= =?utf-8?q?oEV+nn47iEkJJVGM/tSWslqWiwKNzWYlFvYPoHr0nNwxwRpvfx/OKT26muF+bTUH9?= =?utf-8?q?1UbWm7/mZwZnChwQbRb799ehknOpWIa92ln16o1WZX3hPAKyMoHgsUQyEzwGkNwf2?= =?utf-8?q?gTm+mX1WfY4Wuwp6HvrmR4s66ATKetRkA04Ke8ByxJ8TgaJJ60LFXF3K7QXwQRc1g?= =?utf-8?q?VIaWwJ9q2HggE2gTkaetuRuevZ7blYQ4LCtzGZ4xibzvu9/1sN8I01EhzUaBmpGE1?= =?utf-8?q?gFe9EyAequggLwvqsRdGBCbEDzvd2sb+XQnaBl8z2h7RonoldDRn8aUeZSf9Qzf07?= =?utf-8?q?krJ7x5rnrpdCYSLUHbdXTvwxiGIMBCTCckRdCPpaTJLS2Bs33bWMI2pLSosAHvSU4?= =?utf-8?q?XMYJu+hqrAMYFo0MJiE4d/TqTqWT/16I7Q=3D=3D?= x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:AM8PR07MB7602.eurprd07.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230040)(366016)(1800799024)(376014)(38070700018); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?utf-8?q?xbYl2UYtTis+j7eqDmMyI9zw+mME?= =?utf-8?q?ee7i4C5KHASWMBnWIE509O69Hx2tFz4edAaDPyeOyM+GxnT1TfTVWWMEqZFtnAcF3?= =?utf-8?q?ATp3jNq1tNKcDq/qoT7nJhOhDQiIMI13x4s9KcfbzWkeVaVGRiq9ylcFw5rTIkJ8t?= =?utf-8?q?Zji+cGWoxHz2t81QS8VWHPTfY8ksmOKUpxTiKrjOYW5C8a00DKx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p?= =?utf-8?q?TUCmRUvXy8lFa1za+TcLkVhBLaWYpSE3lfnLCNij4L1npUynl82yPr2OStThBtFwP?= =?utf-8?q?5czZbFFs3PyZTcKGQ+KIPXjArExH5BJw5uuNdiI6K0idkCoU3vRVnfggwPJsOcEzI?= =?utf-8?q?BvJTX7woWK4MWe7aJmR4bPvVk1y5e/mmBpzp1uvU660Wfc0ewK+CBQRYAZa5W5wd2?= =?utf-8?q?VLXWsZ9s69eVN3JCnOZ/8u7AlWgtxgaVSvEjiaWzhkrVhfmZFjCSNvQokW1iHePk0?= =?utf-8?q?hOcsZXuaeugvHZDH6XZgx2BGvhoRPw1BPKcif9YALnzawEgqgwSk4RsLY970Fo0AN?= =?utf-8?q?wMjwH5fkVFgepxEwCQBopoXZed/X6FNvdJOmVnTIPyyLe9Xe2GE80s0gR5ZQlfVMI?= =?utf-8?q?jGv8c7jczGWEE79eUdsWQelC6nEFBnRtIs3fH7sBTcWkxFroFxxioTGf2LGqSeZzZ?= =?utf-8?q?aac/yXaf0aeEmTddP280ETAz32RIhooB9HllXAUk55ZVnewpxIZL7pY=3D?= Content-ID: <996E3B806C931749B7E7ED207FC690B2@eurprd07.prod.outlook.com> MIME-Version: 1.0 X-OriginatorOrg: eviden.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: AM8PR07MB7602.eurprd07.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 87fce5cb-fd61-46b8-300c-08dc9f42b092 X-MS-Exchange-CrossTenant-originalarrivaltime: 08 Jul 2024 11:39:55.8248 (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: am5unmpkSXmuVdbUvfFApVxu0w+DMXyDrcN047idqMfuqpTw46P3FCyJ/RBJa63V76LPHRrv1nxVEpJgrqKiV3+pT4fZmQuh/txMUoOfFLflkdTOyqM3ijQr26g3+8l4 X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR07MB7400 Received-SPF: pass client-ip=80.78.11.85; envelope-from=clement.mathieu--drif@eviden.com; helo=smarthost4.eviden.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org From: Clément 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. This is not an issue by itself, but using unsigned here seems cleaner. Signed-off-by: Clément Mathieu--Drif Reviewed-by: Yi Liu --- hw/i386/intel_iommu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/i386/intel_iommu.c b/hw/i386/intel_iommu.c index 37c21a0aec..be0cb39b5c 100644 --- a/hw/i386/intel_iommu.c +++ b/hw/i386/intel_iommu.c @@ -358,7 +358,7 @@ static VTDIOTLBEntry *vtd_lookup_iotlb(IntelIOMMUState *s, uint16_t source_id, { struct vtd_iotlb_key key; VTDIOTLBEntry *entry; - int level; + unsigned level; for (level = VTD_SL_PT_LEVEL; level < VTD_SL_PML4_LEVEL; level++) { key.gfn = vtd_get_iotlb_gfn(addr, level);