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

Re: [Xen-devel] [PATCH v3 06/13] xen/arm: implement arch_vmap_virt_end



On Wed, 2013-04-24 at 20:07 +0100, Stefano Stabellini wrote:
> Move virt_start out of ioremap and rename it to early_vmap_start.
> Implement arch_vmap_virt_end by returning early_vmap_start.
> 
> Signed-off-by: Stefano Stabellini <stefano.stabellini@xxxxxxxxxxxxx>
> ---
>  xen/arch/arm/mm.c |   24 +++++++++++++++---------
>  1 files changed, 15 insertions(+), 9 deletions(-)
> 
> diff --git a/xen/arch/arm/mm.c b/xen/arch/arm/mm.c
> index bd7baaf..4d4556b 100644
> --- a/xen/arch/arm/mm.c
> +++ b/xen/arch/arm/mm.c
> @@ -431,34 +431,40 @@ void __init setup_frametable_mappings(paddr_t ps, 
> paddr_t pe)
>   * start has to be 2MB aligned.
>   * len has to be < EARLY_VMAP_VIRT_END - EARLY_VMAP_VIRT_START.
>   */
> +static unsigned long early_vmap_start = EARLY_VMAP_VIRT_END;

__initdata I think?

>  void* __init early_ioremap(paddr_t start, size_t len, unsigned attributes)
>  {
> -    static unsigned long virt_start = EARLY_VMAP_VIRT_END;
>      paddr_t end = start + len;
> +    unsigned long map_start;
>  
>      len = ((len + SECOND_SIZE - 1) >> SECOND_SHIFT) << SECOND_SHIFT;
> -    virt_start -= len;
> +    early_vmap_start -= len;
>  
>      ASSERT(!(start & (~SECOND_MASK)));
> -    ASSERT(!(virt_start & (~SECOND_MASK)));
> +    ASSERT(!(early_vmap_start & (~SECOND_MASK)));
>  
>      /* The range we need to map is too big */
> -    if ( virt_start >= EARLY_VMAP_VIRT_START )
> +    if ( early_vmap_start >= EARLY_VMAP_VIRT_START )
>          return NULL;
>  
> +    map_start = early_vmap_start;
>      while ( start < end )
>      {
>          lpae_t e = mfn_to_xen_entry(start >> PAGE_SHIFT);
>          e.pt.ai = attributes;
> -        write_pte(xen_second + second_table_offset(virt_start), e);
> +        write_pte(xen_second + second_table_offset(map_start), e);
>  
>          start += SECOND_SIZE;
> -        virt_start += SECOND_SIZE;
> +        map_start += SECOND_SIZE;
>      }
> -    virt_start -= len;
> -    flush_xen_data_tlb_range_va(virt_start, len);
> +    flush_xen_data_tlb_range_va(early_vmap_start, len);
>  
> -    return (void*)virt_start;
> +    return (void*)early_vmap_start;

Hrm, you may have just implemented my comments on the previous patch. I
think you could perhaps just fold the two and together with the improved
changelog I asked for it would be obvious and natural to reverse the
mapping and implement arch_vmap_virt_end in one go.

> +}
> +
> +void *__init arch_vmap_virt_end(void)
> +{
> +    return (void *)early_vmap_start;
>  }
>  
>  enum mg { mg_clear, mg_ro, mg_rw, mg_rx };



_______________________________________________
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®.