From patchwork Mon Jul 8 11:39:53 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: 13726439 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 60C79C41513 for ; Mon, 8 Jul 2024 11:40:57 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sQmj0-0003oo-DD; Mon, 08 Jul 2024 07:40:07 -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 1sQmix-0003nV-EM for qemu-devel@nongnu.org; Mon, 08 Jul 2024 07:40:03 -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 1sQmit-0007rq-K3 for qemu-devel@nongnu.org; Mon, 08 Jul 2024 07:40:02 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=eviden.com; i=@eviden.com; q=dns/txt; s=mail; t=1720438799; x=1751974799; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-id:content-transfer-encoding: mime-version; bh=r6WyKd+WY8Yb8bDrXxdIwpfjKQeRsih/fOFlu4WzvwU=; b=qbGaApfJ7F2IUdapF/afKdAMAlhjXLPIOUxburs0WE08uRJJxjGOcQMH C0eTt0S6KqvYWR6seBKza7P30exJCSu6pY6/Agl62MWtEGnShvza6Xvnc NKpkfiH8Jsid70zmCImVpJDHdW30E+wInYIeuBEB6dwJ8nyEE7js387BV YSGftpMR4QMy+yTKEliuPovOuY2xV/dhCa0LQEXasU/4+c9Pw6aTSegCq K4nIJEeSC9aVu4+fhAu3mdiE3dBz8l8MM8hvZXFcjIkJQ2eSgOvpTITnR /MK0Tl11jfmDw0ZkHLgnuFpp0mKc+YSvWN9yLTvKinWF9fdLBmZbkSw/C g==; X-IronPort-AV: E=Sophos;i="6.09,191,1716242400"; d="scan'208";a="16087895" X-MGA-submission: MDHO49zdhKfK930NtW0XntY4bGHTZPIK1dliWYanPiHFXuoQ7p9t9YRdHZ1d9HjeE6RSYDYl2e869Ir6f9t5jLl0bmoTAqnTZzhhaaBdiM43LOdtCmak5QfibcSzpxpwSJk1WcVr6+UJIZtaXDYpsqWICD8V9GtutYcak2EcKM5xSQ== Received: from mail-vi1eur03lp2108.outbound.protection.outlook.com (HELO EUR03-VI1-obe.outbound.protection.outlook.com) ([104.47.30.108]) by smarthost3.eviden.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 Jul 2024 13:39:54 +0200 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=b4veTFFRx8snHcZERsc2zU72CsC98NljYB7l5qeAgElVhWu/GBHA3EaGpECW6rhf9OfPOe0ORaH3mM0i4NbRHv/0uavMNSIHfzXs2PaXeWZDHGF3u07PMFcEYmrUBslwIoSefd1aU2UAVorAXxz3Lk16MDpRnv6ObEDYBwpu2V66gdB1XcqVwGfpFrgpRB2LgfxUFaznaXjPykcVf9u7flsmoQnrbCZZ4mnJ6+F0996NO5IVWg/91zM3pLVgiMzlVD8YutED7y/fcClF6oJ/uQzqOnVCvMXX4el3qCk0lqYy4EtGdOqB0rcg5gtfriKMQF9kSEwuhMpPiKzBsB1HBQ== 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=r6WyKd+WY8Yb8bDrXxdIwpfjKQeRsih/fOFlu4WzvwU=; b=C2PFX7v4rRLWAMIrbCidmIe7vWviqW/dnqWCBl7xMSWAzH5qhUNzGs4jqlMXemad9qLEtZ/HZl83XZy4bZrrYu6FTSd8j1Xoij3I7iHdpLOK2FE/lb6/AAldyZGZhCfH4kwrYmjs1uUTdoz0LdiD1w5hkt6XXG7m08Yi/gA43alr8HcBz0Vlom6ZyHESiD/NVClshTyqoxoecu9sc8iJoE0Sg97veYdfbz5OzGjdwA1ssGXMN76PNBDvU8G8Ae3R3h+z7jSmrEoO8Uam5r+yb64ZQrTQm/XWa4NTJKQ79FAf0+TiL1A8TlBzv0ROY3ZPylG7mNdldVxIuYk3YIOl8Q== 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=r6WyKd+WY8Yb8bDrXxdIwpfjKQeRsih/fOFlu4WzvwU=; b=Sl/cNpPu5ERGQWyCt/eg+G8itJINTpBchczINaJ6o+BAJC3JJvTaPHm8Nk+RpbTegbzY05mCpnKOrqNR8slO2hxXov9Q+Bx5COCK52Pp36gdNPPUapz4IPyOc+4dyNJ12X5BJ/yDsiKSBjQECpuy2pQZ6B3kM56+Ba7X+LgTv4YRQYcke+fPPvRt/FrKqUOMNmnSPIQ4MBuiqew94Dx6BW7i0HS05IKP/+6dJbLNwyQip7suH4pChV5SC64kJjAGeSUFPxOb8YQ7hZqX6J/nMqHy1MdpddzxcgWvdnilvIpydzgZFK9QmkJ1dcqiCkXDYki9mlCFIEt8LalJXFVKoQ== Received: from AM8PR07MB7602.eurprd07.prod.outlook.com (2603:10a6:20b:24b::7) by AS8PR07MB7400.eurprd07.prod.outlook.com (2603:10a6:20b:2a4::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7762.18; Mon, 8 Jul 2024 11:39:53 +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; Mon, 8 Jul 2024 11:39:53 +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 v5 1/4] intel_iommu: fix FRCD construction macro Thread-Topic: [PATCH v5 1/4] intel_iommu: fix FRCD construction macro Thread-Index: AQHa0SuMWtlLXh0D9UKhcXu+XOoyDQ== Date: Mon, 8 Jul 2024 11:39:53 +0000 Message-ID: <20240708113908.19535-2-clement.mathieu--drif@eviden.com> References: <20240708113908.19535-1-clement.mathieu--drif@eviden.com> In-Reply-To: <20240708113908.19535-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_|AS8PR07MB7400:EE_ x-ms-office365-filtering-correlation-id: b3df6517-c334-43fc-068c-08dc9f42aee5 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?49L8sPQCp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yy?= =?utf-8?q?YHhBaNWoZM8gViKToqTqHhHYe1/YPHoSbFpo5EYH8SKFcrBDIEEVxiEAH3eW8c0Ec?= =?utf-8?q?WhVaSvsdiDPjcJHL+dGd3dcc2DgN6uvGS/M4HWkzilRqLo5ofZ5jucgo1/6CYpfyY?= =?utf-8?q?MY03Tfp7eIJCl0cmR3mHuJ5fjG1J8KtZ6L/SsyXWEeyCkMwpZa7JEpSenyF5N3zsH?= =?utf-8?q?zqT2MepTNM9umW0CescCNJ6DmiNxir/rfyE/InvClJtlMMzj5CmT3Ov+8l1sED1Ir?= =?utf-8?q?oMpYtP/nRU2ps21iRQBlKayXTgJ8fUZNW6sk6sHDP2MKEBYMkVUvKRAw9aZ98/Ox8?= =?utf-8?q?34yvCPRethA81lvIZXULH5q04pWHV9/wuT9sqgbruBZP2yuDPyJ19diD6dzSzSiUl?= =?utf-8?q?qu0U3X1xiMvhtv3C7nLeHK7JJOkxLrGmvWTs3KbxctPVxeh9zT1QDItLJ/3+bWanX?= =?utf-8?q?KyfeUoiazAhZdjf0jGWMiZRtVdxpmPtF8A=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?zhGbGRbk7MA5YgQDDHZRuMAAGTq9?= =?utf-8?q?sMZ0mRs+SWNsOilwirkPcfrBQpnDOFnW7sny0YO10deJYOiEVnR7h6ijkFbKMKji6?= =?utf-8?q?3Wk8ZpvoTp+Rcth3q4rfVxsoivDDt4U1k5CVZ8U7D+OBn+trDwYC8/SPEnFBPPOYm?= =?utf-8?q?b2m5Li0KZNqLkuBUaFGGVFiKzYZXnJ7XLr14W+HRjduxK6lMEbpTTU4xDZ3kyf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Y9v+2g2w3JLUF3QMyrNocyk9o5bcTdBzShJTHxtJ7UCpoyeX53+WC8F9Gfdyq?= =?utf-8?q?mKNiW4OWgbtOorNqaAojbTxCjBdyma2EToN6VZcA3bzQYOPKanMu3pEsMdVuyyV/J?= =?utf-8?q?M/K9N+wxTU4yqtxub6+lI/w3KRjEt00arkTfkGARPeyGzC3hYy+tSMnNwNG5U37Xq?= =?utf-8?q?+r3/qtofgmgKmXpYMbperRsr0J1hvSnFud1QqJOd3dLjltXutCAiVyHpdb5zIlHJp?= =?utf-8?q?1refH3HxfDFoE4AmSPAUUDENuWoV3ZQfS2U2lNgXjTAO6Z7f53OhdwGqz4bFHo0o8?= =?utf-8?q?OazhZd1A5V53b5z/cs5pYkZwvjlr+/xoJbzUudXkJ5UaxS9EyJ5GrurU8lMTaFBb/?= =?utf-8?q?htaPzeBQTRv2Ksh4UVWnt3gBTP4gYXL2ULZRLctlao/Z+jDNAwo3dgZsqSEIsJPe4?= =?utf-8?q?Zm9AV7REmg1aAWBHw0lnhk28n0X36tZvkdhevU+nsilrttUjwwI+Hz4=3D?= Content-ID: <162AB7B83577174CA6EF253EDEC4126B@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: b3df6517-c334-43fc-068c-08dc9f42aee5 X-MS-Exchange-CrossTenant-originalarrivaltime: 08 Jul 2024 11:39:53.0448 (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: Kyt2hs+Q6PWEp/kvXty1ZlKf4JetkYh8bGmcSgqJ9qIIJxxK4chiH7g7X4lEAWP6C5EYbSYgrwKagKAya8DqTL+1nLgHLVBrTSCGdl7Ppq13deJu/aC8jWITn2qosSWp X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR07MB7400 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 Mon Jul 8 11:39:54 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: 13726441 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 A9A28C3271E for ; Mon, 8 Jul 2024 11:41:01 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sQmjN-0004Nu-Uh; Mon, 08 Jul 2024 07:40:30 -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 1sQmjB-000415-Tx for qemu-devel@nongnu.org; Mon, 08 Jul 2024 07:40:18 -0400 Received: from smarthost1.eviden.com ([80.78.11.82]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sQmj6-0007rr-5m for qemu-devel@nongnu.org; Mon, 08 Jul 2024 07:40:16 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=eviden.com; i=@eviden.com; q=dns/txt; s=mail; t=1720438812; x=1751974812; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-id:content-transfer-encoding: mime-version; bh=xQVM7ylMlGKzxRaBVpQZpqXD9KGA8oCWP93OVr5usyQ=; b=u8Hag+pJfDP/S2Ct+sjZKxXA53O7XU+0ATXpcvePhGgbc8eVnV/Flmyw mEhmVbVbm1rXKr+9BFnGWyDRMgvfGUArO3YXYi+SysWDtmJDFzLhiNkvO McTIRDVz2Ef8KbRHYZm8UGjcFf/VLkPkA8VvWso9dleszWn0f7YKf9JbC /T/VlIthuo/qd3opdETTP2tc04uHFdf8SO1ZGYDRlhbYjshD/3VtlFzNB f7YFdHriqFLp7BoxLLRA3Rsi3k6Xgt0UN210LVWuv3/t5rWRqrvqjVzTI G7VZJoshqSV9pk7tz6UXZ6ijhVGQ2l1iTTuoTiZyL500b5ztRs5eQ3JTv Q==; X-IronPort-AV: E=Sophos;i="6.09,191,1716242400"; d="scan'208";a="16077477" X-MGA-submission: MDEA7u1XtJwC04CN3vh+0fhaLBoa9W7HsmJZpqjvSKGvonBSfTxzN1pe/XEcJ9w9vEJGrzCDPH8ivUC+DIhj9ZZKR9QTisN5uqcbf2neWi0Zgea4BBtcqxSDubcJMBeP+L6tAOTz7N9mC/T5BbiHmlwNg2rnT0/qzl1lTyuqNYUqPA== Received: from mail-vi1eur03lp2110.outbound.protection.outlook.com (HELO EUR03-VI1-obe.outbound.protection.outlook.com) ([104.47.30.110]) by smarthost1.eviden.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 Jul 2024 13:39:55 +0200 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=diyPNUNr9Iq7gvKYklrjGuqsDcctOVYRU3+SVTgqjrjOWIfVm9XIEdIcvfA6/mPc8rbB4hqts4A8+3KvVWamNwEaE9ApXLQbv6xRsUY4HQUBLaLE59HRnSWA5Fw7+Kwk2grlE3AsLWdb5v77POfeY7tr8xHpLdDY9AS9dK+daOfN2NaEtkrWb8ihcC7QPNyJzluUI/ozpuc0LlJn4aSFNFO0awMoraEvB6Y8B7sNL0aJVyU7O0YD7gOpKXHCWnwzh76JgFoQi7O3Apc1FlbwfmVHrIy3qURiy4G++VRmbfJ0UuyKnKp20w4MmcjjTtIHII9Knu0MP7wQT5vzbHSdvw== 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=xQVM7ylMlGKzxRaBVpQZpqXD9KGA8oCWP93OVr5usyQ=; b=Vb2COn001I1r8BD1vvM6XWfwtLem1kW76yoZ7uM7R9eVuPexvxSGfw4J0iL+tHp6lcmatDqAzB1jq2YLfP4KyXJCaUWMxNST3oQBaJH326y88R1DKXaolRSSTqTMF2fV6aZDn86PQ6Ux6YQqGw4a5ITfKrGmpAjeH0bJGBhBg2IdrF4W6R3qiHH7VCdtdKTn91/cq8b8bqbSwBTO9CXjsNCXtrZY/9BgFUXADy3eEv2CAPe6FUMoK7eGiHNKn3zirqaY8LwzySq7KHeD8ePnEAs8xzruouQBZ9QolAZjmTQmgnXlB5E+fst+guBpoHn2FL9CyUaYYJMYLXq5aBgLjw== 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=xQVM7ylMlGKzxRaBVpQZpqXD9KGA8oCWP93OVr5usyQ=; b=oj7Kbzcz8OnvPnCbTVHZuUXPzTh/P1/j4ZWmhHRSIRoaY+pKL10SxUkmLGBaAl7iIveEwBR28lyKWI4hyWu/Iyj7eOj4Y3hfRukcgcehZDiJw1brdyDzotvaSNECDXB8sGSaElwE3DTNB7sQyFSi0UTzRzCnJx5Z/qHgiFQRv1xrZ8XJmqrMm15iVuoWpCzOkXaTimLY+h2f8kOyLAqxRxXIt4cpIDpm30XDB1UrWWVv2EOuxgQkRAkodh/48p4ef2aRS7+ETxQTXbpmBiFD8V2YYWHcMw3Wm0wQSqGvaXXBUR7SFAMKSjjfw77xPgN0KlC/VI9zdaq4RET3Y4tGeg== Received: from AM8PR07MB7602.eurprd07.prod.outlook.com (2603:10a6:20b:24b::7) by AS8PR07MB7400.eurprd07.prod.outlook.com (2603:10a6:20b:2a4::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7762.18; Mon, 8 Jul 2024 11:39:54 +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; Mon, 8 Jul 2024 11:39:54 +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 v5 2/4] intel_iommu: move VTD_FRCD_PV and VTD_FRCD_PP declarations Thread-Topic: [PATCH v5 2/4] intel_iommu: move VTD_FRCD_PV and VTD_FRCD_PP declarations Thread-Index: AQHa0SuNdXrKd5AlR0+pdFBq0nmsCw== Date: Mon, 8 Jul 2024 11:39:54 +0000 Message-ID: <20240708113908.19535-3-clement.mathieu--drif@eviden.com> References: <20240708113908.19535-1-clement.mathieu--drif@eviden.com> In-Reply-To: <20240708113908.19535-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_|AS8PR07MB7400:EE_ x-ms-office365-filtering-correlation-id: 1ff73dd2-0028-4898-9c1b-08dc9f42af7d 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?B5GbjBZ6zwXfvNXeWQ4Nh7YFpQujDVa?= =?utf-8?q?XZJ1dAA2jwGYppTuzfVnTWXZOj8lozQzHAFsSdg41Vvdjtky2hGX1+xASa/gpYxWE?= =?utf-8?q?aLfgxR2khVB85FasEQX0W9dC+6mcerxJ0TUBIj1Rw9O+9BsRqXs1vp1aiBozz9epX?= =?utf-8?q?J/HefKhDW/B3MGXIJZHoJ/9V9eYpWdYp/L38io23DmatrPh5GSQfLyBxmfXWQTptE?= =?utf-8?q?8GbCsC+jdZbm/A2EpmQ+nXvdCsKCk1nAWMqId9s8QbX/TOSIO2EwtKyHYqKYjStnz?= =?utf-8?q?LwOBPT03s6bNCQApteAXcloqtJ19oAtDFJeNJdaJpq/U1sbH18KCF66YU/O/+PIE1?= =?utf-8?q?Zt+uOCdvyYyk8Kgf69ej6SwseaVDqoFh2M/QrJbzoOeOngUz67QlMNFGpOMl0EbWz?= =?utf-8?q?/5IC0XqkShGHuINw7CqPjqIt9JB8jjkh4mjra8Sj47YMxP2lCkreRS1LtrMkCdZjl?= =?utf-8?q?HlnZoAKMOsP/mwRkcztE16acgriDGffQXa6ZoAuTR9U5sIfE5tzUTcihHW9UNZsRt?= =?utf-8?q?8omY6DZ+w1Uu5NYNdqwGRnb1W1EnyMundRWiLuYqqSMAP826Rf7uhhze2Q//mjFKj?= =?utf-8?q?ZZpJoWGjAHNIilhU+e1OHUBNzs3uaGR4aIROCj8XFps7vOvhWi17a1zDxUYJ4uzYX?= =?utf-8?q?5xkRANb/YMovjkey5LTLcm7aNHrH8cHko4+uctBY/OdKixWtSp87DQjFoDKtniRGk?= =?utf-8?q?E8541a0UpeKmHX/wWxIVGlsaMn564iMjTQQfD7w05m0aAh9qY8x8S0Guk5x2xh0Bj?= =?utf-8?q?kD2jYcE+OjcW49x0307iPNnCpIJdwEYp7kS9S5wkcmf9mK38m2hAHBOGOSUscWUqS?= =?utf-8?q?jGEIM1k5wxrQi7UEjgu2/6I4vLpmXo4mqdHcgpHM5JSDkHxMC4hCsKUgrja3JhuEi?= =?utf-8?q?HVBbXdOqiSIOyZVrce6amgv0z0eZqUqa+k6xzJYXcbYrSiGpRU0+du2ReDveREOzY?= =?utf-8?q?wietz8lVqeDtQxse1Vx6e3K9Qpt5Gf5EigEBUCjRKtlLaBllpvPL0NxEKyXiryuiT?= =?utf-8?q?IfTes2S3vFL1PF9bz6Ju6V3m8VWGXCMeQPDj0V1ps9CWuCZ4NAE7/LHO04D6T4urF?= =?utf-8?q?RIgBzoQh41HBSPry4V7A1XTLGyX+vDFLLk7JyBJ5osJW3GnJ98YDJ/itKlWZSr1HL?= =?utf-8?q?KSzWquohFrfXv6WQXiS9Rje6n++TheCHggpeEuTUkqwHu5eebS9pWCE0Hc6NXWMtq?= =?utf-8?q?B6jmLBkHwOQbSQEG5F+RzfUCv2zlIcBoPdNZwmCE8oMRf/DpxfVZHjk5nt7QhLSv+?= =?utf-8?q?331lkC1lfotBCDjYlnhj0triva3nGW0T0t+Dd6hnTCYF9sHT8Tp1wzmc+WOdvNDqH?= =?utf-8?q?6B8ALkf7n4pd2f/kWjgIdcjrk83eXlXd8w=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?jWCa4hLpUvmZ7fs9WMKeUSwA48BU?= =?utf-8?q?iTLVYCp5bBDvrfFzslE7b0C5oyDWVm10twAmqBFJ4gl7WPvjH+YkbO1ZqH1QNPmSZ?= =?utf-8?q?ALjXfLhhK9Sn02xj7T0vZX10ixPymZWtST+MUZCRoJdMYG1Z023FxaPDOpY5aRDvz?= =?utf-8?q?wKCMdGlvZrK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V68QT44udLNTr1uyLAuhr8RIf6GCuu8CvFSbrUHI45wNrtCK7AWQk3N6IXuZE?= =?utf-8?q?Fblmk/Dxy/mBeD3CBGARp58mjXlI20Ktu0koq6rc0VJe2aHh2mvj2dVAill3yZE6V?= =?utf-8?q?nCDdO/d1aXzUmcCFUBTNUqTakGn2EAYhK1lAmFRqWZjRwXwv3XjIzjchy/zBK9eBN?= =?utf-8?q?9lPjhDLu0ouEGQOzH+Qc0hfW0NO113Uh4Ld6ZGnkJcIic1xrJbX+wx3PIM9shEz3g?= =?utf-8?q?ZL1QHDIkTYKrU2LDt9+U6UxD4r3Qwrm8zPW5IJL465UkggAwENM9kdUkYHPdhJOcP?= =?utf-8?q?FfzYiauIqvXNps990aesNAXD6WIsHrnXO97zQIoQL2AANQEo/JCC9EK0fPrYXqk40?= =?utf-8?q?JnqaocyW9i8+ch7M2rFB9ywGvIaPHkHF+7ZpZZjp4a23dzyrjLjEXyzEplq+EZIIg?= =?utf-8?q?7M0nbMMApccSG+R0hi686Nhx4UbKYwlB2QS2QUTM9JAnsOCWVmLrVj/5YNdtFUjkZ?= =?utf-8?q?RCA3PujbMV103N8Y3alWwwGBDuD9yUE7GsDDfmaNSj1f4b4ScyOdJGk=3D?= Content-ID: <3CBBB09A47AF9C4BB29D2F88CE1436F2@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: 1ff73dd2-0028-4898-9c1b-08dc9f42af7d X-MS-Exchange-CrossTenant-originalarrivaltime: 08 Jul 2024 11:39:54.0565 (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: ZwgmdMLQ9ypHrY6cf7Cmzxwaeco4/aXiCmPYou2HO5wNJlCfApCgjyaVqstPLgWGZatT0/aDaHX61sFGsGMVa2AW1Q4Fuiz4nTRt+0RlEqmFNdjujV3Q1J+GPVNfyEWp X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR07MB7400 Received-SPF: pass client-ip=80.78.11.82; envelope-from=clement.mathieu--drif@eviden.com; helo=smarthost1.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 --- 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 Mon Jul 8 11:39:54 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: 13726443 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 B4ADEC3271E for ; Mon, 8 Jul 2024 11:41:47 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sQmjO-0004O1-AP; Mon, 08 Jul 2024 07:40:30 -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 1sQmj6-0003x4-UD for qemu-devel@nongnu.org; Mon, 08 Jul 2024 07:40:13 -0400 Received: from smarthost2.eviden.com ([80.78.11.83]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sQmiv-0007ru-2R for qemu-devel@nongnu.org; Mon, 08 Jul 2024 07:40:12 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=eviden.com; i=@eviden.com; q=dns/txt; s=mail; t=1720438801; x=1751974801; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-id:content-transfer-encoding: mime-version; bh=hVh5soF1sbHB0PJ604yENPnseV6Ov4o/X3k1Zl3qdXU=; b=TWZkvPXcuqc5p/iVCmIpIpBx+PsSzyctJZAIbTKyZllW0sqXIWwHbdnq TeBq3+n5eDgHB55LI2+w6ozGP3WOAeFS6m8zzWis7aHhlfche13D/6LkG B3C9tRGl+pA8kUW1540NCGcerTE6qraimzAVtSa1CbOnudbFjeOGW6YpE SVVGMA5p1GngaeFJPu4kuYvjlrzRwvSmtWB9h/2mKn7MHyGtK+WJjq+2c nD4UByXeJcm2kwIJ3F3lpo2e6xkuEf/5AQGPbfCDLlX23Kc3rc/IF6NDA Q7FEvkpvSIKEz/o/IBHI4ZGeDTPUDS3+waJ7bG2i2kSWRDYExlaqTKaBT g==; X-IronPort-AV: E=Sophos;i="6.09,191,1716242400"; d="scan'208";a="16088415" X-MGA-submission: MDFAqD+/7YTWuWa8Ao4O1OoCaN49GNglfsbPirOs6tkaG/U9KBFGAuRK0XcXjLR6Kh7UL2EP3Tp261Dm05SwwxM/zUfwWCsqYXbILs7FW9IhPvVGRSYbTS6OqDK9PtwrxNVOKZH1Ve4burjLtzEa6MnMrRq9vFtjJHBWLthZbrFnKg== Received: from mail-vi1eur03lp2105.outbound.protection.outlook.com (HELO EUR03-VI1-obe.outbound.protection.outlook.com) ([104.47.30.105]) by smarthost2.eviden.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 Jul 2024 13:39:56 +0200 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=CFUmfmElNTxIm9dEnaCgZ9LixdOLaGvdmpRuAXaedfTfCBbwHlRKfdhQOwyCt5gPaxDpO9ou1wDsCHqzNaJR7LviAS5LgGbds1ybTP5Z0CVBEg4Yan9RnCDH2LAFBz9Vx1PwssXbfb+Sl718uCuqaZIhRQKKhXmCo6vU8iXr2fp0hgVMbEluJ/EwKJkJPI4h2TmPpLmGAEX0Vt/TV4XRWRbeIB6xiQ7sa2N6xm4QeA6K+XwrSIgvq1rEZRgHR/xm1PL+K0nqTE8QGmLwpCQ2hilseIr618OqPoOAey7W2G8y4mkup0vv2bwdamr7oRGqbdTdG2DV4ESyJCurWMfyDQ== 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=hVh5soF1sbHB0PJ604yENPnseV6Ov4o/X3k1Zl3qdXU=; b=k3bfaldWrJUtMHlr/EAGbZe8s207dIOC0nM0Wh5jaAx0Ma2HtleEoxCWIco93OLJsSV06GSa7LUp9hSA5RalSf7KEI/Fu8vCKbM2nW/+PkEhjjxwiHqOz6Cs2pqMYdzKLs+5EXtu3DY6gh1O9tjeWSBRQJ9asI6UV6sff0QErF3M3nhhhLkPp08/MmgYumOVmsmNr1KrYMDEWo9oyT+mc7FqU5ZJOzvMO8++In1Wdk8ayJJqHxoT3TPXo0D1EKc6jbmhWj0IkmsEMq7Wgr5BfyjCMYUbX8WSYPX46YSIq+6pJKr+uv1Ek+jq5ckeoYo/x4coyO2f7S/POYKHiIlZsQ== 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=hVh5soF1sbHB0PJ604yENPnseV6Ov4o/X3k1Zl3qdXU=; b=AqR0fxLuLUbZoeSvqyd/ObYWNuIftjX0sHOUgYEPiqfBXL+5MrpTqpt5h4DQz7WM6Dy5180SjQkFn8E4U61P2i76whnSJloOmkkr8kDk4A987c34oqXFQsPlJMs8bo1SiizGv+paGzbFtBAkuo4y5ApZrxkufs/M0P2JXbwcScNBj4QMOtXMuT51+KjCWH5vsiOdqzHpfGDS/7fXpyvuzCYCpDqf+pdvrDhnN6xLagLD6qJhgN2cBAC2WHLuOO7DHBgVPGWSrZ0wLRNmVdZLJqLEfutKVInYDTBHX7PupBOcxgGaGKjsDlS5DfJgorHCDXA7iH0pbLtUWJLpPYhp4g== Received: from AM8PR07MB7602.eurprd07.prod.outlook.com (2603:10a6:20b:24b::7) by AS8PR07MB7400.eurprd07.prod.outlook.com (2603:10a6:20b:2a4::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7762.18; Mon, 8 Jul 2024 11:39:55 +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; Mon, 8 Jul 2024 11:39:55 +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 v5 3/4] intel_iommu: fix type of the mask field in VTDIOTLBPageInvInfo Thread-Topic: [PATCH v5 3/4] intel_iommu: fix type of the mask field in VTDIOTLBPageInvInfo Thread-Index: AQHa0SuNYymPsQHFfky5WnjMRsYUBA== Date: Mon, 8 Jul 2024 11:39:54 +0000 Message-ID: <20240708113908.19535-4-clement.mathieu--drif@eviden.com> References: <20240708113908.19535-1-clement.mathieu--drif@eviden.com> In-Reply-To: <20240708113908.19535-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_|AS8PR07MB7400:EE_ x-ms-office365-filtering-correlation-id: a59437e5-7193-42b2-b31b-08dc9f42b00c 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?pqWRHhweOmfVqjaCYCHRwaryZ4FAbME?= =?utf-8?q?QjKRvp3OWjmhowf00s3ctdVa1a5VxHmooS5E7BtbDPP+T1m07D9UDLFxG+zYJsEXq?= =?utf-8?q?vlKePUzZcBbiCjEHl/VKJT0OIOS/JaKK2Ensk3DNGEyRGGiRF15yMsWuAJp2ANpti?= =?utf-8?q?prtK+GF004OB8jIk1lR4zTPFLiXgVMTwSz/J21kJ8wJmSFiFx/6ayhqBqadBiK8hU?= =?utf-8?q?PQd9aCQ1y5+wLDLwt6dWL6ps3z6QkZEdp3+/9KPrb3OE4vk1vpwLpeMIJHtg6mhs7?= =?utf-8?q?Qla4CyrZjy8YqQB8PcST1YXVONHJRNTVc7KE46nBaU4gieXKX+/BmkLQBDhjaZd/z?= =?utf-8?q?qYLd8zG7gpTMF0WQsZU7eABIoEhvGZBw02WDS+okNgxct//v+AT6uYlW+ATXYLoV1?= =?utf-8?q?dClIITYg+pbHWqrm4yhHMefQWWmT6JTVriOUhLB6E7nLhHAbOUvFI7VGf9TVY2IUZ?= =?utf-8?q?ZRxupR8w5AAE/QLkSddatZ8CWkw7RHkQpumW4cX7cKija+wfFF+XUxldOUGFfbH85?= =?utf-8?q?vPSNjqv/8HMe/u8fR4WS8Zxfdg/xzMmd10MABvXCLs4CNmv9Wfm3HRgNZz+ssfaT3?= =?utf-8?q?IHBzRMMcxxLJY06QDzlIwI0ux5xXfm192jQlyDwfJt9WaH3plNNkhaf/QHTq4l6vA?= =?utf-8?q?Xb+oexY483MLRLWgw0GyFsUpvZ6lDD+CX684kgNuA9saB0UsrKTKPPrW/V52Rdyw6?= =?utf-8?q?6xAVh5LB4CoxvSHPw5JLvNXVK45nYk4pgZ0cJHLW1lraN6gQawhUaHEApzeu0c37T?= =?utf-8?q?2IOXQ4rqko0drKPKLO18x83wV7yuM0jxgxd/ex3U08R2Azz52x9uVLMOuVu24qIta?= =?utf-8?q?6YiKopZYCBT1xBycRywnXM7VoRann/eKm+dMnh93QbOkpeNwqd+PpMAjVElLjW6N0?= =?utf-8?q?TlDslaxcg4xbIHMYU0tHlmmd4tSwz1IAo1/QPDXSGUocgz6I8PJEtsVFZEFARY20O?= =?utf-8?q?l34tbOxVTVot2tFQyBsMDfKZJvUKUA5l5ghK/ezH2kVkb/OMuR2Xl7aOH7YDA6Isq?= =?utf-8?q?9s1JYZmXFfm1037a7H3mJBTiqeKXBAMDbriiJ0hDJ09q2HHLzL5Ht8BoJ3MS57a1U?= =?utf-8?q?KYj1d9v7M8COp7BuoZWe/V/3J7avayVS+rdHwbS7ow/1uZrYjhN80AWoeZNcrCFeI?= =?utf-8?q?dAsGsFKd7bqNgH15rxx8SOp2/zzrsY3ZJMxN8AwnGUOhgWrGO5xAdGFb1rYd0gJrt?= =?utf-8?q?TBjknfT/v1nIIM0sRlbe2MyVQQBHmoOLNPOxZnNCcLSkneksLWHviiQRDqtCTNRaP?= =?utf-8?q?YfnhrHkImD7qytD+ukN1lfUTL/pwUpP+9sIA4Zq1RHrSRB1Ok7ubySYZXFL5dTzKt?= =?utf-8?q?Ti93omVstAoFzxGzkDQxOAvt4eMbStUyqg=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?tzZGdDfKDONhGfCADt7IVHxgWNld?= =?utf-8?q?K6qW+0KsGiBfvUWLCsVYPHfN9qa9gXnYyhItYzX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/KuiI//zwgygp7xJdUBpveH?= =?utf-8?q?UyJQOx0/q9NPVEBU63qcJLGLxq0apog2GEtWX3WvdxA//nF7/K5PNjeTyJG0GkRsK?= =?utf-8?q?qnN4FsSXznUtt7yCFe76SAispcQ/F7JQxm9S2ixJG2MPKOs7NegUc02hOfpquGOOp?= =?utf-8?q?GO8RlXHifAvvCxNwi07OdwlB+R49kL2VBQW5n/yBIIxtO5xOJES4ff0D7svMsM7Yn?= =?utf-8?q?OFDdNeuCHa9ARUno/oBfj4FQGY6M7cNUMupxAPPjcC2CtjdJKB4hAKQ7Bg4Kz2cBK?= =?utf-8?q?1G88PJVdGJZy1r9wk002hpXgofSQgFgVGWCpUbg89iadITAfUu8YHup26AOaeyIya?= =?utf-8?q?lXom+Cs2B0RFmlpEEuY6kW5Zwo4pyJMb4EXii6B8wGmnMFDcazDrV2sWWola+nQTI?= =?utf-8?q?T6uEbQPAzgMTjXLYm+F0+M1iojH2bqUOYwXCgtaRUH9imYO6d0YLdSH6XXZNrpA9w?= =?utf-8?q?gZm12SdX2rRsj6jEXLXcTq0P2XjqucP7sffmQCzDZnOzYkmeChN8uPOrCPODMyNoD?= =?utf-8?q?Yf8yeQ9j0U+3PK+vYp8gR7UTNenZm9cbmroC99mxSTiec8rqg/I0wklIaz+MEGVeP?= =?utf-8?q?NSLEWy3ZFHDO3sfU9M9tjH9DqnMT8y9n5BWdhZg9r0QsyIi4ncNvSYE=3D?= Content-ID: <335F543A0BD124458A581B97CC6CBA0B@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: a59437e5-7193-42b2-b31b-08dc9f42b00c X-MS-Exchange-CrossTenant-originalarrivaltime: 08 Jul 2024 11:39:54.9477 (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: 3lxipbX/oFtypJYJU3vQGThxZYW/naPd/r5tN+PkJqzZ9u4cQAWISZw14G4Q7agHIPuduSWCQJytOKOQH/6hxqsxiuacwj5WRGmy+fVRJbXVxX+HK5HaLUon2ZchEkRW X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR07MB7400 Received-SPF: pass client-ip=80.78.11.83; envelope-from=clement.mathieu--drif@eviden.com; helo=smarthost2.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 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. Signed-off-by: Clément Mathieu--Drif 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 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 Mon Jul 8 11:39:55 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: 13726440 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 5C856C3271E for ; Mon, 8 Jul 2024 11:40:57 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sQmj8-0003xq-4B; Mon, 08 Jul 2024 07:40:14 -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 1sQmiy-0003o4-Py for qemu-devel@nongnu.org; Mon, 08 Jul 2024 07:40: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 1sQmit-0007s0-L3 for qemu-devel@nongnu.org; Mon, 08 Jul 2024 07:40:04 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=eviden.com; i=@eviden.com; q=dns/txt; s=mail; t=1720438800; x=1751974800; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-id:content-transfer-encoding: mime-version; bh=la8b6EsER2myyyqfK0mnc02PBu9H7RQtt1F+MmsewQc=; b=T6KvGj3TxAFbywoEmYhS0j7j853W4cShUvu39047MthFVx+/jyl84yN0 FbpywVZK54SM3+z/YAqf6m8L5J/oBiV1XzEvU/RCJNXEmaB4r8bNPLOte Uwtvtv2PMrKXeyY5fauvcnCQxvjDm6MxVKSPHZDZmuE2dJPKVnqu4icaL x2Ck3fv9aLQfGlLiV9GQGcSAGsciikFoe0HW9aOF7K8LzuMtGjEP6gb9d 8hEPNTfXh0qmL1+q9z4Z0nsxiY2tik68vkQ2smGGnZZKqB4x7w+j2hWfs oEKpTvTiq+hSyj2fTG0NjVRZAY+zMJMbl3WVRlAnZbNuBGnp1uLILLfoM A==; X-IronPort-AV: E=Sophos;i="6.09,191,1716242400"; d="scan'208";a="16192496" X-MGA-submission: MDE9xd9uTUWmHiN7aWnKyofv+/EfU5l1GT2n1yRzwB/e/6YnwfwGVB+yWSORsoa+c0U62h0prL0amYIaaJHaOS2nLwq84tRgpx5rwlDqw6nY6RQ2WJ/uW3gn9xNW+dy67NTivPN2WNuVXJaOet2FEmsF1yekdewnIuxAg9bb63tz/w== Received: from mail-vi1eur03lp2109.outbound.protection.outlook.com (HELO EUR03-VI1-obe.outbound.protection.outlook.com) ([104.47.30.109]) by smarthost4.eviden.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 Jul 2024 13:39:57 +0200 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=k7Kla+nNF/f46vNEiFUQDvOm68hTMGOo+5/AEtTo9faqofYlbyI+P8+wq+FAt+UBQH9BKPt5d5eFUpcRL3iYfIzWY1bvRXrLaUaUWOTHdyTrryuKMlRGYA6AAlLfe0aMbH9/yAbucZF1JNGP8AthPeR/u4BNlBCUq2XhlMIpsTIlAjqGjZ56RnzgeOhmsHCJoBg6Sq2jefS2eyIlAYTVNqkfSUgHMnd15eBga0yhdMp1JdW8RwzyNGv0vwqNgX0gpB4UadLkHsXQ3m2wHR4tt5MVXw+Z9XGZL95zq5lAMPx4bZUYZjhw2/+Cjz1oY2MHnLJdVxW9bGXnrCMkv+BInw== 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=UScYjwVMItxfY+L79p8u7YUaDHb4PYXbXNxtMeiOmcoWvWVzdLyMzBZPGmhF7D9noZXuvLJ5eHqQ2LC7jLq9TrMpuG90fZoNHHc2TsV3GIlf/WmJ+gKuWD7qJzWer4CVW4GHhw8V2GfSCFULJ+aXJ+sOTuWK5RSnD1KGt0Wb9LpCGdaoiSIogt26RfqKwCNDCdGnP5/Y/X9qyKREF48WjYT+0T0R4xXaoaXi6kc9jcGu33Ux2VP50HCJhOMUqIZbCYLA0UAJscCyxzVgxqGlWW7JegW14pEE1B+NPmUEyf0jzAJuQ48Yn4wUkUzJ1y3pvU8oGmfvZnUgroa02b3kBg== 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=bv5WYFmFDfrDsx3mtcXq+iJgM5ywqlsHegyI0ytxXLgWtsW4nZEbq675LQKLZ7YUKa+o2KTLb9oL2wF0Mp7YxTWOnuVYNILC5FvbkPVEG8amYbyjLRsTAHbBYlEDZ6f3td5E0qFAYZDjYau16lT9dEMWsODkokdUThakqO3kE5bh2Q10CUR6YDJGlOREuoTcTeuoRU7KuKp23gBiRI03IIzG5QPjx4g5/S16savCBK7XWGSJbjNGBA0gKOIJHoRMNRIXvdfDMyjPAlcuQoc9mJxM5KitJcq6AAUajQAc1Eco4GwXibkAgh+ZstvgIXVb+/R7A+6kGEatFbHxjAbaEQ== Received: from AM8PR07MB7602.eurprd07.prod.outlook.com (2603:10a6:20b:24b::7) by AS8PR07MB7400.eurprd07.prod.outlook.com (2603:10a6:20b:2a4::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7762.18; Mon, 8 Jul 2024 11:39:55 +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; Mon, 8 Jul 2024 11:39:55 +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 v5 4/4] intel_iommu: make type match Thread-Topic: [PATCH v5 4/4] intel_iommu: make type match Thread-Index: AQHa0SuOE0rt69ReTEOYvhH3NMq2QQ== Date: Mon, 8 Jul 2024 11:39:55 +0000 Message-ID: <20240708113908.19535-5-clement.mathieu--drif@eviden.com> References: <20240708113908.19535-1-clement.mathieu--drif@eviden.com> In-Reply-To: <20240708113908.19535-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_|AS8PR07MB7400:EE_ x-ms-office365-filtering-correlation-id: 87fce5cb-fd61-46b8-300c-08dc9f42b092 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?Dk4IQDE958nmfHNsYLVmgeWlqWVJnCw?= =?utf-8?q?i0CeLwzR/VNLaJryLIl59Qlc1/RgfiwRZszrfogLn2wdQiHmxQypvJXYIUMlxFxko?= =?utf-8?q?IMKlImKzm8Eru3EExxTrAJYJ7BeNnCVx0XFXEq3amPlWdFEOT/k7PyBIG9SccRuge?= =?utf-8?q?+6ngk9WyATvzATT8DD87CfKFKYzGbiptN1MFUzXorw4wkktUAsYPRuZdfI65lI9qH?= =?utf-8?q?cjYMGz0pMhAB/HGkyxguaVxZKQCwNM/jNqPw5hl5qKkm0Y+N13p56ZfuderFxmHxq?= =?utf-8?q?+IlitvQkfwnhRjpxiS/7XS8g0tbZJYsVuYiXd8K1FHV86Jpzl9BRjGW/aXWkf+xWp?= =?utf-8?q?eI7Z8Z5h9EGEgrbvpk6STrdhZ7yzAaER2rUIOZDg57Ojcx71F8f2mJ84dntPNZTtg?= =?utf-8?q?kVLvSVQW8/DEnkyIQiCyHVUD6YTblSn04kH1XcjP9XpLm9zP2093uL9+T4mklTgL3?= =?utf-8?q?7Ntc4tn4fR9ts9XQv82Zwsd2Iut1M7DMuka6x3NBbS5RGGVaHZNtSFJ+Wtb/rLDbd?= =?utf-8?q?TXt+/5oEEN7qYzC7I2zlRlYA0JC+ECeCSfo8Vtqt688c4Zzn2Qcrd6ZqNX5f5oYVC?= =?utf-8?q?zcPTaFD6Wq5/pmvwcSxBs+4WagHJIY7n/GBTYkrpT0CQtERXVxbDxXwjEBTuO9UWi?= =?utf-8?q?SOsuHQIrKvtvPgR6Q+Kkrx/v2jORp/2v9tYc5/B0g8wpuqTLcp3Ve8L3QStVoI4Dj?= =?utf-8?q?FdMWBl3+k2LdEejP0RTELUR/NfSo4FMTTVE38r6lzOTIXCMvFRV2a/4Sn1dzhjs3h?= =?utf-8?q?lmOQBhuHdOLH563V91GIS3kyXyjA2UAgUrFfc1LulgSogp4o5BEby/ChudJIBQhJJ?= =?utf-8?q?rt325JlMmYD/0aorAZ3qiqr6Zp6MhwX68XbWt1Ec1QUnRbIjeVTD4YFk7HCBgYyxE?= =?utf-8?q?DypYp5Vzuh6nDYwl8LZEmGx2XuAYwB2dWyV6u4cmzUhOuMStcucnjEB+NZevIh/10?= =?utf-8?q?oEV+nn47iEkJJVGM/tSWslqWiwKNzWYlFvYPoHr0nNwxwRpvfx/OKT26muF+bTUH9?= =?utf-8?q?1UbWm7/mZwZnChwQbRb799ehknOpWIa92ln16o1WZX3hPAKyMoHgsUQyEzwGkNwf2?= =?utf-8?q?gTm+mX1WfY4Wuwp6HvrmR4s66ATKetRkA04Ke8ByxJ8TgaJJ60LFXF3K7QXwQRc1g?= =?utf-8?q?VIaWwJ9q2HggE2gTkaetuRuevZ7blYQ4LCtzGZ4xibzvu9/1sN8I01EhzUaBmpGE1?= =?utf-8?q?gFe9EyAequggLwvqsRdGBCbEDzvd2sb+XQnaBl8z2h7RonoldDRn8aUeZSf9Qzf07?= =?utf-8?q?krJ7x5rnrpdCYSLUHbdXTvwxiGIMBCTCckRdCPpaTJLS2Bs33bWMI2pLSosAHvSU4?= =?utf-8?q?XMYJu+hqrAMYFo0MJiE4d/TqTqWT/16I7Q=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?xbYl2UYtTis+j7eqDmMyI9zw+mME?= =?utf-8?q?ee7i4C5KHASWMBnWIE509O69Hx2tFz4edAaDPyeOyM+GxnT1TfTVWWMEqZFtnAcF3?= =?utf-8?q?ATp3jNq1tNKcDq/qoT7nJhOhDQiIMI13x4s9KcfbzWkeVaVGRiq9ylcFw5rTIkJ8t?= =?utf-8?q?Zji+cGWoxHz2t81QS8VWHPTfY8ksmOKUpxTiKrjOYW5C8a00DKx9wqcyBv4LSbNPz?= =?utf-8?q?WKHq0OGUqnCVAdf5UqbI4rJ0histWtQF/8pJZ/1VkQY9FUWThaq3LEOKnkroKd+V8?= =?utf-8?q?K55TvglyyTvCAqNpbI2O3uTfe2RI6mOG3JP5WGghZ5dDnFKKh4aIR0AUFMBpHlxTt?= =?utf-8?q?288YCo7bGzFhdF02ziya224AzKiTDqPvWMevgRHBgiUthE9YYkF+mYAXop7LFKW6c?= =?utf-8?q?55Lf1qvdxATm8JAODVFSyyh93Wqr8IB0iQd9zWxEL/KVXC3IlKnTWCs3wGPi67yhy?= =?utf-8?q?6pKCacOXo9IM6wSHTniA00z2HvBUgFO/YLMyo6S9gmdMQnR34ETOMHFp4kIMr4fdr?= =?utf-8?q?dzSsT2cGq8x549sENtjkkDrIY6O+N5/yadGhavRLxqQYMVClArLdb0r6ngtfB8rY4?= =?utf-8?q?EwWJySoymoKc0r/k6BS+BnIBl6/RkCFNtScFhORtNzqnmAaGOr4+m7Z1zKvEN8Hsv?= =?utf-8?q?l/0iBSCEPTDtfZDrl/B7cCbinB14f6J2l0whugKjc/POrG5kW2H44E5Y3cRHiUa0x?= =?utf-8?q?owdxDQ/5Wn6fuwsDHka/44pOm1S4MDbeSuKCxz48goh9QWNs9OMEj8gYQk8Ql2iK+?= =?utf-8?q?MVTBXokhNOwv+kEm2MaTx9YZyDiyF9BiHLCcRrApXGgHwy2nUdU4BZRAnpzEXK39F?= =?utf-8?q?GRnHbRFIDJFA+nWXtsXPPz2M5d5E0N2ECdrfrEotn4Y9u1eJsUX2ykupb2gQqHPcQ?= =?utf-8?q?snAim9SjqzGNCtTnr0LwHcxGv2iAxMKeLwkNRvCeMqC/MQ64rzq48xlqEmsA1RbHt?= =?utf-8?q?mLHpRXKyWOP6Kzc0chAfw9vkqVekRYROf79U+l/Pny6TwQClU4eXbwIyFKlkYcQlu?= =?utf-8?q?k3hzJIbl226nAInFuPVYCJMVMFTwaWKyjqVkvQZdGDV8fLR0VFOewzjdik/34aW5p?= =?utf-8?q?TUCmRUvXy8lFa1za+TcLkVhBLaWYpSE3lfnLCNij4L1npUynl82yPr2OStThBtFwP?= =?utf-8?q?5czZbFFs3PyZTcKGQ+KIPXjArExH5BJw5uuNdiI6K0idkCoU3vRVnfggwPJsOcEzI?= =?utf-8?q?BvJTX7woWK4MWe7aJmR4bPvVk1y5e/mmBpzp1uvU660Wfc0ewK+CBQRYAZa5W5wd2?= =?utf-8?q?VLXWsZ9s69eVN3JCnOZ/8u7AlWgtxgaVSvEjiaWzhkrVhfmZFjCSNvQokW1iHePk0?= =?utf-8?q?hOcsZXuaeugvHZDH6XZgx2BGvhoRPw1BPKcif9YALnzawEgqgwSk4RsLY970Fo0AN?= =?utf-8?q?wMjwH5fkVFgepxEwCQBopoXZed/X6FNvdJOmVnTIPyyLe9Xe2GE80s0gR5ZQlfVMI?= =?utf-8?q?jGv8c7jczGWEE79eUdsWQelC6nEFBnRtIs3fH7sBTcWkxFroFxxioTGf2LGqSeZzZ?= =?utf-8?q?aac/yXaf0aeEmTddP280ETAz32RIhooB9HllXAUk55ZVnewpxIZL7pY=3D?= Content-ID: <996E3B806C931749B7E7ED207FC690B2@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: 87fce5cb-fd61-46b8-300c-08dc9f42b092 X-MS-Exchange-CrossTenant-originalarrivaltime: 08 Jul 2024 11:39:55.8248 (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: am5unmpkSXmuVdbUvfFApVxu0w+DMXyDrcN047idqMfuqpTw46P3FCyJ/RBJa63V76LPHRrv1nxVEpJgrqKiV3+pT4fZmQuh/txMUoOfFLflkdTOyqM3ijQr26g3+8l4 X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR07MB7400 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 '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);