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

Re: [Xen-devel] [PATCH 4/4] x86/boot: Size the boot/directmap mappings dynamically



On 13.01.2020 18:50, Andrew Cooper wrote:
> --- a/xen/arch/x86/boot/head.S
> +++ b/xen/arch/x86/boot/head.S
> @@ -687,14 +687,19 @@ trampoline_setup:
>           * handling/walking), and identity map Xen into bootmap (needed for
>           * the transition into long mode), using 2M superpages.
>           */
> -        lea     sym_esi(start),%ebx
> -        lea     
> (1<<L2_PAGETABLE_SHIFT)*7+(PAGE_HYPERVISOR_RWX|_PAGE_PSE)(%ebx),%eax
> -        shr     $(L2_PAGETABLE_SHIFT-3),%ebx
> -        mov     $8,%ecx
> -1:      mov     %eax,sym_fs(l2_bootmap)-8(%ebx,%ecx,8)
> -        mov     %eax,sym_fs(l2_directmap)-8(%ebx,%ecx,8)
> -        sub     $(1<<L2_PAGETABLE_SHIFT),%eax
> -        loop    1b
> +        lea     sym_esi(_start), %ecx
> +        lea     -1 + sym_esi(_end), %edx

This looks pretty odd - does

        lea     sym_esi(_end) - 1, %edx

not work?

> +        lea     _PAGE_PSE + PAGE_HYPERVISOR_RWX(%ecx), %eax /* PTE to write. 
> */
> +        shr     $L2_PAGETABLE_SHIFT, %ecx                   /* First slot to 
> write. */
> +        shr     $L2_PAGETABLE_SHIFT, %edx                   /* Final slot to 
> write. */
> +
> +1:      mov     %eax, sym_offs(l2_bootmap)  (%esi, %ecx, 8)
> +        mov     %eax, sym_offs(l2_directmap)(%esi, %ecx, 8)

I guess I could have noticed this on the previous patch already:
This would look better as

1:      mov     %eax, sym_esi(l2_bootmap,   %ecx, 8)
        mov     %eax, sym_esi(l2_directmap, %ecx, 8)

Can sym_esi() perhaps be made

#define sym_esi(sym, extra...)      sym_offs(sym)(%esi, ## extra)

?

> --- a/xen/arch/x86/xen.lds.S
> +++ b/xen/arch/x86/xen.lds.S
> @@ -384,6 +384,3 @@ ASSERT((trampoline_end - trampoline_start) < 
> TRAMPOLINE_SPACE - MBI_SPACE_MIN,
>      "not enough room for trampoline and mbi data")
>  ASSERT((wakeup_stack - wakeup_stack_start) >= WAKEUP_STACK_MIN,
>      "wakeup stack too small")
> -
> -/* Plenty of boot code assumes that Xen isn't larger than 16M. */
> -ASSERT(_end - _start <= MB(16), "Xen too large for early-boot assumptions")

Following your reply to the cover letter, this can't be dropped just yet.
Even when that remaining issue got addressed, I think it would be better
to keep it, altering the bound to GB(1).

Jan

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/xen-devel

 


Rackspace

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