From nobody Mon Feb 9 01:09:04 2026 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=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1570548402; cv=none; d=zoho.com; s=zohoarc; b=No7oqIqTpqMsNbsrZtMkEjEP0lsz+KTg0Eovm+Eo+cABMrYyUY6jKjQEEKQMJLQyNAp3vgCZfqDXMGMuPGoaWyfMk/oNPvqO0tY7mttLaUrhzT8cFJjhaHsQrH6g8mH7u2p/I4P2yuzT8XyMpYt3Ht2cDaw+/nl5ILP8zuePIRo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1570548402; 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=ZaDuZ6bB3zIMBIucM9w1yEUXqrdftEpO+EjAQoQlIes=; b=jYGKyTSZR8rzXWaOLV5ym5BlUX5aomYxy1pjTTafK1J/nHhTPhjKRCMTjmhSdYKvkTIoUdjK141l6KAsoZGis+6Fe4MxgHrbe/swBl9CjECYztWEzHNWQvT5Km44dokoBy8gQRMzqLR+z3Ft9o8BEWZp6rk/zQ5BCG1gFzzfJ8Q= 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 1570548402786344.79768822940764; Tue, 8 Oct 2019 08:26:42 -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 1iHrMX-0004Xq-Am; Tue, 08 Oct 2019 15:25:21 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1iHrMW-0004Xl-FS for xen-devel@lists.xenproject.org; Tue, 08 Oct 2019 15:25:20 +0000 Received: from mail-lj1-x243.google.com (unknown [2a00:1450:4864:20::243]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id d5db8ab4-e9df-11e9-80e3-bc764e2007e4; Tue, 08 Oct 2019 15:25:19 +0000 (UTC) Received: by mail-lj1-x243.google.com with SMTP id f5so18012041ljg.8 for ; Tue, 08 Oct 2019 08:25:19 -0700 (PDT) Received: from otyshchenko.kyiv.epam.com (ll-74.141.223.85.sovam.net.ua. [85.223.141.74]) by smtp.gmail.com with ESMTPSA id h12sm3984783ljg.24.2019.10.08.08.25.16 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 08 Oct 2019 08:25:17 -0700 (PDT) X-Inumbo-ID: d5db8ab4-e9df-11e9-80e3-bc764e2007e4 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=EgoNg0rDOVixSSUIvs0Qc5Y5gj5bOjJ9IcQIEZ8RSH8=; b=n9ppuvVY66KrySNNu4z/SzcCGiPTwE68rOY6dVseTYQ8dxZBD+Sf3LZOrZ52c5VT9C b8trwmQ3DuN3pR2jGT2u4x5M4OKgjjGBiuU2yw5bvVxpbpn/iuyLiUcysO7lsFfkVhws t2yTRTWh/6XSDeXbc4fHYan5p8y6EDHNwvUQkZX1QcAbYlHv4YPNo4NpkHa9kJ5jFk7d JvGX6q5tK7472RK7HVnDj2EKM0aD03r/bzfabRQh8N7L/Sh68hPNfzqgupQduZRlSfDx kVUtnPnWmn+4IM7MBhsy8LU1WkADzVAMPckkTsRqPqM6J7j4tgM2WHw6deed8V4/fx9o gwsg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=EgoNg0rDOVixSSUIvs0Qc5Y5gj5bOjJ9IcQIEZ8RSH8=; b=VGstADtnVfkSRJLEIXcPGt/X9IsEt8CUkQelYDAonUCUlaeoB3p4aLAtQaONEh+X21 FcpWJwKzQexhb/5FVtyBOhDz64DT5oImQmHnWY9Mv3wpQlbl5KXBoZldY1feO6KSEPkb bKMm06o3FCwj6JUyzLNesuUJyFHojiWN4aP4FiNj97NXBDgba1oljwcuaSRKOJpSX2zb zJm8XR473vOdgPmBx8Vvd64d1EGWtAxMkLysMZyGb1tOfcXYbkNVjR1l7aMh4yPN9glf nG4wbqem2NQooDLScBN7M/MORoQjNtA5N9RasGn4zrnZzG71YGFeMl1411+PqPduxAUy S7NA== X-Gm-Message-State: APjAAAWGqyinZ+BtukU5FQV4r7jNJLxENJGDW13N2exn0M5HBzOEplDD ezERDvmA4/qDm1ZR2w8vbr7SskYI/uM= X-Google-Smtp-Source: APXvYqxyVHXj3s5+PiKOIzrsYZDM3xI5TztxGfLhNlj0LJd9Co9B/cCOGDYhRfKNb4R+YJPGzjy0wQ== X-Received: by 2002:a2e:3808:: with SMTP id f8mr22500837lja.7.1570548317959; Tue, 08 Oct 2019 08:25:17 -0700 (PDT) From: Oleksandr Tyshchenko To: xen-devel@lists.xenproject.org Date: Tue, 8 Oct 2019 18:25:04 +0300 Message-Id: <1570548304-12020-1-git-send-email-olekstysh@gmail.com> X-Mailer: git-send-email 2.7.4 Subject: [Xen-devel] [PATCH for-4.13 v2] xen/arm: domain_build: Don't expose IOMMU specific properties to hwdom 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: Oleksandr Tyshchenko , julien.grall@arm.com, sstabellini@kernel.org, volodymyr_babchuk@epam.com 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) From: Oleksandr Tyshchenko We don't passthrough IOMMU device to hwdom even if it is not used by Xen. Therefore exposing the properties that describe relationship between master devices and IOMMUs does not make any sense. According to the: 1. Documentation/devicetree/bindings/iommu/iommu.txt 2. Documentation/devicetree/bindings/pci/pci-iommu.txt Signed-off-by: Oleksandr Tyshchenko --- Changes V1 [1] -> V2: - Only skip IOMMU specific properties of the master device if we skip the corresponding IOMMU device - Use "hwdom" over "Dom0" [1] https://lists.xenproject.org/archives/html/xen-devel/2019-10/msg00104.h= tml --- xen/arch/arm/domain_build.c | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/xen/arch/arm/domain_build.c b/xen/arch/arm/domain_build.c index 6d6dd52..a7321b8 100644 --- a/xen/arch/arm/domain_build.c +++ b/xen/arch/arm/domain_build.c @@ -480,10 +480,26 @@ static int __init write_properties(struct domain *d, = struct kernel_info *kinfo, const struct dt_property *prop, *status =3D NULL; int res =3D 0; int had_dom0_bootargs =3D 0; + struct dt_device_node *iommu_node; =20 if ( kinfo->cmdline && kinfo->cmdline[0] ) bootargs =3D &kinfo->cmdline[0]; =20 + /* + * If we skip the IOMMU device when creating DT for hwdom (even if + * the IOMMU device is not used by Xen), we should also skip the IOMMU + * specific properties of the master device behind it in order to avoid + * exposing an half complete IOMMU bindings to hwdom. + * Use "iommu_node" as an indicator of the master device which propert= ies + * should be skipped. + */ + iommu_node =3D dt_parse_phandle(node, "iommus", 0); + if ( iommu_node ) + { + if ( device_get_class(iommu_node) !=3D DEVICE_IOMMU ) + iommu_node =3D NULL; + } + dt_for_each_property_node (node, prop) { const void *prop_data =3D prop->value; @@ -540,6 +556,19 @@ static int __init write_properties(struct domain *d, s= truct kernel_info *kinfo, continue; } =20 + if ( iommu_node ) + { + /* Don't expose IOMMU specific properties to hwdom */ + if ( dt_property_name_is_equal(prop, "iommus") ) + continue; + + if ( dt_property_name_is_equal(prop, "iommu-map") ) + continue; + + if ( dt_property_name_is_equal(prop, "iommu-map-mask") ) + continue; + } + res =3D fdt_property(kinfo->fdt, prop->name, prop_data, prop_len); =20 if ( res ) --=20 2.7.4 _______________________________________________ Xen-devel mailing list Xen-devel@lists.xenproject.org https://lists.xenproject.org/mailman/listinfo/xen-devel