From patchwork Tue Jul 9 14:26:08 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: 13728149 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 A38D3C41513 for ; Tue, 9 Jul 2024 14:27:31 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sRBnX-0006YT-Fv; Tue, 09 Jul 2024 10:26: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 1sRBnU-0006Oc-TA for qemu-devel@nongnu.org; Tue, 09 Jul 2024 10:26: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 1sRBnK-0002k2-Sa for qemu-devel@nongnu.org; Tue, 09 Jul 2024 10:26:24 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=eviden.com; i=@eviden.com; q=dns/txt; s=mail; t=1720535174; x=1752071174; 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=N/EcZmLnBcOw9yih7fFjMi/rR+JKAtIvQ/Orqzy6vmrKe0mPMrI3ieFQ iwGUJS1D7s2hfGpwYRp1KVv9/xH6naz6JSF8tSMOipijQ3EQJ1Ta8dNOb RB5urfsdv/dTRhdWMz9JWIA0FoVGLBIDpmcZzEca3zgskYvAGJWdX1kN3 CWJKmdpTyviUY8w/AaD4s5XTaM7r/4psJ5rGY/0duaMGJHAp2+l5+2afr uZ5HcgFvzYfT/D0+QK/p89HmQavFHzC+5jZc/nkfGgwiQr7IKtv/10Wxp n+0yNwkWxfOiq21+50NCz/vvrn4aD6f89/6PbabwR9Ku3enHzKLBdzLha A==; X-IronPort-AV: E=Sophos;i="6.09,195,1716242400"; d="scan'208";a="16172660" X-MGA-submission: MDHt0OLFiCuR5mDp0hqv4unM60BKCx6Zkpx3ujwDxYt4jv7MdtL3iqfM40u65+U6S5znVKG8A0QjNIz7moXoQGLlqEwXS0fo6ZMu172eXveKUkG6/GBIbaBWCIDjwRZfPhiFBBTzkf/8EGRsi2ZvjhGtguA202oPCAFdPgD0dZHNRg== Received: from mail-db5eur02lp2105.outbound.protection.outlook.com (HELO EUR02-DB5-obe.outbound.protection.outlook.com) ([104.47.11.105]) by smarthost3.eviden.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 09 Jul 2024 16:26:10 +0200 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=unJKgZlBnJStIE9vUAkIBR+S10KOjg4bC3CYdX9JbaRj9RPYy39NUFa7stdL9j9OrILV2mgJ5Maon9cavmbrTUa0NGB37BJMf9VAWBXYUM/Pb9oEo7jKg9ahq3+S2J8w1PiQ77vjgoeeAVINSlGOwmHXCFCGVThL0L1geb+oUJgtKBlVkeNyISAitV6hExHEiLW6rcx1rMgJHAx1WNNQrDKiX26iZr4SVBvWicOxc5sdt5/GLAVMmRBUfZ9KyPvrIh0CijSfKbdkYseomSEPTR5p9TjLOUliUjdJTw/z6RzOsdozolMDGlws3icT+Gz+LFXQ5WMt2J35dV0KXuv53Q== 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=ILNEjZaTFB4/QtXmSZUP4sudjbF4VW+3zWSbP4yibaxYW2hRLCcEuaAfdUGjHANlEd09kvSgiWNdS3t1GuFdPx5IorVLCpcaYS49AzC+MlIsbU86sUYO4PyWFjC/uUBu8xu1kw1Dxrym/jqukckOPjICKYYR8GCUGEwdpYc7WaG1Zmv8CmqbWlREMyc4JOxtLwW/y8HlNLjVx7pm+4EJvpnE8H0RhAsI7jLszh2Ubhy3KLp4t4Eg1AUGJ7Ob04VcolAV996xb/FDKR5c2k6fwPIOpTkIV9GBSWWo8ABukNgblaU8ytYuMPDQBxuP+QhPPFfKEGPo8OfQxoXADSVDPA== 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=nF6hQMx4rNXBVc35IfJ/GCtEOKH052nF1Aaoblf6r3UdZ/h4aq5NrESb4K42EjU+Mw8COiqjIOp3Opt50QN8wK2iOkR8fDcODhcphlbw4vDWyw2y3scoJs+dHxPeOf5a/PtzfQ5AuLZSpHY/tfnEAw3zfhEl7K1eW2gyOgxGFE/7tl+znOxHFq/nsQ9quEXmtqpRXYogTTJzqId95wv6NdAiW3lFc7rcFlrpkryhswic49rccjY+Fdiet7wa7GC75i7mBLfWY/jxgkOMOIJ3qIkY6yl37HZHS0hDfDsmiiUyvmdXr3VV5kBYwGnmVKJBb0nTCDI2AygFEJLoqvvxCA== Received: from AM8PR07MB7602.eurprd07.prod.outlook.com (2603:10a6:20b:24b::7) by AS4PR07MB8459.eurprd07.prod.outlook.com (2603:10a6:20b:4e6::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 14:26: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 14:26: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 v7 1/4] intel_iommu: fix FRCD construction macro Thread-Topic: [PATCH v7 1/4] intel_iommu: fix FRCD construction macro Thread-Index: AQHa0gvwQEBSmTxjMESb+vD3l1do3A== Date: Tue, 9 Jul 2024 14:26:08 +0000 Message-ID: <20240709142557.317271-2-clement.mathieu--drif@eviden.com> References: <20240709142557.317271-1-clement.mathieu--drif@eviden.com> In-Reply-To: <20240709142557.317271-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_|AS4PR07MB8459:EE_ x-ms-office365-filtering-correlation-id: 1ca57ec1-763c-44bb-e619-08dca023133d 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?V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kcopqNV4XUlZc/pD5cA3KBQjU?= =?utf-8?q?f71bXJRTPGJcOorSjdCBsEsTmJS3m3lXyqtVmqHMu2taajuYXVDE7A6kLt3k6Z2n2?= =?utf-8?q?lrXK72AOkkKYf+sBClXQxCs/B7Fsh6vlsgH4ZRvPDm+JF4Ye342txvft2i80pA9ku?= =?utf-8?q?CYvxgFEaRBqs9XoHjj9Z9hPq1cjfw5VFyLvA0sSjiXdP3In5ZdKfG+Ci4YbHWo/3o?= =?utf-8?q?UgtZf3Im9ICFo+apRMUKk6mVcxAmaQCkWDeBMbr1/6648vLdvE/zJKj2OibsZZkm0?= =?utf-8?q?imx6m4C6+b08BpuL2yLd+p88Gu7BBWk1SiM4MZu1BnWzUWFNg/A0IKaCa2H/Ou1XD?= =?utf-8?q?sa33s0bwrdMuYf6G74O2JA2dLkuQ/t/LggtwcZlOvflZhB914yy8hOStjxfwuRK5w?= =?utf-8?q?PJc2L9HeidwljaugIttFVmS5uKJ6ORFm4An6ptrDM139yjkaTvfxPYpxizBqo3AIO?= =?utf-8?q?brMHWUNBYdCBEpkUujCWvkaOGj4O1ddfLQ=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?d2COXBGjbeysIIOEq8UejgBvAXBm?= =?utf-8?q?xDETgbYrmrVHqEHm70F+dw8T+LkkfsEfhvUWoRgiB5TwlsVWa5cDIIJYC2oL9RPBr?= =?utf-8?q?nXKslx+jlvFGB6Fa0d+63VZ35pzFnX8VFbzn4cOz0iMp1L7BJJCQoSjkB7iDQy0G1?= =?utf-8?q?iwI6Jw7OQLCwFhcre6dXCLAsGNWOuh4r5h4oPN1oraA+olXOsTQ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2HP3a?= =?utf-8?q?hjYwo2hWlqA+f2VBBpV8dMeETVxPcddfui8A5cVvQGIyO/ZPcrm0T7TZwwSeKkgxt?= =?utf-8?q?6YSbfbFJZ3yujs+TIb1+/ZYudi0pmykyelPkN1lRrT84tGVzvUsO2C0dQ82iw26Zj?= =?utf-8?q?otQhKQXtk2FIgE3d89Ear/n08i3QpIFKdT/2H3ux7JAKxY8plbuLVMJjXQkxqAjiO?= =?utf-8?q?jXm9baxxYNqsTWv+cImIhfgx39v6SEcGrlKwuMt3u7ZP7E5MvjP2hpuQM2hg300p1?= =?utf-8?q?lCWyXMZjLzJkU5048CyqCurwDxVtrelp0s1IbdMahLq9oIA34gZs/+THb31cyRok3?= =?utf-8?q?U87ESas9BWAHP94UsfuU5AjsfTfTvoZOCVJBN546NpFHLPmzWT6DBhx/DD0CYpCNu?= =?utf-8?q?zlSyFVMXdvQM+F0lHuwtSbQuDPqS3dKyjpej0aTUT1cw0CRBeexZsU2rXMRm75XWj?= =?utf-8?q?lXgILom2FUu4plzcZ7l22yXA7x9WH1ufwvIaC32gu7F8Xn0NqIf2Qx0=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: 1ca57ec1-763c-44bb-e619-08dca023133d X-MS-Exchange-CrossTenant-originalarrivaltime: 09 Jul 2024 14:26:08.6339 (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: q2RUq1romSoXg1RSkFbm838rFvVAlUGCaB5TTzF3pYmz5zwPsDvpSR91Xdnsm8Rr1OkTTnnUvgFlqShScthTpYIdcjz9auXijY4bviiOriSfoWbJHjTy6k1/pYi9jerL X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS4PR07MB8459 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 14:26: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: 13728148 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 98F7AC3DA47 for ; Tue, 9 Jul 2024 14:27:31 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sRBns-00087m-D4; Tue, 09 Jul 2024 10:26:48 -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 1sRBnd-00073q-FM for qemu-devel@nongnu.org; Tue, 09 Jul 2024 10:26:34 -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 1sRBnM-0002lO-Ob for qemu-devel@nongnu.org; Tue, 09 Jul 2024 10:26:31 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=eviden.com; i=@eviden.com; q=dns/txt; s=mail; t=1720535176; x=1752071176; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-id:content-transfer-encoding: mime-version; bh=rMSbcG3FjkA/956ne7dFU6tsNnbwdrHjNAv6+ySCMSM=; b=IMOIJMgVK3v5OI1V1nOJWtUKCpNfMV6NXQ2s7FxsQmfyI20IbjM25PIo K0feHUM3VKy7uHinWQ10Cq7IfVNE+gvXo9kF7lDYSGrYzKh2nZACT5ZrW W7OOhbi5ATg/Qy5C0au/sLrte79r0bzLeGSLBiow8KZBToZbt37BkZRfQ hwtfv9GW2N2JxS4hUXtVQNU4VpbmtwoHe7n5XEUXsSikPnUS2oXQgiuQc vrGV0mu7Bajxs3eEUCryCg9mf748Q7vLH/kMcgbmOyxEyTqPsmBLkyWbL ns4dNtRi4f+JIfa0Yv+SQXGyQx4HuE2Zr8/khiSH/voOMia7phHTNDDe2 g==; X-IronPort-AV: E=Sophos;i="6.09,195,1716242400"; d="scan'208";a="16172661" X-MGA-submission: MDGeFlJoZcif0Gxd9c5oju/xlyOa1hR8axmOdNrwpFNW/Yn3HMQlpKb5W5oHK4i16K/VbjFazZoMoZNwF/xwxH5jyJPJ4uYaeg7T1RJnoudnUont48OzKVWRIOQAY+9dH92xagBXE/VJuvMJaUebSNUU1VzxsJyL61KwOBiFX6BCWw== Received: from mail-db5eur02lp2104.outbound.protection.outlook.com (HELO EUR02-DB5-obe.outbound.protection.outlook.com) ([104.47.11.104]) by smarthost3.eviden.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 09 Jul 2024 16:26:13 +0200 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=rD1ryXXgg+SbImK77vPKOjbwkzevnw/vOWuCaNf/s7VTKChaHJTmRbydDIbaEUqFMNnGLR+rom39Y7uc2Iudf8Mfsi3RljB7qycCC94IQy/td3ZmkcyEB9ORe1QL58EefvMjvo63e29KvVM1mGLeaL5V6FTnIlIZCtC1FzdC6BIDic+gitKWgdnuC6q8V15zEnTYeZ4v4twTqDi2huSRywYMww0GeVT7RzMy5s1b2KlFD2e1X4SWGNvUklcKomiuaAglUtMsStwB+piJzRBc/gGJ1kcVWswQlfS6Q+Fbbqdb9HJlJZHpkusgVxNG03XPrOehEiZKd1KtYteatKbo4Q== 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=rMSbcG3FjkA/956ne7dFU6tsNnbwdrHjNAv6+ySCMSM=; b=pf39+yrCaTEOlm+uZkBxUd9Pylkd6UQwaO1hRd14YMv4AKFcZUFARgGOVcTr5OqPBvFabla2lM9tVGdVkn9HNbteRZs6q9tXAG9l1JIAz519HqPyV69/qvtJm6RJ2PzsKXlP7ASwLlDMsGnTmImwEMQcNT1KOqASDtnzarz1L1wQazJu4kH43LOe+Aakw/x0NBjYSmpo3QaDMMvkNa9unG08Gck/qSHKCGk84Rc+Y4kqm/I5y98lfDAZvELrkI+diiaxWZcrfGqR9bSb+kX5LIyERUsMpCgOayFhwsB5Nlo8xhBzlVFuke+yXnJDyQqg3dLvu04N//DwHijDfeh9aQ== 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=rMSbcG3FjkA/956ne7dFU6tsNnbwdrHjNAv6+ySCMSM=; b=jHaa4e6RHNBnkd5leIvT0xDE+P8HFLc0ORw/z+lFLpE6jYrOoLHjzZHd8yMhc58o5Dugz1EwM9/a9MUCcB0JgJUAS7URB57r907KzDU+InUVXB3fV1QX8hqF+L7kiXrG1KRkgpRvk9tBHol3PjRHHpw6w5l87y8NCBv7zQ0sC96LjkdnnrgAMftR0mLVEZpO0mlFSFoaphayXvFFSeJkY19s/Tu5aMLleoOXf1ZFMPk2umIr+wnyYSMPu0VIiNM5kkF0C3j5zTrOMWvWaH1RJSnqfUrQV6yVf5VYeoiC6ZW3ifEqPU0OuObGVu+afZYdi31HkYF/GvaG05rxKEDgEQ== Received: from AM8PR07MB7602.eurprd07.prod.outlook.com (2603:10a6:20b:24b::7) by AS4PR07MB8459.eurprd07.prod.outlook.com (2603:10a6:20b:4e6::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 14:26: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 14:26: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 v7 2/4] intel_iommu: move VTD_FRCD_PV and VTD_FRCD_PP declarations Thread-Topic: [PATCH v7 2/4] intel_iommu: move VTD_FRCD_PV and VTD_FRCD_PP declarations Thread-Index: AQHa0gvxlNSFVDQ4xEy/j0fpVYVa5A== Date: Tue, 9 Jul 2024 14:26:09 +0000 Message-ID: <20240709142557.317271-3-clement.mathieu--drif@eviden.com> References: <20240709142557.317271-1-clement.mathieu--drif@eviden.com> In-Reply-To: <20240709142557.317271-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_|AS4PR07MB8459:EE_ x-ms-office365-filtering-correlation-id: 4bc7f8e3-c624-4409-c3e6-08dca02313a6 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?QXMBN9UjVoTB0dyPgpVYU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= =?utf-8?q?2bdIiedoWUb4m2IGKDoERstxicjtVuZuNTjf8xcMWfUy1fKERJL0MJRp0MrBk/43K?= =?utf-8?q?FeVs5I3sQuCffIDAzpRnZlEVLnPKJLEzOpKT6baoOBy9rruXTpNvRSXxPTea9Kfy2?= =?utf-8?q?iDeAEka0f4vznQv3l49SbMESl6kdCLwGRIHNWngds0kCrGoaFsq6Pm+0l7Ni4sUKa?= =?utf-8?q?a4FM8tTSwEdwNsn8qLXJ76aKbsCdEh6dUGYHo4FcoltbNTEbJnIUobMt6DfYlAyre?= =?utf-8?q?ve46148HJk7pCWjtsnI4u4zTADlmlZ7TjLq5L6DZZMLTesiUrrTUDvZb4BTAiNi1C?= =?utf-8?q?+VzY+s2GflPWtFnY22L4IF2GcC+EHkWdsQSmxRXHolskdYv996TgsM7OGZ+YkWviI?= =?utf-8?q?2yCMzbx9Bdua23iH55Luhpye1eGho3scR1yqxbw6KwbHf0+uEGUERY7nWclXB4ad1?= =?utf-8?q?Tgdq6vloZ9FXTEwiakyQVzXoZ9x9f/x1CA=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?b2uHC74L58rtDxTWtCSu+5NK9yJf?= =?utf-8?q?rBcy5LJ7WP15clyrBHIJlU45MXwOxVrlhIFQv6SqF4UsMlcn/w3FvGD6oqIpgD7QS?= =?utf-8?q?KmZw1zsjZYkFEYvaJcE1sP3uFB6koim8B5myCHiI4bJPhUr5Z26Gpo+KEOlwqvVef?= =?utf-8?q?3NAf7yQGMlrd7h7HDlxmRqaMZMWLebZ+Eaf2QS6LbWVnzbmumk969lKoj3ChMZFzs?= =?utf-8?q?5SKiMCQai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rLCYGb9zHx+oEsnmwcOOWuxKvzayAjmFOXajb+bChZT8RD7GKwcveQ?= =?utf-8?q?YR4gRDVXmV2io0v23iAJuK4bg4GMuJ+BITmRImBXNiLimezgWxYoISApYLQe9j0+T?= =?utf-8?q?ldFl0Hra5nrOjhPukA4YiwSjwqU6TBCDQmBY69Q5KH+pCgVR4h4sFb8Ip1Za52MBV?= =?utf-8?q?zx/BodPJKm/MUuTj4et67ohoFrJzkTztduG0gKN/9IGfH0yBsCuT+RTLq+26Iq1v6?= =?utf-8?q?ejkuXRycHrg1fEX8joFav30lJIX0FOZeF9CApN8CoQ5wDS63fFUC/iyj/unt98SZJ?= =?utf-8?q?T4w4PlW+Dww3fnDuc1I/XbB41UQa6WeF2nG0fw05iV9xxaLrUEbkQcpB4BIQVrLk6?= =?utf-8?q?m4yLInuMKk6bC6DrrZ2ANmlplnEfzinmvj9bdq2Ekgb+ekZfTcQtmHPrwBSJvY4Ti?= =?utf-8?q?pwVW0MBlhH97xdNKtGw3ES/yNSc99W/xcWrJYXWEQqpeSJ94v265ykA=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: 4bc7f8e3-c624-4409-c3e6-08dca02313a6 X-MS-Exchange-CrossTenant-originalarrivaltime: 09 Jul 2024 14:26:09.3614 (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: NWFPlI0Z8AFEtvMNCIlxkSFTzFXcVKFJY0ThdIyqxEyIsDn48vS04ehHeJZ6JOR1g7cP14/RptyjN/G08+i2TtLmNeBar5niTOfVgY6IVkVAm2FDzDRPXJDOEIXal0Bq X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS4PR07MB8459 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 14:26: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: 13728147 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 EF004C2BD09 for ; Tue, 9 Jul 2024 14:27:29 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sRBnb-0006rE-Vb; Tue, 09 Jul 2024 10:26:32 -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 1sRBnX-0006XQ-5Z for qemu-devel@nongnu.org; Tue, 09 Jul 2024 10:26:27 -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 1sRBnV-0002k2-8S for qemu-devel@nongnu.org; Tue, 09 Jul 2024 10:26:26 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=eviden.com; i=@eviden.com; q=dns/txt; s=mail; t=1720535185; x=1752071185; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-id:content-transfer-encoding: mime-version; bh=LD3dfZ2F2UETlVfIWevvE8qQfgdkNOQiC0RyOj3j5uU=; b=a9u0oSy5tNgoSys0WjyhjN8mmNJrgqDmFQ/dtvZCUWmhXqx7clpGYYql DAhP7hxqzeVA+ZpMfbVABPJn5EV2Lc7VNzx2riBNby0oLaeYkHJrKV4oX 77K0u/bnmndzJUYfXA5H1eMWcsKboCmrvLDto4eVmh4edm45EqChBVVqO FSwo0ijteaF26+kBAF9cmW2u6vPp4w5xaPUZX7TI+Bd3hPdttQqX1Iv1V uG9QsoV+L1zW9fl3/+AmBQg/4BsSq3KgO79x4iCm43b6tHsvwCNlaeqR4 EX/oWy541HuORjV0pnb8XgD9QDUjTJI403nswVpb9AF2cAWe6QWxr56Ri w==; X-IronPort-AV: E=Sophos;i="6.09,195,1716242400"; d="scan'208";a="16172663" X-MGA-submission: MDFFOgHd5UU7r4auyfq9wTqTwmWeLSiBUlIiOugfvvWfrH9OxUDes7NVdgna3sbaWdxj+SApKoQrtbFnC9GCjERs4kZrzfeoRna3b6lKi5oovmguMHTxKF4NnH6LtbjN0Pef0rHIw+vRa37NzYR09N72hn0Q9gCy5vOdYAFrQkWWWA== Received: from mail-db5eur02lp2105.outbound.protection.outlook.com (HELO EUR02-DB5-obe.outbound.protection.outlook.com) ([104.47.11.105]) by smarthost3.eviden.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 09 Jul 2024 16:26:14 +0200 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=hh4Bi1jwggkafryvK8KPsN5hJAYShNoRNmRlPQxh17dD9uXlzBlNf5yqTl5Ee2Gn44qUBC24Z94o8aDjbNqjf49es8yRw+mMX0DeWbSgKwftwRCIbLst+j8dEcCH+Ako8GSlnVmKqDIovmW7YKOLWCXCGcJRQf4Mvm55AFJsSUQ8Ta+ZOzzx3yeOzn8qNAhNioS27vWiMsi8OMNjKq0+gMa9KbzEa0XwA6O+TIbWbns9ija10sZKp/ksFp1yfAlK8X+KqSKH0i154PR3i0neflwLcPmObSYzwtmwqMON7/0Cf6PLksUih/nTym5gl+x9LjI7w2pS+ECAZqR/ESr5CA== 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=LD3dfZ2F2UETlVfIWevvE8qQfgdkNOQiC0RyOj3j5uU=; b=bI2sTeImUy7Xzio04tbWVwZMF2Hma4w88coMfowOBWKx92PFH64EMu2gWPneD9z3P5rUBAarRBEFA90CF3csEF26f+SmJTtpkCLXk3Tw1x+GEtoLKKWHq+iVMAEh17tx3LahhpvQrZ+tOXBFCkejKYqfG6F+WteC5O7zL9RtIfTflgnK/9Zh7GHUR4KUXLzX2+L1DIopWb+pHs3E/ZDETsoBeuL4p8Dtz1+F1oS5FRRE/phm7KuYx5PqxjkvhWROtDDoXyObvSkkYpOa6AKQWA+s34rYiHZdeAE2KnKIPhJuNtktbl0eKCClBBLuBSkAIKqceWXlk6HtTvAXJhQMYg== 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=LD3dfZ2F2UETlVfIWevvE8qQfgdkNOQiC0RyOj3j5uU=; b=fGOU/6jBPQndhNLmA4y/DB/O2D4PP1tOPPp1mw6KA7zsRQWsYsCJX6L5a8QAZ14P+wbTSkQQEWkwD0/WEPb9H1KbuemPy3kAwjjB0P0UTjZnAvjILeo77o9RkgSoMMGUEbQ3Afutv5TMEGKV+bu6L8utWSPV0RIvpK5wDHdYc1LzDiYre5aJMFzvlY2dUgKvwmxKzoQp2YPsL2VXa6q6FFFklDOM8UoqY+Cfi/QFldFJ419nmpFswg3JZLI1XHC1URNVVC8JqZINycLbtaiRjOg4OLxrsjDvPWqcR/M7KKn+AfzjjLwQ9+5PV17/WaSKKkDbIM2u9KH7alRxPeOiiQ== Received: from AM8PR07MB7602.eurprd07.prod.outlook.com (2603:10a6:20b:24b::7) by AS4PR07MB8459.eurprd07.prod.outlook.com (2603:10a6:20b:4e6::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 14:26: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 14:26: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 , Minwoo Im Subject: [PATCH v7 3/4] intel_iommu: fix type of the mask field in VTDIOTLBPageInvInfo Thread-Topic: [PATCH v7 3/4] intel_iommu: fix type of the mask field in VTDIOTLBPageInvInfo Thread-Index: AQHa0gvxim5DZG7IQkeXyOKD2lbMJg== Date: Tue, 9 Jul 2024 14:26:10 +0000 Message-ID: <20240709142557.317271-4-clement.mathieu--drif@eviden.com> References: <20240709142557.317271-1-clement.mathieu--drif@eviden.com> In-Reply-To: <20240709142557.317271-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_|AS4PR07MB8459:EE_ x-ms-office365-filtering-correlation-id: ccab5a72-331e-4ac3-acd2-08dca023140f x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; ARA:13230040|366016|376014|1800799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q?mktw5BnfAZtEq8yTky/nIiP2eXtIB0shypqE4Qga1kSHph33W9S+xW91BdP9k2cJ0?= =?utf-8?q?E7JvMmtxBIfifvaYIw0w20j0sDXPX4HC/8puFPB2ZpIzE9Ny/+n/P18CFncGPEWUO?= =?utf-8?q?K3P1hBT1fY/+0UrD5jfXy8i87Ypbsd+MnkOu70HPGRRvAbAVhsS+X+1E5Gk+b8S+s?= =?utf-8?q?gmLQfhXxeeRl0ynU6y2ZugLxLjxi9d88xgd5PvVWE+EJvOzQtwCuzAjxfE/GtJ32B?= =?utf-8?q?MlCV5s5m6VbTESTfru5ZNo7HnDLOJWHaQNljqmyYHv6pKPBtYYw+ROjXTyil4d0VD?= =?utf-8?q?kAMu/5vN3641Ed1xsGrNyu5L8xcULp80z89xxP7wDI3N9kF6LuTVtdeB3Jp3kOrrJ?= =?utf-8?q?CFJN/vx2ITGCYC/2ktrnNkjSLa9QIcD8xYyKcN1tOqoBhPCsGkjtrnLlJFZ2yo61l?= =?utf-8?q?eeaqYwnjmt3ImgjrBA5PLnom9rI/FobWF2iyi4YI1fVlUSkYpura6UmMI3zc07KU7?= =?utf-8?q?fwGcG5qrY7cq8Kj7i15CpqVY48PaBZdpmw=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?uG8DyHZLhEZI0xmGBaizH3wcThw7?= =?utf-8?q?vOMxhrPHagIhL7As4vRAzCOPJyXaMrU1WSzOAKpLjDClvNsHwHCUUBwaFOHCkoRTD?= =?utf-8?q?mnCmjCX88CnXmiTJmOYpC5OIIr7sCEf5E5DZEBgAcLjkCI2HD0hMBPaJkv/0/u9n3?= =?utf-8?q?cws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JGoG0jLVwMUMqwpEtFCi+2PYUK7PeZ5riCJQ7VOVMEbBhM9xOZP1guO2ausyKjf?= =?utf-8?q?DHW/Ym6Domlu/JDuiHa3nsqONp0Hjdfc6SfT8vfgfgvWmZ9PjDpRQCWGmTs0YRq2J?= =?utf-8?q?u6m0SPZztWIocL5p0LnKscFPwIVRLxHghl0OdhNCMUVFkZPFZzNJOVC/4AS4Jtyr3?= =?utf-8?q?yvg1IpP/ulTjAnpvM4wD7MvnSbX4iNLVU6qQVfvcL/3HvHIr272Kp5tLTUWNoohx8?= =?utf-8?q?7MYMcNT4EaPKgFYzs5UXi6JEs0fx0I9b2jQM5mFyidibYSFlcf4BrGCvupb+3YEhf?= =?utf-8?q?MkZEkwrAoSFtEdevUf60kVfXhyLkslEjCJRlYvO9PZwJzLtjCBuy9wlPET82qi3Bl?= =?utf-8?q?miO1cd1WWqS5VN5LwdV+qCJAamGbRCduvM7Jjuhc92hUhwVvmLYKgi+lMTIS7CSGt?= =?utf-8?q?81vhdjjKT+bA3OM6CixAQJaMo1o9jrCURQbwWqYY/DERzra8XFNKVGrc8Hy5zNvCW?= =?utf-8?q?291UxeE7lVw2ypaG0fE3iAUKDrxgzHJcTOiqc50wOYex9/2jMEI4XmU=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: ccab5a72-331e-4ac3-acd2-08dca023140f X-MS-Exchange-CrossTenant-originalarrivaltime: 09 Jul 2024 14:26:10.0313 (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: VyKgq2WgTx/PqY0PGel1kDoOJ9z2/KWYIDQj+pgFiuxY8bJKIr+uI8cWk9y6ZhE6s5OGEk7VSzOZbC0za0YPtxoBD13dIAZAIg7f8HF4fJspcLBJi7uh3n3h5c3V08IY X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS4PR07MB8459 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 Per the below code, it can overflow as am can be larger than 8 according to the CH 6.5.2.3 IOTLB Invalidate. Use uint64_t to avoid overflows. 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 14:26: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: 13728146 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 84BD6C2BD09 for ; Tue, 9 Jul 2024 14:26:45 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sRBnc-000708-M9; Tue, 09 Jul 2024 10:26:34 -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 1sRBnX-0006ZL-Jx for qemu-devel@nongnu.org; Tue, 09 Jul 2024 10:26:27 -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 1sRBnW-0002pg-0B for qemu-devel@nongnu.org; Tue, 09 Jul 2024 10:26:27 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=eviden.com; i=@eviden.com; q=dns/txt; s=mail; t=1720535186; x=1752071186; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-id:content-transfer-encoding: mime-version; bh=HE1nSNC+fM1pwokpWi9++/4rNMhNj9V1sCadInCpIzU=; b=eWdNAUM88XqvMpsRLDG9atT5/42R87yjT57v3Lh1T010Ksicp2CREGWg ZAtWzIG+iFdcSSr6fdYhz67p+pz+xTLq9GP2NMY1sjtCW5oFa3hdfRiJS NTmLB7YzTfXGNtX00MDhLZbZsc7tlof3TvgYICjDJfso0zs3b/YE1cA5E b1WFxF1PK5KGrIFv6GxFNIY0QCldRC0K1Gg3OKHkZ9cUqEpOj4XiWMOlj RXXJvBy2e5A9Yz58acPYwLQOY2zKrUkwrX6ZE7ojyL0JXazTRPVMlF2/G vbMK1q4KdgEeizdt7KQIyFSShrNva397Pztjg9wKrgssLFBqSp9msXcTl A==; X-IronPort-AV: E=Sophos;i="6.09,195,1716242400"; d="scan'208";a="16172664" X-MGA-submission: MDG+5ntEpwAgC68QuJnMBPpC3A7wgmGE4UYMjngDd2aBHajF+cxgk7i6RU5VlAJZyxgQUMAScoKkr3l6BRt4CSwrQXdFMgp9fTekcghx07uZnADruegqJkU37mPehSJWJ3A3i8lR3R/ZF30PxLJq8bwlc4vsM5V37wd6NPiOQL25dQ== Received: from mail-db5eur02lp2105.outbound.protection.outlook.com (HELO EUR02-DB5-obe.outbound.protection.outlook.com) ([104.47.11.105]) by smarthost3.eviden.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 09 Jul 2024 16:26:15 +0200 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=FZSYJf4FQS41HC6VAMZaLcIMXCXe4YnJ0BYwOYNpo4kiEuciLpuhl4a49fyg+EwwxLd5RF6Lj+KhY2UmZLF1hBmAL/W4gKDQPuvbWO/cP9LNEdQyjm2XvOWy5J2ocmp9gLKrA7zJypBqK6KvVlPO5zJrx01qJtduTacYzbsOAUKTDN6ejluAgjUSzYJv7UTPjF8bhyJOtm6xgMme4oU5AC7CEAuFJFen92kaD9RChA5kToaU9sPOvFrPioOETFeWdhUcHmFvCRsRVLGbHFhAbzU9vNM38t7KNzr5sfP++tNKbgFAC4+j3iShysrInlqToaV0BuYTLrhKVcU3R5nz2Q== 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=Drhw/A2CQVxykPG/XF7Z7D21UfdGP6FvuHZEnmzvMcibU4NLrTasxHkedrbdloZMi0Booec6wfcK0QNhysH9puKrUlfrTCFoMmKfVcSAeOUrJoDyerma4zRvwSCj4U0vQx33XMB64O4RnA0ljvgI3riPuFGf0a/wmQfX5ee839Dy1GTXpXWHlbpEc/+kU76zq9otubW02gQbzMsW++AFW0LrkfXEvbcmT2R34wQQlRYUKKkFcUDJVxAOU5rlibM0owtJfcQ8CfV4VW54k0KxHgXs51LbwBQlc87pKyL5JQG4V9j4Msdf/shoicWQDq/jFY8cCUnsb6QAGYH01pjIAg== 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=FMPHHDrF/PG6Ng4hJ78dLsBV0RUEFKGdQBub/FFe89mAQg1c+/sirizPJmQZfG678I+A9Adzh14shkWwDaL37gPkgpj/NQ/MfdBsmE17dkCdfOM3T3cYTjVWgxqlNgBM6xRecRP8xWlwTEjCmAtF++b7DM7Yr3DwgjtvBy29BWJoyYEUelNM/5Ra3MB7W9y7NAqdtj5G2lrS9BV6NZobBexENf90bWSK/LBr7FL8k+CFdzIGi1/z86SIpGYYVU1OyAnDn/Nr0S0ccJ1VTAKQi/5XgHkqE4nSnGkxKUaWUwEHcSJD/uFGStiV+ipT2jEOQy+Ci+VYxPUOMBMYjc78VQ== Received: from AM8PR07MB7602.eurprd07.prod.outlook.com (2603:10a6:20b:24b::7) by AS4PR07MB8459.eurprd07.prod.outlook.com (2603:10a6:20b:4e6::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 14:26:13 +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 14:26: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 v7 4/4] intel_iommu: make type match Thread-Topic: [PATCH v7 4/4] intel_iommu: make type match Thread-Index: AQHa0gvxRjyKfg1NiUKh789rILHFuQ== Date: Tue, 9 Jul 2024 14:26:10 +0000 Message-ID: <20240709142557.317271-5-clement.mathieu--drif@eviden.com> References: <20240709142557.317271-1-clement.mathieu--drif@eviden.com> In-Reply-To: <20240709142557.317271-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_|AS4PR07MB8459:EE_ x-ms-office365-filtering-correlation-id: bb01d6a3-ddfa-4816-904a-08dca0231478 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?b9Ct6PHCSJ5ZNMxNW2rkUjBTN3zUVJT?= =?utf-8?q?bLG9URJ2AXieU9wiAMHz7Jtu8P/sLHl8fWyC9XwTA8V+hlrl4FZi2nnzs4JAISYU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-8?q?mxxlUiu4nzW+664eRQh7gi3QgZS4LBkiQT6//JLD2mwnTY+pShuDxsL8oA06HHkes?= =?utf-8?q?awgXtfOtMmvAVuRgc3iuaDAEfV9MpBaMtCm5o3OQ9JBfEg9al7/uMoDhXgS1hahpv?= =?utf-8?q?y2zs0BV8jHPM/Zox+cKoBnU1dkHC8NQOHtwFmKbUhm/nu3hJ4NO5WB7y7dNZe2/ou?= =?utf-8?q?rs/ChlXsqf2cHgpuo7RJP3LEXSJlzTkP/5Y6dOiG0vqnP8ZFYiBz0jNMjE3DfpK1+?= =?utf-8?q?1I15MNsuHCosZ2HIMYN6FiS3Sp05gH2qFhln1QB0EdPgcW5bsZR8ufpONyf/YLmAv?= =?utf-8?q?D2FoHemlqT3+vBGrxrb5Ruf81THt+gpZTJsFO9b+z8SKJ22IOhVHXXzNaZJ2WVrEh?= =?utf-8?q?GAdyZqfZwCqL0/2IwKYUJ+D1+wUV8h9Gfw=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?rYU5ke0SCjmqBGiXkaGwSkHgvnfG?= =?utf-8?q?VKc5O+DFbbTX76n/fs6Sc5exzMYUMEkp5qLQQ9U7+fPlpkTf6hLGnpQKAojVxLIIG?= =?utf-8?q?hRlm7Ds29FzvHz5Bu+jp6R45bxfwyMvkEywzAQsFI9cwiyRiK2FUhqivu5FX5D6cH?= =?utf-8?q?JyP75ZA82Kny0ndZcQOkNhNBc5c1sutO88UAwifhNC9VXJbGIstMpwyDGTYYwfzXv?= =?utf-8?q?6FRKdVeG36Cr7BohJl5F9CFFhaOB+XBb/0ZV+Az5hVjDSMpAkyue1kT4EIyV8FYp7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8?q?Zsj0MjouHE5uGSjqyeu7z5WgzsAykmN6cDg25RCqJWv33XRBrvUn2NkVOw/V0wZ7J?= =?utf-8?q?8M02BX742FmAJoW9kUpWyl3DBrEfnizO0/ne30NIJ0wnjNdAWTtsTMkSCB/othF4a?= =?utf-8?q?KVfmD+IiKCgN5+IhYrL/dzkAFcaOTo+Gt1uqtbGtmfYZLSR8rUVZm3W/OOkPKNUMA?= =?utf-8?q?q6Ey4aWmDSXR0848abr91m4E1lECG+ewMuX4nefDeSIm0U6pOuO8cF6D2hD4krfq8?= =?utf-8?q?esjIZmak+Q6lLE2RO/kVG2ArPyR1/49wvQ2c/b7Pbp7laC1zGkCXQQlPzOmhzwaDe?= =?utf-8?q?2oBgNOCKOKYe2jQsncx0fbZx/sU2kHMb7nBuyCapNuXuK2Or4DeqlYLvv3Bs4r0hu?= =?utf-8?q?Di7OX2v8CqZiroKc9DKyhN49G1V2yxWMdYmgbF+2ppC79a1Df8HKe1I=3D?= Content-ID: <9A237FF0AC58C24F933878A4935EAC3E@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: bb01d6a3-ddfa-4816-904a-08dca0231478 X-MS-Exchange-CrossTenant-originalarrivaltime: 09 Jul 2024 14:26:10.7457 (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: eTm6I7nO5AC27XoljQ38+g216WPplaeNMdO7BptIn92LshGN8EARdxSBnM/rsXwqD367dtKoPYD308dQ3nFSs7rBJOuCL8rL6Qdc4JJ6ricV7Ut2cYn8VS2TzrdHimbN X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS4PR07MB8459 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);