From patchwork Thu Jul 4 15:12:47 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: 13723892 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 62151C30653 for ; Thu, 4 Jul 2024 15:14:00 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sPO8n-0005Wq-50; Thu, 04 Jul 2024 11:12:57 -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 1sPO8k-0005WK-2G for qemu-devel@nongnu.org; Thu, 04 Jul 2024 11:12:54 -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 1sPO8i-0002sY-2x for qemu-devel@nongnu.org; Thu, 04 Jul 2024 11:12:53 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=eviden.com; i=@eviden.com; q=dns/txt; s=mail; t=1720105972; x=1751641972; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-id:content-transfer-encoding: mime-version; bh=iKgWTW73+sONWU+F9uuFcnPrFDqHO//Sx1zKx7/KBTY=; b=tDZeUX58b0BDrYyiqA5c2CBFCizDZnVX1yCQ2hD5VOWt/Ejgdn+peulZ yi3dSKeVlwy1tE4glxh8OGt0rQj9vChf5+P9PjgQ4OamF87qlmNfZiEA3 odAVTaE69/PCRAdYPaLP9BPl86cZ7kBx5W9w2bQJecOi82ft1DbX5MdYR laB37bOnwu7BQyyy0Kdun9i8HqQm4cxFbB569W3RP61ljUdV5Q1wSyRaN ueggQWduB8D82tHcfBXpc3B4xjC5aO2kSg1kk0mOliAZn9lk7j0JOIv0J 5EcR8VVPX6ymzfNYII+EW+ib8g49wyEu9aY3bjZNlQUQGMj5kmeibg/fG w==; X-IronPort-AV: E=Sophos;i="6.09,183,1716242400"; d="scan'208";a="16007268" X-MGA-submission: MDEs5hfOVmg/sN6QarBZfts0n2pZf+VekM9Y9e8/NlAHkLuGPXnBULwfU+bcaPkoiH4jYPbpyZYYh4NZlDrwX9btEBQa7+P5QEMz8FDsRErx6YNjU6IyNOK+IafgQobMg2nT0PDDJM/sCJ0pYcIeBpmqAGU3hV4S3cwogCRSXs3Weg== Received: from mail-am0eur02lp2238.outbound.protection.outlook.com (HELO EUR02-AM0-obe.outbound.protection.outlook.com) ([104.47.11.238]) by smarthost4.eviden.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 04 Jul 2024 17:12:49 +0200 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=PGS4DIUuDbvni+yF5gyWhVeLAJjU23GSoXnc+8lvn3iGNQNVaL2hQaGidr/fclqHNxps1ncQm7tF4wgpiJanO5gQDhenVwBGU8l2ezGtv2GpsyQPwOyie3rHrX73E2vVWfI28fNqEIfyu7BTZ5qAegqXQqiTa5rpXH+V4rJ/USFXLpxjOXHywReMwP9/ryShPBMgG4D/rsG8qrePpZ8GMQ8c+tSTLpNTZEzFX0rDGSYqzKR+Js+9to7C5LiLM0E8Oj/VC037OPJyeWyy5D2fs3glEW8mPIbEhAbm3we3ZL0vB4RLBK8wVhp4lpBsBw+/u3G8Nfv0BLIIDPndpkPWLA== 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=iKgWTW73+sONWU+F9uuFcnPrFDqHO//Sx1zKx7/KBTY=; b=VeYBxCdaLdeLkDzWnhtaMW72JtoRHAsJrFOQ/4Nw5+RVJf/6cs6b79g1crKkIV7TQaSkerwgiU76DUfUDwdW2iQjrt2sKru/CsDrBitfIFQgdHnuUQ4qJCqqlGi+qpxhJBwV89IHpGmmxKBe//PI4kbfQvJl3bW8zhaoqALYyRRHhJLSrueXgliwJCe0LEY7dBmK3nJLBzq/XjUK71p67nIg5oZVhAiM90gXUcPx6txFViMZ81OCdEZW38zFPxR+vERsz35yzfBdu7aMJd8UIHasd+BeIYSHeDgSqfp/bdxG9yPsOJRLlaIU6ttw3haohEHn57UOlQP6JJAzzWipQw== 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=iKgWTW73+sONWU+F9uuFcnPrFDqHO//Sx1zKx7/KBTY=; b=BQtAew+PcHHXjwpYwdsahY5VWwSxEg+shu5hLVZrDht2GCvKeN8rLNLJBc0fWyiT/Mh4dbk+rJYbc/evtYIl3i3dr2Q4y+xDfAsi77Dc+awNMgYeJWK2hdwF2Hkx1BRYZ5DwYYF2uwViFHGbnn2PJHCg1kwO5JSzxDVKlXWpuwwGbaiGCzjV1+CGONnlcrqJw23yC4B+DDY4FvPaJ92s50a4VxyKq7U5zOYCRjxgLdNq6lv7HaIk/Nm8reNhiWdCgNTWhnzq936nZBPFuemhum7sHr7wi9dVE6h0s/IcUCnL1NTL85k/8FH+6ZrWh17mRpzwUKyEAZmb1P42umVhLg== Received: from AM8PR07MB7602.eurprd07.prod.outlook.com (2603:10a6:20b:24b::7) by AM7PR07MB6455.eurprd07.prod.outlook.com (2603:10a6:20b:137::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7762.8; Thu, 4 Jul 2024 15:12:47 +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; Thu, 4 Jul 2024 15:12:47 +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 v2 1/3] intel_iommu: fix FRCD construction macro. Thread-Topic: [PATCH v2 1/3] intel_iommu: fix FRCD construction macro. Thread-Index: AQHaziShz6ld2iURc0GxUCRF+M342w== Date: Thu, 4 Jul 2024 15:12:47 +0000 Message-ID: <20240704151220.1018104-2-clement.mathieu--drif@eviden.com> References: <20240704151220.1018104-1-clement.mathieu--drif@eviden.com> In-Reply-To: <20240704151220.1018104-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_|AM7PR07MB6455:EE_ x-ms-office365-filtering-correlation-id: 900d6382-f470-4033-33d4-08dc9c3bc3a7 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?0ob9hl9N6GqEu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I43EUM/551qyeuibNyR3c?= =?utf-8?q?3pP6B9Lt/mH71B02YGBWo+35DT7cxreh3K6yuoNt3gVt0cHaXkzjzKi4+M5LTrJdD?= =?utf-8?q?txIGYkXfoJraZGz5bvWcdtizvuV6S6RhVitfcYH/G9oITDRR75r2fy8oyppMDKP3M?= =?utf-8?q?gcbW9s9FtADXsqdtntGS3iuyfITqagJyvdkEmrcjn05Q5B7vIS7tOATntCp917P5U?= =?utf-8?q?9dLiOyavws/6L/7oqxgE0AYZHRmobhjWwXA4ETQppftvleeP+GcTRnNndOT0KRTou?= =?utf-8?q?p/2PRFBGwQdEMUCH49Gper2UPEUJ8yuIgDWR6Y7LZ2NW7Pv2ATJKv7JRJbHCycCGs?= =?utf-8?q?HBmCn1u1915UHbFYz2iywrPyJ2B43aVFaYDm+sSS6W+nVTtR6UqhRaM9iXa7BZKDw?= =?utf-8?q?xHBLf+2v9difJ11Kcrg+DhnBbHcZ2UKcfNa5Gq5PCm7/lT0jkv+T/izujNWruZsPP?= =?utf-8?q?l8hYlaw65Zx+8aonMRLXeLU4ylmuaacCqw=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?rw27Dj4r4vr6lie6H9JlIhuNzBCW?= =?utf-8?q?m7SvI9rpIgWflArrflMY/C98fhevAxYjAhzE+3uvJnR2Zr3eewM5doCwk6zyE76x4?= =?utf-8?q?DrRn+J7f2QRG24lvGxeipyKaiLZsj+55SxNLJ2bA/coKBFzuEnhEZtUlEdvGu43H5?= =?utf-8?q?URyBh3gxztOQhyT+Dr1L3Pi5XUGVAhmHtj2d2+hqun1gEhVIW2wpCRGwfKg4iJTcF?= =?utf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VK9tnVlNkVx1jK9rFb2hPZZ4WaN7/0VZoyNOgz1mE7xVfli0s81Y7jU9WHN?= =?utf-8?q?6WMyUMyKlFlABrmL0duvL+3Tnxq6p40VYs97LdQnH577yzhOVIsdVVrAtzulc7MI6?= =?utf-8?q?Q15Oi4nhzGFaiETijD8PGB+fjPt/OASlko21C7a353y1aj/BmsLRr6fSinYsPyZN1?= =?utf-8?q?dYe2LndDFWQrU3uRgi7D6rHyd7Mg9tQdMribyjM0rQ6659xB6z/8RiChBOmXp2Blg?= =?utf-8?q?qFOKegpA33WMrgKJEfOuXG+QvhY8O3Utj0Qsb0orvkLfutD09Ww48ys1CrCtcpb6S?= =?utf-8?q?yFMDp+oAZktUkB6ge9tL3q99L+ZTqRLrRFKGbI481ard5Jec/2G6YSy8bEaNhGrWK?= =?utf-8?q?BJMRFNglYtIZVOc7RIrG5/3cYofoTH0eHcOiW+kv/d2WZuD640SmuA/xWlj/bUJHm?= =?utf-8?q?n3Thoe4J4jZGU6kJ6DDc/jvyOI08Ue5mb3WiZtLrYD4te38/y5y9LRE=3D?= Content-ID: <4FA3C3152EC55743ABD06366529166EB@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: 900d6382-f470-4033-33d4-08dc9c3bc3a7 X-MS-Exchange-CrossTenant-originalarrivaltime: 04 Jul 2024 15:12:47.8948 (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: +Jvf2QVoqwZMYmtObPyLWHJjF3s/fSXl4p9Iwzw7rU2RLwvnUNwvnTOCK8tuljpXCt+/QI3anPU/Cl2e2lOcXbTWQ8YA6Z84Q27s33u9Xmg0rq0A49WSw/Lxdb/OeuGl X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM7PR07MB6455 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: 1b2b12376c ("intel-iommu: PASID support") Signed-off-by: Clément Mathieu--Drif 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 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 */