From: Andi Kleen <andi@firstfloor.org>
To: Keir Fraser <Keir.Fraser@cl.cam.ac.uk>
Cc: "dan.magenheimer@oracle.com" <dan.magenheimer@oracle.com>,
"xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
Samuel Thibault <samuel.thibault@eu.citrix.com>
Subject: Re: Early test for 32- vs 64-bit hvm domain?
Date: Wed, 30 Jan 2008 19:44:08 +0100 [thread overview]
Message-ID: <p73ejbz5f2f.fsf@bingen.suse.de> (raw)
In-Reply-To: <C3C5E404.1307F%Keir.Fraser@cl.cam.ac.uk> (Keir Fraser's message of "Wed\, 30 Jan 2008 08\:21\:24 +0000")
Keir Fraser <Keir.Fraser@cl.cam.ac.uk> writes:
> On 30/1/08 00:34, "Dan Magenheimer" <dan.magenheimer@oracle.com> 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.
You could do it slightly earlier by intercepting bios int 0x15 eax=0xec00 ebx=2
The kernel issues that to tell the BIOS it is 64bit.
That will only work if the boot loader does not skip the real mode code
(a few do)
-Andi
next prev parent reply other threads:[~2008-01-30 18:44 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-01-30 0:01 Early test for 32- vs 64-bit hvm domain? Dan Magenheimer
2008-01-30 0:11 ` Samuel Thibault
2008-01-30 0:34 ` Dan Magenheimer
2008-01-30 8:21 ` Keir Fraser
2008-01-30 18:44 ` Andi Kleen [this message]
2008-01-30 19:28 ` Keir Fraser
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=p73ejbz5f2f.fsf@bingen.suse.de \
--to=andi@firstfloor.org \
--cc=Keir.Fraser@cl.cam.ac.uk \
--cc=dan.magenheimer@oracle.com \
--cc=samuel.thibault@eu.citrix.com \
--cc=xen-devel@lists.xensource.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.