From mboxrd@z Thu Jan 1 00:00:00 1970 From: Keir Fraser Subject: Re: [PATCH] tools/hvmloader: move shared_info to reserved memory area Date: Fri, 26 Oct 2012 09:08:51 -0700 Message-ID: References: <20121026155128.GA18615@aepfle.de> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <20121026155128.GA18615@aepfle.de> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Olaf Hering , Konrad Rzeszutek Wilk Cc: xen-devel@lists.xen.org List-Id: xen-devel@lists.xenproject.org On 26/10/2012 08:51, "Olaf Hering" wrote: > 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: Looks okay to me. -- Keir > 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)