From patchwork Thu Jul 4 14:47:55 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: 13723860 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 2D0BAC3271E for ; Thu, 4 Jul 2024 14:48:49 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sPNkh-0003P4-8C; Thu, 04 Jul 2024 10:48:03 -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 1sPNke-0003OL-MJ for qemu-devel@nongnu.org; Thu, 04 Jul 2024 10:48:00 -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 1sPNkd-0003KV-1N for qemu-devel@nongnu.org; Thu, 04 Jul 2024 10:48:00 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=eviden.com; i=@eviden.com; q=dns/txt; s=mail; t=1720104479; x=1751640479; 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=SQiMwa9CJetiQJHx35LmIpI3/UCo1yz3IC6lLqlpfXAAKBW5rXYXriZa YUnAveKnyEp/t97hEj4LeCfg3RJr1XzK9nz0EY44h/ob/FmFUkqhR0q7a Sg+CSyz6Uls1/KebJtabPpp66bzK3PWJwYpXeIlHhTHmoTxwSwBoW3JuR bmqZn1UqjH+ZaKrJJE/ST+FZEC47fDN2cvvqF0DvvQx2mfBiDWOzGH/q9 TGGumM6RUxOnlbVjguyLh7Oe2QAEU5Eyw+YECtPpNPh6T6FmQboZpfFdl KMsy54f/hZwRUJRStRNj0rSVwmON9sDbWqDl+9eZzo6T5EgywYDZqLtPZ Q==; X-IronPort-AV: E=Sophos;i="6.09,183,1716242400"; d="scan'208";a="16005881" X-MGA-submission: MDHHAwn0dQXRYrONlGIN7dz8bDAZUDLaNcZp05xRK5Gh0+ZB+1vv+5iA8Z7VMQuTaIPdOGFHQrafqH9OKSb+y6wl+sl+NqrNBrwZLK7hF7JZF+wzN0zb2yrwr0mD5zv+SJkss+GcfHCA0ArWJ8ONapguxzXcPQfXL5xZu3xoBZaB4w== Received: from mail-db8eur05lp2105.outbound.protection.outlook.com (HELO EUR05-DB8-obe.outbound.protection.outlook.com) ([104.47.17.105]) by smarthost4.eviden.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 04 Jul 2024 16:47:57 +0200 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ISlvHX5/kGRuV6A22897bc4xHpGOzZFlUWvAtdudBwZf/OiThodjeT093YQuVUs4BxJdGKZSRsLmYdRwkZMA/4CoPFD1imk/oO6qV5gu5N+OIJ1+OGcLhffSdVATTWj6adVUj6rrSIvkuFNSfoVrJQcguWY1dannCZEh2mzfRznAT+bttT/l4xds/9MDHTkLUVgInFhzU1yUrK3avJmlQKy3NfKiMQQWbw3SY3JwpHR/yk9pb3TZERQtd6ZzGjFegTpDwt3tZEaOYyReP1Ek37bpGFiE9YPnaaUAolXBLJ+vSsGuxkGynHTUqwAqIgQ0kCJ5V+gabAOFvQXZCiZ1tA== 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=jxnWGYZ8jFioIfrWEBfD7/qL7y/bvOhpKylGzGcMzui+sRTmHWU//5j617L8f91zKxbfYlZJWQzqijbSje9YG8lTlZA6rBsvtgt+q1eRNdd12gkGV5WTAZunOaclhqkzTO8kgWBMe9TWfpsMErezclE6jwJ4MPTVGA2lcq/+KKYrhmvhcgyL9eVBqw7whmL07aTGjdMxPi42h/2ErA5kdXFC5fk+A5l2ded9ZSCPkuZ3lgt1Cg/9f5yJsUunIomFA+xg5SzoSK70TWQr2snK49DXLjcPvjTXjUhccCtSQPnDsDp35uN3OZTC994GXfE83LK/pRiEkqu3KKv0xA6w6A== 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=OwD1SzdyrFiW0gtV8ks48F3EjsOovFUC7uqdFT3Ai+4HIY3zcdS0uyB4LSuoH+4NUcWpvdybXqj0EFFbepI/sDPsPpM2QfmLSwnD5zOszckOir+9FoV6+ljnPKRPkmSda6eN1zf47b2SRxaL0IZ24g4OF5g/NEr7t+zIRWdJsLmsWQBkEVM8nxTDvIL9M/goRSX4ogkJ1d2PF94MxKS/v0FSuwivdbp1UoPZord1ulpDLNOFmMKHo8lRsFTnAL2InGgwpyhuUYHTqQwhOOGoyEFh9Ld0lYEr4CWTDMZmBAAbYUrJ1Q+QnJqCpbCFRRst5rrhZ4vuYPdu0wUYyh32vg== Received: from AM8PR07MB7602.eurprd07.prod.outlook.com (2603:10a6:20b:24b::7) by VI1PR07MB9499.eurprd07.prod.outlook.com (2603:10a6:800:1c8::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7698.29; Thu, 4 Jul 2024 14:47:55 +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 14:47:55 +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 v1 1/3] intel_iommu: fix FRCD construction macro. Thread-Topic: [PATCH v1 1/3] intel_iommu: fix FRCD construction macro. Thread-Index: AQHaziEntPU4BZdwwkqAjCf6BiuOgQ== Date: Thu, 4 Jul 2024 14:47:55 +0000 Message-ID: <20240704144737.996889-2-clement.mathieu--drif@eviden.com> References: <20240704144737.996889-1-clement.mathieu--drif@eviden.com> In-Reply-To: <20240704144737.996889-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_|VI1PR07MB9499:EE_ x-ms-office365-filtering-correlation-id: 3a3d150f-c827-4e6a-55d2-08dc9c384a32 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?z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Z286/8F9HMxfaAtrOnZFbHtXTeUO6?= =?utf-8?q?uD+UXYdjnb47g2l/5Q9KLUeQkFESdjlBszG1BaxAbNZNSz/isFVpDVQaNsZT+Y1fC?= =?utf-8?q?HALK9IKZpzbbUTr9QgQtxBVwi5/5h7nixMgmsRPBIvlIWWn45FrEc4H1dgSkxDLeT?= =?utf-8?q?od0wIYBGLdB75ZCZG2VgFoS/HQ0nj0bcqPSEZ4Zdmv9QB6nawG+R3SZJNsmC+5gmM?= =?utf-8?q?hlyFABzIzoZMRL9QcNzHyMYyF/tEH9FoERsBdfTsg6YpZuYkMQu2ceGyRVcDURx6x?= =?utf-8?q?nxZfaz+FFykJ+8SYQS7nSa19udbuCcUIcxb0jUf7JnQjUl3vOBaLPGBGlT0rmqHIq?= =?utf-8?q?Rsi60W3gNux+6bZ8XHuTjJTFZKBguMLE9yE/xfCy2v2eJTSw0ABSG9GDHCUQAQJen?= =?utf-8?q?7UlIYKRombW+uPNtdT172ep0vpn/tqitIoWPXHxFjkJc+Eq+rFUzgi3P1QGnTeD94?= =?utf-8?q?eA8F2NZECyAnvVlg+5sN5LGhRGmDWjRldQ=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?n7YCnSbZPDUs5a/pJ3H13aqPGpsz?= =?utf-8?q?hiEMSWJNPFmb/MIEEmkZUXdGWgVlSCafn3+7HXWC8CLccRYZw4egMq4WyXN9V+Rbw?= =?utf-8?q?A8h5ymN0mzAWwcQEhBc8DdfwamagcBf/9fEzIJvboK9Zpc9vcTOS3V+n6//LxvGNW?= =?utf-8?q?XI+7Mx+lQpIpR3EHNyLiEqszojLUKPMsBU7nHj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B9sZh2U2POlA0Y7ZO7Er?= =?utf-8?q?ueWln+d/6OUy0Fx9N2Betkol+V8uGAx0C14WMBXIvguj2Wvy9V+I+QjYb0J4bT4nC?= =?utf-8?q?mmkb1u2lgceQ3Rb/mlUTJuPSYRlcB8FLXRaSCoXUqacgfhllj6dL4qTRRbNLc4+ef?= =?utf-8?q?fk+hc0/13dmaPNKqPb2lhtHqv7yIRox1b3uv5Oaaz2bAl4/HtuE5c0p8obPCHqRK8?= =?utf-8?q?HA0jC7KCNow1v8Z1kKm1rftIz2coqNvFrM8ZAwAzfbcPYuET338UXIVc7AfwE0XtW?= =?utf-8?q?KnlsTeG+T1hknKSWIFdWYU/2hOuCcntJNzQfPHkcuX6/BmozIUYEa+WEHT2VQmyR3?= =?utf-8?q?7efow3WVrXRMSfjb3xA/HAgMpBGzBpjAkoaM4AMz12phryU+K0lzOa9LFNjZUisLk?= =?utf-8?q?/hZTKO1Eare9kepyFLq639K3zoBK9XtUZnNvhleMzow67awl5b/I1H+kS8Ad6EiQj?= =?utf-8?q?YYEF91Z6/Lo2lq55WIzuj4n0jW6AmE5rkb0O8lwNo2VBK/HyYUMRTTo=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: 3a3d150f-c827-4e6a-55d2-08dc9c384a32 X-MS-Exchange-CrossTenant-originalarrivaltime: 04 Jul 2024 14:47:55.6102 (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: 1Wx/DDKasGc7ODiYT5h4lElaJLdAgUPaSQZ1QawZj8kl53Hgl9Bv3RPzplSZyFfplFh7f8pQQiQ7O02UJR5lo2o/9bKQ2zWWJdNfVak/1CylsPEW+QRA1plQQOu0uVyh X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR07MB9499 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 */