From nobody Tue Feb 10 15:46:37 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org ARC-Seal: i=1; a=rsa-sha256; t=1601891378; cv=none; d=zohomail.com; s=zohoarc; b=KdSKGQ6OJOmDWMrzfxfGB+CAkHABX8HrVahRm1DXzt409cROLOSovX+GVfxJPWA8SRKnwoXnyJmRkBjZrMUuOB+kZa29NqFb1gGFjs7+oFZFsaqvPrUT1hCMmAzuKRksxBm05GM/uZcSEJSGUQuHsbt93jtvwKxrg1Guoe2ei2s= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1601891378; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=0/TvnggoZgnvE3hOxtGaw8lHv49nlACtJLzfHJVFPDg=; b=eWEL0HhFrsrtDAjpvfAhYhxGsvGpC4fP395m5Uumjt1ZxTxQWwRCJAqpHJ9RjRASt0etmxM4AJwi8nckRJvwQn7yZ1LykO7dJneOzVzp/V7hg30IRoxIiPtE+zp+QSfyz5kV78hU/wDqXutl3x6u8EnnCKu1OcN1KddZgIa3Ufc= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1601891378912172.9490663160757; Mon, 5 Oct 2020 02:49:38 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.2947.8436 (Exim 4.92) (envelope-from ) id 1kPN7N-0000cr-Rq; Mon, 05 Oct 2020 09:49:17 +0000 Received: by outflank-mailman (output) from mailman id 2947.8436; Mon, 05 Oct 2020 09:49:17 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1kPN7N-0000cj-O6; Mon, 05 Oct 2020 09:49:17 +0000 Received: by outflank-mailman (input) for mailman id 2947; Mon, 05 Oct 2020 09:49:17 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1kPN7N-0000a2-4g for xen-devel@lists.xenproject.org; Mon, 05 Oct 2020 09:49:17 +0000 Received: from mail.xenproject.org (unknown [104.130.215.37]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id cc291b9a-82d7-464d-b8ff-200c3d85c9aa; Mon, 05 Oct 2020 09:49:13 +0000 (UTC) Received: from xenbits.xenproject.org ([104.239.192.120]) by mail.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1kPN7J-00018j-D5; Mon, 05 Oct 2020 09:49:13 +0000 Received: from host109-146-187-185.range109-146.btcentralplus.com ([109.146.187.185] helo=u2f063a87eabd5f.home) by xenbits.xenproject.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kPN7J-0007gW-5k; Mon, 05 Oct 2020 09:49:13 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1kPN7N-0000a2-4g for xen-devel@lists.xenproject.org; Mon, 05 Oct 2020 09:49:17 +0000 Received: from mail.xenproject.org (unknown [104.130.215.37]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id cc291b9a-82d7-464d-b8ff-200c3d85c9aa; Mon, 05 Oct 2020 09:49:13 +0000 (UTC) Received: from xenbits.xenproject.org ([104.239.192.120]) by mail.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1kPN7J-00018j-D5; Mon, 05 Oct 2020 09:49:13 +0000 Received: from host109-146-187-185.range109-146.btcentralplus.com ([109.146.187.185] helo=u2f063a87eabd5f.home) by xenbits.xenproject.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kPN7J-0007gW-5k; Mon, 05 Oct 2020 09:49:13 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: cc291b9a-82d7-464d-b8ff-200c3d85c9aa DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org; s=20200302mail; h=Content-Transfer-Encoding:MIME-Version:References: In-Reply-To:Message-Id:Date:Subject:Cc:To:From; bh=0/TvnggoZgnvE3hOxtGaw8lHv49nlACtJLzfHJVFPDg=; b=daBGQ6wW7PKyicNrzxKeGW/4xr JsNo/tu6Lto8STSfVzRNs3wrlqCf6RgM9URkBR0sk+ytSsYT7z+u38waeP6sT0LGWMON6encXeLRU sTbJgN48uiUrZaprjjzECD/WIaQpuNxGHpPGeWuDoOTBF5Ag+iDqmhSfdz0HjcRaLMys=; From: Paul Durrant To: xen-devel@lists.xenproject.org Cc: Paul Durrant , Jan Beulich Subject: [PATCH 4/5] iommu: set 'hap_pt_share' and 'need_sync' flags earlier in iommu_domain_init() Date: Mon, 5 Oct 2020 10:49:04 +0100 Message-Id: <20201005094905.2929-5-paul@xen.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20201005094905.2929-1-paul@xen.org> References: <20201005094905.2929-1-paul@xen.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @xen.org) Content-Type: text/plain; charset="utf-8" From: Paul Durrant Set these flags prior to the calls to arch_iommu_domain_init() and the implementation init() method. There is no reason to hide this information f= rom those functions and the value of 'hap_pt_share' will be needed by a modification to arch_iommu_domain_init() made in a subsequent patch. Signed-off-by: Paul Durrant Reviewed-by: Julien Grall --- Cc: Jan Beulich --- xen/drivers/passthrough/iommu.c | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/xen/drivers/passthrough/iommu.c b/xen/drivers/passthrough/iomm= u.c index 642d5c8331..fd9705b3a9 100644 --- a/xen/drivers/passthrough/iommu.c +++ b/xen/drivers/passthrough/iommu.c @@ -174,15 +174,6 @@ int iommu_domain_init(struct domain *d, unsigned int o= pts) hd->node =3D NUMA_NO_NODE; #endif =20 - ret =3D arch_iommu_domain_init(d); - if ( ret ) - return ret; - - hd->platform_ops =3D iommu_get_ops(); - ret =3D hd->platform_ops->init(d); - if ( ret || is_system_domain(d) ) - return ret; - /* * Use shared page tables for HAP and IOMMU if the global option * is enabled (from which we can infer the h/w is capable) and @@ -202,7 +193,12 @@ int iommu_domain_init(struct domain *d, unsigned int o= pts) =20 ASSERT(!(hd->need_sync && hd->hap_pt_share)); =20 - return 0; + ret =3D arch_iommu_domain_init(d); + if ( ret ) + return ret; + + hd->platform_ops =3D iommu_get_ops(); + return hd->platform_ops->init(d); } =20 void __hwdom_init iommu_hwdom_init(struct domain *d) --=20 2.20.1