]> xenbits.xensource.com Git - people/dariof/xen.git/commitdiff
xen: allow console_io hypercalls from certain DomUs
authorStefano Stabellini <sstabellini@kernel.org>
Tue, 13 Nov 2018 16:45:49 +0000 (08:45 -0800)
committerJulien Grall <julien.grall@arm.com>
Wed, 14 Nov 2018 19:24:52 +0000 (19:24 +0000)
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 <stefanos@xilinx.com>
Acked-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
Acked-by: Jan Beulich <jbeulich@suse.com>
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
xen/include/xsm/dummy.h

index 3171eabfd692293e8405967780bd7b6a4ad633e9..7e51a39358037d8935e2712ae43a9129e6eed309 100644 (file)
@@ -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? */
index ae971822d546e4c20e230888acc72f4aeef55e87..a29d1efe9b04df63cd74c56e4ac5ccd5eeaeb4ef 100644 (file)
@@ -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);