From: Stefano Stabellini Date: Tue, 13 Nov 2018 16:45:49 +0000 (-0800) Subject: xen: allow console_io hypercalls from certain DomUs X-Git-Tag: archive/raspbian/4.14.0+80-gd101b417b7-1+rpi1^2~63^2~2954 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=b9a4fadf94d09a4087ce655055d6091d3da8b8c9;p=xen.git xen: allow console_io hypercalls from certain DomUs Introduce an is_console option to allow certain classes of domUs to use the Xen console. Specifically, it will be used to give console access to all domUs started from Xen from information on device tree. Signed-off-by: Stefano Stabellini Acked-by: Daniel De Graaf Acked-by: Jan Beulich CC: andrew.cooper3@citrix.com CC: George.Dunlap@eu.citrix.com CC: ian.jackson@eu.citrix.com CC: jbeulich@suse.com CC: konrad.wilk@oracle.com CC: tim@xen.org CC: wei.liu2@citrix.com CC: dgdegra@tycho.nsa.gov --- diff --git a/xen/include/xen/sched.h b/xen/include/xen/sched.h index 3171eabfd6..7e51a39358 100644 --- a/xen/include/xen/sched.h +++ b/xen/include/xen/sched.h @@ -376,6 +376,8 @@ struct domain bool auto_node_affinity; /* Is this guest fully privileged (aka dom0)? */ bool is_privileged; + /* Can this guest access the Xen console? */ + bool is_console; /* Is this a xenstore domain (not dom0)? */ bool is_xenstore; /* Domain's VCPUs are pinned 1:1 to physical CPUs? */ diff --git a/xen/include/xsm/dummy.h b/xen/include/xsm/dummy.h index ae971822d5..a29d1efe9b 100644 --- a/xen/include/xsm/dummy.h +++ b/xen/include/xsm/dummy.h @@ -231,6 +231,8 @@ static XSM_INLINE int xsm_memory_stat_reservation(XSM_DEFAULT_ARG struct domain static XSM_INLINE int xsm_console_io(XSM_DEFAULT_ARG struct domain *d, int cmd) { XSM_ASSERT_ACTION(XSM_OTHER); + if ( d->is_console ) + return xsm_default_action(XSM_HOOK, d, NULL); #ifdef CONFIG_VERBOSE_DEBUG if ( cmd == CONSOLEIO_write ) return xsm_default_action(XSM_HOOK, d, NULL);