From patchwork Thu Jul 4 14:47: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: 13723861 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 341F8C3DA40 for ; Thu, 4 Jul 2024 14:48:49 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sPNkk-0003QZ-NH; Thu, 04 Jul 2024 10:48: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 1sPNki-0003Pe-LS for qemu-devel@nongnu.org; Thu, 04 Jul 2024 10:48: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 1sPNkg-0003Lq-Uk for qemu-devel@nongnu.org; Thu, 04 Jul 2024 10:48:04 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=eviden.com; i=@eviden.com; q=dns/txt; s=mail; t=1720104483; x=1751640483; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-id:content-transfer-encoding: mime-version; bh=2svyLmHlQ6d1l2Iag7bhkpug/Bb2fDl8x+3PvU0cF0w=; b=nwpRLJWuDl9F0k0yKs3ZL8KwfaOPK1gxqitfYOMfqcU7rLB87ZGpT4yX hsvxbne1c5miALI0hQ1yUER2Pj6vF2YKFrS0gakvotwTYAqKFzi+EA5BU 7qCAnR/tR0QHMVYRU+yYVODSFPmcGxPySURh5GUIj9XwyineEUTDaO2Vb /symxrfiB45bg9sFBFbg3xqQY0zpPabKh0GHaHaOBsJjkA9cU+DlieFzv +CG9Vly6wCEYci+jXl/BnYOQRUL4msQZwzLRNQANIj3XAbTJY9EV6SPT1 0d+AM8YONLqT2D4KuIzpLCEE43rXiufjIi8PkYp66xtoylhe6hSURe3ak A==; X-IronPort-AV: E=Sophos;i="6.09,183,1716242400"; d="scan'208";a="16005887" X-MGA-submission: MDHvxumJxW+xlRTDGNcApb8433uaACFQtIPj128wY/h2RP1GrNjNeB+1EWlf0UhEYlhtQID2TJA0/dcJkDaSEKxkAMBKAZD0YqMW9hPs5NzxmnXNxwLEQMglMxdFg6BtvzHS3fgfsTSPazjDOXmwQHI4UuvfX9jQRehaZ7dc34Lm8g== Received: from mail-db8eur05lp2104.outbound.protection.outlook.com (HELO EUR05-DB8-obe.outbound.protection.outlook.com) ([104.47.17.104]) by smarthost4.eviden.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 04 Jul 2024 16:48:01 +0200 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=AVf5W14V3tB0wlRChXB2HhZPZlpCAxiXNGdDPkYEQc7idmKe4gNz2JnSBPwq5uVtFiG/4fQg8R92W3bPon20dueKurwgcxaWn/FNprAJMuPfR4NGRqClXMOAtk2kt8Pkn6oborvugivo1KJjgshTzgl1Vx7Pw/qOsr4J9CC172fhsKJQiVXZ+FwQmBB29uyZOa1MsJlQlEk643QT69DW8Ia8FPgS0ildQzFoL+EHIaQRZYPI/UNXP1f2o2xRoKyJ/7Tozht8k8t1Ik4Pmtp3bbT06vrAwsxUCjld4L3UG1lr103G+6ihhLGXKDbpaTgm2U1FAvQPpaSGz8LiEgTQRA== 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=2svyLmHlQ6d1l2Iag7bhkpug/Bb2fDl8x+3PvU0cF0w=; b=K3JnJcmwIIU0/bxs3QVoW1e9A+Sy+gYpUF5UThoLqKtaeh+X/SHxUSTLz77f+fTZjhbvSvLKxuxzNydu9IWyF05HhDIqMNNb1ZZXnCUkh5YzqAWH9L4ZNcmCdmXVwVIc3ZWrH5pAB2lzsRULten0id7AOMjYHIrmRUv6BtonSw6YsWinIVOTVPCa4S/do0gxPRYBijjeb6pm3le4NLsUyg+rfTS9pjgojWixKvjzZznxcK59Qi70fNC043bBFJdcG+1W30iAbHAXLrIL/EMkZi/wV9eY14vlTfM9lc88JcZ7iMQW5OCwSdS6hbvTchzrtQ8iopuvtkOmzDuZibEw/g== 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=2svyLmHlQ6d1l2Iag7bhkpug/Bb2fDl8x+3PvU0cF0w=; b=X6ilOpyH3OlPuUKf2S6f8GjjpdlEcPQ3peKaVLOGQyEZDvRSGVnwDHeI3HXG1ILXj82SH0NXIAqVICT814fbFfkSR4pCxu+sJrnGX7dxiRrpKNAIaR4Qb74jefzwjqqpahcfV+zKSs461KRJyg2glIsEV95f5IAhEWWqmlQuLpNuSkJVxlOxz5h4GqfcNHkPjZjfqC5xRhto0OUG/VuvgFJN4jGJMogUsXo+ptyS1EL+j3sNDszQBm8cwgJe6DsCRwvnRxiVZA++IAPF2ubou7FzG81z5tKLWaPdXyW2YmJfsuB4EHTaC98+zqv49q5OOFtQaniSAs7cPhxOnEsnzw== Received: from AM8PR07MB7602.eurprd07.prod.outlook.com (2603:10a6:20b:24b::7) by VI1PR07MB9499.eurprd07.prod.outlook.com (2603:10a6:800:1c8::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7698.29; Thu, 4 Jul 2024 14:47: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; Thu, 4 Jul 2024 14:47: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 , CLEMENT MATHIEU--DRIF Subject: [PATCH v1 2/3] intel_iommu: make types match Thread-Topic: [PATCH v1 2/3] intel_iommu: make types match Thread-Index: AQHaziEpnBS59oBIpUuVMnrpPnUfBA== Date: Thu, 4 Jul 2024 14:47:59 +0000 Message-ID: <20240704144737.996889-3-clement.mathieu--drif@eviden.com> References: <20240704144737.996889-1-clement.mathieu--drif@eviden.com> In-Reply-To: <20240704144737.996889-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_|VI1PR07MB9499:EE_ x-ms-office365-filtering-correlation-id: 078e6f02-8941-4a44-235c-08dc9c384c78 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?U/NTGl41UvsBAlvFZhze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z81Qd?= =?utf-8?q?o0yvtDz3Gy5jZkX4fNvfIaRTZTObrR2iDFdddvN70Npylgm0+gSAViUKMKxIPLWKU?= =?utf-8?q?+TrS35BFQaf8pppdW7Maa3xqm9q2i/aMf5HFsIVMMkb3VBDaBmJi8ayoztbbH+OCM?= =?utf-8?q?/nkUEUNTDCKIsPw2uPOqXXPr0tDrO9h8ikp1JVZAoea0XBWQckzVUHkYeySjzPtgT?= =?utf-8?q?XkOuEJR/QhQfoKzc5UIRE/NCmN1VSrJpzERl3gZhNC+SOh9dS/f+Sl5+f49LDcMRM?= =?utf-8?q?PAbbgkcnWOyKk+nijXcV4jo2qd0aQqeu1knQe6Gw5mgXyEkICMlescPCs/QSQ3Viq?= =?utf-8?q?pd3xzj0RJyv0musrL2W1N+tVYL0SOsM52J9E5nFjHXaOAKbhTeG32Elfncii9vzUl?= =?utf-8?q?sm0963VOkSXNGoElfklrHkVAvS4iyTPvCxPNwuSIEOi504rY19BN6T/hJs21EicsE?= =?utf-8?q?NH5XLR9Sbrf+o5q4ZiZzjJdc6fdNzeSdQg=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?1ML8rQnRFq4fN2XLWndupg1+uSoR?= =?utf-8?q?PeAXmnNlq/JiAYWTrjhasZKxNGvV2NSw6ftbpmH/XLK32ydpFXImZw9USp/u6DhJs?= =?utf-8?q?mIQFQ871DK5LvdiLrx3kAGnrrndjC4jAcuLruEDaVoYI18+mCOHbxS0co0woDZy/S?= =?utf-8?q?vml9vklj/Jyu4cJ8kv6a+TJISelojajbkaohrh4jq7cJxRI+cnO3J1K6ng1dwAPd8?= =?utf-8?q?JlwOzC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ulvzxEWVHx0HZ/fBb7n6ap/gEMFhCqPFA7fEf2QpKz0mQIOl?= =?utf-8?q?9prpttnNEWrVn0BJFZR3CRFY4lrFRM9fWx5ZxkaYmP/Vag4kQdH7fSi7rWNTaiJmK?= =?utf-8?q?e1hthY7aY7q6OHTLQMtiVkqlOP1fRZPHxKzv6eGNJIoykii/vGJF8tVjkcmdK13jM?= =?utf-8?q?nYo3SngpvOe/6mbrOIMJLy0j4uyPcsr/EDWixVFHQj0YGg9gh+S8U7bHlayGGipCu?= =?utf-8?q?c8l7O/1r8s9HTA1d95v9AMbBbn039orrk6Xk81mpdIP9sfOGisZ+oaVY1iHJMxkQK?= =?utf-8?q?IbSvKd2nildqZtHQZdVWF9eKDWVa/mIJ5GkFkdSUj6gm6AEbf5HTsfGjSzBE53+/c?= =?utf-8?q?hreM+Fn24Msc7psMPw3HEFEoXcaBKRRhujK1TBUHE6VMG7txBcoRW/je6t7W8IoMq?= =?utf-8?q?2CxvayMAG6YEL0NUoxk6Z7p2onxqejyh9PvNBEAKh4NoIYz7+F0Qwgs=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: 078e6f02-8941-4a44-235c-08dc9c384c78 X-MS-Exchange-CrossTenant-originalarrivaltime: 04 Jul 2024 14:47:59.4631 (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: FWo9zLY5LXmPcvzneebd2UALRQFOHmy513cPPXABLK90QV1lzvoAXZ9/Sfx0ziH0AjYS/12nsXHFQreA2Nsu0ssmF+xQLCozBUkg6c5yOsa6dKU4SL3OnnQEsaLsxYSj X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR07MB9499 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: Clement 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ément 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 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); diff --git a/hw/i386/intel_iommu_internal.h b/hw/i386/intel_iommu_internal.h index cbc4030031..5fcbe2744f 100644 --- a/hw/i386/intel_iommu_internal.h +++ b/hw/i386/intel_iommu_internal.h @@ -436,7 +436,7 @@ struct VTDIOTLBPageInvInfo { uint16_t domain_id; uint32_t pasid; uint64_t addr; - uint8_t mask; + uint64_t mask; }; typedef struct VTDIOTLBPageInvInfo VTDIOTLBPageInvInfo;