From patchwork Mon Jun 3 05:59:41 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: 13683286 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 808F8C25B75 for ; Mon, 3 Jun 2024 06:04:25 +0000 (UTC) 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 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: MDGllue0+6Hs+LKhCB7wXGGRUxeGB/JfQNCbpIqQX3u0wDfrUSmnlyrc6+8/BTxDp5+AX5yb+y5d3VMkiHBJJaUKEpiMIBYQnSg4EjYCsDWidNt8THWSnTRHIxgtwqpz2d6X5lUFjQ+NDW6ShKCeWfuCnVKtZBMhSnZ7cXVNKVLwbw== 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 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== 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 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?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7rN3MPa6IxHh3WOls5oLdXDI6wNeGswazdIg?= =?utf-8?q?wjSu7o8R9kwbIssZl0WzN6pY8i6OCrjlZHNZ/ZjzKMKYQT0piYBBWxRsw9knq+/l5?= =?utf-8?q?PSdzNEPRKvqcQ8ngx7To12xCtvw43N+5pGg35Uv6nir/5Q24Gty3i7x1Ftr6d/1Rn?= =?utf-8?q?R1m8AuMlPrimQ/R0bmNLsh01ToekN4uzfHnQR4mPSCKMbbjCVoiUUQccc0y9CHYv/?= =?utf-8?q?iwIehkeisflmBag06lpJPJMF4VlkyGq9Bmh4kTJDO9ndBag9N5Q2vqfmZlF8lKaEy?= =?utf-8?q?g+nku4R31TFDEYmrMwCOuG2nVu3giqgvIVUcKC9Ub3OQcfLbMG+ER/eEYowlS2V/e?= =?utf-8?q?ZOG/iVZjVV1XPoecQ9hAqedXJRmj1vlByunTK0R6M+6J9CXm98aahhqx0tc+7Xe0V?= =?utf-8?q?9HSkijqqOjlc9GHygyK+RgLu5RTYNQTArtw=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:(13230031)(376005)(366007)(1800799015)(38070700009); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?utf-8?q?hYTqWNtVPc5z3GwsJWXN51L/NrHd?= =?utf-8?q?EV3moTR6eCFRiy5rvzmBTmlBAjV/hUA/xS9syfTSw4OAg2E9vyMb6492yFN8QjS0i?= =?utf-8?q?ahFfLQdZ20SUt7roKLJMdgYRbnbvJMq+BPCCdaSIMYcKMOjsJoZU0kDsqXtr7NPi6?= =?utf-8?q?uL27CjgoF2tr5/PhSnXb1nVVRsxrOxX90Z39vkRG9223VrtRMHQ/E7Egzmv5TRbVO?= =?utf-8?q?qbDYaMdYTz9db5rFM9cCFTI+zLXVdMSdt3Hq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++Dcb6KPhlcjBMHsD74?= =?utf-8?q?Lj7UiayYcCcucmK7wFiVpqlqXtNavvHDmZeTDeXwtu0GVSVPFZvFRoW1PrPSvSFWE?= =?utf-8?q?tICDvc/YEItor4W1pPhCv0LiAMl3wRSHEp+CI6K8ymupXK98MT2pRdhvM1toe8g5M?= =?utf-8?q?n6jDKI4ZyLVgjZ+8KsIreMpT5BrEeSB7EdFFBiF3XGD/gNTgmBeHF7cX9CpIUsoSi?= =?utf-8?q?Yak/H5tZXG7kgrt84d8+iH/dXdAtjBIpzknbmSEhaMRxmptInn0Te7HoCOBXEOuqy?= =?utf-8?q?gBlSbGNICwR+tOOpKWu0t1vwg5z6LwZkxl1grvgx4sE1pcg96lKaNXMmb2xDE9wjo?= =?utf-8?q?CNwHHlGadBUKnZfuCYUEXG1xdVa4Inbu5blNoo2p6Cvye6HuDgB+2DSCGSMcAiHf5?= =?utf-8?q?Su96gvuZWssu0eVRZQaX6dQV2R6pK5m1Hy08hdBMV2ghGcfnEhNzsmQ=3D?= Content-ID: <9141EAFAE0DE124FA6CAA1FE14C67B81@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: 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 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+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. 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 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; 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 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;