[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Xen-devel] [PATCH 7/8] xen/arm: Blacklist some sun7i UARTs
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@xxxxxxxxxx> --- 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 _______________________________________________ Xen-devel mailing list Xen-devel@xxxxxxxxxxxxx http://lists.xen.org/xen-devel
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |