Discussion:
[Xen-changelog] [xen staging] xen: allow console_io hypercalls from certain DomUs
p***@xen.org
2018-11-14 19:55:05 UTC
Permalink
commit b9a4fadf94d09a4087ce655055d6091d3da8b8c9
Author: Stefano Stabellini <***@kernel.org>
AuthorDate: Tue Nov 13 08:45:49 2018 -0800
Commit: Julien Grall <***@arm.com>
CommitDate: Wed Nov 14 19:24:52 2018 +0000

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 <***@xilinx.com>
Acked-by: Daniel De Graaf <***@tycho.nsa.gov>
Acked-by: Jan Beulich <***@suse.com>
CC: ***@citrix.com
CC: ***@eu.citrix.com
CC: ***@eu.citrix.com
CC: ***@suse.com
CC: ***@oracle.com
CC: ***@xen.org
CC: ***@citrix.com
CC: ***@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);
--
generated by git-patchbot for /home/xen/git/xen.git#staging

Loading...