From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ian Campbell Subject: [PATCH 7/8] xen/arm: Blacklist some sun7i UARTs Date: Fri, 13 Sep 2013 17:04:06 +0100 Message-ID: <1379088247-29325-7-git-send-email-ian.campbell@citrix.com> References: <1379088118.19256.95.camel@kazak.uk.xensource.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1379088118.19256.95.camel@kazak.uk.xensource.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: xen-devel@lists.xen.org Cc: keir@xen.org, Ian Campbell , stefano.stabellini@eu.citrix.com, julien.grall@linaro.org, tim@xen.org, jbeulich@suse.com, Josh Zhao List-Id: xen-devel@lists.xenproject.org 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 --- 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 #include +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