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

[Xen-devel] Early test for Windows vs Linux hvm domain?

To: "Xen-Devel (E-mail)" <xen-devel@xxxxxxxxxxxxxxxxxxx>
Subject: [Xen-devel] Early test for Windows vs Linux hvm domain?
From: "Dan Magenheimer" <dan.magenheimer@xxxxxxxxxx>
Date: Wed, 30 Jan 2008 15:28:24 -0700
Delivery-date: Wed, 30 Jan 2008 14:30:18 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
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/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Organization: Oracle Corporation
Reply-to: "dan.magenheimer@xxxxxxxxxx" <dan.magenheimer@xxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
Thread-index: Achi1+Nj20UZxvFOQ8Ozk2RUKUhg5wAQTaGJAB1MapA=
Thanks to all for the 32-bit vs 64-bit ideas.  Keir's
EFER LME bit works like a charm.

Now a probably tougher (and more controversial) question:

Is there any algorithm or heuristic early in hvm launch that
can distinguish between a windows guest and a linux guest
(64-bit specifically, but if same or different test works
for 32-bit that would be useful too).

Thanks,
Dan

> -----Original Message-----
> From: Keir Fraser [mailto:Keir.Fraser@xxxxxxxxxxxx]
> Sent: Wednesday, January 30, 2008 1:21 AM
> To: dan.magenheimer@xxxxxxxxxx; Samuel Thibault
> Cc: xen-devel@xxxxxxxxxxxxxxxxxxx
> Subject: Re: [Xen-devel] Early test for 32- vs 64-bit hvm domain?
> 
> 
> On 30/1/08 00:34, "Dan Magenheimer" 
> <dan.magenheimer@xxxxxxxxxx> wrote:
> 
> >> As long as e.g. Linux has not started (i.e. during bios 
> and grub for
> >> instance), you can't know whether that will be a 64bit Linux
> >> or a 32bit
> >> Linux.
> >
> > That's what I was afraid of...
> >
> > Then what is the earliest point in the execution of an x86_64
> > domain/vcpu in *xen* where hvm_long_mode_enabled(v) will work
> > properly? E.g. in Linux/x86_64 is long mode set early in __start?
> > And is this done via a hypercall or an emulated instruction?
> 
> As sson as you see LME bit get set in the EFER MSR then you 
> know you have a
> 64-bit guest. Writes to EFER are emulated in 
> long_mode_do_msr_write() in
> vmx.c and svm.c. Those are the places to patch in Xen 3.1 branch.
> 
>  -- Keir
> 
> 
>


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

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