From b9a4fadf94d09a4087ce655055d6091d3da8b8c9 Mon Sep 17 00:00:00 2001 From: Stefano Stabellini Date: Tue, 13 Nov 2018 08:45:49 -0800 Subject: [PATCH] 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 --- xen/include/xen/sched.h | 2 ++ xen/include/xsm/dummy.h | 2 ++ 2 files changed, 4 insertions(+) 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); -- 2.30.2