From patchwork Thu Jul 4 15:12:48 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: 13723890 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 CD7ECC3271E for ; Thu, 4 Jul 2024 15:13:37 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sPO8t-0005az-0B; Thu, 04 Jul 2024 11:13:03 -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 1sPO8r-0005aI-IA for qemu-devel@nongnu.org; Thu, 04 Jul 2024 11:13:01 -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 1sPO8k-0002sV-2y for qemu-devel@nongnu.org; Thu, 04 Jul 2024 11:13:01 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=eviden.com; i=@eviden.com; q=dns/txt; s=mail; t=1720105973; x=1751641973; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-id:content-transfer-encoding: mime-version; bh=YoEDiqSXeBOMuFcUpS2ye/tE0awOTVdmwpSMPRrvMks=; b=QdWBSNSjZs6cuvvIVWe+eUzNZHxn2NXl4QmH02XP5pbqUKXQlbtqZ/+s dNcesyTIaIIZQ8LbxVzj+NnRjdQZw3ckXP4y7+8xGLG+G3o7ipcK0LMtg tP6s6aD9SejF4w61/90qe62y+uQhl+CrCOwdc7PnBBkS2E9eNaJUpShZC pJBomOvKLmpo54mI+y2HppvspJyyjIBgHnjts/u5V7jyW7VkIXvKuz9hm /R1t+YcJ51QbuEw9OkLak2859fyWMrfsxjegpvGvqhydqYLdcvCzxphD3 jQ1MIJy1mdfcWds/wpBSeqGspvN5E+IJ2j6zXmGpH17WaovM+t7QVbytJ Q==; X-IronPort-AV: E=Sophos;i="6.09,183,1716242400"; d="scan'208";a="15910928" X-MGA-submission: MDGzkHGvFftBHh6nyWM5Tui3e99VGUub4u6NAl6eEdQBAlmFy8RlRwoiCOqE7IE2xNzdl+4HdR/BEcvUj/uwEMrZM0o9tc5XBxV9xiL/B1rzVSKk6ym6P4IvbGsCtRLAIxbDG1xew8S/gcORAGy7ll51eAdXUAGnjHDDS8mcSe4BUA== Received: from mail-am0eur02lp2238.outbound.protection.outlook.com (HELO EUR02-AM0-obe.outbound.protection.outlook.com) ([104.47.11.238]) by smarthost3.eviden.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 04 Jul 2024 17:12:49 +0200 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=n8H0koQKgoAHlkLEZJy3O8DTw5zyS44NjwFjmQIx7FKmM3CEKZcwiZ3l0gcdRToyXY0wTps3swJ38euwEmMaGi3LYMop2MuEvfj89jsZA7ulrvGAoKemZ6wSNV5+rIP3ReMmx97oJ5zsHi8JjgFMmPz6oGgTsrKhtEU3/06UEtiEfeplgn2ttQuYlmqJ2I+S4pZ3XuFSdcFCFUj+k8nIg8pt+F/K2gP3jui+xIVkaN0vjhqIeONgYqGviv/4TUg+HU7+oUWL8LWcbsseGxmuMt8n5phMWIeTZ7dCIbtioOE2+7jZ4KmhyVNTKazl8EYV/BVb3iEgPALqlNg9z+DusQ== 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=YoEDiqSXeBOMuFcUpS2ye/tE0awOTVdmwpSMPRrvMks=; b=NqGJ1ISk5ekE7nTr5Gu/XgPvjA/x7etT7l8sA4rkxM/hnUSz+e4IV5KvefqEh5Wd+qKKUR0RNI1zYlMz7tbHcqZqiFs3NRhOEiv/xNQ0RB97wYceXoJJ+WznH3ydEmyXWiUH5S6c0RUBNxjEACUXwL+mEwo0beOSBHpVGoe5+ZuD1m0SYg5F+I5H3xICsNxnruZS17NgLpW2VZDEf2caj+8B/i/Ziqjz0Cz/jx/eS/6VwMuLsU37dhhQsSKu9MOIuamKPk3CZ2/QdnCMO2N1tyUX+AWKVTHCwWZiQPHS/+hf5zo3hqEUQC8igNAw4H0NcdeCEZXOdHbks4rXL6qKfA== 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=YoEDiqSXeBOMuFcUpS2ye/tE0awOTVdmwpSMPRrvMks=; b=sRstGMeOliD8UB1IIKtqlDWe4FrVrBNFnY4r/o8Vt1B1CbSQYF2ZPnO1+INnbT1UIFyaLCumLLynST6Hrhnqn8wrXbd360UtCUXa9F4N9fZWyG8jTcL/D3EkBusUrANlurNBJuB+ty2GsWILX5X9851BMPjGPrrbLhv91JSAHa7x6OhUomIg5CkGS4yd6o9DPdYwJCc25Ymj6Y0srZp1zrpgXdcimmxTDKAQcVxpCF+JcfDvp0cwTO9qeyqijRggrqcwoIO8jn9XoBago45t7k+NDpeMc3O0/v0CiQodSTn87XzT0+f9TzP8rL8mCK1xQaEdMFjK6lAo4EbaNeTiew== Received: from AM8PR07MB7602.eurprd07.prod.outlook.com (2603:10a6:20b:24b::7) by AM7PR07MB6455.eurprd07.prod.outlook.com (2603:10a6:20b:137::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7762.8; Thu, 4 Jul 2024 15:12:48 +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 15:12:48 +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 v2 2/3] intel_iommu: make types match Thread-Topic: [PATCH v2 2/3] intel_iommu: make types match Thread-Index: AQHaziShhEkI93qTq02nWGGZ+3bagg== Date: Thu, 4 Jul 2024 15:12:48 +0000 Message-ID: <20240704151220.1018104-3-clement.mathieu--drif@eviden.com> References: <20240704151220.1018104-1-clement.mathieu--drif@eviden.com> In-Reply-To: <20240704151220.1018104-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_|AM7PR07MB6455:EE_ x-ms-office365-filtering-correlation-id: 8ba64991-c07e-48a4-a547-08dc9c3bc419 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?WPASB764ng5hDi9nRpW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mPeAc9kgBB7tAcSaJ7SvEX?= =?utf-8?q?ddNTpAa/HXRpJxOE1SdoHoPdyOiJ5ikzXDn00CVdkT8cgAdv0abvQBr+E8R4qxRJW?= =?utf-8?q?pIej6S3N7K6IoJ5SfGR9TNAoww/Qq0sn6fEIP9AXCZKolq93bwPKjc1ciVij/o+80?= =?utf-8?q?PXMBVd1Vbkai+eUU7IS2biR5md/yexHC+277QwEspBK1XAKj6Gvd+vlOtJOGh0eK/?= =?utf-8?q?vUe/OwUv/79zy90FmDCLqtWj3iexv7INkw7GURGN0YTGBLQ5c7P7Y9844QkJm4uxe?= =?utf-8?q?++nGHhyGUtdErGdHyCC1FggYQMiozWImVGsDGTTRA59xML0mLkEIjyja7/M/KAp5K?= =?utf-8?q?5TW6twKx7cKCgZzdnxwPlGhhHaiX3GTZ7wpPeo821HEwEKxYepo8MHPBd9UigC47d?= =?utf-8?q?TKAOaAO7qYnYtN+45b+ZaXO/15E4bT+9XkgDlvt5dYH5THxNY5FJQo/6PuS5Og5iw?= =?utf-8?q?avMcigeisADVPW+f5vXFNwOI/eMECQjxyg=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?X9kwfZQIjZ/r+CAGCTO++xHYZW3f?= =?utf-8?q?pCgRr7mnIjv53j58M90b5mr2qoiw3/ORtgAi1DUnAOCNcjYyoROC0pevUF2TpKIi5?= =?utf-8?q?sY3Yf5qM7GfIeroSXT0LqHd3fz7d3HlOUYEsxyMmgokGLPuU5mpZNIrHPisLX4Ns/?= =?utf-8?q?n3+gaf7kr/8auFoU0/HMYYu/lIAnnzESashY6vlsoQl3zOXz6VjzAQzEfT15izHOH?=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FRXuyFY9rBC?= =?utf-8?q?1uVQAE1jdnWBswz6pELTiQ4tZUWf3DYogwOAc1EQeVUm8fpPTcw7WauNM3/m4Aps3?= =?utf-8?q?Qzas4EncQh6VApadqLHvgQ4uv4p/NT1EeUCszrQgsxd/hTM6jiVgKeTv3j0lSXFnF?= =?utf-8?q?RMRboZBual+3d1ywrfAN34d7VE6LQ9GAARW4fOBYtru8Sv3M6rOyIqwOfyHXwdwtE?= =?utf-8?q?hHCAvBjmwZY5LgAbcvTM5nvGYdO/8iFwh3oZzMBdhSHkW5sjEIQbUhe4V5+ZnIDuF?= =?utf-8?q?p5XO4Viye4tlZZeXUE+9lur6GpBXsoVXND1GBAGZvXlaISsC+HD10qed3y/1wVoYK?= =?utf-8?q?SmkITSB2v64wdbDrq9SeSk0F4QeKA2Cr3S5iTJgY1b8ycV1/tb2i0vkwW/1DX5lnv?= =?utf-8?q?7S2kZaEI3Ywstl3vpnqv/lQrZj8Z+rvx0oFNZmXLq8EsH/gVl7TK+4hlFes4gKUDo?= =?utf-8?q?Sh06hQ3SnMdFd77mtX0YszcrRRBjPx/JPW6lpSlY8Awx+VvTkQ3Bdo8=3D?= Content-ID: <82FB477312FDD042B15B559A837FA5F4@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: 8ba64991-c07e-48a4-a547-08dc9c3bc419 X-MS-Exchange-CrossTenant-originalarrivaltime: 04 Jul 2024 15:12:48.6189 (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: FfWnISGlKNQo5unx69g4eLSzuNhGzwm3jdYsCVEBN7EMQCMDWJ2gcZna2tI2EBwtEw6Re1YPWpDrvJeTxHmSRAR687tzzuFl+A82v5AdLMf3xILqUiccUmOJCrWzukKt X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM7PR07MB6455 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. 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;