From patchwork Tue Jul 9 14:26:10 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: 13728146 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 84BD6C2BD09 for ; Tue, 9 Jul 2024 14:26:45 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sRBnc-000708-M9; Tue, 09 Jul 2024 10:26:34 -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 1sRBnX-0006ZL-Jx for qemu-devel@nongnu.org; Tue, 09 Jul 2024 10:26:27 -0400 Received: from smarthost3.eviden.com ([80.78.11.84]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sRBnW-0002pg-0B for qemu-devel@nongnu.org; Tue, 09 Jul 2024 10:26:27 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=eviden.com; i=@eviden.com; q=dns/txt; s=mail; t=1720535186; x=1752071186; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-id:content-transfer-encoding: mime-version; bh=HE1nSNC+fM1pwokpWi9++/4rNMhNj9V1sCadInCpIzU=; b=eWdNAUM88XqvMpsRLDG9atT5/42R87yjT57v3Lh1T010Ksicp2CREGWg ZAtWzIG+iFdcSSr6fdYhz67p+pz+xTLq9GP2NMY1sjtCW5oFa3hdfRiJS NTmLB7YzTfXGNtX00MDhLZbZsc7tlof3TvgYICjDJfso0zs3b/YE1cA5E b1WFxF1PK5KGrIFv6GxFNIY0QCldRC0K1Gg3OKHkZ9cUqEpOj4XiWMOlj RXXJvBy2e5A9Yz58acPYwLQOY2zKrUkwrX6ZE7ojyL0JXazTRPVMlF2/G vbMK1q4KdgEeizdt7KQIyFSShrNva397Pztjg9wKrgssLFBqSp9msXcTl A==; X-IronPort-AV: E=Sophos;i="6.09,195,1716242400"; d="scan'208";a="16172664" X-MGA-submission: MDG+5ntEpwAgC68QuJnMBPpC3A7wgmGE4UYMjngDd2aBHajF+cxgk7i6RU5VlAJZyxgQUMAScoKkr3l6BRt4CSwrQXdFMgp9fTekcghx07uZnADruegqJkU37mPehSJWJ3A3i8lR3R/ZF30PxLJq8bwlc4vsM5V37wd6NPiOQL25dQ== Received: from mail-db5eur02lp2105.outbound.protection.outlook.com (HELO EUR02-DB5-obe.outbound.protection.outlook.com) ([104.47.11.105]) by smarthost3.eviden.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 09 Jul 2024 16:26:15 +0200 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=FZSYJf4FQS41HC6VAMZaLcIMXCXe4YnJ0BYwOYNpo4kiEuciLpuhl4a49fyg+EwwxLd5RF6Lj+KhY2UmZLF1hBmAL/W4gKDQPuvbWO/cP9LNEdQyjm2XvOWy5J2ocmp9gLKrA7zJypBqK6KvVlPO5zJrx01qJtduTacYzbsOAUKTDN6ejluAgjUSzYJv7UTPjF8bhyJOtm6xgMme4oU5AC7CEAuFJFen92kaD9RChA5kToaU9sPOvFrPioOETFeWdhUcHmFvCRsRVLGbHFhAbzU9vNM38t7KNzr5sfP++tNKbgFAC4+j3iShysrInlqToaV0BuYTLrhKVcU3R5nz2Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=HE1nSNC+fM1pwokpWi9++/4rNMhNj9V1sCadInCpIzU=; b=Drhw/A2CQVxykPG/XF7Z7D21UfdGP6FvuHZEnmzvMcibU4NLrTasxHkedrbdloZMi0Booec6wfcK0QNhysH9puKrUlfrTCFoMmKfVcSAeOUrJoDyerma4zRvwSCj4U0vQx33XMB64O4RnA0ljvgI3riPuFGf0a/wmQfX5ee839Dy1GTXpXWHlbpEc/+kU76zq9otubW02gQbzMsW++AFW0LrkfXEvbcmT2R34wQQlRYUKKkFcUDJVxAOU5rlibM0owtJfcQ8CfV4VW54k0KxHgXs51LbwBQlc87pKyL5JQG4V9j4Msdf/shoicWQDq/jFY8cCUnsb6QAGYH01pjIAg== 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=HE1nSNC+fM1pwokpWi9++/4rNMhNj9V1sCadInCpIzU=; b=FMPHHDrF/PG6Ng4hJ78dLsBV0RUEFKGdQBub/FFe89mAQg1c+/sirizPJmQZfG678I+A9Adzh14shkWwDaL37gPkgpj/NQ/MfdBsmE17dkCdfOM3T3cYTjVWgxqlNgBM6xRecRP8xWlwTEjCmAtF++b7DM7Yr3DwgjtvBy29BWJoyYEUelNM/5Ra3MB7W9y7NAqdtj5G2lrS9BV6NZobBexENf90bWSK/LBr7FL8k+CFdzIGi1/z86SIpGYYVU1OyAnDn/Nr0S0ccJ1VTAKQi/5XgHkqE4nSnGkxKUaWUwEHcSJD/uFGStiV+ipT2jEOQy+Ci+VYxPUOMBMYjc78VQ== Received: from AM8PR07MB7602.eurprd07.prod.outlook.com (2603:10a6:20b:24b::7) by AS4PR07MB8459.eurprd07.prod.outlook.com (2603:10a6:20b:4e6::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7762.19; Tue, 9 Jul 2024 14:26:13 +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; Tue, 9 Jul 2024 14:26:10 +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 v7 4/4] intel_iommu: make type match Thread-Topic: [PATCH v7 4/4] intel_iommu: make type match Thread-Index: AQHa0gvxRjyKfg1NiUKh789rILHFuQ== Date: Tue, 9 Jul 2024 14:26:10 +0000 Message-ID: <20240709142557.317271-5-clement.mathieu--drif@eviden.com> References: <20240709142557.317271-1-clement.mathieu--drif@eviden.com> In-Reply-To: <20240709142557.317271-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_|AS4PR07MB8459:EE_ x-ms-office365-filtering-correlation-id: bb01d6a3-ddfa-4816-904a-08dca0231478 x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; ARA:13230040|366016|376014|1800799024|38070700018; x-microsoft-antispam-message-info: =?utf-8?q?b9Ct6PHCSJ5ZNMxNW2rkUjBTN3zUVJT?= =?utf-8?q?b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jKlCWdSPghfbGX8p6POqF8EW/k4jTN78DE1zFNchrn+n1oP0unBeZJFS/gGLb?= =?utf-8?q?mxxlUiu4nzW+664eRQh7gi3QgZS4LBkiQT6//JLD2mwnTY+pShuDxsL8oA06HHkes?= =?utf-8?q?awgXtfOtMmvAVuRgc3iuaDAEfV9MpBaMtCm5o3OQ9JBfEg9al7/uMoDhXgS1hahpv?= =?utf-8?q?y2zs0BV8jHPM/Zox+cKoBnU1dkHC8NQOHtwFmKbUhm/nu3hJ4NO5WB7y7dNZe2/ou?= =?utf-8?q?rs/ChlXsqf2cHgpuo7RJP3LEXSJlzTkP/5Y6dOiG0vqnP8ZFYiBz0jNMjE3DfpK1+?= =?utf-8?q?1I15MNsuHCosZ2HIMYN6FiS3Sp05gH2qFhln1QB0EdPgcW5bsZR8ufpONyf/YLmAv?= =?utf-8?q?D2FoHemlqT3+vBGrxrb5Ruf81THt+gpZTJsFO9b+z8SKJ22IOhVHXXzNaZJ2WVrEh?= =?utf-8?q?GAdyZqfZwCqL0/2IwKYUJ+D1+wUV8h9Gfw=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)(376014)(1800799024)(38070700018); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?utf-8?q?rYU5ke0SCjmqBGiXkaGwSkHgvnfG?= =?utf-8?q?VKc5O+DFbbTX76n/fs6Sc5exzMYUMEkp5qLQQ9U7+fPlpkTf6hLGnpQKAojVxLIIG?= =?utf-8?q?hRlm7Ds29FzvHz5Bu+jp6R45bxfwyMvkEywzAQsFI9cwiyRiK2FUhqivu5FX5D6cH?= =?utf-8?q?JyP75ZA82Kny0ndZcQOkNhNBc5c1sutO88UAwifhNC9VXJbGIstMpwyDGTYYwfzXv?= =?utf-8?q?6F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h5kH2rts1/YCmqP2N8c3JKMOEUA6vZxnITepq94F0QboIcrhsRCs/AsQky7fs?= =?utf-8?q?Zsj0MjouHE5uGSjqyeu7z5WgzsAykmN6cDg25RCqJWv33XRBrvUn2NkVOw/V0wZ7J?= =?utf-8?q?8M02BX742FmAJoW9kUpWyl3DBrEfnizO0/ne30NIJ0wnjNdAWTtsTMkSCB/othF4a?= =?utf-8?q?KVfmD+IiKCgN5+IhYrL/dzkAFcaOTo+Gt1uqtbGtmfYZLSR8rUVZm3W/OOkPKNUMA?= =?utf-8?q?q6Ey4aWmDSXR0848abr91m4E1lECG+ewMuX4nefDeSIm0U6pOuO8cF6D2hD4krfq8?= =?utf-8?q?esjIZmak+Q6lLE2RO/kVG2ArPyR1/49wvQ2c/b7Pbp7laC1zGkCXQQlPzOmhzwaDe?= =?utf-8?q?2oBgNOCKOKYe2jQsncx0fbZx/sU2kHMb7nBuyCapNuXuK2Or4DeqlYLvv3Bs4r0hu?= =?utf-8?q?Di7OX2v8CqZiroKc9DKyhN49G1V2yxWMdYmgbF+2ppC79a1Df8HKe1I=3D?= Content-ID: <9A237FF0AC58C24F933878A4935EAC3E@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: bb01d6a3-ddfa-4816-904a-08dca0231478 X-MS-Exchange-CrossTenant-originalarrivaltime: 09 Jul 2024 14:26:10.7457 (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: eTm6I7nO5AC27XoljQ38+g216WPplaeNMdO7BptIn92LshGN8EARdxSBnM/rsXwqD367dtKoPYD308dQ3nFSs7rBJOuCL8rL6Qdc4JJ6ricV7Ut2cYn8VS2TzrdHimbN X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS4PR07MB8459 Received-SPF: pass client-ip=80.78.11.84; envelope-from=clement.mathieu--drif@eviden.com; helo=smarthost3.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 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);