From nobody Mon Apr 29 15:28:46 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=none (zohomail.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=fail(p=none dis=none) header.from=citrix.com ARC-Seal: i=1; a=rsa-sha256; t=1583330480; cv=none; d=zohomail.com; s=zohoarc; b=IoU5DTFxwo9+l8WZ/HPZOYSo9vJum7HD47f1sJMbFSk6hHnzr9n/QUjD8AFFjh9R3EWV4rKZAlux36qvo/U/jcGFHY4hC1DpEdrAiTynp4RedaLyAydQ6O+ET4tGtgnNJRNrpRC3DcQG1lQGRUWikg7gXf8jm/zbyZp0HUKauLw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1583330480; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:To; bh=thB4fJ1cISKkCOGy0CbGpnsJJzapTwBCuuy/6DmFp4c=; b=JyZczQR6Srd5wbz2i0tPhvPuzOxuhIotSEPJqW/VTkVcHl8kkD/8rRyz50T+3oCHe8SqtqtqPoo22+rlhvi+3hRl3zp2gsTDKsf8U4t2SPomQbiyE9eeyREpPMdsh8EntC7gSf8gT8VnUuT4p4g9HQNKsi80Gs6VLojjsR/xPOM= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=none (zohomail.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1583330480634108.65704207870215; Wed, 4 Mar 2020 06:01:20 -0800 (PST) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1j9UZq-0001XF-FF; Wed, 04 Mar 2020 14:00:46 +0000 Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1j9UZp-0001X9-GA for xen-devel@lists.xenproject.org; Wed, 04 Mar 2020 14:00:45 +0000 Received: from esa2.hc3370-68.iphmx.com (unknown [216.71.145.153]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS id 89d9f87a-5e20-11ea-a3e5-12813bfff9fa; Wed, 04 Mar 2020 14:00:44 +0000 (UTC) X-Inumbo-ID: 89d9f87a-5e20-11ea-a3e5-12813bfff9fa DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=citrix.com; s=securemail; t=1583330445; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=i3mRY+lx1Hy3oLRJQMX1AYdZ0waCfrmdMA30h5tkSK8=; b=eyrIDDRsmgkXjW1D0AZOhMTIkM3EMf+zBb9bWFRAuNolwxznRLxbnMz4 Jp5PEFpkI4TqwFD01c5VYtpSDKA9avD7hvE2ok8eLYEBAD+meGmKdyEER J3mXBzz0e09J6Te2satVjP19tRJeECp86tyKvV5CrtdrBo2vBw2mPujIt o=; Authentication-Results: esa2.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none; spf=None smtp.pra=roger.pau@citrix.com; spf=Pass smtp.mailfrom=roger.pau@citrix.com; spf=None smtp.helo=postmaster@mail.citrix.com Received-SPF: none (zohomail.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Received-SPF: None (esa2.hc3370-68.iphmx.com: no sender authenticity information available from domain of roger.pau@citrix.com) identity=pra; client-ip=162.221.158.21; receiver=esa2.hc3370-68.iphmx.com; envelope-from="roger.pau@citrix.com"; x-sender="roger.pau@citrix.com"; x-conformance=sidf_compatible Received-SPF: Pass (esa2.hc3370-68.iphmx.com: domain of roger.pau@citrix.com designates 162.221.158.21 as permitted sender) identity=mailfrom; client-ip=162.221.158.21; receiver=esa2.hc3370-68.iphmx.com; envelope-from="roger.pau@citrix.com"; x-sender="roger.pau@citrix.com"; x-conformance=sidf_compatible; x-record-type="v=spf1"; x-record-text="v=spf1 ip4:209.167.231.154 ip4:178.63.86.133 ip4:195.66.111.40/30 ip4:85.115.9.32/28 ip4:199.102.83.4 ip4:192.28.146.160 ip4:192.28.146.107 ip4:216.52.6.88 ip4:216.52.6.188 ip4:162.221.158.21 ip4:162.221.156.83 ip4:168.245.78.127 ~all" Received-SPF: None (esa2.hc3370-68.iphmx.com: no sender authenticity information available from domain of postmaster@mail.citrix.com) identity=helo; client-ip=162.221.158.21; receiver=esa2.hc3370-68.iphmx.com; envelope-from="roger.pau@citrix.com"; x-sender="postmaster@mail.citrix.com"; x-conformance=sidf_compatible IronPort-SDR: lZe6UpeJcjEZ12HV+wVrKPe0BAIVlZA1vXS1RzvewUHEXsMhANAwXqM2IThNv1nJloVyAXg7D+ FVCNBhJcZG+pAmVoBT/lsMGFq9rczh++PGC1XiKn63tG4GIdC0v5IY3eeMmJ3HmsA18r+EKMgA UdpTFVDmqY7wV1vip1p1KT0jWYVSFRHsv7ItmXeHPIuh8Y62Ydx/4PDIQmSyTemTtSbMZvamEU xdIraAmeIN1MbIqQe/ATmXrxY1LJV5+r4ZRo/8RPDutyNUoW8h7fZRWQb9HFLnmtRtHbWIMRPf jCo= X-SBRS: 2.7 X-MesageID: 13403949 X-Ironport-Server: esa2.hc3370-68.iphmx.com X-Remote-IP: 162.221.158.21 X-Policy: $RELAYED X-IronPort-AV: E=Sophos;i="5.70,514,1574139600"; d="scan'208";a="13403949" From: Roger Pau Monne To: Date: Wed, 4 Mar 2020 15:00:21 +0100 Message-ID: <20200304140021.55777-1-roger.pau@citrix.com> X-Mailer: git-send-email 2.25.0 MIME-Version: 1.0 Subject: [Xen-devel] [PATCH] iommu: fix check for autotranslated hardware domain X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Cc: Paul Durrant , Jan Beulich , Roger Pau Monne Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) The current position of the check_hwdom_reqs is wrong, as there's a is_iommu_enabled at the top of the function that will prevent getting to the check on systems without an IOMMU, because the hardware domain won't have the XEN_DOMCTL_CDF_iommu flag set. Move the position of the check so it's done before the is_iommu_enabled one, and thus attempts to create a translated hardware domain without an IOMMU can be detected. Fixes: f89f555827a ('remove late (on-demand) construction of IOMMU page tab= les') Signed-off-by: Roger Pau Monn=C3=A9 Reviewed-by: Jan Beulich --- xen/drivers/passthrough/iommu.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/xen/drivers/passthrough/iommu.c b/xen/drivers/passthrough/iomm= u.c index cab7a068aa..dac1b58fa5 100644 --- a/xen/drivers/passthrough/iommu.c +++ b/xen/drivers/passthrough/iommu.c @@ -172,6 +172,9 @@ int iommu_domain_init(struct domain *d, unsigned int op= ts) struct domain_iommu *hd =3D dom_iommu(d); int ret =3D 0; =20 + if ( is_hardware_domain(d) ) + check_hwdom_reqs(d); /* may modify iommu_hwdom_strict */ + if ( !is_iommu_enabled(d) ) return 0; =20 @@ -188,9 +191,6 @@ int iommu_domain_init(struct domain *d, unsigned int op= ts) if ( ret || is_system_domain(d) ) return ret; =20 - if ( is_hardware_domain(d) ) - check_hwdom_reqs(d); /* may modify iommu_hwdom_strict */ - /* * 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 --=20 2.25.0 _______________________________________________ Xen-devel mailing list Xen-devel@lists.xenproject.org https://lists.xenproject.org/mailman/listinfo/xen-devel