From nobody Tue Nov 11 05:45:21 2025 Delivered-To: importer@patchew.org Received-SPF: none (zoho.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; Authentication-Results: mx.zohomail.com; dkim=fail; spf=none (zoho.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=kernel.org ARC-Seal: i=1; a=rsa-sha256; t=1569877078; cv=none; d=zoho.com; s=zohoarc; b=fPgt2SK2CY8p7TObTsoXJWxmoX3zAokCmQY6Xq0bq+a+By6l8CxWFZQaK7Cdlw1cAP7JnVHATPHuqpl5nfapx8L2UTxdF/8OM7JY+++N4w+9bZZ0FcBGcJA3WaD6uK6TZHmvl1gpNHsz9/rL4Xt0nv+Uly+DDygzTPT/DaIzIug= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1569877078; 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:ARC-Authentication-Results; bh=hkwNZyzQZWJjRRUStY6CBSt/LkQ04iXb8qS5NDk4plo=; b=fNJqmlICNascgz12FsLkN8MnrQAKWHxChcVTuQl1DVXcEoFQqBDgOuEJqNb1nNTsBKbR7SLFFQdEcg79xuRmTm1uf5EEak2NneO0hI/QoS8xp/Wc3pKGy67EPPQSQDd/JgmUigyT6csNaem2ZeaDXY2JLaVoDhXz2LR+bj40rvg= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=fail; spf=none (zoho.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 1569877078578960.1735722891673; Mon, 30 Sep 2019 13:57:58 -0700 (PDT) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1iF2im-0004ej-8R; Mon, 30 Sep 2019 20:56:40 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1iF2ik-0004ee-Uu for xen-devel@lists.xenproject.org; Mon, 30 Sep 2019 20:56:38 +0000 Received: from mail.kernel.org (unknown [198.145.29.99]) by localhost (Halon) with ESMTPS id cb5453f8-e3c4-11e9-bf31-bc764e2007e4; Mon, 30 Sep 2019 20:56:38 +0000 (UTC) Received: from sstabellini-ThinkPad-T480s.xilinx.com (c-67-164-102-47.hsd1.ca.comcast.net [67.164.102.47]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 7D1EB224FE; Mon, 30 Sep 2019 20:56:36 +0000 (UTC) X-Inumbo-ID: cb5453f8-e3c4-11e9-bf31-bc764e2007e4 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1569876997; bh=l4J92BlFI+IbnssZg7FIBDzaige2BuGLjWU+LNK5mWc=; h=From:To:Cc:Subject:Date:From; b=x+JDGCzIMdsNm3c7IoXpRT17eYYlVKUw3eKmLHuFEfkIPzIRU+anFGPIRVwdwxwyH NYY2wHEma50Ae3gZSSOPNL2yDMRbZzoEdwrmnwSy8yinnzvHM4Uyi5NdtPLoTgr/3r pETJ04ilDibOD1Sp2glkLTbHPSf7WAwO2IlMO3Ng= From: Stefano Stabellini To: julien.grall@arm.com Date: Mon, 30 Sep 2019 13:56:18 -0700 Message-Id: <20190930205618.29942-1-sstabellini@kernel.org> X-Mailer: git-send-email 2.17.1 Subject: [Xen-devel] [PATCH for-4.13] xen/arm: boot with device trees with "mmu-masters" and "iommus" 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: olekstysh@gmail.com, xen-devel@lists.xenproject.org, sstabellini@kernel.org, Stefano Stabellini MIME-Version: 1.0 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) Some Device Trees may expose both legacy SMMU and generic IOMMU bindings together. However, the SMMU driver in Xen is only supporting the legacy SMMU bindings, leading to fatal initialization errors at boot time. This patch fixes the booting problem by adding a check to iommu_add_dt_device: if the Xen driver doesn't support the new generic bindings, and the device is behind an IOMMU, do not return error. The following iommu_assign_dt_device should succeed. This check will become superfluous, hence removable, once the Xen SMMU driver gets support for the generic IOMMU bindings. Signed-off-by: Stefano Stabellini Acked-by: Julien Grall Reviewed-by: Oleksandr Tyshchenko --- xen/drivers/passthrough/device_tree.c | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/xen/drivers/passthrough/device_tree.c b/xen/drivers/passthroug= h/device_tree.c index cc900bac70..27e265b936 100644 --- a/xen/drivers/passthrough/device_tree.c +++ b/xen/drivers/passthrough/device_tree.c @@ -155,7 +155,22 @@ int iommu_add_dt_device(struct dt_device_node *np) * these callback implemented. */ if ( !ops->add_device || !ops->dt_xlate ) - return -EINVAL; + { + /* + * Some Device Trees may expose both legacy SMMU and generic + * IOMMU bindings together. However, the SMMU driver is only + * supporting the former and will protect them during the + * initialization. So we need to skip them and not return + * error here. + * + * XXX: This can be dropped when the SMMU is able to deal + * with generic bindings. + */ + if ( dt_device_is_protected(np) ) + return 0; + else + return -EINVAL; + } =20 if ( !dt_device_is_available(iommu_spec.np) ) break; --=20 2.17.1 _______________________________________________ Xen-devel mailing list Xen-devel@lists.xenproject.org https://lists.xenproject.org/mailman/listinfo/xen-devel