From patchwork Tue Jul 9 06:18:07 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: CLEMENT MATHIEU--DRIF X-Patchwork-Id: 13727299 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 2A09CC2BD09 for ; Tue, 9 Jul 2024 06:19:47 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sR4BE-0000qx-BG; Tue, 09 Jul 2024 02:18:24 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sR4BC-0000l1-MX for qemu-devel@nongnu.org; Tue, 09 Jul 2024 02:18:22 -0400 Received: from smarthost3.eviden.com ([80.78.11.84]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sR4B4-00080Y-9D for qemu-devel@nongnu.org; Tue, 09 Jul 2024 02:18:22 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=eviden.com; i=@eviden.com; q=dns/txt; s=mail; t=1720505892; x=1752041892; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-id:content-transfer-encoding: mime-version; bh=u/EE/MVYvmwVs8wPu6Il6DxMESvsWjmJtHWqiv7M++c=; b=c2j3YLxpTs1D3C3/w6uJAdjMbNrPqsZFBDiXTK855uGoq7d/hjivey2N gmWw/w3M5LZ5GzIreFohPLTc9MsF9ngrFN8LUo2oi+8GtQ2KjebGl8TrQ 6pv5MQSi8cJqMsd8P6Mr2ba4YKRkHlZTLbc6F6a4c7AfjDVioDusKOiLO 5BKOMfHsESf2CoqUA7rbXHdi5oEwXuXWgxnibmqLDIDk07k0DP53P97FB QHQktWfXc+HjNxs2oFXyGg5D7tpWpYaC3H6ukrO3aqCaPxsyESqx4gJYy sYykCphttpQyRIzY9A2XqcZVtKuRnUWmzo6cwPoeY7nECUQFGzYYVwmrC Q==; X-IronPort-AV: E=Sophos;i="6.09,194,1716242400"; d="scan'208";a="16131806" X-MGA-submission: MDFZkqDnocJs0Ve7nOf5mK0LcPgE+m5APfHnugirGUpw6OOBO7dZ4uNmwwOS0OVXXyV+If3x0YJIt2osAXlDSJ1/F+yZG1ZqUbj8/Mt29liI47xn2HYTdIuEpxVy1A4QMHGDUdwMwEAOxj9bn9u8F22zW8LIEGWidm3RLMdW9Xh9bg== Received: from mail-db8eur05lp2104.outbound.protection.outlook.com (HELO EUR05-DB8-obe.outbound.protection.outlook.com) ([104.47.17.104]) by smarthost3.eviden.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 09 Jul 2024 08:18:08 +0200 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=mKsznQQ4g39mbFBVWIHPQZtUXO29S/9KnpUsIVNZBq1OMpDrD6v+mB91WEHvWZBWrCGNKoZNFnF7GwrmhFDre/ytlzyAGw5GKA0KCa0PE4wORU52BE61wv82X++/swzgYNocgaTMl1Fk2jAgvyjK7S/QA41xQYSO+XBONYZQie3vDlpIbc2xRFuC4puPWxpGmV8V9YY8ytel6fhB0RVdpBeop1JoVgidCci1KFQVJuYJSRdElHaxldVZvK2k8V/rww3Y52Ac3IJyeld22TcLSMBhHPnKWLmXRu4zDlV0Ulgc/ecSQ69rGaQubThGKn75YlMoig/gtpsnzAYAqhzx8w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=u/EE/MVYvmwVs8wPu6Il6DxMESvsWjmJtHWqiv7M++c=; b=e2fyPuoU3hoKwmZA6bzmrgDiAtgzcS5SOmD2KzF+D9cE/VYAy6jR5/tei3zum2nZIbs7yAM+Z1pP456G48pma6QKZ+W4yzV8LlfeUh/h2eVFEE81lwEbu5sjMY1acsaYcA2gCca0bppaMBJHfJ4yw28as/3ZecUWes1hafgofg7sXrP8sFA7oSmR8GrqSDbtG1AGN4BqYGdJjsN5GbPi6pNm1GdWp+IIqF7vxZyfhs5Nky3tAfYPVcwKahXb1xgLNhwDeiP6klIFKe+w0oHvv/e12ff4/dTHoPOcF6SGgZmB9iE6SOcpGUsymKyfvJqnqeOsmqXaEPIP9DGQ+CWY0A== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=eviden.com; dmarc=pass action=none header.from=eviden.com; dkim=pass header.d=eviden.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Eviden.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=u/EE/MVYvmwVs8wPu6Il6DxMESvsWjmJtHWqiv7M++c=; b=Qwh6Ld7xr6W8HTtP3L6L+tuylo+HKiKeA0x4Y9m2kHLut4BL4tfSYA6BfL0NbxU0x1RjxNYW083OQzpGOeGsh6bFFMSu7MXh+fauLXpPZ6DbjmWOJwxeeLKZq6J0AcgJHZcmi1vv7ugkobvlL/X39urKupR8zsu3rc+LULEt763GOCumXnkte/y/wK7daaBi2rpmNeh1hgtzqwv5OlEXS3LmpqQF//tUxkwVrUbpeZ78OPcAUf7TIqtqxWjuRU494wyb47V/ozC9DzGyO2NlziQCrOHOCU615TfFrJsUkqf/IPyFPZ57+bZjo+q4SmQ3yENCSuH4y+pg1VMjE05hOA== Received: from AM8PR07MB7602.eurprd07.prod.outlook.com (2603:10a6:20b:24b::7) by DU0PR07MB8466.eurprd07.prod.outlook.com (2603:10a6:10:355::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7762.19; Tue, 9 Jul 2024 06:18:07 +0000 Received: from AM8PR07MB7602.eurprd07.prod.outlook.com ([fe80::fbd7:ca71:b636:6f9d]) by AM8PR07MB7602.eurprd07.prod.outlook.com ([fe80::fbd7:ca71:b636:6f9d%4]) with mapi id 15.20.7762.016; Tue, 9 Jul 2024 06:18:07 +0000 From: CLEMENT MATHIEU--DRIF To: "qemu-devel@nongnu.org" CC: "jasowang@redhat.com" , "zhenzhong.duan@intel.com" , "kevin.tian@intel.com" , "yi.l.liu@intel.com" , "joao.m.martins@oracle.com" , "peterx@redhat.com" , "mst@redhat.com" , CLEMENT MATHIEU--DRIF , Minwoo Im Subject: [PATCH v6 1/4] intel_iommu: fix FRCD construction macro Thread-Topic: [PATCH v6 1/4] intel_iommu: fix FRCD construction macro Thread-Index: AQHa0cfDyRBjQJXZs02vrGVT0F2j9A== Date: Tue, 9 Jul 2024 06:18:07 +0000 Message-ID: <20240709061756.56347-2-clement.mathieu--drif@eviden.com> References: <20240709061756.56347-1-clement.mathieu--drif@eviden.com> In-Reply-To: <20240709061756.56347-1-clement.mathieu--drif@eviden.com> Accept-Language: en-GB, fr-FR, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=eviden.com; x-ms-publictraffictype: Email x-ms-traffictypediagnostic: AM8PR07MB7602:EE_|DU0PR07MB8466:EE_ x-ms-office365-filtering-correlation-id: ee56422e-ddcc-4e86-4998-08dc9fdee621 x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; ARA:13230040|366016|1800799024|376014|38070700018; x-microsoft-antispam-message-info: =?utf-8?q?pNWDXlK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dBBYN0O89OakiCQzu4KTvbmft?= =?utf-8?q?IzOEqQdhhimL63wg0Sn8kltz/ScZsTr7Q1+KIO6d9XXSlM52Q1UJ8PotD/FTbvdZu?= =?utf-8?q?VVAJS85XqimsGZ198bayBaCGBxns3kXOghxIs/W4T4/sx8SoOmTvUMilLNJJ2uQE7?= =?utf-8?q?qIe1XEegk81gXOD5NZuH9lriCtAEXKVL66wsJ9ZafgrEH9/7zc0N3456MSKN+3dye?= =?utf-8?q?wiKkFUbN2/NkMNldxPadcDItA7/tbLIXhgb/s2+iSEJKT+7BFVr6EW2Dhwu3+aCr3?= =?utf-8?q?r3LAt2Dmn/B91NOzb6hwSq2l+PfiL0t4e5GXMky/beehkaysGTjpw32thmrOyeI+l?= =?utf-8?q?1BNL13nklGkvquxS88Y3pLt/ttsS6F83/MDYZCrrFS8r2/d7aTKDDe3pLGsNO3fMD?= =?utf-8?q?Fdiuk0VkVsS7qkfKgGhgjJ4qhXi/KuLuSBLKQcf13Tg30bXNKR8LKIJbIaS4bvUmL?= =?utf-8?q?C3DnwlpVyiyilxncnqztJxy7txQK0LQf2A=3D=3D?= x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:AM8PR07MB7602.eurprd07.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230040)(366016)(1800799024)(376014)(38070700018); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?utf-8?q?wSvL4ijWDG+XN5PUE6rR8VCyd2UF?= =?utf-8?q?6yOdaoanbXK7vtMGXLaOKxvaSMRA5FxqHweLcqEDb1eHd01P8cTde0Nn22t0M/Fsq?= =?utf-8?q?iYs6RARiOCYHXvzO5n0eMujndshxB2LwVfQSx809bEczWGdcPqNTJfZRwZCKKXL1x?= =?utf-8?q?ANMUZhihpbLOFH6cLB15VBqpikNTZ8J3CwE0oWs3nIJT7fCM50ux03EtMQtLLog9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W0H31d9a?= =?utf-8?q?fnNkQWj6v9TIFH4u8WW09Xr46iWt/xrTaHqq0cxxVz8l70G+6x3vF26sdclaW0xDs?= =?utf-8?q?tSOQaVnq4rdMd18Dbze6J0OFjzzc9ABckWigtcnHQKcSp6PTJbUjDCAePoMZ2i5VY?= =?utf-8?q?3Zjbcop6Ix2H9XukkTcKRcASyhWVBgHYqz2JY+xBa5Ga0UygvBJxddRB7z/WGJxNZ?= =?utf-8?q?miMiYm9AZZo3s41+tW2LknomZV7OK9kPAcMr60BsIDSOejL2P/gpjBrkqgg/+rRuk?= =?utf-8?q?l1BpuoUE2vpp63s30WKl4f51hHshhXd7nEpxfeDOlCB0ueNv/xzh9wa6wDLWnpaY5?= =?utf-8?q?Pu/hvhiUNbuyfOFwWofW1l80/o6/HmDN6kvG2pf/OMMobt0bMorCGVYCPx32gK0n0?= =?utf-8?q?EVjVLBlb0hYLjhD4mD7CI27yn/s4pQO1a0JsDHs7M7v5JIaDnDVSKdkgXBLUIHTT4?= =?utf-8?q?XwTclvb5DQl65Eke1KBdh7VIc+t7lffjUOqNY+LcAxHrFkHhieKFnAE=3D?= Content-ID: MIME-Version: 1.0 X-OriginatorOrg: eviden.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: AM8PR07MB7602.eurprd07.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: ee56422e-ddcc-4e86-4998-08dc9fdee621 X-MS-Exchange-CrossTenant-originalarrivaltime: 09 Jul 2024 06:18:07.1829 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 7d1c7785-2d8a-437d-b842-1ed5d8fbe00a X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: HB9AsLjF9b9QPhovnEWOyT+8s2SOl2+w2D6X4KUPL9CTJP47Mb2xJohQoq3UpE0HtEh/rYhiAy31bznWy02Ap39hWNpPbP6ZXfPGq4bVUMxuMWtpgmKfm7CM2pDIg4BN X-MS-Exchange-Transport-CrossTenantHeadersStamped: DU0PR07MB8466 Received-SPF: pass client-ip=80.78.11.84; envelope-from=clement.mathieu--drif@eviden.com; helo=smarthost3.eviden.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org From: Clément Mathieu--Drif The constant must be unsigned, otherwise the two's complement overrides the other fields when a PASID is present. Fixes: 1b2b12376c8a ("intel-iommu: PASID support") Signed-off-by: Clément Mathieu--Drif Reviewed-by: Yi Liu Reviewed-by: Zhenzhong Duan Reviewed-by: Minwoo Im --- hw/i386/intel_iommu_internal.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/i386/intel_iommu_internal.h b/hw/i386/intel_iommu_internal.h index f8cf99bddf..cbc4030031 100644 --- a/hw/i386/intel_iommu_internal.h +++ b/hw/i386/intel_iommu_internal.h @@ -267,7 +267,7 @@ /* For the low 64-bit of 128-bit */ #define VTD_FRCD_FI(val) ((val) & ~0xfffULL) #define VTD_FRCD_PV(val) (((val) & 0xffffULL) << 40) -#define VTD_FRCD_PP(val) (((val) & 0x1) << 31) +#define VTD_FRCD_PP(val) (((val) & 0x1ULL) << 31) #define VTD_FRCD_IR_IDX(val) (((val) & 0xffffULL) << 48) /* DMA Remapping Fault Conditions */