[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] about __XEN_VIRT_START and 0x100000



2011/8/19 Keir Fraser <keir@xxxxxxx>:
> 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.
>

yes , yes , I just saw symbols ,early_stack address should be same as
trampoline_end .


>> 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.
>
exactly , it seems that trampoline code is basicly 10K , so 0x7c000
should be lower enough ,it can't overlap to 0x80000, this will be very
rich
I finally understand why you tell me to use 0x80000. (0xa0000 - 128K
EBDA max size) .

>> 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
>
thanks Keir very very much!  , it is so nice of you. I quite
appreciate your help on this issue. I learned a lot from you! thanks
again!


--Bob Zhang

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


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.