[PATCH v2 03/11] xen/hvmlite: Initialize HVMlite kernel

From: Boris Ostrovsky
Date: Mon Feb 01 2016 - 10:41:32 EST


HVMlite guests need to make a few additional initialization calls
compared to regular HVM guests.

Signed-off-by: Boris Ostrovsky <boris.ostrovsky@xxxxxxxxxx>
---
arch/x86/xen/enlighten.c | 18 ++++++++++++------
1 files changed, 12 insertions(+), 6 deletions(-)

diff --git a/arch/x86/xen/enlighten.c b/arch/x86/xen/enlighten.c
index 5f05fa2..1409de6 100644
--- a/arch/x86/xen/enlighten.c
+++ b/arch/x86/xen/enlighten.c
@@ -1863,15 +1863,21 @@ static void __init init_hvm_pv_info(void)
minor = eax & 0xffff;
printk(KERN_INFO "Xen version %d.%d.\n", major, minor);

- cpuid(base + 2, &pages, &msr, &ecx, &edx);
-
- pfn = __pa(hypercall_page);
- wrmsr_safe(msr, (u32)pfn, (u32)(pfn >> 32));
+ /* HVMlite set up hypercall page earlier in xen_prepare_hvmlite() */
+ if (xen_hvmlite) {
+ pv_info.name = "Xen HVMlite";
+ pv_info.paravirt_enabled = 1;
+ xen_init_apic();
+ machine_ops = xen_machine_ops;
+ } else {
+ pv_info.name = "Xen HVM";
+ cpuid(base + 2, &pages, &msr, &ecx, &edx);
+ pfn = __pa(hypercall_page);
+ wrmsr_safe(msr, (u32)pfn, (u32)(pfn >> 32));
+ }

xen_setup_features();

- pv_info.name = "Xen HVM";
-
xen_domain_type = XEN_HVM_DOMAIN;
}

--
1.7.1