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

Re: [Xen-devel] [PATCH] x86/32-on-64: adjust Dom0 initial page table layout


  • To: Jan Beulich <JBeulich@xxxxxxxx>, xen-devel <xen-devel@xxxxxxxxxxxxx>
  • From: Keir Fraser <keir.xen@xxxxxxxxx>
  • Date: Mon, 03 Sep 2012 08:38:54 +0100
  • Cc: Konrad Rzeszutek Wilk <konrad.wilk@xxxxxxxxxx>
  • Delivery-date: Mon, 03 Sep 2012 07:39:17 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xen.org>
  • Thread-index: Ac2Jpyskr9SeAANVLkuzcy6v2yk5qQ==
  • Thread-topic: [Xen-devel] [PATCH] x86/32-on-64: adjust Dom0 initial page table layout

On 03/09/2012 07:58, "Jan Beulich" <JBeulich@xxxxxxxx> wrote:

> Drop the unnecessary reservation of the L4 page for 32on64 Dom0, and
> allocate its L3 first (to match behavior when running identical bit-
> width hypervisor and Dom0 kernel).
> 
> Reported-by: Konrad Rzeszutek Wilk <konrad.wilk@xxxxxxxxxx>
> Signed-off-by: Jan Beulich <jbeulich@xxxxxxxx>

This, and your other proposed patch to xc_dom_x86.c, I'm not sure about for
4.2.0. Are we prepared to possibly slip 4.2.0 for these, rather than put
them in 4.2.1 instead (which will certainly be sooner than our proposed
usual 3-month schedule for point releases)?

 -- Keir

> --- a/xen/arch/x86/domain_build.c
> +++ b/xen/arch/x86/domain_build.c
> @@ -510,7 +510,7 @@ int __init construct_dom0(
>  #define NR(_l,_h,_s) \
>      (((((_h) + ((1UL<<(_s))-1)) & ~((1UL<<(_s))-1)) - \
>         ((_l) & ~((1UL<<(_s))-1))) >> (_s))
> -        if ( (1 + /* # L4 */
> +        if ( (!is_pv_32on64_domain(d) + /* # L4 */
>                NR(v_start, v_end, L4_PAGETABLE_SHIFT) + /* # L3 */
>                (!is_pv_32on64_domain(d) ?
>                 NR(v_start, v_end, L3_PAGETABLE_SHIFT) : /* # L2 */
> @@ -756,6 +756,8 @@ int __init construct_dom0(
>              panic("Not enough RAM for domain 0 PML4.\n");
>          page->u.inuse.type_info = PGT_l4_page_table|PGT_validated|1;
>          l4start = l4tab = page_to_virt(page);
> +        maddr_to_page(mpt_alloc)->u.inuse.type_info = PGT_l3_page_table;
> +        l3start = __va(mpt_alloc); mpt_alloc += PAGE_SIZE;
>      }
>      copy_page(l4tab, idle_pg_table);
>      l4tab[0] = l4e_empty(); /* zap trampoline mapping */
> @@ -787,9 +789,13 @@ int __init construct_dom0(
>                      l2tab += l2_table_offset(v_start);
>                  if ( !((unsigned long)l3tab & (PAGE_SIZE-1)) )
>                  {
> -                    maddr_to_page(mpt_alloc)->u.inuse.type_info =
> -                        PGT_l3_page_table;
> -                    l3start = l3tab = __va(mpt_alloc); mpt_alloc +=
> PAGE_SIZE;
> +                    if ( count || !l3start )
> +                    {
> +                        maddr_to_page(mpt_alloc)->u.inuse.type_info =
> +                            PGT_l3_page_table;
> +                        l3start = __va(mpt_alloc); mpt_alloc += PAGE_SIZE;
> +                    }
> +                    l3tab = l3start;
>                      clear_page(l3tab);
>                      if ( count == 0 )
>                          l3tab += l3_table_offset(v_start);
> @@ -938,7 +944,7 @@ int __init construct_dom0(
>      if ( !vinitrd_start && initrd_len )
>          si->flags   |= SIF_MOD_START_PFN;
>      si->flags       |= (xen_processor_pmbits << 8) & SIF_PM_MASK;
> -    si->pt_base      = vpt_start + 2 * PAGE_SIZE * !!is_pv_32on64_domain(d);
> +    si->pt_base      = vpt_start;
>      si->nr_pt_frames = nr_pt_pages;
>      si->mfn_list     = vphysmap_start;
>      snprintf(si->magic, sizeof(si->magic), "xen-3.0-x86_%d%s",
> 
> 
> 
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@xxxxxxxxxxxxx
> http://lists.xen.org/xen-devel



_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

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