WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

Re: [Xen-devel] [PATCH 02/11] early PV on HVM

To: Konrad Rzeszutek Wilk <konrad.wilk@xxxxxxxxxx>
Subject: Re: [Xen-devel] [PATCH 02/11] early PV on HVM
From: Stefano Stabellini <stefano.stabellini@xxxxxxxxxxxxx>
Date: Tue, 11 May 2010 12:23:28 +0100
Cc: "xen-devel@xxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxx>, "Yaozu \(Eddie\) Dong" <eddie.dong@xxxxxxxxx>, Sheng Yang <sheng@xxxxxxxxxxxxxxx>, Stefano Stabellini <Stefano.Stabellini@xxxxxxxxxxxxx>
Delivery-date: Tue, 11 May 2010 04:21:46 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <20100510154634.GK29517@xxxxxxxxxxxxxxxxxxx>
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
References: <> <1273501247-27267-3-git-send-email-stefano.stabellini@xxxxxxxxxxxxx> <20100510154634.GK29517@xxxxxxxxxxxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Alpine 2.00 (DEB 1167 2008-08-23)
On Mon, 10 May 2010, Konrad Rzeszutek Wilk wrote:
> > @@ -1014,6 +1015,7 @@ void __init setup_arch(char **cmdline_p)
> >     probe_nr_irqs_gsi();
> >  
> >     kvm_guest_init();
> > +   xen_guest_init();
> 
> Upstream has this new mechanism for detecting hypervisors with a fancy
> data structure that makes '->detect' and other things. You might want to
> take that under consideration as when you post this patch upstream
> upstream they are going to ask why you aren't using it.
> 
> > @@ -1189,3 +1191,88 @@ asmlinkage void __init xen_start_kernel(void)
> >     x86_64_start_reservations((char *)__pa_symbol(&boot_params));
> >  #endif
> >  }
> > +
> > +static uint32_t xen_cpuid_base(void)
> > +{
> > +   uint32_t base, eax, ebx, ecx, edx;
> > +   char signature[13];
> > +
> > +   for (base = 0x40000000; base < 0x40010000; base += 0x100) {
> > +           cpuid(base, &eax, &ebx, &ecx, &edx);
> > +           *(uint32_t*)(signature + 0) = ebx;
> > +           *(uint32_t*)(signature + 4) = ecx;
> > +           *(uint32_t*)(signature + 8) = edx;
> > +           signature[12] = 0;
> > +
> > +           if (!strcmp("XenVMMXenVMM", signature) && ((eax - base) >= 2))
> > +                   return base;
> > +   }
> > +
> > +   return 0;
> > +}
> 
> And this seems to be used by the VMWare/HyperV detection engine too.
> 
> Maybe make another patch that makes a generic cpuid function that can be
> shared with VMWAre/HyperV/Xen?
> 

When I rebased to upstream before sending the series to LKML I'll
keep this in mind.
I am pretty sure I can at least avoid adding the call to xen_guest_init
in setup.c, using init_hypervisor_platform instead.


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel

<Prev in Thread] Current Thread [Next in Thread>