From patchwork Fri Jul 5 05:03:16 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: 13724414 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 0324EC30658 for ; Fri, 5 Jul 2024 05:04:10 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sPb6V-0005LS-5B; Fri, 05 Jul 2024 01:03: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 1sPb6T-0005Kz-DE for qemu-devel@nongnu.org; Fri, 05 Jul 2024 01:03:25 -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 1sPb6R-0003dq-BM for qemu-devel@nongnu.org; Fri, 05 Jul 2024 01:03:25 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=eviden.com; i=@eviden.com; q=dns/txt; s=mail; t=1720155803; x=1751691803; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-id:content-transfer-encoding: mime-version; bh=n+KWipWUJfWSA2mhPfNQC43RVT4lkeLpK+cxoqpKD4E=; b=VnOqRd1Lpmc7D01+DqUg8orV9wHWGyE5G2RDg39PDLVlAcyutTjj6pPk baikHeNg6wy8ILPP1WPizSaIT2TO69zT3lFmzjWmrd4l9lMcCH8TgirsH bRh1Qq6SyxdvgfBcg2Y+We/1w3CuWxAqhyfnSJU2cDDxS/JAQUxuRr1F+ iRfmqy932ypIhj602v7rFn0oYo64tw3/+dW5bGQbdeRsANx0kM+3i9tIV A6EZ0h78/kQodGkPz+ySfoN5t3vxI8WtgnVLpay7LfXJtdx7pYjw02ngZ EZk0NZwickOHref8tVo2Mx7h+uqID0g/eofzwnWbnj9qB9ReUuBpYTcMR g==; X-IronPort-AV: E=Sophos;i="6.09,184,1716242400"; d="scan'208";a="16030231" X-MGA-submission: MDGEHUwOIuPgVdBdVf16c1kNXZ42L+f3kxqHpLBabrcBpQbhj5jg0Rgy7ECm1tWpS1V6KyJzyn7DPD/xFiQm/aMWQYHdgHSK3MzEN79eLg8L2Q9m+kY9YzHEqL5f+39YNtV08440beR2BZv5EPGf/nNOIeKawb/mM4L51kxXcjje2w== Received: from mail-vi1eur05lp2168.outbound.protection.outlook.com (HELO EUR05-VI1-obe.outbound.protection.outlook.com) ([104.47.17.168]) by smarthost4.eviden.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 05 Jul 2024 07:03:18 +0200 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=OZeR8yOeCg/GnOujNsxAs9NfKuSsk/9qDxXwjxOCkZ11bALkQk+2SffCu0dSj8A2RyBr3Uk8T71gDrBpeSqeC4QP/1yN7DQDOAE80F68XhRQ+hZwLxy53XLBY3cz+c9828+tBcPkOHDP5Ynsh4suRNjw2/CJL/eIXtAnc6d5gkuM8eRaVH5JGFE2rtrhHIygebNBHGAd+wU/TAs6KaGnGetOyVvPbB4sIm1Ea12cuvConXt6efCVBE/U6atiT5OO1/a/CzchptY6RkilOyxt+ShLFPvUuTY+L6bnMe16/ctf/n2fnT0bgMxOqgcufT/MCj9RMB9jBSz1sntkbgmxKQ== 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=n+KWipWUJfWSA2mhPfNQC43RVT4lkeLpK+cxoqpKD4E=; b=axgUejzfv28JHZhnt/dwpsGSlco7/2EedyIlQ8GVH/DqPRnlaAk8AGs6YWAd/Huv83P+WleO2pDzTvu1qFNQW9Kh29lGRMf26QFzmTaEr88OgdnUyDjqSlx4oFHLPFSJdcEPLbLCl1GH2tSKnffOIpls4w/RedOOfx/X2JdGMsGAEltEqNYTnN01kVAepwmO/pVbISpOcLRc8ZKFCPGSA92785uqDrIDfYMS962EducTDF/g4ovF074zZmslLbLD6pxlIEm+eC9c3VhVv0lqP+sweRTGPiX0Ao4b6pxVilm7GDBR/4ZZ+ir9XoEIcYeXxNea7BGEEhqOUYZbHuLEKA== 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=n+KWipWUJfWSA2mhPfNQC43RVT4lkeLpK+cxoqpKD4E=; b=Sbf5drm6Ecp832cjI/tgQtbLh37hRy2bfH9p4cgeJAcQGJTwm4WWNheWuhW5CxgM8KJAjjeEGjnp5c/QyjZi1X3G8BojJGGb9IhMn7Vx5JT8W6MN825lFHALFgFEtaNpFUWma5VuSTwR/+BnS8BymorDyXgN8QpG26UJj6rrjZUfVTQP4swwVlZbvyQ+vP6Om4/+9RyWhTvn4WeXPBa2kt1f2iLqxTiCCJ0fGPXIvGmBsrCgkq2tZcMw3KinIN7rkCDPdy+uNEPrP2I0l5gOmbhO2lGH+WAT9p30mwrmslgwezpNWBd5bact0Nep0HFLR8pdMqevY9M1fmz/ekhJLA== Received: from AM8PR07MB7602.eurprd07.prod.outlook.com (2603:10a6:20b:24b::7) by VI1PR07MB6542.eurprd07.prod.outlook.com (2603:10a6:800:179::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7762.11; Fri, 5 Jul 2024 05:03:16 +0000 Received: from AM8PR07MB7602.eurprd07.prod.outlook.com ([fe80::fbd7:ca71:b636:6f9d]) by AM8PR07MB7602.eurprd07.prod.outlook.com ([fe80::fbd7:ca71:b636:6f9d%4]) with mapi id 15.20.7741.017; Fri, 5 Jul 2024 05:03:16 +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 v3 1/3] intel_iommu: fix FRCD construction macro. Thread-Topic: [PATCH v3 1/3] intel_iommu: fix FRCD construction macro. Thread-Index: AQHazpilPvi8AA6UY0+AS7/gkgP0ZQ== Date: Fri, 5 Jul 2024 05:03:16 +0000 Message-ID: <20240705050213.1492515-2-clement.mathieu--drif@eviden.com> References: <20240705050213.1492515-1-clement.mathieu--drif@eviden.com> In-Reply-To: <20240705050213.1492515-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_|VI1PR07MB6542:EE_ x-ms-office365-filtering-correlation-id: 91f817e6-5f3f-483c-79ab-08dc9cafc7ba x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; ARA:13230040|1800799024|376014|366016|38070700018; x-microsoft-antispam-message-info: =?utf-8?q?mVH1phwI1SCl/H4ENpG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E1Bge40uBsvQ0?= =?utf-8?q?BT6PYOvRE1xg5MRsas6Exr+Z2/RoyX5PNnaef9HIHTG71U3cpdilJtegHAv6ajFo+?= =?utf-8?q?mIjRuhRsKfUF7maM8JUHcCihPEFevMAMQm4pfoQwWQEPhfrFw2UrBuRwkfOf98N2j?= =?utf-8?q?BHODQV7jp+SUao5KmEVXsJ8w0/vF7Hh0PPwZvtrurPd3ASZrf15SGhKIa1A6gfgWX?= =?utf-8?q?lNTFyrzRpmm68X0W/hxOT2/PWTUvoTR4XvFeZGSrq5TxBdWkVeYNqZKxFUnoQWyj4?= =?utf-8?q?bp8HiBr3JPyDAjB0WDKBlkAgsw1YhHpg7hEtmzLtQ2zELHtQOeiatBU6uXNElfGzw?= =?utf-8?q?nu2++wOWXxZZbs2l00/UwiFXnZJm5QpC6y4QbmPwnZpt464v4XGvGppRTjCTXAI05?= =?utf-8?q?fwoc5/S+dBVIfe2wrUkdUuaEkmIPum3njXyCRaVl2kpdWrHvBKuyn46aW0bB2y22/?= =?utf-8?q?90DCUwSC7E9ju6YSfliuKgyj9Xc/XbjaCQ=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)(1800799024)(376014)(366016)(38070700018); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?utf-8?q?9Ws1boPcpDD93vNmg7njQrojkfq+?= =?utf-8?q?CpV4QD0jhZFNAiaLL0UfGvIBjo2G7L4OMOm8IUpUVud2aORjO0ZikeF25eIiDsicb?= =?utf-8?q?NNO8i52dZz0YmfCpiOdgvTeihT+ltQ3wjQzqskIgnqgv4pdTZszkdG0FN4Zl7mOT4?= =?utf-8?q?E/XLuhzhagoSs5fDOHgj092LBVAcOQA1SZfgzDKVF815IkDtTollGR+KW1qNX53eE?= =?ut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5RtY0OXdQmXjspA7GWoEFhfj+wLre+tLJTOI29s4WMCKWNyHX6tzo?= =?utf-8?q?ucK28xH6VKH5kxUj3r8A7dgFS3ohaWfxFtXlI2SUZUP7sXl+wsithRgdX81FW0K9C?= =?utf-8?q?LySQ8VAHvEuJRoa8FwiDGgMlaQeiS4+QLH/fMwc/Qq3spy5dgrjHw3XfobdTWd+e8?= =?utf-8?q?/izSAL4q//Dz78yBXaR9meXRugCk++suoIZQkSYfUQFxzb7KDOZGCT4lyGKk/yyos?= =?utf-8?q?zkKpMYXT9U2hPfzp0C887mrneI6zp4I5/AClSX9FEk1ljwERxGdH/Q7v33F2a4kqP?= =?utf-8?q?KqouO0AnkzzbB6CxDlQzMehWgenJMpUT41dureJKdkOHr9L42jaorUafK2ZlwkaDK?= =?utf-8?q?li0MOcKS6eLFSZSiG/KpCnM29E+guygUE9Dkr+jGta7e3uOBVQOYv6+zxXxTy5RWS?= =?utf-8?q?SduVtHFkQYScwJV45yyzZioKH4Uz2n7Al9PjXzsYnfK7cdQOSvK+5vw=3D?= Content-ID: <2544701311DD0E478C9928077DE812AA@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: 91f817e6-5f3f-483c-79ab-08dc9cafc7ba X-MS-Exchange-CrossTenant-originalarrivaltime: 05 Jul 2024 05:03:16.3538 (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: v3wRJh1LyciE6IKtL6Y0lHkVN24JQgS03yEJuRiVo9m92U+oXaFWs8sx5+cYyxb4/zFvhgfljHqJuMyqFuJTJ4UMM6134HlX4C7za08tmHtGHg5FhVGXKVP+2qJ2B6yQ X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR07MB6542 Received-SPF: pass client-ip=80.78.11.85; envelope-from=clement.mathieu--drif@eviden.com; helo=smarthost4.eviden.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 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 --- 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 */