xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Ian Campbell <ian.campbell@citrix.com>
To: xen-devel@lists.xen.org
Cc: Josh Zhao <joshsystem@gmail.com>,
	julien.grall@linaro.org, tim@xen.org,
	Ian Campbell <ian.campbell@citrix.com>,
	stefano.stabellini@eu.citrix.com
Subject: [PATCH RFC 7/8] xen/arm: Blacklist some sun7i UARTs
Date: Tue, 10 Sep 2013 15:18:24 +0100	[thread overview]
Message-ID: <1378822705-19310-7-git-send-email-ian.campbell@citrix.com> (raw)
In-Reply-To: <1378822681.10928.8.camel@kazak.uk.xensource.com>

These are in the same page as the UART which is used as the Xen console. We are
not currently smart enough to avoid passing them through to the guest,
accidentally giving the guest access to the Xen console UART.

NOT TO BE APPLIED: Short term this should use Juliens forthcoming platform
blacklist patch. Long term we need to be much cleverer about devices which
share the same MMIO page...

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/arch/arm/platforms/sunxi.c |   31 +++++++++++++++++++++++++++++++
 1 file changed, 31 insertions(+)

diff --git a/xen/arch/arm/platforms/sunxi.c b/xen/arch/arm/platforms/sunxi.c
index ee0f39b..4252580 100644
--- a/xen/arch/arm/platforms/sunxi.c
+++ b/xen/arch/arm/platforms/sunxi.c
@@ -22,6 +22,36 @@
 #include <xen/mm.h>
 #include <xen/device_tree.h>
 
+static int hide_by_name(const char *name)
+{
+    struct dt_device_node *n;
+
+    n = dt_find_node_by_path(name);
+    if ( !n )
+    {
+        printk("Unable to find %s to hide\n", name);
+        return -ENODEV;
+    }
+    dt_device_set_used_by(n, DOMID_XEN);
+    return 0;
+}
+
+static int sunxi_init(void)
+{
+    int rc;
+
+    if ( (rc = hide_by_name("/soc@01c00000/serial@01c28000")) < 0 )
+        return rc;
+    if ( (rc = hide_by_name("/soc@01c00000/serial@01c28400")) < 0 )
+        return rc;
+    if ( (rc = hide_by_name("/soc@01c00000/serial@01c28800")) < 0 )
+        return rc;
+    if ( (rc = hide_by_name("/soc@01c00000/serial@01c28c00")) < 0 )
+        return rc;
+
+    return 0;
+}
+
 static const char const *sunxi_dt_compat[] __initdata =
 {
     "allwinner,sun7i-a20",
@@ -30,6 +60,7 @@ static const char const *sunxi_dt_compat[] __initdata =
 
 PLATFORM_START(sunxi, "Allwinner A20")
     .compatible = sunxi_dt_compat,
+    .init = sunxi_init,
 PLATFORM_END
 
 /*
-- 
1.7.10.4

  parent reply	other threads:[~2013-09-10 14:18 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-09-10 14:18 [PATCH RFC 0/8] xen/arm: very initial cubieboard2 support Ian Campbell
2013-09-10 14:18 ` [PATCH RFC 1/8] xen/arm: Implement ioremap Ian Campbell
2013-09-10 15:03   ` Julien Grall
2013-09-10 15:14     ` Ian Campbell
2013-09-10 15:20       ` Julien Grall
2013-09-10 14:18 ` [PATCH RFC 2/8] xen/arm: implement read[bl] and write[bl] Ian Campbell
2013-09-10 15:00   ` Julien Grall
2013-09-10 15:09     ` Ian Campbell
2013-09-10 15:12       ` Julien Grall
2013-09-10 15:15         ` Ian Campbell
2013-09-10 14:18 ` [PATCH RFC 3/8] ns16550: make usable on ARM Ian Campbell
2013-09-10 14:36   ` Keir Fraser
2013-09-10 14:45     ` Ian Campbell
2013-09-10 15:00   ` Jan Beulich
2013-09-10 15:11     ` Ian Campbell
2013-09-10 15:18       ` Jan Beulich
2013-09-10 15:21         ` Ian Campbell
2013-09-10 14:18 ` [PATCH RFC 4/8] ns16550: support DesignWare 8250 Ian Campbell
2013-09-10 14:36   ` Keir Fraser
2013-09-10 15:02   ` Jan Beulich
2013-09-10 15:12     ` Ian Campbell
2013-09-10 15:19       ` Jan Beulich
2013-09-10 15:21         ` Ian Campbell
2013-09-10 15:28           ` Jan Beulich
2013-09-10 15:30             ` Ian Campbell
2013-09-10 14:18 ` [PATCH RFC 5/8] xen/arm: Support Cortex-A7 GIC Ian Campbell
2013-09-10 14:18 ` [PATCH RFC 6/8] xen/arm: Basic support for sunxi/sun7i platform Ian Campbell
2013-09-10 14:18 ` Ian Campbell [this message]
2013-09-10 14:18 ` [PATCH RFC 8/8] xen/arm: Some early trap logging Ian Campbell
2013-09-13 13:26   ` Julien Grall
2013-09-13 13:35     ` Ian Campbell
2013-09-13 13:44       ` Julien Grall
2013-09-11  2:05 ` [PATCH RFC 0/8] xen/arm: very initial cubieboard2 support Josh Zhao
2013-09-11 10:15   ` Ian Campbell

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=1378822705-19310-7-git-send-email-ian.campbell@citrix.com \
    --to=ian.campbell@citrix.com \
    --cc=joshsystem@gmail.com \
    --cc=julien.grall@linaro.org \
    --cc=stefano.stabellini@eu.citrix.com \
    --cc=tim@xen.org \
    --cc=xen-devel@lists.xen.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).