]> xenbits.xensource.com Git - xtf.git/commitdiff
Cope being booting as the initial domain
authorAndrew Cooper <andrew.cooper3@citrix.com>
Sun, 28 Jan 2018 18:23:27 +0000 (18:23 +0000)
committerAndrew Cooper <andrew.cooper3@citrix.com>
Wed, 31 Jan 2018 11:43:43 +0000 (11:43 +0000)
When booted as the initial domain (most commonly in PV-shim mode), the console
and xenbus rings aren't configured, as it is the responsibility of the initial
domain to provide xenconsole/xenstored services for other domains.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
arch/x86/setup.c
include/xen/xen.h

index c41ace441233e9d4d398f3e92ff7454ec42480c3..42e3c2bd5bbe3fb4406d9fb2ae99b038815b61eb 100644 (file)
@@ -143,6 +143,14 @@ static void init_hypercalls(void)
         panic("Hypercall page not initialised correctly\n");
 }
 
+static bool is_initdomain(void)
+{
+    if ( IS_DEFINED(CONFIG_PV) )
+        return pv_start_info->flags & SIF_INITDOMAIN;
+    else
+        return pvh_start_info && pvh_start_info->flags & SIF_INITDOMAIN;
+}
+
 static void setup_pv_console(void)
 {
     xencons_interface_t *cons_ring;
@@ -250,9 +258,13 @@ void arch_setup(void)
 
     init_hypercalls();
 
-    setup_pv_console();
+    if ( !is_initdomain() )
+    {
+        setup_pv_console();
+        setup_xenbus();
+    }
+
     map_shared_info();
-    setup_xenbus();
 }
 
 /*
index fe0d6d8522cd18bb5bfa9f89f51ec416cd070bdd..877f2f0eb8a68cc142874733701adf619bdf6d58 100644 (file)
@@ -236,6 +236,10 @@ struct xen_pv_start_info {
 typedef struct xen_pv_start_info xen_pv_start_info_t;
 #endif
 
+/* These flags are passed in the 'flags' field of start_info_t. */
+#define SIF_PRIVILEGED    (1u << 0)  /* Is the domain privileged? */
+#define SIF_INITDOMAIN    (1u << 1)  /* Is this the initial control domain? */
+
 /* MMU UPDATE operations */
 #ifndef __ASSEMBLY__
 struct mmu_update {