From patchwork Fri Jul 5 11:01:59 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: 13724968 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 465FDC3271F for ; Fri, 5 Jul 2024 11:03:30 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sPghv-0006Wy-9T; Fri, 05 Jul 2024 07:02:27 -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 1sPghq-0006TF-Qn for qemu-devel@nongnu.org; Fri, 05 Jul 2024 07:02:23 -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 1sPghi-0001Tp-RE for qemu-devel@nongnu.org; Fri, 05 Jul 2024 07:02:22 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=eviden.com; i=@eviden.com; q=dns/txt; s=mail; t=1720177335; x=1751713335; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-id:content-transfer-encoding: mime-version; bh=la8b6EsER2myyyqfK0mnc02PBu9H7RQtt1F+MmsewQc=; b=Yk9clPNgKwnATra+AZdbg/p4YN5QVltoGXVGNeLJVq8oMbKWD/x1ziI1 gvelaf2+SYbFE9E78a7qunX4GG/CCbvkpq5s2k9PTpZ45tSTSsGJYDmVU LSvVQr4yNzGSSsmZgYElSUSOSIDS35PxLJsv4fmxBGjlMYJcrzFrK3jmo nB6Id9SzaoPdE8pbTnzjyCgcNa1Z8uSCfTdU0U/LSoSJr12Kfc3dNahVF tofh2rgdlF+564bF+yHz7iq4bT/Yw5eonBclg9jaXUMSkZTadCDBe7t4h 7woyoxvwXFL4dJ5pRMHx/br9o5Go5LaRRol2XCe0CjWTV+Doae71RU5ma g==; X-IronPort-AV: E=Sophos;i="6.09,184,1716242400"; d="scan'208";a="16056529" X-MGA-submission: MDHy3uUudlM5pFoU4fo48EyQ9kstlmK1+5CpBHmNpzrvdopxkoKQyWigHf3CztWdxtzp9XsQd227AihOHmgDn0iw4aBijxMHIpePeJZYXf4eGMaHxb3buEQVOCzDYhkmwfBNvLxIXkqd44SHpHZ8ASvhooBqMUGUtTAHMGrpGjoUog== Received: from mail-db5eur02lp2104.outbound.protection.outlook.com (HELO EUR02-DB5-obe.outbound.protection.outlook.com) ([104.47.11.104]) by smarthost4.eviden.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 05 Jul 2024 13:02:04 +0200 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=WbNLgvMRDz/bzwba75+Jr6K25BNrzo4243mA7YYtZ0rSxKPpNn/s/YuEIv3N+qhIuIsb0lI/cA21hPAdGhvBcsrxC0bXWTClEo/1T1g3tFU0py+742LJJMkgW/26zMKAtmzUj74Ti0o6BFQis/SleGzx5LOJP6SILdD+M9quvjcQs1bol5Vf/ickvrN1snZMNFKTpYH2QBPtZbcNU1aoPwjy2vEgFkukRt8dq9JEQFVqt0EVx4ohBP1uQTd3rQuq1kq1mQ6yeLo2bADEJwf7QKSpU4fav/nsWtv0QO0QtCMsWN0wCcx5hJAeAVNHcjTS9cmMWk+goMRaK3w83GFjkQ== 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=m36D5/QAm6VmOCn08qg0+l2wiadlSOxGRqlrl1d1nTdOGkU9g8hORW9M8pyhk/QfL9Apx2F/7nWBU8nAWrEod/JE0hn2pQfDA5rHIT+2byyBv6AvnyzTjWvd+GIRh9OkKm4tB/upe0KqX694udw2cxrbPy9JAl3lGtcmm7pkBxKDV74zIfRq7vdoSiTywX8qGWz0HHhj1RqCWu9ertJsLxC/oW2YgZ213VzWuadhAumqKqbp2iRRDf9qCRlj3ilIz8LegDOrk0rH8O2LVcqPmI4aNN6jRo9r3hZDW2LWl1cMND95J8bY/2kUvwlSNrM4JYd9ye7piXm5/JO2OrOT0Q== 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=R07i3oAujca48BoSbJZFJHsZnkmcvpTuuX2M/trxsD7EQSqCnPDJ9fb8JwvP5J64+jSaxVcreU5Euap4JFsKdiX5vmd5/JwulV5Pdsci4vgUOxxyRI3e2z6Op6czzjQ1NHxg+1GvlfWzEmvsGZpq9vtgV6o2iNbk96vrj3akxsXdegZ4xntUdG1ACgSSU4gHJHzC5JnjM8E+X7roHtoJ7nAr/m5MrRTWRPI/vrdV1GTPr+00qJWMsWYjaklVSDKtLXSMBKkvhJSBGX47wilyNUFghUv6yCra/UwAcYhkPK3Y6kFAntOxkqXK42dryL/bewtsYV/P9K4sFbJbgBxTJA== Received: from AM8PR07MB7602.eurprd07.prod.outlook.com (2603:10a6:20b:24b::7) by AS2PR07MB9502.eurprd07.prod.outlook.com (2603:10a6:20b:649::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7719.25; Fri, 5 Jul 2024 11:01:59 +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.7741.017; Fri, 5 Jul 2024 11:01:59 +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 v4 4/4] intel_iommu: make types match Thread-Topic: [PATCH v4 4/4] intel_iommu: make types match Thread-Index: AQHazsrBg81pTYUcukGJyjgjd47O+g== Date: Fri, 5 Jul 2024 11:01:59 +0000 Message-ID: <20240705105937.1630829-5-clement.mathieu--drif@eviden.com> References: <20240705105937.1630829-1-clement.mathieu--drif@eviden.com> In-Reply-To: <20240705105937.1630829-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_|AS2PR07MB9502:EE_ x-ms-office365-filtering-correlation-id: 3f7bc1ef-9fc9-40d9-1a94-08dc9ce1e47e x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; ARA:13230040|1800799024|366016|376014|38070700018; x-microsoft-antispam-message-info: =?utf-8?q?ndmynvqXoIqweITtdDV6Jgakkws2S8w?= =?utf-8?q?jGQH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SmkyZVUca05SXnlEdWKZnJ0VMk+T3u7Ynq7?= =?utf-8?q?r9aiGcKurY0oVZqjEhX1G8PVgY0lpk5FK0+vdAbjT/a/qlKCZ/7/bOH3lN/sR8vHG?= =?utf-8?q?3AiPQBftJTOyk4m2SQ3ebQE8+MAtcWLQWsmHh/XL9PJdeI7v1YefYmvdikDXFkFx/?= =?utf-8?q?nam0bwYln9iYBt4kFlRZRzLHXv1oKEoomTRzlctkBSC/QDNxzwYY0P0nVJjiPpMxr?= =?utf-8?q?QPaJaAKgTAqBxr0Yec03bExTTr9fJDSWVR9I1NefTbuJIZZ7/SKMiXDMvFMtvUYSg?= =?utf-8?q?bNKn6NgLm6TPhaOK1ZhKKUifMpCDeZivocRg67U+M+HVj04NMCOwJ4CtoxMFVgBTj?= =?utf-8?q?uJYNa7PaGwkDYkurHTjIS2ct2tUMr6tcugXeGGw1Y4wbi1xsepr2XvaQfSQ5AB03w?= =?utf-8?q?mcZSpMW1lgf0xa2m09xU+OudOawhhW8Cgg=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)(1800799024)(366016)(376014)(38070700018); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?utf-8?q?0soJDf6ArMWdDmc4rRx7xLAfHvRm?= =?utf-8?q?tpB2CZJT2VBllnRkisXtyfbpXSOJjkZry+cH6gIQboJ3rMaOSw/VoyySB7KhC9PQu?= =?utf-8?q?HfVKY3nSh6S90OMxOneK9wgsowzZ14Zoi3ta+SWxrVIf1w53JKpf88Zu4KHY3OL2i?= =?utf-8?q?bAXrOb+ansH+LA0uEAiFz3GqkPYaoxFv9pSnE772Ubg1fB+7MeIadDtl4RmCrm9Qv?= =?utf-8?q?/4in9Fzh29zxKrUcjbUyr81jqBSShwLPLqgt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OqAGndG1Srn8N8q8gXkU+QKBeINDx0LQ?= =?utf-8?q?6ofUTcpiYAtKlcpcxLpNSWViawCUWo7uWSNtHJO1iWpdutTPrA528ATOjqibe3r5+?= =?utf-8?q?rUK43YjA9xXIOFaGM6RN8yYzon09p+oWfWCTMTR5c4TgsVg5u4n6gtKPUrZ55RMVY?= =?utf-8?q?WVjua+f1JBKe9WMq8NXwv0SuFSgBMCLvbmgjqI9ab9z3h+nigvVDffChM1NNTnVTN?= =?utf-8?q?poI59pkPbxJaVjbaLDu6oX+iz73cuY5tY41aNLD6fGlSGF0Y+9Y/roGyDV3RfgwDY?= =?utf-8?q?dpEw/BtwxBh8869xUruM8ASYCb4P6YN9anCYo7aTGCR6DXxkHGaB9veZrZgObB+3K?= =?utf-8?q?JYuuVAn2GebQKqHnbJV/IzeSk6PI9/QqYls6VjDF8cERZjet2u9qQQjOnt0ZL699/?= =?utf-8?q?vyr5LvSLrpkLVq8MIEDY/ALWqK7mvzDhY5nYMG4k91Kx4r8kVPK10wQ=3D?= Content-ID: 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: 3f7bc1ef-9fc9-40d9-1a94-08dc9ce1e47e X-MS-Exchange-CrossTenant-originalarrivaltime: 05 Jul 2024 11:01:59.4215 (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: 5FOMf2aYdpCjxOalsEVa8iLsRKsqjE1W72yF1iaYLmydGzb6mfDAVTiqoJBLn3CAxMEeL/X7dKBwVLgZ9pVvEvRAzKuxPNHdokU7Nqk7pQrWCirSVEO3/7T+x81CZges X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS2PR07MB9502 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 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 --- 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);