[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [PATCH] tools/hvmloader: move shared_info to reserved memory area



On Fri, Oct 26, Olaf Hering wrote:

> Oh, my take would be to return false in xen_hvm_platform if the
> hypervisor is 3.3 or older, so that the guest does not use the PVonHVM
> extensions.

Like this untested patch:

diff --git a/arch/x86/xen/enlighten.c b/arch/x86/xen/enlighten.c
index 0cc41f8..8566fa8 100644
--- a/arch/x86/xen/enlighten.c
+++ b/arch/x86/xen/enlighten.c
@@ -1543,17 +1543,10 @@ static void __init xen_hvm_init_shared_info(void)
 
 static void __init init_hvm_pv_info(void)
 {
-       int major, minor;
        uint32_t eax, ebx, ecx, edx, pages, msr, base;
        u64 pfn;
 
        base = xen_cpuid_base();
-       cpuid(base + 1, &eax, &ebx, &ecx, &edx);
-
-       major = eax >> 16;
-       minor = eax & 0xffff;
-       printk(KERN_INFO "Xen version %d.%d.\n", major, minor);
-
        cpuid(base + 2, &pages, &msr, &ecx, &edx);
 
        pfn = __pa(hypercall_page);
@@ -1604,13 +1597,29 @@ static void __init xen_hvm_guest_init(void)
 
 static bool __init xen_hvm_platform(void)
 {
+       int major, minor, old = 0;
+       uint32_t eax, ebx, ecx, edx, base;
+       bool usable = true;
+
        if (xen_pv_domain())
                return false;
 
-       if (!xen_cpuid_base())
+       base = xen_cpuid_base();
+       if (!base)
                return false;
 
-       return true;
+       cpuid(base + 1, &eax, &ebx, &ecx, &edx);
+
+       major = eax >> 16;
+       minor = eax & 0xffff;
+
+       /* Require at least Xen 3.4 */
+       if (major < 3 || (major == 3 && minor < 4))
+               usable = false;
+       printk(KERN_INFO "Xen version %d.%d.%s\n",
+               major, minor, usable ? "" : " (too old)");
+
+       return usable;
 }
 
 bool xen_hvm_need_lapic(void)

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.