|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Xen-devel] [PATCH 13/17] x86: don't create Dom0 if neither PV nor HVM is available
This will give us a Xen setting in idle loop. This doesn't have
practical use except for debugging purpose.
Signed-off-by: Wei Liu <wei.liu2@xxxxxxxxxx>
---
xen/arch/x86/setup.c | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/xen/arch/x86/setup.c b/xen/arch/x86/setup.c
index 6a44902..6ac5d32 100644
--- a/xen/arch/x86/setup.c
+++ b/xen/arch/x86/setup.c
@@ -114,11 +114,13 @@ unsigned long __read_mostly mmu_cr4_features =
XEN_MINIMAL_CR4;
#define SMEP_HVM_ONLY (-1)
static s8 __initdata opt_smep = 1;
+#if defined(CONFIG_PV) || defined(CONFIG_HVM)
/*
* Initial domain place holder. Needs to be global so it can be created in
* __start_xen and unpaused in init_done.
*/
static struct domain *__initdata dom0;
+#endif
static int __init parse_smep_param(const char *s)
{
@@ -594,7 +596,9 @@ static void noinline init_done(void)
system_state = SYS_STATE_active;
+#if defined(CONFIG_PV) || defined(CONFIG_HVM)
domain_unpause_by_systemcontroller(dom0);
+#endif
/* MUST be done prior to removing .init data. */
unregister_init_virtual_region();
@@ -1706,10 +1710,12 @@ void __init noreturn __start_xen(unsigned long mbi_p)
}
dom0_cfg.max_vcpus = dom0_max_vcpus();
+#if defined(CONFIG_PV) || defined(CONFIG_HVM)
/* Create initial domain 0. */
dom0 = domain_create(get_initial_domain_id(), &dom0_cfg, !pv_shim);
if ( IS_ERR(dom0) || (alloc_dom0_vcpu0(dom0) == NULL) )
panic("Error creating domain 0\n");
+#endif
/* Grab the DOM0 command line. */
cmdline = (char *)(mod[0].string ? __va(mod[0].string) : NULL);
@@ -1765,6 +1771,7 @@ void __init noreturn __start_xen(unsigned long mbi_p)
cpu_has_nx ? XENLOG_INFO : XENLOG_WARNING "Warning: ",
cpu_has_nx ? "" : "not ");
+#if defined(CONFIG_PV) || defined(CONFIG_HVM)
/*
* We're going to setup domain0 using the module(s) that we stashed safely
* above our heap. The second module, if present, is an initrd ramdisk.
@@ -1779,6 +1786,7 @@ void __init noreturn __start_xen(unsigned long mbi_p)
write_cr4(read_cr4() | X86_CR4_SMAP);
cr4_pv32_mask |= X86_CR4_SMAP;
}
+#endif
heap_init_late();
@@ -1793,7 +1801,9 @@ void __init noreturn __start_xen(unsigned long mbi_p)
dmi_end_boot();
+#if defined(CONFIG_PV) || defined(CONFIG_HVM)
setup_io_bitmap(dom0);
+#endif
if ( bsp_delay_spec_ctrl )
{
--
git-series 0.9.1
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/xen-devel
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |