From patchwork Fri Jul 5 11:01:56 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: 13724969 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 AC3B6C3271F for ; Fri, 5 Jul 2024 11:03:37 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sPghl-0006OH-8p; Fri, 05 Jul 2024 07:02:17 -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 1sPghi-0006NM-H4 for qemu-devel@nongnu.org; Fri, 05 Jul 2024 07:02:14 -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 1sPghg-0001Tp-Ql for qemu-devel@nongnu.org; Fri, 05 Jul 2024 07:02:14 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=eviden.com; i=@eviden.com; q=dns/txt; s=mail; t=1720177333; x=1751713333; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-id:content-transfer-encoding: mime-version; bh=pqwkHTle5zShwb1UCmzN30OIyPBuDlyHBRRNtdojXrI=; b=KtlUg61o4xBgsp771pGfLGfMsGbaUokSTYZVkFrclZjDf/0k0byce6a4 /AFQubHaejnkCAflm9AvlCPkL69UeSzmlfpzO/nFcIU3Ax1BevxjowDDe r5FckWFTS0XKR3CUvRUNIGsJHBRu+CiCgAW0Nz7mxXdRlob1Ih2eVGGVc 3qD3Sxewc3et2ShcEq8Z6ahvmyDwY5eRe4bnFeV7TmFWfCygKjXPG5Ruh lQk7SGmZTL02OxQXNOUj32/urmum4eVxcc4FTLJStm3nndkSyV50s4pW7 R5f1LDFE9w82FYMEXlht0Xqs1doxmcizaMLmDnFJI9TfwWktL6vljRXj2 w==; X-IronPort-AV: E=Sophos;i="6.09,184,1716242400"; d="scan'208";a="16056518" X-MGA-submission: MDF81VNHdETT8m7DUYm1R9HzmQbRFpR8fLT/F8LkxX/MCI2D9ADG6pHXGr2A7hQDbAasZY1S9rgG0bewF/yzzrxiDiMN4nexmTYKGyb7FyhPZZ1QgSWF58Bnp79tRMmInaGOG5V/qBUcH2KZL0uU2rEh3orgL67uNvnWFPbdWiijvQ== Received: from mail-db8eur05lp2104.outbound.protection.outlook.com (HELO EUR05-DB8-obe.outbound.protection.outlook.com) ([104.47.17.104]) by smarthost4.eviden.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 05 Jul 2024 13:01:58 +0200 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=B4rLa4Z6fUS0t6UNSRAqXF/K1V+moAB/dSv3m36onN6ScJv74vKexUsxA1IjpERdAmsmnHgwVLXDsTJifVTacNih9qhlIQL/LCVdwQsyaxvBpFl1mFK3+ovztAKEByKLfI59kuXb6tPMW56LcAeRdMQaUelXrzLbWYsMpDvWIuvDhkIbbERa27MnEo+fe+Q4VH6Y4WhtyuDhem5GUcdcRrDEfaWEiiAMqoNsFj/toSMsOIaiYLbFgLFna2Q8m5R7wHlUjAOn3rw4l0PqkXcVJCWCQ60EScPhkeeJQxF8lx4dCZ9CWoLx0Z0u5MFQpkX3RgiGCctIp8eat6KhLN8wHw== 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=pqwkHTle5zShwb1UCmzN30OIyPBuDlyHBRRNtdojXrI=; b=NSSDa9RtAqT2epk9AExU491oQ1iDF6nQdrMZ8VovPayGOuZPX0TnzNDSe5aWbphHDeQGv5P3JtEOGnMEN866OSoo+YsjxVNHnO8KdBdOCAl3UpakHtprhUGZ40IjIeg1Y5ZsIbNDXiCtlurGS0ytOwSzY54CDCgTDTDdngBXOHJof0nO0NXLYbnZUL5+RT/LDieLjIukJ+ppa+TyRhTMDjHqPFKlIz+T2IpEFULz/APvXFUCsKT9XTdEefrtyjMa7M0yIPkMsEXlgDemu4JYtjVM90Uq27/kHDTc2ROYSgT7NKapORbwbLbzPG7OE797L4Y91Z8pjUC9A04epo6Spg== 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=pqwkHTle5zShwb1UCmzN30OIyPBuDlyHBRRNtdojXrI=; b=Grgg6BmwVm7Dxp1YUghj0k+OKHaESzI5/HWL6cX3OiJ9raaCtr9t3Fn4F0bKUbTY/HQMPLzCO+AHwwibfVDn0Xrmy4i+PCbRx8OXHGwf6Ch+4krRWhGBs8Pmky4Tfyq2ky53eRlVuYwzL4Cn7gmJP7DmNglQqh7efnlwIEU8k4ONb27eDBlfevYBLqLC/IltpciJqbsRqKjMGCyRlH/1GdUV5DPrevv7NBWVgYuorfDJOR4pyHG9RSYzs4tthpgv9s25xOo/KNVWEg6Rze2iablElD9PIqF2eUaLnZxpI7i461uKy8WRoe1XwFiKEnv77MqvZeXNBZI+ViMw6cQcAQ== Received: from AM8PR07MB7602.eurprd07.prod.outlook.com (2603:10a6:20b:24b::7) by AS8PR07MB7303.eurprd07.prod.outlook.com (2603:10a6:20b:259::9) 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 11:01:57 +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 11:01:56 +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 v4 1/4] intel_iommu: fix FRCD construction macro Thread-Topic: [PATCH v4 1/4] intel_iommu: fix FRCD construction macro Thread-Index: AQHazsrARhZLqun5JEis8sZiKlyPAg== Date: Fri, 5 Jul 2024 11:01:56 +0000 Message-ID: <20240705105937.1630829-2-clement.mathieu--drif@eviden.com> References: <20240705105937.1630829-1-clement.mathieu--drif@eviden.com> In-Reply-To: <20240705105937.1630829-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_|AS8PR07MB7303:EE_ x-ms-office365-filtering-correlation-id: 5bf0e129-ae69-499c-a499-08dc9ce1e300 x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; ARA:13230040|376014|366016|1800799024|38070700018; x-microsoft-antispam-message-info: =?utf-8?q?VbEEJn6UL82cxNqR3Ba40ku1j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cO/?= =?utf-8?q?3aVvZTKDd+X3ifmRzbB1iXpw0IDQnQFXNBUyTWlutM5UIYLoNvyq8ZrWSNvEeLK0E?= =?utf-8?q?HHHfyyKknSD19XbGnpfS72CJA/TTqjU5CY6FLy84jkI6aclrijdsZ/+L6/ggiJUg6?= =?utf-8?q?Jh1/Owj9mAwqWq/ejDDJSnXge1Fi80wxuNXoUU9vm0ylgYOHTVEtA0bMDE/7isX/J?= =?utf-8?q?U08ZzuNHAtk4kl94Yee0VvH+XBVC4WHA0+kIyiz2G5mA1KIeQneMlk0e2hMmCQLez?= =?utf-8?q?km8Er2d4cxi1CoVxUaEHebDFWy0/cML1AfeG+x+4mNLn2nsN6vLR5WIi+5Jc6ULQe?= =?utf-8?q?P1voinfe57QmaBhcFGQtI3fThshERpy59zcyonWSyRgoN1CNIROvOEbQi2m1/BFUM?= =?utf-8?q?9kbqRO8AsxPSOJ3+gIq3h5TYUNrGvCG9MvrHGrDGI2/UXUSpZ2qquF32CZiwqqCvt?= =?utf-8?q?mkPstMcEvMgo+9squKYflNd1K17SJDwj3g=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)(376014)(366016)(1800799024)(38070700018); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?utf-8?q?qAa8yr84V+n3EUkGNlEijB/TxxBJ?= =?utf-8?q?P6cU2KDOH3nCTz2wWVuLWFxi8dh6YHOAVGqOj9egGCiSeIf9j37BD573qMuJGbrLq?= =?utf-8?q?692aDYIIwemVkTqG/X2xz1KoyMvrb4zKIQeqMzlM4bZ+E4wmQW2Zn8S4lhN19gOZ9?= =?utf-8?q?2KNbRJBPtg82U6DARtml7dtsC26Jm2W6FCOOPoV0ZVT8n2482f6OmcuXhDGPqfqsQ?= =?utf-8?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u3Mm2hsat6qiGgczRBux8sKPJdIZY4qyqR01674weHh1phdjuXJJhs?= =?utf-8?q?6+JqSEjIEOcBG2U+Q/AUJ9Gnfc1asU4O5FReqz/TdkttGP62YCL5EdJsm2JaJJ4wt?= =?utf-8?q?CzrxBfMfk/gIYSWgwZqQobEzT0K8ohYoQBkRMDpUObSomc2I+E3leb9Z8ApMZp0hF?= =?utf-8?q?yvK89Pwkhx5TAYuG5lHjzndOGdkz0uzgqtJ/XLhoAPIon481LCTlJOr/rFuVY5/rr?= =?utf-8?q?ItO9qmoGPlfTsyGSHTtOYsicBBm28s3ibGJyKjl2w2D68SuWTgXXjvGM2v6h5Rq98?= =?utf-8?q?8wNHVFxWHYtoQyiF2bPjX5Om6d3BzzLEy0+XiVfSL5Ikp02EMJxfaYbgsjD9sR6zv?= =?utf-8?q?oXNfx+TQrMAZzCpXgZTikFj3ME5B9No0SSxFM573FibmhGt8wcel+bjQzxoAXSXAB?= =?utf-8?q?sz/vAizTHJ9mysJ49WFGP9f5VQ2coL+aVkLWX692Hb/O+SPONe04lxg=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: 5bf0e129-ae69-499c-a499-08dc9ce1e300 X-MS-Exchange-CrossTenant-originalarrivaltime: 05 Jul 2024 11:01:56.9537 (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: 9C1uPOXehEW7YKHzXo4VgdMTlsM5hlWE+ZZG2vB5F8pf7IBzBvN80uQxNq1F3jw4Q/Y6gzqNKUluL+v/LLG6N5idWWVRDFT99qb0OHEk1Vmnh8uq0W21zzErNnXJ8Zh3 X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR07MB7303 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 */