aboutsummaryrefslogtreecommitdiffstats
path: root/xen/common/kernel.c
diff options
context:
space:
mode:
authorJan Beulich <jbeulich@novell.com>2011-07-23 08:49:15 +0100
committerJan Beulich <jbeulich@novell.com>2011-07-23 08:49:15 +0100
commitec029aaa9a79965f83476808e32b8573891aa79c (patch)
tree8f7a0d56b7a3869f0bf7d42e165f8b7d72f3371e /xen/common/kernel.c
parent173b4afb894a248ade34bfd38850214f82d657c3 (diff)
downloadxen-ec029aaa9a79965f83476808e32b8573891aa79c.tar.gz
xen-ec029aaa9a79965f83476808e32b8573891aa79c.tar.bz2
xen-ec029aaa9a79965f83476808e32b8573891aa79c.zip
add privileged (dom0) kernel feature indication
With our switching away from supporting 32-bit Dom0 operation, users complained that attempts (perhaps due to lack of knowledge of that change) to boot the no longer privileged kernel in Dom0 resulted in apparently silent failure. To make the mismatch explicit and visible, add dom0 feature flag that the kernel can set to indicate operation as dom0 is supported. Due to the way elf_xen_parse_features() worked up to now (getting fixed here), adding features indications to the old, string based ELF note would make the respective kernel unusable on older hypervisors. For that reason, a new ELF Note is being introduced that allows specifying supported features as a bit array instead (with features unknown to the hypervisor simply ignored, as now also done by elf_xen_parse_features(), whereas here unknown kernel-required features still keep the kernel [and hence VM] from booting). Introduce and use elf_note_numeric_array() to be forward compatible (or else an old hypervisor wouldn't be able to parse kernel specified features occupying more than 64 bits - thanks, Ian!). Signed-off-by: Jan Beulich <jbeulich@novell.com>
Diffstat (limited to 'xen/common/kernel.c')
-rw-r--r--xen/common/kernel.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/xen/common/kernel.c b/xen/common/kernel.c
index 5558dc0712..7decc1d70d 100644
--- a/xen/common/kernel.c
+++ b/xen/common/kernel.c
@@ -287,6 +287,8 @@ DO(xen_version)(int cmd, XEN_GUEST_HANDLE(void) arg)
(1U << XENFEAT_auto_translated_physmap);
if ( supervisor_mode_kernel )
fi.submap |= 1U << XENFEAT_supervisor_mode_kernel;
+ if ( current->domain == dom0 )
+ fi.submap |= 1U << XENFEAT_dom0;
#ifdef CONFIG_X86
if ( !is_hvm_vcpu(current) )
fi.submap |= (1U << XENFEAT_mmu_pt_update_preserve_ad) |