From: Andrew Cooper Date: Sun, 28 Jan 2018 18:23:27 +0000 (+0000) Subject: Cope being booting as the initial domain X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=9eeb26f3faeb25925c0cfde9ec18571fdbfbe4fa;p=xtf.git Cope being booting as the initial domain 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 --- diff --git a/arch/x86/setup.c b/arch/x86/setup.c index c41ace4..42e3c2b 100644 --- a/arch/x86/setup.c +++ b/arch/x86/setup.c @@ -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(); } /* diff --git a/include/xen/xen.h b/include/xen/xen.h index fe0d6d8..877f2f0 100644 --- a/include/xen/xen.h +++ b/include/xen/xen.h @@ -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 {