aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/xen
diff options
context:
space:
mode:
authorJeremy Fitzhardinge <jeremy@goop.org>2008-08-19 16:16:17 -0400
committerIngo Molnar <mingo@elte.hu>2008-08-20 06:40:07 -0400
commit6e833587e11ed0dbf12e647127f2650e2f80b26d (patch)
tree7ba3d76705547ed1377f87694e0b0e4391fe0015 /arch/x86/xen
parent170465ee7f5a9a2d0ac71285507e52642e040353 (diff)
xen: clean up domain mode predicates
There are four operating modes Xen code may find itself running in: - native - hvm domain - pv dom0 - pv domU Clean up predicates for testing for these states to make them more consistent. Signed-off-by: Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com> Cc: Xen-devel <xen-devel@lists.xensource.com> Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'arch/x86/xen')
-rw-r--r--arch/x86/xen/enlighten.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/arch/x86/xen/enlighten.c b/arch/x86/xen/enlighten.c
index 53afa14eb314..b106e825d266 100644
--- a/arch/x86/xen/enlighten.c
+++ b/arch/x86/xen/enlighten.c
@@ -56,6 +56,9 @@ EXPORT_SYMBOL_GPL(hypercall_page);
56DEFINE_PER_CPU(struct vcpu_info *, xen_vcpu); 56DEFINE_PER_CPU(struct vcpu_info *, xen_vcpu);
57DEFINE_PER_CPU(struct vcpu_info, xen_vcpu_info); 57DEFINE_PER_CPU(struct vcpu_info, xen_vcpu_info);
58 58
59enum xen_domain_type xen_domain_type = XEN_NATIVE;
60EXPORT_SYMBOL_GPL(xen_domain_type);
61
59/* 62/*
60 * Identity map, in addition to plain kernel map. This needs to be 63 * Identity map, in addition to plain kernel map. This needs to be
61 * large enough to allocate page table pages to allocate the rest. 64 * large enough to allocate page table pages to allocate the rest.
@@ -1613,6 +1616,8 @@ asmlinkage void __init xen_start_kernel(void)
1613 if (!xen_start_info) 1616 if (!xen_start_info)
1614 return; 1617 return;
1615 1618
1619 xen_domain_type = XEN_PV_DOMAIN;
1620
1616 BUG_ON(memcmp(xen_start_info->magic, "xen-3", 5) != 0); 1621 BUG_ON(memcmp(xen_start_info->magic, "xen-3", 5) != 0);
1617 1622
1618 xen_setup_features(); 1623 xen_setup_features();
@@ -1650,7 +1655,7 @@ asmlinkage void __init xen_start_kernel(void)
1650 1655
1651 /* Prevent unwanted bits from being set in PTEs. */ 1656 /* Prevent unwanted bits from being set in PTEs. */
1652 __supported_pte_mask &= ~_PAGE_GLOBAL; 1657 __supported_pte_mask &= ~_PAGE_GLOBAL;
1653 if (!is_initial_xendomain()) 1658 if (!xen_initial_domain())
1654 __supported_pte_mask &= ~(_PAGE_PWT | _PAGE_PCD); 1659 __supported_pte_mask &= ~(_PAGE_PWT | _PAGE_PCD);
1655 1660
1656 /* Don't do the full vcpu_info placement stuff until we have a 1661 /* Don't do the full vcpu_info placement stuff until we have a
@@ -1685,7 +1690,7 @@ asmlinkage void __init xen_start_kernel(void)
1685 boot_params.hdr.ramdisk_size = xen_start_info->mod_len; 1690 boot_params.hdr.ramdisk_size = xen_start_info->mod_len;
1686 boot_params.hdr.cmd_line_ptr = __pa(xen_start_info->cmd_line); 1691 boot_params.hdr.cmd_line_ptr = __pa(xen_start_info->cmd_line);
1687 1692
1688 if (!is_initial_xendomain()) { 1693 if (!xen_initial_domain()) {
1689 add_preferred_console("xenboot", 0, NULL); 1694 add_preferred_console("xenboot", 0, NULL);
1690 add_preferred_console("tty", 0, NULL); 1695 add_preferred_console("tty", 0, NULL);
1691 add_preferred_console("hvc", 0, NULL); 1696 add_preferred_console("hvc", 0, NULL);