From patchwork Thu Jul 4 15:12:49 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: 13723891 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 7FA1BC3271E for ; Thu, 4 Jul 2024 15:13:51 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sPO8n-0005Wv-GB; 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 1sPO8l-0005Wb-1q for qemu-devel@nongnu.org; Thu, 04 Jul 2024 11:12:55 -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-0002sf-8P for qemu-devel@nongnu.org; Thu, 04 Jul 2024 11:12:54 -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=iBpkynY43mL8XVpRQnuzbD1QM2hvJ56uVWjBhaZKJG8=; b=aEwev2yvboMjsxfSW5hhl730nUtVyF+l2TNQN+ww0Sj9fHS1igIgN4vz sgyp7uN9jIURU/G9GACVNeBjdv0FlOdZp+1EaqsjtWqHddoBVcw8i3AcO +9Yzb9WqV7y9r5zGRgzseyKYl9eJVcW5TLNUVsxRmZhgAg/mDiJFm9jCR ys+EgFJYgho0uS2RXbFPma19jNZg7Uf/1qkCLDV0PJq/nWQp6IS9w6Qca TxmLepd7tVDUpb3YcZbzbhgQl9TYRU2nn1fzrb6GcuBjM+X8LKnqWJjEd FljrehuMFco8kmXlujQLKuGyUAhA4WFQm4NJJ9gsy1JGFMKFYAMaJ+OYO A==; X-IronPort-AV: E=Sophos;i="6.09,183,1716242400"; d="scan'208";a="16007273" X-MGA-submission: MDE+f+j2sBrgrESUPvTtDkOgbPpwntNHhiTMWUvzFvhOiSnoHeB0c1JPs/WDJjDHNgvernO0cjMgJmaQLYeCVG/GPIeOXj4G5O1+V0fRSkv9u+u2lyjhP1OOKR87njb8yLQJFWwheIfL2FwgVQm7j0Tv4uqRk78xRtn7rr3nXebhKA== Received: from mail-db5eur02lp2104.outbound.protection.outlook.com (HELO EUR02-DB5-obe.outbound.protection.outlook.com) ([104.47.11.104]) by smarthost4.eviden.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 04 Jul 2024 17:12:50 +0200 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=cjwmznCH+oubcacRiQwB3iD9vmFBrCdnDpZ2fSjtoRnFXSL5DUSdrwblOdraY0wNtdmSe/aCRk5R6nb5SJenIF1glZUQWGW+kpK0U7vm4xd5B0m0XxH6M60R3okBF4V014q8f0p/A+jwloBakyEKlzy+Y7aGXDgG0j7tXy5qgLHTTtGdqNwmK4M6I8739+inD/IXgWzVcU3IvJM4d+vIufoQxJ2XDt9u7xs3YCxTMQAA/K+xr+YqGfgTTxetTpvPZELF/4XzJljBSKb4E1pX8FAl+L36/fC3mGtoDxhwfyBxJg+IekVC1FVH0IXxWmu/twWPqG+eBl54dI+A8w7eVw== 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=iBpkynY43mL8XVpRQnuzbD1QM2hvJ56uVWjBhaZKJG8=; b=BFlJKNYpyDxct7f1WFuMjvH+g7YsFuVEObisZ3ii3XSxaC+pPvrPjfC039E+jzFmfLcVTrPw+jx6o5mVEfvBOl3R0za+7By9vBpStJUwGmORzP9/BqPBIJEejXeEGV2a9OQUxYDjyCgYlrB2VJOhODmIVfdDQmIJ7b5XAiG3U8ET4HXKJNIJD58lTHdxJXvLH4ttUevONxHJ2WkwaazbNNSPZRMjVL/M5+kp2cdBldXzYq8hDHgBRws7tb5XSu73SA0vGcJtr1GauyOlk8m3yJAYTKNLlOvEqEufgorBLZ1i17kf7nAgsukdNi+/GSiDzLqG95HeC8Qmu7hLSva2UQ== 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=iBpkynY43mL8XVpRQnuzbD1QM2hvJ56uVWjBhaZKJG8=; b=obEaaGD3llEmidi9L/0z97O0k6qITqUquppDJdYB3Mz32/kU73+zB6iew3LDofLNCEIj4s1dltlKpeAOCHMiXfmIjy9GFr/2k22kpvb9lMTrKBKYkUYIr1osqL9frIDMD+foEW0DiCEFAdaNpSAAvcXRLfryfhAercdjhNF50X27KzGmAqpLU07UacCAMHrEOCsxpDnmtht8ZBKWdQUbRR2M9FWP3uyXhxiEQABkCXBUaAZ/lBsJH4v4oOgF9KrnaIQ3uCwh1dbN1AhaNy9tRnfQDeqN2mxg1nrORw90Ky/WY4FgK2FXsXkHS87wiZQ1EYFimxPP/C+462onDiJ5DA== 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:49 +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:49 +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 3/3] intel_iommu: Bypass barrier wait descriptor Thread-Topic: [PATCH v2 3/3] intel_iommu: Bypass barrier wait descriptor Thread-Index: AQHaziSiPOur2dIIN0e52ufwAoMAAg== Date: Thu, 4 Jul 2024 15:12:49 +0000 Message-ID: <20240704151220.1018104-4-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: 862794dd-7376-489d-9a9b-08dc9c3bc482 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?PcKXMQI06PdYaAZ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USc6G2nbhkRXA7YdTKjMZ?= =?utf-8?q?8/koI7Thyig+vUvK5qJfRz9rwcOXFdekpiTdJwr4cUnZlfAuwvX9XOk55ceAPMRB7?= =?utf-8?q?WKxujX0ZrEHZ6E5Eg4cYBZpVyCN3JTB4oCFBviLG2LEc/ikeH4cXKDI2UizDji9BX?= =?utf-8?q?87vFRi19IYS3qc/ORxgx+GLi8wkOIh1Vua5z5GdMlLkpoKfIK6DXAB2IVutwvvah/?= =?utf-8?q?QFbiP/TJ9OsYTbU1Ap9SesmmNTFKGnHa2hDKD/e5aWIFxwJXvQJy6shxCjBBv+3F7?= =?utf-8?q?7O2GeN7vIds1XscTWfMVY+WiKYZRSHmNRHyEpJntlZjEP8Oa1MlJF1pIZ29eqrzZo?= =?utf-8?q?gKWTZLpUBwhlsaPIUMKutDGP+aTZt1nr3Ok0jz39jERq5qtnpv2OBOjB5p3lYVkES?= =?utf-8?q?8rYruqa3LTKc2GSplsKUkJKhuUbR5W97khRB1DCg/hCFRlhhOm28zgJf/EKU4eU2x?= =?utf-8?q?8ZUWo/GgREW7qvrnXjGnLRh+05qqSRUuUg=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?/QZixEPS6TSLK+xH4aK8CE+sN3Yl?= =?utf-8?q?NTsccDQAVL1GGTvjg3bXdlF4eM2vmrDThveSzO26MOZps5nwYsiyafAXtgqYQsZfl?= =?utf-8?q?c/+BHLs6NCLUBtSszI6S5yErpwBmEMTWaVRZu2yIBS2CNrdWbB5KuRaFepRmiuRtT?= =?utf-8?q?vYO3lx5BoU7BwsYhcczC7oJWbiYWRmiKM8pXug04cIJYwoJ+riKPs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6cNaERF9GBT+xc?= =?utf-8?q?byjMrEu8EMIVNK8gPiC+mAfGzxdSIAnrJEVh73u3cw18Gp+qDEgV/EG0WqYPfS2dI?= =?utf-8?q?0KDF1gjvymqAgb8zrANuKSDPlEpqrAXiv0BsFCzd6lpxPiAAORFpCHYP7MMHAIBZe?= =?utf-8?q?OrtCmObgklpyL8BI/r2YLnxpLZmB5l/9lHrxtqTesWkDXpWh3xqNpSk4d01WyqhAu?= =?utf-8?q?kZrSeebQhFbQS5Z/iSYYhUl+reyRhi3Yd7G4ga+n1rV5FeFwM5usWwWvD08ptSTyI?= =?utf-8?q?5oSdXnlWo8+4OrkLlg0UyLGansgA64uHVHMMwOI7oNfdEspHEhHGz9RtcdRJtfIZG?= =?utf-8?q?MjouSvS5XlzGqLyjxqHU+l1AlY3p/W2ADonF4nX07NmW2CHDr+MwCqYDX4YHpqJ8v?= =?utf-8?q?P7HKe6an8ex4Ci4wAv2OdkuBSwLL9hPBBbmdCUBJaTvZ1U2I7wiJCslFsQOQU3gs/?= =?utf-8?q?Mp7IOzeVuAyoGGiwxbjSbaS4kg7qgrgbVLZGaXG5M5lFH5y8eoTauqM=3D?= Content-ID: <1CA8D6BD41C829419E7823F8B02CA48E@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: 862794dd-7376-489d-9a9b-08dc9c3bc482 X-MS-Exchange-CrossTenant-originalarrivaltime: 04 Jul 2024 15:12:49.3463 (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: V2T2A0UDX+hx+lVNyijoBAK70/4UIDM8j/soRFrGZNQZorUKSMbCpfO5Zepxj/iDyMIX5ncluERX9JnGjySuhwr0iAOy1t2i0SXNfHmsU7wbsiPhaHE245pni6EoGAHg 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 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,