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] about __XEN_VIRT_START and 0x100000

To: Lin-Bao Zhang <2004.zhang@xxxxxxxxx>, Ian Campbell <Ian.Campbell@xxxxxxxxxx>
Subject: Re: [Xen-devel] about __XEN_VIRT_START and 0x100000
From: Keir Fraser <keir@xxxxxxx>
Date: Fri, 19 Aug 2011 10:20:50 +0100
Cc: "xen-devel@xxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxx>
Delivery-date: Fri, 19 Aug 2011 02:22:59 -0700
Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=sender:user-agent:date:subject:from:to:cc:message-id:thread-topic :thread-index:in-reply-to:mime-version:content-type :content-transfer-encoding; bh=VETC2Odf4vHjDqChTgJ748nxH7u9xmCgexOLECPuHgw=; b=JgZHD1dN16z8x4AeqaO75hiJrBGNe5ZQmgSTIZdu561BoP3Y9pq2sqhTh1JnRv/PNn Nb+VMUhDzW4pW0cV9tf7zqaN2PW5JqV1D/gphy9eXT9v8vmXTL4aL9SB5DWBekLkkGpU Z+90NuILdUa707aLadlRG6y6gGA2Bql4NEAzQ=
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <CANuKePk3CKmCYF6_t1gZ=giofBuUJqjubMsOm++QRcuboEkZUQ@xxxxxxxxxxxxxx>
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>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
Thread-index: AcxeUUkt6TxJ+4MzLkyaFS884aDPTw==
Thread-topic: [Xen-devel] about __XEN_VIRT_START and 0x100000
User-agent: Microsoft-Entourage/12.30.0.110427
On 19/08/2011 09:59, "Lin-Bao Zhang" <2004.zhang@xxxxxxxxx> wrote:

> thanks very much!
> another question:
> 
> in xen-4.1.0: code about trampoline.S
> 1, in head.S:
> ------------------------------------------------------------------------------
> -------
>    /* Copy bootstrap trampoline to low memory, below 1MB. */
>         mov     $sym_phys(trampoline_start),%esi
>         mov     $bootsym_phys(trampoline_start),%edi
>         mov     $trampoline_end - trampoline_start,%ecx
>         rep     movsb
> //bob comment, I know its function :copy beginning address(esi) 's ecx
> bytes to edi address.
> 
>         mov     $bootsym_phys(early_stack),%esp
>         call    cmdline_parse_early
> 
>         /* Jump into the relocated trampoline. */
>         jmp     $BOOT_CS32,$bootsym_phys(trampoline_boot_cpu_entry)
> 
> a)where defines early_stack ?
> I just see:
> early_stack:
>   (the last line in file ,no content again)

Stacks grow downwards/backwards in memory. The early_stack definition is
immediately *before* the early_stack label.

> b) what is function of ”   mov     $bootsym_phys(early_stack),%esp" ?
> is this related with trampoline relocation ?

The trampoline stack (early_stack) is now allocated within the trampoline
code/data area, rather than being hard-coded at an address (e.g., 0x98000).

> c)how to make sure these trampoline code can't overlap other area for
> example EBDA(directly below 0xa0000) ?

Move it lower. In 4.1 you can see we moved the trampoline down to 0x7c000.
It fits entirely below 0x80000, so it cannot overlap within even the
theoretically largest possible 128kB EBDA.

> d)     jmp     $BOOT_CS32,$bootsym_phys(trampoline_boot_cpu_entry)
> as my idea , should jump to BOOT_TRAMPOLINE ,but why jump to
> trampoline_boot_cpu_entry ?  what is relationship between
> trampoline_boot_cpu_entry and BOOT_TRAMPOLINE ?

trampoline_boot_cpu_entry is not at the start of the trampoline area, hence
jumping at BOOT_TRAMPOLINE would not work. We instead jump at
BOOT_TRAMPOLINE + (trampoline_boot_cpu_entry-trampoline_start). Handily that
is exactly what bootsym_phys() macro calculates for us.

 -- Keir

> 
> 2, about reloc.S
> 
> #include "cmdline.S"
> 
> reloc:
> #include "reloc.S"
> 
>         .align 16
>         .globl trampoline_start, trampoline_end
> trampoline_start:
> #include "trampoline.S"
> trampoline_end:
> ------------------------------------------------------------------------------
> -------------
> why I can't find reloc.S in my xen-4.1.0 code ?
> 
> thanks very much! maybe my questions are too many , thanks again!
> 
> -Bob Zhang
> 
> _______________________________________________
> 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