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 */ From patchwork Thu Jul 4 14:47:59 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: 13723861 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 341F8C3DA40 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 1sPNkk-0003QZ-NH; Thu, 04 Jul 2024 10:48:06 -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 1sPNki-0003Pe-LS for qemu-devel@nongnu.org; Thu, 04 Jul 2024 10:48:04 -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 1sPNkg-0003Lq-Uk for qemu-devel@nongnu.org; Thu, 04 Jul 2024 10:48:04 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=eviden.com; i=@eviden.com; q=dns/txt; s=mail; t=1720104483; x=1751640483; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-id:content-transfer-encoding: mime-version; bh=2svyLmHlQ6d1l2Iag7bhkpug/Bb2fDl8x+3PvU0cF0w=; b=nwpRLJWuDl9F0k0yKs3ZL8KwfaOPK1gxqitfYOMfqcU7rLB87ZGpT4yX hsvxbne1c5miALI0hQ1yUER2Pj6vF2YKFrS0gakvotwTYAqKFzi+EA5BU 7qCAnR/tR0QHMVYRU+yYVODSFPmcGxPySURh5GUIj9XwyineEUTDaO2Vb /symxrfiB45bg9sFBFbg3xqQY0zpPabKh0GHaHaOBsJjkA9cU+DlieFzv +CG9Vly6wCEYci+jXl/BnYOQRUL4msQZwzLRNQANIj3XAbTJY9EV6SPT1 0d+AM8YONLqT2D4KuIzpLCEE43rXiufjIi8PkYp66xtoylhe6hSURe3ak A==; X-IronPort-AV: E=Sophos;i="6.09,183,1716242400"; d="scan'208";a="16005887" X-MGA-submission: MDHvxumJxW+xlRTDGNcApb8433uaACFQtIPj128wY/h2RP1GrNjNeB+1EWlf0UhEYlhtQID2TJA0/dcJkDaSEKxkAMBKAZD0YqMW9hPs5NzxmnXNxwLEQMglMxdFg6BtvzHS3fgfsTSPazjDOXmwQHI4UuvfX9jQRehaZ7dc34Lm8g== 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; 04 Jul 2024 16:48:01 +0200 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=AVf5W14V3tB0wlRChXB2HhZPZlpCAxiXNGdDPkYEQc7idmKe4gNz2JnSBPwq5uVtFiG/4fQg8R92W3bPon20dueKurwgcxaWn/FNprAJMuPfR4NGRqClXMOAtk2kt8Pkn6oborvugivo1KJjgshTzgl1Vx7Pw/qOsr4J9CC172fhsKJQiVXZ+FwQmBB29uyZOa1MsJlQlEk643QT69DW8Ia8FPgS0ildQzFoL+EHIaQRZYPI/UNXP1f2o2xRoKyJ/7Tozht8k8t1Ik4Pmtp3bbT06vrAwsxUCjld4L3UG1lr103G+6ihhLGXKDbpaTgm2U1FAvQPpaSGz8LiEgTQRA== 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=2svyLmHlQ6d1l2Iag7bhkpug/Bb2fDl8x+3PvU0cF0w=; b=K3JnJcmwIIU0/bxs3QVoW1e9A+Sy+gYpUF5UThoLqKtaeh+X/SHxUSTLz77f+fTZjhbvSvLKxuxzNydu9IWyF05HhDIqMNNb1ZZXnCUkh5YzqAWH9L4ZNcmCdmXVwVIc3ZWrH5pAB2lzsRULten0id7AOMjYHIrmRUv6BtonSw6YsWinIVOTVPCa4S/do0gxPRYBijjeb6pm3le4NLsUyg+rfTS9pjgojWixKvjzZznxcK59Qi70fNC043bBFJdcG+1W30iAbHAXLrIL/EMkZi/wV9eY14vlTfM9lc88JcZ7iMQW5OCwSdS6hbvTchzrtQ8iopuvtkOmzDuZibEw/g== 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=2svyLmHlQ6d1l2Iag7bhkpug/Bb2fDl8x+3PvU0cF0w=; b=X6ilOpyH3OlPuUKf2S6f8GjjpdlEcPQ3peKaVLOGQyEZDvRSGVnwDHeI3HXG1ILXj82SH0NXIAqVICT814fbFfkSR4pCxu+sJrnGX7dxiRrpKNAIaR4Qb74jefzwjqqpahcfV+zKSs461KRJyg2glIsEV95f5IAhEWWqmlQuLpNuSkJVxlOxz5h4GqfcNHkPjZjfqC5xRhto0OUG/VuvgFJN4jGJMogUsXo+ptyS1EL+j3sNDszQBm8cwgJe6DsCRwvnRxiVZA++IAPF2ubou7FzG81z5tKLWaPdXyW2YmJfsuB4EHTaC98+zqv49q5OOFtQaniSAs7cPhxOnEsnzw== 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:59 +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:59 +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 , CLEMENT MATHIEU--DRIF Subject: [PATCH v1 2/3] intel_iommu: make types match Thread-Topic: [PATCH v1 2/3] intel_iommu: make types match Thread-Index: AQHaziEpnBS59oBIpUuVMnrpPnUfBA== Date: Thu, 4 Jul 2024 14:47:59 +0000 Message-ID: <20240704144737.996889-3-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: 078e6f02-8941-4a44-235c-08dc9c384c78 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?U/NTGl41UvsBAlvFZhze7USaAF4avPZ?= =?utf-8?q?TNLK9fhAQsKtv1k1IJ5XmlelrXY8b+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ddvN70Npylgm0+gSAViUKMKxIPLWKU?= =?utf-8?q?+TrS35BFQaf8pppdW7Maa3xqm9q2i/aMf5HFsIVMMkb3VBDaBmJi8ayoztbbH+OCM?= =?utf-8?q?/nkUEUNTDCKIsPw2uPOqXXPr0tDrO9h8ikp1JVZAoea0XBWQckzVUHkYeySjzPtgT?= =?utf-8?q?XkOuEJR/QhQfoKzc5UIRE/NCmN1VSrJpzERl3gZhNC+SOh9dS/f+Sl5+f49LDcMRM?= =?utf-8?q?PAbbgkcnWOyKk+nijXcV4jo2qd0aQqeu1knQe6Gw5mgXyEkICMlescPCs/QSQ3Viq?= =?utf-8?q?pd3xzj0RJyv0musrL2W1N+tVYL0SOsM52J9E5nFjHXaOAKbhTeG32Elfncii9vzUl?= =?utf-8?q?sm0963VOkSXNGoElfklrHkVAvS4iyTPvCxPNwuSIEOi504rY19BN6T/hJs21EicsE?= =?utf-8?q?NH5XLR9Sbrf+o5q4ZiZzjJdc6fdNzeSdQg=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?1ML8rQnRFq4fN2XLWndupg1+uSoR?= =?utf-8?q?PeAXmnNlq/JiAYWTrjhasZKxNGvV2NSw6ftbpmH/XLK32ydpFXImZw9USp/u6DhJs?= =?utf-8?q?mIQFQ871DK5LvdiLrx3kAGnrrndjC4jAcuLruEDaVoYI18+mCOHbxS0co0woDZy/S?= =?utf-8?q?vml9vklj/Jyu4cJ8kv6a+TJISelojajbkaohrh4jq7cJxRI+cnO3J1K6ng1dwAPd8?= =?utf-8?q?JlwOzCSjsbp++KtoUM41vOuuB9SdedyKAFcMdJu3mXjg1iYTd+7XqyE76Ogx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?utf-8?q?9prpttnNEWrVn0BJFZR3CRFY4lrFRM9fWx5ZxkaYmP/Vag4kQdH7fSi7rWNTaiJmK?= =?utf-8?q?e1hthY7aY7q6OHTLQMtiVkqlOP1fRZPHxKzv6eGNJIoykii/vGJF8tVjkcmdK13jM?= =?utf-8?q?nYo3SngpvOe/6mbrOIMJLy0j4uyPcsr/EDWixVFHQj0YGg9gh+S8U7bHlayGGipCu?= =?utf-8?q?c8l7O/1r8s9HTA1d95v9AMbBbn039orrk6Xk81mpdIP9sfOGisZ+oaVY1iHJMxkQK?= =?utf-8?q?IbSvKd2nildqZtHQZdVWF9eKDWVa/mIJ5GkFkdSUj6gm6AEbf5HTsfGjSzBE53+/c?= =?utf-8?q?hreM+Fn24Msc7psMPw3HEFEoXcaBKRRhujK1TBUHE6VMG7txBcoRW/je6t7W8IoMq?= =?utf-8?q?2CxvayMAG6YEL0NUoxk6Z7p2onxqejyh9PvNBEAKh4NoIYz7+F0Qwgs=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: 078e6f02-8941-4a44-235c-08dc9c384c78 X-MS-Exchange-CrossTenant-originalarrivaltime: 04 Jul 2024 14:47:59.4631 (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: FWo9zLY5LXmPcvzneebd2UALRQFOHmy513cPPXABLK90QV1lzvoAXZ9/Sfx0ziH0AjYS/12nsXHFQreA2Nsu0ssmF+xQLCozBUkg6c5yOsa6dKU4SL3OnnQEsaLsxYSj 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: Clement Mathieu--Drif The 'level' field in vtd_iotlb_key is an unsigned integer. We don't need to store level as an int in vtd_lookup_iotlb. VTDIOTLBPageInvInfo.mask is used in binary operations with addresses. Signed-off-by: Clément Mathieu--Drif --- hw/i386/intel_iommu.c | 2 +- hw/i386/intel_iommu_internal.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/hw/i386/intel_iommu.c b/hw/i386/intel_iommu.c index 37c21a0aec..be0cb39b5c 100644 --- a/hw/i386/intel_iommu.c +++ b/hw/i386/intel_iommu.c @@ -358,7 +358,7 @@ static VTDIOTLBEntry *vtd_lookup_iotlb(IntelIOMMUState *s, uint16_t source_id, { struct vtd_iotlb_key key; VTDIOTLBEntry *entry; - int level; + unsigned level; for (level = VTD_SL_PT_LEVEL; level < VTD_SL_PML4_LEVEL; level++) { key.gfn = vtd_get_iotlb_gfn(addr, level); diff --git a/hw/i386/intel_iommu_internal.h b/hw/i386/intel_iommu_internal.h index cbc4030031..5fcbe2744f 100644 --- a/hw/i386/intel_iommu_internal.h +++ b/hw/i386/intel_iommu_internal.h @@ -436,7 +436,7 @@ struct VTDIOTLBPageInvInfo { uint16_t domain_id; uint32_t pasid; uint64_t addr; - uint8_t mask; + uint64_t mask; }; typedef struct VTDIOTLBPageInvInfo VTDIOTLBPageInvInfo; From patchwork Thu Jul 4 14:48:00 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: 13723863 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 49081C30653 for ; Thu, 4 Jul 2024 14:49:11 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sPNko-0003SA-DR; Thu, 04 Jul 2024 10:48:10 -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 1sPNkm-0003RE-CT for qemu-devel@nongnu.org; Thu, 04 Jul 2024 10:48:08 -0400 Received: from smarthost1.eviden.com ([80.78.11.82]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sPNkk-0003Mu-J9 for qemu-devel@nongnu.org; Thu, 04 Jul 2024 10:48:08 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=eviden.com; i=@eviden.com; q=dns/txt; s=mail; t=1720104486; x=1751640486; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-id:content-transfer-encoding: mime-version; bh=QQb36lRclXYTkFjtwY0m8Lyj053oQOM+CfZ9/7UX5G0=; b=BYXF9B67ECto9NruHiUBh/LPTSuLOjRN4UK1+g8xBmqFyOQek45qaCpN /KogIaKwyKFvQXQtk4YsiB9nSmD3W1IUeaYnyzWrGvfOS+Qy5F87j1Yim +M9EOpxzcQdvknEc5znGHlhIiTO3eFOXGnqu1Na34Z86BCtipmE5rb/Ru yzL7EOfXyt3bNJsEN2IojELYWvuka4K3cL9f8O69ddRd5ZERnL/60u9vw EnnpwBhUnaTGCR1FNYSafGFF+Y/ltn7MPu0TGYogbDguMKhaxgpqyu6ow 1HhSPImxzBqfJTz/v/bsdPNK1FvHhsqEfCuKyexaKrJac0PwzTsaGatMd Q==; X-IronPort-AV: E=Sophos;i="6.09,183,1716242400"; d="scan'208";a="15900767" X-MGA-submission: MDE+WswcBz3JFwimMrhWkbhout1gA3DnuuzYTsvXwuP+7meO8zIjdl9RShBbQVmTV24g1iaJ7dMzvJ5rSIg/zDFycmFXW1UKb7IkxXc/3krlXdpKkKpS69AZLfjRPNBvK8GqhXxfsUVx7EmPPdRblmzDA2McNQjdZH+kb5R0mZb5zQ== Received: from mail-db8eur05lp2105.outbound.protection.outlook.com (HELO EUR05-DB8-obe.outbound.protection.outlook.com) ([104.47.17.105]) by smarthost1.eviden.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 04 Jul 2024 16:48:02 +0200 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=IPns+1ZQlcWikVS6E3wwOM1rHfGjWcTc6ye8KFT2VpbQsNymZNI7YTw0FirzV/0le7eVwLMsoKMa1a3mlmHDoVhLJF8Hkg6kW72enGS83N7du6mavzkSDxhao5jWPAOsOGzbQoqNZItqfKOkOSBRr/xzzifz9Sg91X0hCfMxkWg/xwhd4sO7h3WixxBPudDwLMyIiTIDnhqdtOLde8FME6h/MSnQvLsUoiQStIsdCrX/9iZzEcpnfkCx9AytXlZwv3ILFYfjsyjZhq8E7bar4UEnxu/lqegDeha1mHJd31BjyezPpxO7b0TXnRcwqAsZFMG/F3Np8unABtt7p3GZzw== 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=QQb36lRclXYTkFjtwY0m8Lyj053oQOM+CfZ9/7UX5G0=; b=Kvc7I5d/DJCq2Ys1jHK42uwoBnyJEoUM/+xWRGrsC6tEBWb/n45RYJEpdyWErCDzC3eWKKaHivGfmDBeiHP/20dh18XqAmHaePxHd6fcz2tUhDk2ht0tGZs5yhVgWDFEARRUngqcVwu0rMRmVKE+qaf2jAPftAyiB26mfBteJJfXjEn01ny8SGMFnkJ6WDIOMnZkVvO6Psgmh/5qmhbtv2+RjvqzhX90V29lYT6ptr3nBpdWkw+HtRyXFk+t3eny33H831HPoFtoEI+1WpGdS4iEd3maDz/4R8uxvoFn/jEAyimRF+O2K+iCwOo/pRzKTNQA9NRk43Dipo3iiC+k8w== 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=QQb36lRclXYTkFjtwY0m8Lyj053oQOM+CfZ9/7UX5G0=; b=LRSmNWLT82D4/6//I31gSEoeTM0gnWMlxR7ebQgtWXmpFFdWzoKv5EOx9kVuUSxqWMunlbN9YlaUSEkjGzx3cNTMeVzf5+er4V5QkpmUHrNyG1Ag3G5PxR0RUkoJEJF4GMfVuEpMDk4sYaUdyeCH1RCiJ09H3XSoRR3vavevcKN9p6DifUbp/GoZIonZZ9uV1q+d9YPIS34ITBQ4top1dWRvcQ8isaXfDNG3WQBq5+Kd3eKNGt3dnViB9XgI2iBkq0m4cVscAbwtn439h1a6SPuosfnmmmXWe60ga6NStSgVIZOVSFZ3/IMsyYmzSauW4w7RuGmiWHudQSnsdju3tA== 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:48:00 +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:48:00 +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 , CLEMENT MATHIEU--DRIF Subject: [PATCH v1 3/3] intel_iommu: Bypass barrier wait descriptor Thread-Topic: [PATCH v1 3/3] intel_iommu: Bypass barrier wait descriptor Thread-Index: AQHaziEqYSd3fPOVYk+uet6FPduJ+A== Date: Thu, 4 Jul 2024 14:48:00 +0000 Message-ID: <20240704144737.996889-4-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: f34f8d91-3a57-4517-6f3e-08dc9c384d40 x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; ARA:13230040|366016|1800799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?tdfwdhOmuVVkwBDy44PPOm0HZEdqvnMrqx4oVQpcn7RIxqAD5w8RJphsYTLxXvAoa?= =?utf-8?q?spLhoM9cFEQz0ga8tRZ0hESGyz53GQgNqnncjxxVEliorZKbBxKImr0hCvv/vb2oJ?= =?utf-8?q?lNv+HlwveRNlOiFAJbPssKzzYM4rT+gMQu1EtLld25FPt9XR7RlQ9twuYhaO74nSt?= =?utf-8?q?dD3u+FTpKf6dKgk8VqXT98tv8YCISJCvzEmD1WeN5+/nNZWg+5O5IYzMeNINzWTHO?= =?utf-8?q?1ndbJOmuDUKp/rzG060kxoGWqA4Qa7bGoiL45Y6vnf0zj7DeiyMwB+n+heWF0wTEW?= =?utf-8?q?kjuBX/6qk+gy2Sl9kshmUUi3rSoJ6itDXpPso+z5sfqFTDmvPDVm2LAGFoqVM4Jfa?= =?utf-8?q?6IEkcklKkvWppUW3ROaLRx0lSCRNG/9VB6LFT8xWns4107k+TGTlABSBHDfGtyMED?= =?utf-8?q?5on6idcm5CvMdgBjH8T5Lt1H8FFtqonnsvOamPij8N3JTA5m8CaEIViZLdN4Dw2XZ?= =?utf-8?q?jp21RkajWARwQhHKlX30NnytRKFUGKfzPw=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?k3Ru5RWfyxLCYjjDPBurMurWSQJO?= =?utf-8?q?76DTaHI1hA7wRIfed/AAz6bp6uOZmSMgpCvVQZQqQ+Hh1X23O+llrF/rcSduv6EVB?= =?utf-8?q?1PReyLznUfqCHBUOBz0GjvaAw4tCQw9I5M4eqYiHPiuLSSu7v2YV9UZFQQcnn5oDn?= =?utf-8?q?Pll82kTO4J3bzxfW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ZQCUOCHfCYsBN0RLHRSjkOV7Pv2C7S5?= =?utf-8?q?QbtSaaeYIdHrrTf5wpkx8ABwg2KanqJNso8dhKykcqZdzg+nN4gVXmcy/9e2EugYR?= =?utf-8?q?uusD+K5iRtZa4QDqE0hpkpoJ0uKmWynil0dw7O9EPeuwx03ePL+6YbwKa41pzH5/I?= =?utf-8?q?No87+em+j8PYYeENHmCSLYjxqthgZpQB4CIOF6H6yK5drXfQtLmBIGASXKkAn/I4i?= =?utf-8?q?ycebC3P8i6BvYzokidv2roo82OsVedS+mAVmIVcM/Ayq7LQ+QI03GFHQF+0OsPLJZ?= =?utf-8?q?Fth60ZTZj/awGwOCx3hiZeoNqXAtl1LQy3ztinCsIOBy/jkw4cvXWm5iORotCDNw2?= =?utf-8?q?/TiEyDusDT/Sg/ZptNnLq6Vij0ou8NtDH9PN6BwUQA+IDBNY+xqgn0p0fSpWcJ6hT?= =?utf-8?q?2QVweaejt5r5ZLREk04GleVrRYxUMwvMcD+eQufspL7qSwgzCt4edf+RNHreJlhLh?= =?utf-8?q?fCle3HjSLHEEC5kzqtAmD+ZMXjZ+XbmDKQEkWKUmhBmj9veZrZb975Q=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: f34f8d91-3a57-4517-6f3e-08dc9c384d40 X-MS-Exchange-CrossTenant-originalarrivaltime: 04 Jul 2024 14:48:00.7514 (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: 3uw6qK4VvCH60Qegk9xsPdXFvvgOBtf8hz3mv05GBpkH8qyz3X9dkVDgWnGWP/mknT3bYPs405WWy+bTGsvPm7XB3KObl5hC1QtpA1hAi8MpLjw05uAt/XFRJeFMCeuL X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR07MB9499 Received-SPF: pass client-ip=80.78.11.82; envelope-from=clement.mathieu--drif@eviden.com; helo=smarthost1.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: Clement Mathieu--Drif wait_desc with SW=0,IF=0,FN=1 must not be considered as an invalid descriptor as it is used to implement section 7.10 of the VT-d spec Signed-off-by: Clément Mathieu--Drif --- hw/i386/intel_iommu.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/hw/i386/intel_iommu.c b/hw/i386/intel_iommu.c index be0cb39b5c..12ea3a9aa0 100644 --- a/hw/i386/intel_iommu.c +++ b/hw/i386/intel_iommu.c @@ -2561,6 +2561,12 @@ static bool vtd_process_wait_desc(IntelIOMMUState *s, VTDInvDesc *inv_desc) } else if (inv_desc->lo & VTD_INV_DESC_WAIT_IF) { /* Interrupt flag */ vtd_generate_completion_event(s); + } else if (inv_desc->lo & VTD_INV_DESC_WAIT_FN) { + /* + * SW = 0, IF = 0, FN = 1 + * This kind of descriptor is defined in section 7.10 of VT-d + * Nothing to do as we process the events sequentially + */ } else { error_report_once("%s: invalid wait desc: hi=%"PRIx64", lo=%"PRIx64 " (unknown type)", __func__, inv_desc->hi,