From patchwork Mon Jul 8 11:39:53 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: 13726439 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 60C79C41513 for ; Mon, 8 Jul 2024 11:40:57 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sQmj0-0003oo-DD; Mon, 08 Jul 2024 07:40:07 -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 1sQmix-0003nV-EM for qemu-devel@nongnu.org; Mon, 08 Jul 2024 07:40:03 -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 1sQmit-0007rq-K3 for qemu-devel@nongnu.org; Mon, 08 Jul 2024 07:40:02 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=eviden.com; i=@eviden.com; q=dns/txt; s=mail; t=1720438799; x=1751974799; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-id:content-transfer-encoding: mime-version; bh=r6WyKd+WY8Yb8bDrXxdIwpfjKQeRsih/fOFlu4WzvwU=; b=qbGaApfJ7F2IUdapF/afKdAMAlhjXLPIOUxburs0WE08uRJJxjGOcQMH C0eTt0S6KqvYWR6seBKza7P30exJCSu6pY6/Agl62MWtEGnShvza6Xvnc NKpkfiH8Jsid70zmCImVpJDHdW30E+wInYIeuBEB6dwJ8nyEE7js387BV YSGftpMR4QMy+yTKEliuPovOuY2xV/dhCa0LQEXasU/4+c9Pw6aTSegCq K4nIJEeSC9aVu4+fhAu3mdiE3dBz8l8MM8hvZXFcjIkJQ2eSgOvpTITnR /MK0Tl11jfmDw0ZkHLgnuFpp0mKc+YSvWN9yLTvKinWF9fdLBmZbkSw/C g==; X-IronPort-AV: E=Sophos;i="6.09,191,1716242400"; d="scan'208";a="16087895" X-MGA-submission: MDHO49zdhKfK930NtW0XntY4bGHTZPIK1dliWYanPiHFXuoQ7p9t9YRdHZ1d9HjeE6RSYDYl2e869Ir6f9t5jLl0bmoTAqnTZzhhaaBdiM43LOdtCmak5QfibcSzpxpwSJk1WcVr6+UJIZtaXDYpsqWICD8V9GtutYcak2EcKM5xSQ== Received: from mail-vi1eur03lp2108.outbound.protection.outlook.com (HELO EUR03-VI1-obe.outbound.protection.outlook.com) ([104.47.30.108]) by smarthost3.eviden.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 Jul 2024 13:39:54 +0200 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=b4veTFFRx8snHcZERsc2zU72CsC98NljYB7l5qeAgElVhWu/GBHA3EaGpECW6rhf9OfPOe0ORaH3mM0i4NbRHv/0uavMNSIHfzXs2PaXeWZDHGF3u07PMFcEYmrUBslwIoSefd1aU2UAVorAXxz3Lk16MDpRnv6ObEDYBwpu2V66gdB1XcqVwGfpFrgpRB2LgfxUFaznaXjPykcVf9u7flsmoQnrbCZZ4mnJ6+F0996NO5IVWg/91zM3pLVgiMzlVD8YutED7y/fcClF6oJ/uQzqOnVCvMXX4el3qCk0lqYy4EtGdOqB0rcg5gtfriKMQF9kSEwuhMpPiKzBsB1HBQ== 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=r6WyKd+WY8Yb8bDrXxdIwpfjKQeRsih/fOFlu4WzvwU=; b=C2PFX7v4rRLWAMIrbCidmIe7vWviqW/dnqWCBl7xMSWAzH5qhUNzGs4jqlMXemad9qLEtZ/HZl83XZy4bZrrYu6FTSd8j1Xoij3I7iHdpLOK2FE/lb6/AAldyZGZhCfH4kwrYmjs1uUTdoz0LdiD1w5hkt6XXG7m08Yi/gA43alr8HcBz0Vlom6ZyHESiD/NVClshTyqoxoecu9sc8iJoE0Sg97veYdfbz5OzGjdwA1ssGXMN76PNBDvU8G8Ae3R3h+z7jSmrEoO8Uam5r+yb64ZQrTQm/XWa4NTJKQ79FAf0+TiL1A8TlBzv0ROY3ZPylG7mNdldVxIuYk3YIOl8Q== 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=r6WyKd+WY8Yb8bDrXxdIwpfjKQeRsih/fOFlu4WzvwU=; b=Sl/cNpPu5ERGQWyCt/eg+G8itJINTpBchczINaJ6o+BAJC3JJvTaPHm8Nk+RpbTegbzY05mCpnKOrqNR8slO2hxXov9Q+Bx5COCK52Pp36gdNPPUapz4IPyOc+4dyNJ12X5BJ/yDsiKSBjQECpuy2pQZ6B3kM56+Ba7X+LgTv4YRQYcke+fPPvRt/FrKqUOMNmnSPIQ4MBuiqew94Dx6BW7i0HS05IKP/+6dJbLNwyQip7suH4pChV5SC64kJjAGeSUFPxOb8YQ7hZqX6J/nMqHy1MdpddzxcgWvdnilvIpydzgZFK9QmkJ1dcqiCkXDYki9mlCFIEt8LalJXFVKoQ== Received: from AM8PR07MB7602.eurprd07.prod.outlook.com (2603:10a6:20b:24b::7) by AS8PR07MB7400.eurprd07.prod.outlook.com (2603:10a6:20b:2a4::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7762.18; Mon, 8 Jul 2024 11:39:53 +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; Mon, 8 Jul 2024 11:39:53 +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 v5 1/4] intel_iommu: fix FRCD construction macro Thread-Topic: [PATCH v5 1/4] intel_iommu: fix FRCD construction macro Thread-Index: AQHa0SuMWtlLXh0D9UKhcXu+XOoyDQ== Date: Mon, 8 Jul 2024 11:39:53 +0000 Message-ID: <20240708113908.19535-2-clement.mathieu--drif@eviden.com> References: <20240708113908.19535-1-clement.mathieu--drif@eviden.com> In-Reply-To: <20240708113908.19535-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_|AS8PR07MB7400:EE_ x-ms-office365-filtering-correlation-id: b3df6517-c334-43fc-068c-08dc9f42aee5 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?49L8sPQCp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yy?= =?utf-8?q?YHhBaNWoZM8gViKToqTqHhHYe1/YPHoSbFpo5EYH8SKFcrBDIEEVxiEAH3eW8c0Ec?= =?utf-8?q?WhVaSvsdiDPjcJHL+dGd3dcc2DgN6uvGS/M4HWkzilRqLo5ofZ5jucgo1/6CYpfyY?= =?utf-8?q?MY03Tfp7eIJCl0cmR3mHuJ5fjG1J8KtZ6L/SsyXWEeyCkMwpZa7JEpSenyF5N3zsH?= =?utf-8?q?zqT2MepTNM9umW0CescCNJ6DmiNxir/rfyE/InvClJtlMMzj5CmT3Ov+8l1sED1Ir?= =?utf-8?q?oMpYtP/nRU2ps21iRQBlKayXTgJ8fUZNW6sk6sHDP2MKEBYMkVUvKRAw9aZ98/Ox8?= =?utf-8?q?34yvCPRethA81lvIZXULH5q04pWHV9/wuT9sqgbruBZP2yuDPyJ19diD6dzSzSiUl?= =?utf-8?q?qu0U3X1xiMvhtv3C7nLeHK7JJOkxLrGmvWTs3KbxctPVxeh9zT1QDItLJ/3+bWanX?= =?utf-8?q?KyfeUoiazAhZdjf0jGWMiZRtVdxpmPtF8A=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?zhGbGRbk7MA5YgQDDHZRuMAAGTq9?= =?utf-8?q?sMZ0mRs+SWNsOilwirkPcfrBQpnDOFnW7sny0YO10deJYOiEVnR7h6ijkFbKMKji6?= =?utf-8?q?3Wk8ZpvoTp+Rcth3q4rfVxsoivDDt4U1k5CVZ8U7D+OBn+trDwYC8/SPEnFBPPOYm?= =?utf-8?q?b2m5Li0KZNqLkuBUaFGGVFiKzYZXnJ7XLr14W+HRjduxK6lMEbpTTU4xDZ3kyf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Y9v+2g2w3JLUF3QMyrNocyk9o5bcTdBzShJTHxtJ7UCpoyeX53+WC8F9Gfdyq?= =?utf-8?q?mKNiW4OWgbtOorNqaAojbTxCjBdyma2EToN6VZcA3bzQYOPKanMu3pEsMdVuyyV/J?= =?utf-8?q?M/K9N+wxTU4yqtxub6+lI/w3KRjEt00arkTfkGARPeyGzC3hYy+tSMnNwNG5U37Xq?= =?utf-8?q?+r3/qtofgmgKmXpYMbperRsr0J1hvSnFud1QqJOd3dLjltXutCAiVyHpdb5zIlHJp?= =?utf-8?q?1refH3HxfDFoE4AmSPAUUDENuWoV3ZQfS2U2lNgXjTAO6Z7f53OhdwGqz4bFHo0o8?= =?utf-8?q?OazhZd1A5V53b5z/cs5pYkZwvjlr+/xoJbzUudXkJ5UaxS9EyJ5GrurU8lMTaFBb/?= =?utf-8?q?htaPzeBQTRv2Ksh4UVWnt3gBTP4gYXL2ULZRLctlao/Z+jDNAwo3dgZsqSEIsJPe4?= =?utf-8?q?Zm9AV7REmg1aAWBHw0lnhk28n0X36tZvkdhevU+nsilrttUjwwI+Hz4=3D?= Content-ID: <162AB7B83577174CA6EF253EDEC4126B@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: b3df6517-c334-43fc-068c-08dc9f42aee5 X-MS-Exchange-CrossTenant-originalarrivaltime: 08 Jul 2024 11:39:53.0448 (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: Kyt2hs+Q6PWEp/kvXty1ZlKf4JetkYh8bGmcSgqJ9qIIJxxK4chiH7g7X4lEAWP6C5EYbSYgrwKagKAya8DqTL+1nLgHLVBrTSCGdl7Ppq13deJu/aC8jWITn2qosSWp X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR07MB7400 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 */