From patchwork Tue Jul 9 06:18:07 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: 13727299 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 2A09CC2BD09 for ; Tue, 9 Jul 2024 06:19:47 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sR4BE-0000qx-BG; Tue, 09 Jul 2024 02:18:24 -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 1sR4BC-0000l1-MX for qemu-devel@nongnu.org; Tue, 09 Jul 2024 02:18:22 -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 1sR4B4-00080Y-9D for qemu-devel@nongnu.org; Tue, 09 Jul 2024 02:18:22 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=eviden.com; i=@eviden.com; q=dns/txt; s=mail; t=1720505892; x=1752041892; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-id:content-transfer-encoding: mime-version; bh=u/EE/MVYvmwVs8wPu6Il6DxMESvsWjmJtHWqiv7M++c=; b=c2j3YLxpTs1D3C3/w6uJAdjMbNrPqsZFBDiXTK855uGoq7d/hjivey2N gmWw/w3M5LZ5GzIreFohPLTc9MsF9ngrFN8LUo2oi+8GtQ2KjebGl8TrQ 6pv5MQSi8cJqMsd8P6Mr2ba4YKRkHlZTLbc6F6a4c7AfjDVioDusKOiLO 5BKOMfHsESf2CoqUA7rbXHdi5oEwXuXWgxnibmqLDIDk07k0DP53P97FB QHQktWfXc+HjNxs2oFXyGg5D7tpWpYaC3H6ukrO3aqCaPxsyESqx4gJYy sYykCphttpQyRIzY9A2XqcZVtKuRnUWmzo6cwPoeY7nECUQFGzYYVwmrC Q==; X-IronPort-AV: E=Sophos;i="6.09,194,1716242400"; d="scan'208";a="16131806" X-MGA-submission: MDFZkqDnocJs0Ve7nOf5mK0LcPgE+m5APfHnugirGUpw6OOBO7dZ4uNmwwOS0OVXXyV+If3x0YJIt2osAXlDSJ1/F+yZG1ZqUbj8/Mt29liI47xn2HYTdIuEpxVy1A4QMHGDUdwMwEAOxj9bn9u8F22zW8LIEGWidm3RLMdW9Xh9bg== Received: from mail-db8eur05lp2104.outbound.protection.outlook.com (HELO EUR05-DB8-obe.outbound.protection.outlook.com) ([104.47.17.104]) by smarthost3.eviden.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 09 Jul 2024 08:18:08 +0200 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=mKsznQQ4g39mbFBVWIHPQZtUXO29S/9KnpUsIVNZBq1OMpDrD6v+mB91WEHvWZBWrCGNKoZNFnF7GwrmhFDre/ytlzyAGw5GKA0KCa0PE4wORU52BE61wv82X++/swzgYNocgaTMl1Fk2jAgvyjK7S/QA41xQYSO+XBONYZQie3vDlpIbc2xRFuC4puPWxpGmV8V9YY8ytel6fhB0RVdpBeop1JoVgidCci1KFQVJuYJSRdElHaxldVZvK2k8V/rww3Y52Ac3IJyeld22TcLSMBhHPnKWLmXRu4zDlV0Ulgc/ecSQ69rGaQubThGKn75YlMoig/gtpsnzAYAqhzx8w== 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=u/EE/MVYvmwVs8wPu6Il6DxMESvsWjmJtHWqiv7M++c=; b=e2fyPuoU3hoKwmZA6bzmrgDiAtgzcS5SOmD2KzF+D9cE/VYAy6jR5/tei3zum2nZIbs7yAM+Z1pP456G48pma6QKZ+W4yzV8LlfeUh/h2eVFEE81lwEbu5sjMY1acsaYcA2gCca0bppaMBJHfJ4yw28as/3ZecUWes1hafgofg7sXrP8sFA7oSmR8GrqSDbtG1AGN4BqYGdJjsN5GbPi6pNm1GdWp+IIqF7vxZyfhs5Nky3tAfYPVcwKahXb1xgLNhwDeiP6klIFKe+w0oHvv/e12ff4/dTHoPOcF6SGgZmB9iE6SOcpGUsymKyfvJqnqeOsmqXaEPIP9DGQ+CWY0A== 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=u/EE/MVYvmwVs8wPu6Il6DxMESvsWjmJtHWqiv7M++c=; b=Qwh6Ld7xr6W8HTtP3L6L+tuylo+HKiKeA0x4Y9m2kHLut4BL4tfSYA6BfL0NbxU0x1RjxNYW083OQzpGOeGsh6bFFMSu7MXh+fauLXpPZ6DbjmWOJwxeeLKZq6J0AcgJHZcmi1vv7ugkobvlL/X39urKupR8zsu3rc+LULEt763GOCumXnkte/y/wK7daaBi2rpmNeh1hgtzqwv5OlEXS3LmpqQF//tUxkwVrUbpeZ78OPcAUf7TIqtqxWjuRU494wyb47V/ozC9DzGyO2NlziQCrOHOCU615TfFrJsUkqf/IPyFPZ57+bZjo+q4SmQ3yENCSuH4y+pg1VMjE05hOA== Received: from AM8PR07MB7602.eurprd07.prod.outlook.com (2603:10a6:20b:24b::7) by DU0PR07MB8466.eurprd07.prod.outlook.com (2603:10a6:10:355::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 06:18:07 +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 06:18:07 +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 , Minwoo Im Subject: [PATCH v6 1/4] intel_iommu: fix FRCD construction macro Thread-Topic: [PATCH v6 1/4] intel_iommu: fix FRCD construction macro Thread-Index: AQHa0cfDyRBjQJXZs02vrGVT0F2j9A== Date: Tue, 9 Jul 2024 06:18:07 +0000 Message-ID: <20240709061756.56347-2-clement.mathieu--drif@eviden.com> References: <20240709061756.56347-1-clement.mathieu--drif@eviden.com> In-Reply-To: <20240709061756.56347-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_|DU0PR07MB8466:EE_ x-ms-office365-filtering-correlation-id: ee56422e-ddcc-4e86-4998-08dc9fdee621 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?pNWDXlK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dBBYN0O89OakiCQzu4KTvbmft?= =?utf-8?q?IzOEqQdhhimL63wg0Sn8kltz/ScZsTr7Q1+KIO6d9XXSlM52Q1UJ8PotD/FTbvdZu?= =?utf-8?q?VVAJS85XqimsGZ198bayBaCGBxns3kXOghxIs/W4T4/sx8SoOmTvUMilLNJJ2uQE7?= =?utf-8?q?qIe1XEegk81gXOD5NZuH9lriCtAEXKVL66wsJ9ZafgrEH9/7zc0N3456MSKN+3dye?= =?utf-8?q?wiKkFUbN2/NkMNldxPadcDItA7/tbLIXhgb/s2+iSEJKT+7BFVr6EW2Dhwu3+aCr3?= =?utf-8?q?r3LAt2Dmn/B91NOzb6hwSq2l+PfiL0t4e5GXMky/beehkaysGTjpw32thmrOyeI+l?= =?utf-8?q?1BNL13nklGkvquxS88Y3pLt/ttsS6F83/MDYZCrrFS8r2/d7aTKDDe3pLGsNO3fMD?= =?utf-8?q?Fdiuk0VkVsS7qkfKgGhgjJ4qhXi/KuLuSBLKQcf13Tg30bXNKR8LKIJbIaS4bvUmL?= =?utf-8?q?C3DnwlpVyiyilxncnqztJxy7txQK0LQf2A=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?wSvL4ijWDG+XN5PUE6rR8VCyd2UF?= =?utf-8?q?6yOdaoanbXK7vtMGXLaOKxvaSMRA5FxqHweLcqEDb1eHd01P8cTde0Nn22t0M/Fsq?= =?utf-8?q?iYs6RARiOCYHXvzO5n0eMujndshxB2LwVfQSx809bEczWGdcPqNTJfZRwZCKKXL1x?= =?utf-8?q?ANMUZhihpbLOFH6cLB15VBqpikNTZ8J3CwE0oWs3nIJT7fCM50ux03EtMQtLLog9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W0H31d9a?= =?utf-8?q?fnNkQWj6v9TIFH4u8WW09Xr46iWt/xrTaHqq0cxxVz8l70G+6x3vF26sdclaW0xDs?= =?utf-8?q?tSOQaVnq4rdMd18Dbze6J0OFjzzc9ABckWigtcnHQKcSp6PTJbUjDCAePoMZ2i5VY?= =?utf-8?q?3Zjbcop6Ix2H9XukkTcKRcASyhWVBgHYqz2JY+xBa5Ga0UygvBJxddRB7z/WGJxNZ?= =?utf-8?q?miMiYm9AZZo3s41+tW2LknomZV7OK9kPAcMr60BsIDSOejL2P/gpjBrkqgg/+rRuk?= =?utf-8?q?l1BpuoUE2vpp63s30WKl4f51hHshhXd7nEpxfeDOlCB0ueNv/xzh9wa6wDLWnpaY5?= =?utf-8?q?Pu/hvhiUNbuyfOFwWofW1l80/o6/HmDN6kvG2pf/OMMobt0bMorCGVYCPx32gK0n0?= =?utf-8?q?EVjVLBlb0hYLjhD4mD7CI27yn/s4pQO1a0JsDHs7M7v5JIaDnDVSKdkgXBLUIHTT4?= =?utf-8?q?XwTclvb5DQl65Eke1KBdh7VIc+t7lffjUOqNY+LcAxHrFkHhieKFnAE=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: ee56422e-ddcc-4e86-4998-08dc9fdee621 X-MS-Exchange-CrossTenant-originalarrivaltime: 09 Jul 2024 06:18:07.1829 (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: HB9AsLjF9b9QPhovnEWOyT+8s2SOl2+w2D6X4KUPL9CTJP47Mb2xJohQoq3UpE0HtEh/rYhiAy31bznWy02Ap39hWNpPbP6ZXfPGq4bVUMxuMWtpgmKfm7CM2pDIg4BN X-MS-Exchange-Transport-CrossTenantHeadersStamped: DU0PR07MB8466 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 constant must be unsigned, otherwise the two's complement overrides the other fields when a PASID is present. Fixes: 1b2b12376c8a ("intel-iommu: PASID support") Signed-off-by: Clément Mathieu--Drif Reviewed-by: Yi Liu Reviewed-by: Zhenzhong Duan Reviewed-by: Minwoo Im --- hw/i386/intel_iommu_internal.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/i386/intel_iommu_internal.h b/hw/i386/intel_iommu_internal.h index f8cf99bddf..cbc4030031 100644 --- a/hw/i386/intel_iommu_internal.h +++ b/hw/i386/intel_iommu_internal.h @@ -267,7 +267,7 @@ /* For the low 64-bit of 128-bit */ #define VTD_FRCD_FI(val) ((val) & ~0xfffULL) #define VTD_FRCD_PV(val) (((val) & 0xffffULL) << 40) -#define VTD_FRCD_PP(val) (((val) & 0x1) << 31) +#define VTD_FRCD_PP(val) (((val) & 0x1ULL) << 31) #define VTD_FRCD_IR_IDX(val) (((val) & 0xffffULL) << 48) /* DMA Remapping Fault Conditions */ From patchwork Tue Jul 9 06:18:07 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: 13727296 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 D40FEC2BD09 for ; Tue, 9 Jul 2024 06:19:41 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sR4BH-000101-7N; Tue, 09 Jul 2024 02:18: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 1sR4BE-0000uD-P8 for qemu-devel@nongnu.org; Tue, 09 Jul 2024 02:18:24 -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 1sR4BD-00080Y-1E for qemu-devel@nongnu.org; Tue, 09 Jul 2024 02:18:24 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=eviden.com; i=@eviden.com; q=dns/txt; s=mail; t=1720505901; x=1752041901; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-id:content-transfer-encoding: mime-version; bh=DyEyFJrO9lIOagX6ucF6+QC5h8iiBFYHP6dorlEqKw4=; b=nGmanSTIquY+HgDXraMykscT9F+Kpdu8rbRZ48K4ZwAP4Zie0qtXYp5k 8+gY5Gu/RQPg8M3u4/PavgUwNdMYmjOm6UAnVEm0D8uU6AlqqtXNJ/XV2 mM3PfO39dc+3rz6+t+IgABumKbAkjiYRzvMYxUzQ6SkVMkIZrLSKYQS/t VJqoeHjnPJ1tihjg3Jn3IHI/Gzh9naF0IQzquQ2oTzVIVzqErCRrcnM1z Tevkc2vR2ie1DOQArfPD6/Dvdls7iaMLUkOgUQkHrUAHeEdsuWmJtGBZS 1OHIPDeX1e95hcSPNqpIBgEi+f4xVecyhGt5jBOrgnyWgovyrznFxzGFp A==; X-IronPort-AV: E=Sophos;i="6.09,194,1716242400"; d="scan'208";a="16131807" X-MGA-submission: MDHOC8HKFkZaFW9W3CvsYY44beo3RaMb5aF3jvywPKbHCqUptO4+LpUuQxJvT2koVGpecNZKW2IX7ovQNfwtF/bL0vkcvvrrOqACiFmTpJ6Gc4Vs4rex3JlJlmDEPmFfHbasw48IrxSQLZD/Yohsazc1m8gidrc23/VhPJgVSdHiCg== Received: from mail-db8eur05lp2104.outbound.protection.outlook.com (HELO EUR05-DB8-obe.outbound.protection.outlook.com) ([104.47.17.104]) by smarthost3.eviden.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 09 Jul 2024 08:18:08 +0200 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=mHgMR27dUVp6cnBvEI8vPh+NNEIspQtnvOrGUWOAAIZrLLKWkN5u50OOOp1hCQLJtVHEP+58PCO77Y3+nqYIMJ8yyOURSaFQzF77Ab6mB4O23ATU16Evylny8XnHIQ/+HqzAsHVVJRJY0AVd5C4+OWyFnR6qLVxq2bwyt7BQ6O4P4jRezFNAElmRztw8RH8y1+PMaS81GrPuycLh6K/+Yi+ACpXnAWewxOhwGmBzQvo4+TckcA6uQn373Ls0k4ZKzF4GVjXR2UI7XcYfA82K8WQqVeZyXBvzJ6+xUXJTMHnWIVjLci9uz8OUVUYyxWrzO/pRopOJnBZhdEoc6rjpnw== 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=DyEyFJrO9lIOagX6ucF6+QC5h8iiBFYHP6dorlEqKw4=; b=ZKWhoAYXjLF0ESBW9ihEgHihAzWToktrrs7wJbmWMsvWRlGWmh86RqAnsPOlkxFml+PlnFGX1ufKla5r56nXlbj7lt3l4yinpvq1DHvSWv/0B6+AS2NNuJCqHsUuMthydta7hQfhqV7PU241g1wcGs/sMj2EdEAKVFll8cHSZyKZf4HEIkBi6Mq4SgQ0bVfu7x7Rm428DT5Edu5Ahj3fI9Q2/QCoQv53duyw3NJNvz0uIaxAR0eaHq5sxjS3nj6rgNyRhuNetSgnSn7hLKzdImhAmXYJmYn3mJDqy1i5x7Q/TlCXagna2CDfyyi6e0zASrUdpBCSAiaIKL0Kk9G9aw== 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=DyEyFJrO9lIOagX6ucF6+QC5h8iiBFYHP6dorlEqKw4=; b=VtKmnwTeXkKhobDSevVHcOH9C7Gl15p9W8sY0x0GW6yf3GdTggY9FUZeOmDJ0XZU5JiRHVFmKYXYTcApnBzoqFet/3z2LD7fqK3WtWRXuZgFyjHdvE+2oPUGpD28wRX1DBKJGIX5Z2N3ftK3rdPq0hcoKWAfzrMM6ZHTuE2Jx4mCkwIjjNx1W0Dau/Fck9urmidO2tuTC2ceRfP0f/PYIgZ4uGuZaYK0WiHfl6ubop48nPAGlI51mTMKz4i9MdPSMw0ITTUUydH8ox5pqSHpQcdyTPA+75OkZV92UTnyrl0vTMdkPxETKcaZbEo0iXqpJM6EY1wOr7tKZRtIZykbOA== Received: from AM8PR07MB7602.eurprd07.prod.outlook.com (2603:10a6:20b:24b::7) by DU0PR07MB8466.eurprd07.prod.outlook.com (2603:10a6:10:355::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 06:18:08 +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 06:18:08 +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 , Minwoo Im Subject: [PATCH v6 2/4] intel_iommu: move VTD_FRCD_PV and VTD_FRCD_PP declarations Thread-Topic: [PATCH v6 2/4] intel_iommu: move VTD_FRCD_PV and VTD_FRCD_PP declarations Thread-Index: AQHa0cfEhe7Ej2szhUytlU9cUcJt7Q== Date: Tue, 9 Jul 2024 06:18:07 +0000 Message-ID: <20240709061756.56347-3-clement.mathieu--drif@eviden.com> References: <20240709061756.56347-1-clement.mathieu--drif@eviden.com> In-Reply-To: <20240709061756.56347-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_|DU0PR07MB8466:EE_ x-ms-office365-filtering-correlation-id: 7d1c782e-b4f5-4236-11a8-08dc9fdee69d x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; ARA:13230040|366016|1800799024|376014|38070700018; x-microsoft-ant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FRbLLNgnxLmD+ntSxZ5iSPxpfRozai0htMkmZnIw7?= =?utf-8?q?U+MW14F+gDTR/3flPi7fpVgwY94zDWPqYlezqkr117lORrlpmLFzPYl6vOgFhpE1n?= =?utf-8?q?pZeD5+4+9N1UNaqNpgOZ7LfmYXrhdsu+PKbtW4zw/V6wdmv2S9MMs6DOR9AZNhu9k?= =?utf-8?q?iaY4dl99DVLdRgb6CLXL9ozvtVv4rCmSntdelETx9Xr+f6F0YSz6Vnse/u3ETtdKU?= =?utf-8?q?0DX6X5J+ORPDLZB/81qdowqxoQfDpxiHsM2v4+j7icd92AkLEd7RASWe7fKg6Pjbt?= =?utf-8?q?6IjW/E1l0/RX6Vy6cTRrH+ilbrjtIP8a1wRVmkcaH63u1ZK0CE4O34uA9kzRU3JoE?= =?utf-8?q?ZbetTEwOlyzBhbiT5iLdUqbsa5MlfyGEYGFB806XpnVgLQR/4JnNMASeVSvg5P5ur?= =?utf-8?q?TfCkLufyGI467vb06ZMuOLuoFxusuEn3CQPhsGw2v0kupCz0LffXroenXkedAUloh?= =?utf-8?q?Y8toy/bpQHiXt21iUXjPz5qxVu7P8SpiAQ=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?v2hpMOTLGCooRPwhXesE8lU1gsHI?= =?utf-8?q?YhncpyXToFVlNGt23dFP7b1rwn65cc+mVMW7/XYIzcxJqeshIME3rxOHDcqIRkN2i?= =?utf-8?q?nXHJiMuIqjiNjaV1iBu2DS7T/F9uPtDGtcQPudi1e7URojrbzBD3FrZcfSSktktXP?= =?utf-8?q?UsqRwmgulXshEGcW94QDzXhS0ZRjlTJBC093aH3WeIlUk2d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R+muYsGQExO?= =?utf-8?q?utDtAJr+FiCO+caSl3yj41WS0OtkYO3DNvLwlDBBaVWUbFU1TyR3qJe5VZnm5SRfx?= =?utf-8?q?Lk1g1yPtwtQoMZV36XjDlvuffUBTPKZWkHGrGeQOaPuyj8ppKBTT9Ch/MzPVqssUH?= =?utf-8?q?8pJR4Ca4KwzxWFFHBZzLkMxQBzycxN8nBqmuyX6mT4bsx5TVI5hmLT2+OY5cybjOq?= =?utf-8?q?4Tuo5+xAED/0QzFAxIr0NTD6YUzRHbx2KAAWF+NI9Grn0EbwTJ7w7ksUKGhWYd+0q?= =?utf-8?q?VEuUVA4zVCzc+IdqhRJ44DuCWe1gky/nV5fxIcEScaU5qLnNw4b0+P80JhlsBR5O3?= =?utf-8?q?ax7eBFWECIK+ZzMhZXAyDWMQNvdh4NVulKojCLhFavgNGmSZK7nwKS4Tw5OdVz/5X?= =?utf-8?q?qj+hGZPPNvatAthMVt2VBfJNQgTKoHjfSCOd3o4EteFoBpnwZExU8t4FMCFu28sYO?= =?utf-8?q?yLe0dMLwxlSY9NkayPx1I+1+5MuuFVOOxsY+9biFIv/4TTwGSGCnIKU=3D?= Content-ID: <7DDA7387EB6BCC4AAB7D7B3D52AA116D@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: 7d1c782e-b4f5-4236-11a8-08dc9fdee69d X-MS-Exchange-CrossTenant-originalarrivaltime: 09 Jul 2024 06:18:07.9971 (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: sUnFlVozi5rQl+Hem5AquM0chwdq417ie8vPnSqMqZ7B/Wui8vCeRCqyFOPhcnEvIz/kR2RuH2VY9qUQrsAmD03jGZXh8JY5+FDd7hUNv4gHZt9DD1b2Rq3qvlxMwY/U X-MS-Exchange-Transport-CrossTenantHeadersStamped: DU0PR07MB8466 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 These 2 macros are for high 64-bit of the FRCD registers. Declarations have to be moved accordingly. Signed-off-by: Clément Mathieu--Drif Reviewed-by: Minwoo Im Reviewed-by: Yi Liu --- hw/i386/intel_iommu_internal.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hw/i386/intel_iommu_internal.h b/hw/i386/intel_iommu_internal.h index cbc4030031..faea23e8d6 100644 --- a/hw/i386/intel_iommu_internal.h +++ b/hw/i386/intel_iommu_internal.h @@ -264,10 +264,10 @@ #define VTD_FRCD_FR(val) (((val) & 0xffULL) << 32) #define VTD_FRCD_SID_MASK 0xffffULL #define VTD_FRCD_SID(val) ((val) & VTD_FRCD_SID_MASK) -/* For the low 64-bit of 128-bit */ -#define VTD_FRCD_FI(val) ((val) & ~0xfffULL) #define VTD_FRCD_PV(val) (((val) & 0xffffULL) << 40) #define VTD_FRCD_PP(val) (((val) & 0x1ULL) << 31) +/* For the low 64-bit of 128-bit */ +#define VTD_FRCD_FI(val) ((val) & ~0xfffULL) #define VTD_FRCD_IR_IDX(val) (((val) & 0xffffULL) << 48) /* DMA Remapping Fault Conditions */ From patchwork Tue Jul 9 06:18:09 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: 13727295 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 DEDB7C2BD09 for ; Tue, 9 Jul 2024 06:19:14 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sR4BC-0000is-2T; Tue, 09 Jul 2024 02:18:22 -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 1sR4B8-0000gl-1d for qemu-devel@nongnu.org; Tue, 09 Jul 2024 02:18:18 -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 1sR4B4-00080V-6v for qemu-devel@nongnu.org; Tue, 09 Jul 2024 02:18:16 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=eviden.com; i=@eviden.com; q=dns/txt; s=mail; t=1720505894; x=1752041894; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-id:content-transfer-encoding: mime-version; bh=G2NEi8NswOhG6gPA68L8MYt7Ej/ubgwv0BLN5se4lzM=; b=juEYZr9I3mBKfqOWSrHKzLImIzTvDe1FM7ZO3tNHq2pXCsjjYBDxYVZM nNzbRIWJ99+m5TfCWnShrRPtK962k92FiLUyQAajUkFBHIHRigFCewLqX cREahPQxEpri16zJN2colvRpq7BehHf/nHlFduROBrpTg9pBzMqEcsTjv OmOevlw+xckXno/4z0yAKwzt5GR6OcHxAFNuLdrteK2/PomaAZdbJulcX qNX63uxzJeJHvH5vVkGdHU42Dp/lKidbYaIHE371Cfmu/MI34jK525Kl5 ol9/o68kJ+n/L7+3cbfHMnRpD8VnYImNQXUr9T/tKNjGWgyQafwO75nKy Q==; X-IronPort-AV: E=Sophos;i="6.09,194,1716242400"; d="scan'208";a="16237747" X-MGA-submission: MDG1AIf74Eo8cWCLJ70YioV9EfY0HnGQeKCH34zBqaG0aoM5+gIjvtu3QeT1jx3ilcRv0qo8y3OF1jCw6/23LCy+Y+2vdmNRpXbUJ5+Scq4udwkSqIw7LLgOnFkS7aDHcLCrJemKv253M7+Q6dz/6G3b3ZwwStrjLicr0+URBB+jLw== 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; 09 Jul 2024 08:18:10 +0200 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=wDnTm5BHBjuFr74LuKEDCVCosPFmIZ062xoeSGmPrbFwGuQtCuhnSUTjbmUP92bg9wMPVm9UC3CtqtDKHHXOFQCuBmRC7lSyHuqxfP25NJq/ipr5g22V9VZ2pt2kNxIK0/Etbj1VXj9Z82ChwX6+5KubgYmakQo2GMDtcIp7DqtqsjK751uVsdGgtzrcl1qqnrm60JGkruaQLrRl2zVRVukyB+gapd/WSXAqKbnx1YXXC19Rx+Rfml2cTtTMqF+Vq21TkO1Lg8CXJqgctR14UqOIsTuvhamPOuqiwfIoVBagvZLNPE/3uUbgC89LzilrIkMcYd4jC0dr73Bez2MtgQ== 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=G2NEi8NswOhG6gPA68L8MYt7Ej/ubgwv0BLN5se4lzM=; b=MUY1U6O8mtIKiPxyLYbTWx+siPJB7nwih+7/sIaBF+TviSqLXL8QWkGcs+vNYTGEpyffktY6dVBSB9v+HKUHKS7YqdoppHF13OOpZ+KO1FuFbODObCp/KfglO2YO8OYG0vzaU1nDl87nmoKckXuexrigT1IClsVIA12RVQGB2/RJgTrVxoBOQVMUbDCFXzrk/LmcrpQMRHS6kQ5wO8EhrEn9v9oowa5ioDJFGpqE2a4CZrkFJzdOCfqt5j2MNO9gc+7ZCYvZ84mJnXl7Oets39P45/uTGDFGMk6ppRCSP7AkE97aC7Xiy5mPG88aAk4YfXzS7PKkm4ySyQiijYFCTg== 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=G2NEi8NswOhG6gPA68L8MYt7Ej/ubgwv0BLN5se4lzM=; b=kevPtlBhRD7jjJ3ZC04vXXC39x/BDw52e79Q28S840M3U+mNi0badzvu+igEgJi3Bj3gyQZiqpeU29YYi5Lpf5Oxv+A6Yczm/yO51M0nU5JU7o4fmimd6MwgFvC1KcMjWSKG/zBMAeDCm51jYti6SCQUpmUKh/kmJeffD+3qTQkBS66Kh9qSsKSXYrIy/N2Ja7Sa8sJxRoYB6xoFX7PuzCMw9A8FMivvLq/EPEbIHPf4u4kX1FUqPcBUG7mOkgXdZQoXQ6Ie7EDQK93dHe38wiLXtGaJOmqmCWI9vZPxnhRu5V7OYaSHRS/jJ4GnvGXMxMAoiAAnhF7dy/PL7Mw/4w== Received: from AM8PR07MB7602.eurprd07.prod.outlook.com (2603:10a6:20b:24b::7) by DU0PR07MB8466.eurprd07.prod.outlook.com (2603:10a6:10:355::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 06:18:09 +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 06:18:09 +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 , Minwoo Im Subject: [PATCH v6 3/4] intel_iommu: fix type of the mask field in VTDIOTLBPageInvInfo Thread-Topic: [PATCH v6 3/4] intel_iommu: fix type of the mask field in VTDIOTLBPageInvInfo Thread-Index: AQHa0cfEukGxrC/dLUmtiYAPj/jVWw== Date: Tue, 9 Jul 2024 06:18:09 +0000 Message-ID: <20240709061756.56347-4-clement.mathieu--drif@eviden.com> References: <20240709061756.56347-1-clement.mathieu--drif@eviden.com> In-Reply-To: <20240709061756.56347-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_|DU0PR07MB8466:EE_ x-ms-office365-filtering-correlation-id: b7912557-9922-4d7c-e4fd-08dc9fdee76e 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?QThoiviWl4R9keqA1VP5Ou4gW1R544A?= =?utf-8?q?Xf7uVGCEFSTsUrzNswJmYpKGxOhtd/PDwJBywyMYjafYxDff4M5aOjcZyk2QldCZa?= =?utf-8?q?cYjxsaXxda/2UcuP9xch0CisdQLYsmcrqMbZN89frOmrLZkwcAeYMHIqA0x8Fz9sn?= =?utf-8?q?azMRfX3HVLjSnz86kCwVcEe3f5mXrBUnUDWnOIJ+XqHivcoINB3J/vaWTpUPEpV3d?= =?utf-8?q?UhzvpFaCSa1mTQdwgFRjNk5LHpNPYpsbXVHjKfT2TWGcLM2Vo1k9xCHQ8dxl3HuEe?= =?utf-8?q?EqEcWZRKKjqgKP+znCmjN4a0KMLeFfn2/84JUbtFpmkiWqJq9F9ixkZuCNNRx0t8i?= =?utf-8?q?uPUJOEP2/3X6HSq6J/eNX1QHFloBOuo//qbyhpU9+2d8stWPfJQqE5+yWKNQ2SsBP?= =?utf-8?q?Wilxb1J/mC2YUL+YneVWJFS7x0YCiwwwvoNvVOS73GTkiiW/FKQ5sFmW3RXNS0m3a?= =?utf-8?q?8PzhYjbn9YaWUqcLK+mqpHCdU3G7KYyphp5TtYIY4xMCrhcLevQclfyLbcwAZZg1C?= =?utf-8?q?ca39IVvYAnhaGjXzfFrJIqD2KdmG/p5tu4yoPeF9IjVPEypYbhoC7gieXc8PWIs63?= =?utf-8?q?OZc4KKgasdv2flkneAw8/SIcC6lr6HA3KQkNga42LTHbGFtBc+AKoODvzavGgC+Hv?= =?utf-8?q?Voh0Kpc7gViwvR9TwzPb9onfJebNsfVK3TTNLIWMFWII5L+3F0Zw7dEA74ywlLEyC?= =?utf-8?q?VzJ9AnhbcySkwYRA/ArouJbxjnHO+E8ZHg2Wh3tm6GXwJQYsiWc8uT7bo60JY3Wv7?= =?utf-8?q?EE5rxVR77m/vY3rCJzXtfZoNiI6QG3cxZ3y8UdjX/7Lokj8mQNKVJnzKQQxx62GS0?= =?utf-8?q?BDcnoQaz7PwfJm8cnlUOVLc0huQgxFvZmLW9RUKtSnYtTZYpTYI+50p47m9GlWX1F?= =?utf-8?q?EhSj5cWN4Iatp3PGTbwgfp9jq02z17lnB57+a8jexEls9DPTybeDHhoaYvDaWwLh9?= =?utf-8?q?nrpVj1LvdWQpYHUJYG1lTvrEUp5TjkO6giQ6uuOneSwcF1caI1KvrrVJgXH7ey4cI?= =?utf-8?q?4pB7UISmAw93c+M4KYRsqHb5AB8g1XgY+0P+tCy/C3cfR1Jjd6FrVsjTcGZFQlo8z?= =?utf-8?q?+eFTyAq/LqBX0Zn0Cdu6iTKmJubwLymgdTb2TjqsTdbuIVNsVFk1UBOfcN8mz5Ty3?= =?utf-8?q?Oudi6I97g1uFEzpzhuwf2cKy97U+TxVaai3N3aF0kvOa0W0A1B0MoPEjfMN1x+Qsu?= =?utf-8?q?9g7cdru8hZydJkykvVvoe8IfvQezrO7cipPGKXdvnQSbeS8jDqHtCtC6awDIAKMVn?= =?utf-8?q?ab8AzkiVer6t+aL8kPxb0bhqfKPmdSwGQVdy3yCZ995S1nsUzmJ2aNVEUkU4y4rf7?= =?utf-8?q?0Ld4lIGBiM7ZzH4HjB/m9+c8/S+H4zRKwA=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?sqwMKw3dg6nyMtOrztgAWzgaKlcU?= =?utf-8?q?7LfD1zjwOuU9gSdRsEC9/p6Efs99TsV0RT9y0elVSKxb9xEqjJazOrV85sYC5Rrsv?= =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8?q?52UGa26D9F4slH/0Jg22mh2yyspzEOmumjbikgEOxnsnlPmd1wfdNlVM9zLDNUQTf?= =?utf-8?q?03abDtSJsFPnJ37YOqt50tl6TbFK6kDD/LJiyfsW55kxt8Ht4rZdDVVQ8CrbDQRbS?= =?utf-8?q?Tw/ykX3ZQb+L6LfggElEptU9s4DkMFegAMjWS61iCB8QA3SUJb4rm8OMIXex+i15z?= =?utf-8?q?fhXKl+M+XCYcsZaJfbRkaOvqthqWzmX0ZLsi0NAxt2j4FMiAwRGJAvF/zsAWBu6P7?= =?utf-8?q?1IUhT3S1amC6RFM2NdKoSr4vEOeFaoo0k7/wK17KvElzPTrdMXocXLtbSzjFUfTqE?= =?utf-8?q?VZjww1yPUev8fLzFVfHMtky3dgu7g6kllvE+b1E0eonclmUexE2CBbqtBVmJ+Nv1g?= =?utf-8?q?POc6KMdHXua2E3pXIYd8oLHCU44Fu3D64tZpF+ydshILoz0An2q8YptAMx9j+Ztxp?= =?utf-8?q?VvRRBq6OCAhTfN4egevPn2dMCFVtf9pDvrOnw+9uFlOcq2VZYlKp3GW3YSgJeQh93?= =?utf-8?q?WtL+fuaGwu8PaTZ3la+vYICWKvSD6/Z39Bx743PW+t+ws+wguOD3cMWNp8yGwjWLv?= =?utf-8?q?g0ASbCimJjcRpa8oGnFKlvrAL9ze4cSr3O55kvigRBx0QqDvkFVPUeY=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: b7912557-9922-4d7c-e4fd-08dc9fdee76e X-MS-Exchange-CrossTenant-originalarrivaltime: 09 Jul 2024 06:18:09.3790 (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: sj3V35/kuJoXfeGYQMzDcWfOWKYu/55hogeO79ZpNuBNHxkqGmtraVh2pPKF74zoyIVHrCq3vIZQLRpZFG/9pH3wVFoOdBGjry3GsmgqNOYNWtBr6AjnzWmXtqkONQ8T X-MS-Exchange-Transport-CrossTenantHeadersStamped: DU0PR07MB8466 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, RCVD_IN_MSPIKE_H2=-0.001, 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 mask we are trying to store into VTDIOTLBPageInvInfo.mask might not fit in an uint8_t. Use uint64_t to avoid overflows. Per the below code, it can overflow as am can be larger than 8 according to the CH 6.5.2.3 IOTLB Invalidate. And you may want a fix tag as well. info.mask = ~((1 << am) - 1); CH 6.5.2.3 IOTLB Invalidate Address Mask (AM): For page-selective-within-domain invalidations, the Address Mask specifies the number of low order bits of the ADDR field that must be masked for the invalidation operation. This field enables software to request invalidation of contiguous mappings for size-aligned regions. Refer to Table 19 for encodings of this field. When invalidating a large-page translation, software must use the appropriate Address Mask value (0 for 4KByte page, 9 for 2-MByte page, and 18 for 1-GByte page). Hardware implementations report the maximum supported address mask value through the Capability register. Fixes: b5a280c00840 ("intel-iommu: add IOTLB using hash table") Signed-off-by: Clément Mathieu--Drif Reviewed-by: Minwoo Im Reviewed-by: Yi Liu --- hw/i386/intel_iommu_internal.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/i386/intel_iommu_internal.h b/hw/i386/intel_iommu_internal.h index faea23e8d6..5f32c36943 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; From patchwork Tue Jul 9 06:18: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: 13727298 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 AB1C3C3DA41 for ; Tue, 9 Jul 2024 06:19:43 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sR4BL-0001Je-BZ; Tue, 09 Jul 2024 02:18:31 -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 1sR4BG-00012v-Tg for qemu-devel@nongnu.org; Tue, 09 Jul 2024 02:18:26 -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 1sR4BF-00080Y-4a for qemu-devel@nongnu.org; Tue, 09 Jul 2024 02:18:26 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=eviden.com; i=@eviden.com; q=dns/txt; s=mail; t=1720505903; x=1752041903; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-id:content-transfer-encoding: mime-version; bh=HE1nSNC+fM1pwokpWi9++/4rNMhNj9V1sCadInCpIzU=; b=A3BCthzvdCG/mtTL7uANeJ6zQF59Z1kvbEhkW21BjgqqfYtZ2CAig3f+ SZhT34fvlu6dyrooK4YvTY3DJ0dqT7ScWWhujYsJBhqDuaKr2hEtax8+G 6j3Cfk/HxMhAcSd2z7+l44Op5/Ja+OcNVdAnbtxj+H76ZEfmNCAQKNZcI UbDZHq1fQsEvonqu5QQQKMfcAVwiakOSBSyB39WdD7QKLouZ6HuytQQRd aoewIzry36AH8rnu18LCZ3xGuCevfnaQO7gezPXHvPohjLmPeWTUU2RIQ wGwheL03igXWvqfWaomLQljZhrEddaMxvTX/i7KkEjdp8awOxk+nsUhc7 A==; X-IronPort-AV: E=Sophos;i="6.09,194,1716242400"; d="scan'208";a="16131809" X-MGA-submission: MDFPZS5j2/q+i0Z6tBPGe6dM047gGEYsauk+J7SOTqw/NvwQbwUNzdyFOIYyhLWf1gP0slLarfvlG6e2nZxAJm/kiTRs2gQ99JW78/X8EjQf9Vl7csZj6Yv6PxDzHqhCLvfxT+1Ai2lbxSI28HMFn375z0HI1tsWNdSsUP+QZICWug== Received: from mail-am6eur05lp2111.outbound.protection.outlook.com (HELO EUR05-AM6-obe.outbound.protection.outlook.com) ([104.47.18.111]) by smarthost3.eviden.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 09 Jul 2024 08:18:10 +0200 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=XoaAnCsJAc1ijvhu0vedsf6bnw8M1WeMx8Ny1odvho+FnklAfqjKUUY89wU/TnMWUDkXm+7uZwRyeGM2KudVufpDMX9EXGiL5RRLbgqTn4vqso5fl0PfgO2DC3Zq/bev9udrdT8yZNSjR67mc89cwN7uxafzv2TP3iO3a2kUkY5t0XGzksGeLskUU2YCmRw6u7CwumJPLtfsrWhMMm+n5gI8VkTlfxyJunvx7IF8CNhFvcugNG3iM9Zsb/7M1xH3NrSXZvVRyw2JkeZVy16HBIsEDrEV0lxlHZSiEjkN8rEydi11bqmn2ua9aJ+jAy0E6DUsRfkH52G2/cXV4LiMDQ== 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=CQRAwL7BErkAgM1Val4m7HlAVwfwEJ+O6DVXegGpUD+dVcyuAQsrS94IV0fKEhaP2NUgXCw8iQbQ50xxfMcJ3DiaxqmpptQLnSBrVcnfDPLrq13fcL2nnB5d3XElCOo5D2K1y2ua/Oa5X8Ztc95Ld4bqdbGSI+ZYymE1eBeYFJdzJ6w79Zo+iR+y8K/oh8vgQZSG9I+ja0uYsemreuFzUwS1OcZznLD87X3FWwDzYYXAUTp0MjrdLHPPD9CAxb+JbQPAvfxlVdiSbsR1o1XkiJI7J7EBafyyOuSHk65undO8tmog8EyQ0i4TAUA/TjVNoOIY+DGHFVX854hnHRc4Mg== 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=Zq7z9rHYulOPP1zJVJxfq7l4JqhmgBnH+M6iPgJ3ptsdHy/JpyCo+1Fb26GR2scEGIsOXMMyOYQoOSDFqAULeWAvrhPHftOSTiPSgfn+wyLu15mKfmd8spJlnXn45jSY2WGPAY47vwd8xG88/8CGXZlpiomWwqS/n7ESw1fY5k9mt6TgBgXluXvEF84atXHEtksFQItPVOrcIrzdyWVgA+Zvo1UjVbl4/XrzprmkS2bJ9+CHk3ZZ/Kc8yGg5UnxdiYIgidpA8wlcYu7wQV6shPMX1UwTxrB4pOVPFhsTuDoChTknqv240lpBZ95ru6znKemKlMBm/64AZUbh/vKiXw== Received: from AM8PR07MB7602.eurprd07.prod.outlook.com (2603:10a6:20b:24b::7) by DU0PR07MB9289.eurprd07.prod.outlook.com (2603:10a6:10:44f::16) 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 06:18:10 +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 06:18: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 v6 4/4] intel_iommu: make type match Thread-Topic: [PATCH v6 4/4] intel_iommu: make type match Thread-Index: AQHa0cfF5MXBfjhIO0OC3hgSPePY0A== Date: Tue, 9 Jul 2024 06:18:10 +0000 Message-ID: <20240709061756.56347-5-clement.mathieu--drif@eviden.com> References: <20240709061756.56347-1-clement.mathieu--drif@eviden.com> In-Reply-To: <20240709061756.56347-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_|DU0PR07MB9289:EE_ x-ms-office365-filtering-correlation-id: 27cd22fb-811e-4793-cad5-08dc9fdee7d7 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?Bd1X//S1xmPGBBLR3Z5tOYumLfXAOUn?= =?utf-8?q?yCw0vIJzFcvnpaDETkWzGJVvk0Te9/JyDAT7V4rDwpnYHiCPTmYjyWbUpEIHYjjFf?= =?utf-8?q?22TTYsi+CzZmyhFiSKKVBeMZSysBeYKw7r4UPWgwIuaYCLOFeLxkxwRa73WLHBej8?= =?utf-8?q?ZYthgX85tNLjXTvl8q7EHVS9xKZTtxwA2dDAY/RjXbidZA1qLehIv2D8OHRy6Hkwb?= =?utf-8?q?TJDGxPPth6n2VnobksT8E6eexSJT4F9Bf7w19lUZDIhkBtSJSGFeCJLL+MZl2Hk8k?= =?utf-8?q?4Gg/g23Geh2ZLuAbHYENpNsu3t+I7094Uy3tanZmrul/sI6MD77HA9zAUySN5UlPH?= =?utf-8?q?jqNV4xNV9RgZAgc3k6y2JQ4gX17XmxE8t4HRADswt+2vsCquJbciP6cBMxZd8ou31?= =?utf-8?q?sftdWd5lHLvCPwQS4IXWUA++gveZNnzFi6E9agz6TMFJW9mY4rD68eiREJHb6H8S0?= =?utf-8?q?8gaMo6oTEU/BYbVjdb6jpKyQlDSlWsGTkBDlER4474ey/QhFkrSi+MsFfuD1IwJ0d?= =?utf-8?q?FfugMlBuw2XbP+PM9zd/E/yVTz0D56zZMCyCWUnL8AxIBzTeomG0q4wC5oTloq6Pw?= =?utf-8?q?JiZk1dpowY1fvTEjgtERfaN8lljZylg/nQzle7EZlSkzsaTanGA5WOghoYy8Krk0O?= =?utf-8?q?AHqqkSOmlXQWtybD72e+pRfRs/pVBUtEwm0K1KEC2C4IlI24eqrMPueX0AMJPkNlu?= =?utf-8?q?9Or+mTFWGovX3CBZQI+9DZ4RdhfvzJ+Hh+FJRNLvb/Rhx8lgsKQPjAEU6nGd77yx3?= =?utf-8?q?25x2yaRBq+JkDP9Ncn0Z84tyoblKLWDWPTjQJ+3+fHqaL4cJE7XraOqX5dkIBFeZU?= =?utf-8?q?tr9FJ1/e/Cxd7iCSHHnGnj/T8Ds5CMizfoE9Mi+v/FZKSHDi/c60WYWnc4D8hPXBa?= =?utf-8?q?QeJ11rPX8bkeJuUmN6lFyV+zy9jj9SW8RxGeB34W8VdUEpF/U3U+DL2/J2AdnsmJH?= =?utf-8?q?ienvO3ZOAeUMJBBMQcWXR8jOYG2mcBfKuY9TC4/Y3xrsh0tifecXG5EdZYKDini0g?= =?utf-8?q?tlcG3s4+nXov3mMRa7ZK3ua9ZT0VWTg4NdZCvFGZAQ5Dayj59huMdl6Tx2AH8cm78?= =?utf-8?q?/z1h3BEFMdMyWA8xGGYanoBSnCJjQJtXRKY1TPOrNagK53z77f0AIechn0We0i7XO?= =?utf-8?q?KZT9CRtwj1lbSORTKaELWOKbFXQNBKaEUyNFkwNDcZdd2cfHFguUzEJgnU8gTBc7c?= =?utf-8?q?ciUDKepNNGDEj1NqqTEmK/GWiRRkFG3OgtQS6UO7sQJti5JpS1kFrqEjrQ296wKy5?= =?utf-8?q?B82bCTMSqKbgqBwWV75+oRYEwRSq3UNBG9cFi776PdaxQ5E8Fd3j+EGX5CLA5p7EQ?= =?utf-8?q?F6ne4jdCsBWBJmU1HcBF4kDbXcTiLhecwA=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:OU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DTZzuncO8v8BbcASDRMFtFOpv5plxG?= =?utf-8?q?jwgJoV1cdzSv4nl9QRTnmcz1vJicgOZuv3d3t2tXoW7M2b+Emf4B8pwHA0h+2DxIm?= =?utf-8?q?iwnAUp8rKkYqx51LnaR8/ONWFOtx3Z6dbRM38Vt71DDapoVq86o4wgCObEQ2VxcZO?= =?utf-8?q?mJG7d6yRaOEIBl2RHZc7gR8XjGI10MKz553P8twvaCQJH99f/HOooCBMNEaNLkRVG?= =?utf-8?q?60yzTKC7ftx+9PR2BjjZOs/XoO+dZe5iQGyXNC1xTyaxzI8/9jUoUelufgIKR2vay?= =?utf-8?q?xnuyNUDk7uze/ypbJa94+tUEacCI7S8LfgWI16/tBUV0pVkK/lRdCjnMoazJuBjkt?= =?utf-8?q?s/XhwpOzWFnKPXBNm5RjO5hUwuwALYbk9UXMW/6QkwLscY+Bc8cON2P4TAIxWMcLD?= =?utf-8?q?yBq88TcDmKAIeGiCq/plxByF8UbE3aQNaof9LTi5D9vMg4pcTfAFgEA7l5onIlGrj?= =?utf-8?q?ESPnylFjZqniS7ddmJUnbE+n+8TlDFC+GSy8aCZRhTCTddr2ZnMY/S85LQAi24jlp?= =?utf-8?q?Y7g13i/hv0M3tYsakSIaHJ+O5Ef5jBgG1OODc6fdbA4l500m+roce1KkQfBf1nwf0?= =?utf-8?q?s2XHZnxdyw3IDrzNjPc69mzl4gPrWkMp7w9ZlxsIK6lmmkDoT5I88MfIw3P36ezSU?= =?utf-8?q?ksxtrDtd1moG49+zywHJVIOgmJEo87z/J6KxXx/PWrLPdE0mnbt4ck30nJTIkMG+S?= =?utf-8?q?XNzZcz5kvpbu5W0J0bLwWKkCsaUwQ80ygE5NpsrQylNgAK52DaXpznU=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: 27cd22fb-811e-4793-cad5-08dc9fdee7d7 X-MS-Exchange-CrossTenant-originalarrivaltime: 09 Jul 2024 06:18:10.0764 (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: dPcv0/PFd4XEMh0678dBJwmGAT7kEkY9M2WPek0roMrINYT85jjAPA2clr9Ed8Oe48BfYI2HIMvBECgIERh5Go/qt0U4SBkOYgqwMDcZHlybQmZ3enco7mK121Vd4auH X-MS-Exchange-Transport-CrossTenantHeadersStamped: DU0PR07MB9289 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);