From: Jean-Philippe Brucker <jean-philippe.brucker@arm.com>
To: bhelgaas@google.com, robh+dt@kernel.org, mark.rutland@arm.com
Cc: linux-pci@vger.kernel.org, devicetree@vger.kernel.org,
linux-arm-kernel@lists.infradead.org, Grant.Likely@arm.com,
Jeremy.Linton@arm.com, Robin.Murphy@arm.com
Subject: [PATCH 2/2] PCI: OF: Support external-facing property
Date: Mon, 18 Mar 2019 18:21:24 +0000 [thread overview]
Message-ID: <20190318182124.53859-3-jean-philippe.brucker@arm.com> (raw)
In-Reply-To: <20190318182124.53859-1-jean-philippe.brucker@arm.com>
Set the "untrusted" attribute to any PCIe port that has an
"external-facing" device tree property. Any device downstream of this
port will inherit the attribute and have only the strictest IOMMU
protection.
Signed-off-by: Jean-Philippe Brucker <jean-philippe.brucker@arm.com>
---
drivers/pci/of.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/drivers/pci/of.c b/drivers/pci/of.c
index 3d32da15c215..3e7ac7748d90 100644
--- a/drivers/pci/of.c
+++ b/drivers/pci/of.c
@@ -35,6 +35,9 @@ void pci_set_bus_of_node(struct pci_bus *bus)
bus->dev.of_node = pcibios_get_phb_of_node(bus);
else
bus->dev.of_node = of_node_get(bus->self->dev.of_node);
+
+ if (of_get_property(bus->dev.of_node, "external-facing", NULL))
+ bus->self->untrusted = true;
}
void pci_release_bus_of_node(struct pci_bus *bus)
--
2.21.0
prev parent reply other threads:[~2019-03-18 18:24 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-03-18 18:21 [PATCH 0/2] PCI: Describe external-facing ports in device tree Jean-Philippe Brucker
2019-03-18 18:21 ` [PATCH 1/2] dt-bindings: Add external-facing PCIe port property Jean-Philippe Brucker
2019-03-20 22:03 ` Bjorn Helgaas
2019-03-25 12:59 ` Jean-Philippe Brucker
2019-03-25 13:53 ` Bjorn Helgaas
2019-03-18 18:21 ` Jean-Philippe Brucker [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20190318182124.53859-3-jean-philippe.brucker@arm.com \
--to=jean-philippe.brucker@arm.com \
--cc=Grant.Likely@arm.com \
--cc=Jeremy.Linton@arm.com \
--cc=Robin.Murphy@arm.com \
--cc=bhelgaas@google.com \
--cc=devicetree@vger.kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-pci@vger.kernel.org \
--cc=mark.rutland@arm.com \
--cc=robh+dt@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).