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] Questions on hvm loading process (xen-src/tools/firmware)

To: <xen-devel@xxxxxxxxxxxxxxxxxxx>
Subject: [Xen-devel] Questions on hvm loading process (xen-src/tools/firmware)
From: "Hu Jia Yi" <jyhu@xxxxxxxxx>
Date: Fri, 29 Feb 2008 11:44:45 +0800
Delivery-date: Thu, 28 Feb 2008 19:45:17 -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>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
Thread-index: Ach5uZrg+R067P7ZQX+l7RNQ9dvvJAAAUkQAAAg0atAAAxjeCgAAw3AQAAEbMNEAJIS38A==
Thread-topic: Questions on hvm loading process (xen-src/tools/firmware)

I have been trying to trace how the system starts a HVM guest by reading HVM loader source code for three days.. I still have many questions on running bios and HVM guest kerenl. The follows are some of them.

 

I appreciate any help on these.

 

Q1. After “call main” in hvmloader.c in tools/firmware/hvmloader,  the system jumps to execute vmxassist.

In “setup_ctx()” in vmxassist/setup.c, “switch_to_real_mode” is assigned to a newctxt c->eip.  How this newctxt is executed?

 

Q2. How does the entering VM86 happen? The clue of entering VM86 seems broken after enter_real_mode function.

 

Q3. After returning from “call main” in tools/firmware/hvmloader/hvmloader.c, the system setups a real-mode trampoline and move it to 0x0, then jmp to F000:FFF0. Is it to continue executing HVM guest OS? If so, how is HVM guest loaded to such an address?

 

Q4. Is the system in VMX root mode when setting-up the real-mode trampoline in Q3? If so how does it deal with this kind of vmexit?

 

Best regards,

Hu Jia Yi

Ext: 20430

Tel: 65-67510430

 

-----Original Message-----
From: Keir Fraser [mailto:Keir.Fraser@xxxxxxxxxxxx]
Sent: Thursday, February 28, 2008 5:52 PM
To: Hu Jia Yi; Cui, Dexuan; xen-devel@xxxxxxxxxxxxxxxxxxx
Subject: Re: [Xen-devel] A question on vmx loader in xen - how and when rombiosis loaded into memory

 

There isn’t such a document. You can probably find a short list of bullet points on xen.org. Yes emulation much slower but modern bootloaders spend only a short time in real mode. The exceptions (e.g., SuSE bootloader pre-10.2) don’t work with vm86 at all.

 -- Keir

On 28/2/08 09:24, "Hu Jia Yi" <jyhu@xxxxxxxxx> wrote:

Where can I download documents elaborating the differences between xen-3.2.0 and 3.1.0.
 The white paper in xen.org is too short to be enlighting.
 
By the way, how can a full emulation of real mode be done? Is there a big speed gap between the full emulation and VM86?
 

Best regards,
Hu Jia Yi
Ext: 20430
Tel: 65-67510430

-----Original Message-----
From: Keir Fraser [mailto:Keir.Fraser@xxxxxxxxxxxx]
Sent: Thursday, February 28, 2008 4:59 PM
To: Hu Jia Yi; Cui, Dexuan; xen-devel@xxxxxxxxxxxxxxxxxxx
Subject: Re: [Xen-devel] A question on vmx loader in xen - how and when rombiosis loaded into memory

We don’t take that patch in Xen 3.2 and earlier. Instead we use vmxassist (see the use_vmxassist() if statement immediately above the jump to f000:fff0). In current xen-unstable we have got rid of vmxassist and Xen itself does full emulation of real mode; and the tools/firmware/README is gone!

 -- Keir

On 28/2/08 07:33, "Hu Jia Yi" <jyhu@xxxxxxxxx> wrote:
Thank you.
 
I notice the system then jumps to F000:FFF0 to execute. But because VMX is turned on, switching to real-mode would incur problems?
 
I don’t find any clue to turn on the vm86 mode as Readme in the tools/firmware directory puts.
 

Best regards,
Hu Jia Yi
Ext: 20430
Tel: 65-67510430

-----Original Message-----
From: Cui, Dexuan [mailto:dexuan.cui@xxxxxxxxx] <mailto:dexuan.cui@xxxxxxxxx%5d>  
Sent: Thursday, February 28, 2008 11:43 AM
To: Hu Jia Yi; xen-devel@xxxxxxxxxxxxxxxxxxx
Subject: RE: [Xen-devel] A question on vmx loader in xen - how and when rombiosis loaded into memory

> how and when rombios, vgabios and vmxassist have been loaded to the memory from the disk before calling “memcpy”.

They are statically compiled into hvmloader in the way of C array and are loaded with hvmloader.
Please step into the directory hvmloader/ and search for "roms.h" in Makefile.

-- Dexuan


  




From: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx [mailto:xen-devel-bounces@xxxxxxxxxxxxxxxxxxx] <mailto:xen-devel-bounces@xxxxxxxxxxxxxxxxxxx%5d> On Behalf Of Hu Jia Yi
Sent: 2008
228 11:26
To: xen-devel@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-devel] A question on vmx loader in xen - how and when rombiosis loaded into memory
A “main” function is defined in Xen-3.1.0-source/tools/firmware/hvmloader/hvmloader.c.
In this main function, rombios, vgabios and vmxassist are copied to specified address,
with following commands

memcpy((void *)ROMBIOS_PHYSICAL_ADDRESS, rombios, rombios_sz);

memcpy((void *)ETHERBOOT_PHYSICAL_ADDRESS, etherboot, sizeof(etherboot));
….

But after searching the whole directory “firmware”,  I don’t know how and when rombios, vgabios and vmxassist have been loaded to the memory from the disk before calling “memcpy”.

Could anybody help me on this?

Best regards,
Hu Jia Yi
Ext: 20430
Tel: 65-67510430


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

 

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel
<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-devel] Questions on hvm loading process (xen-src/tools/firmware), Hu Jia Yi <=