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

Re: [Xen-devel] [RFC XEN PATCH 01/16] x86_64/mm: explicitly specify the location to place the frame table



On Mon, Oct 10, 2016 at 08:32:20AM +0800, Haozhong Zhang wrote:
> A reserved area on each pmem region is used to place the frame table.
> However, it's not at the beginning of the pmem region, so we need to
> specify the location explicitly when extending the frame table.
> 
> Signed-off-by: Haozhong Zhang <haozhong.zhang@xxxxxxxxx>
> ---
> Cc: Jan Beulich <jbeulich@xxxxxxxx>
> Cc: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
> ---
>  xen/arch/x86/x86_64/mm.c | 9 +++++----
>  1 file changed, 5 insertions(+), 4 deletions(-)
> 
> diff --git a/xen/arch/x86/x86_64/mm.c b/xen/arch/x86/x86_64/mm.c
> index b8b6b70..33f226a 100644
> --- a/xen/arch/x86/x86_64/mm.c
> +++ b/xen/arch/x86/x86_64/mm.c
> @@ -792,7 +792,8 @@ static int setup_frametable_chunk(void *start, void *end,
>      return 0;
>  }
>  
> -static int extend_frame_table(struct mem_hotadd_info *info)
> +static int extend_frame_table(struct mem_hotadd_info *info,

This looks like it could be 'const struct mem_hotadd_info *info' ?

> +                              struct mem_hotadd_info *alloc_info)
>  {
>      unsigned long cidx, nidx, eidx, spfn, epfn;
>  
> @@ -818,9 +819,9 @@ static int extend_frame_table(struct mem_hotadd_info 
> *info)
>          nidx = find_next_bit(pdx_group_valid, eidx, cidx);
>          if ( nidx >= eidx )
>              nidx = eidx;
> -        err = setup_frametable_chunk(pdx_to_page(cidx * PDX_GROUP_COUNT ),
> +        err = setup_frametable_chunk(pdx_to_page(cidx * PDX_GROUP_COUNT),
>                                       pdx_to_page(nidx * PDX_GROUP_COUNT),
> -                                     info);
> +                                     alloc_info);

Granted this one modifies the 'alloc_info' in
alloc_hotadd_mfn, and 'alloc_info'
>          if ( err )
>              return err;
>  
> @@ -1413,7 +1414,7 @@ int memory_add(unsigned long spfn, unsigned long epfn, 
> unsigned int pxm)
>      info.epfn = epfn;
>      info.cur = spfn;
>  
> -    ret = extend_frame_table(&info);
> +    ret = extend_frame_table(&info, &info);

is equivalant to 'info' so I am not sure I understand the purpose
behind this patch?

Thanks.

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

 


Rackspace

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