> -----Original Message-----
> From: Julien Grall [mailto:julien.gr...@arm.com]
> Sent: 01 October 2018 11:26
> To: Paul Durrant <paul.durr...@citrix.com>; xen-devel@lists.xenproject.org
> Cc: Andrew Cooper <andrew.coop...@citrix.com>; George Dunlap
> <george.dun...@citrix.com>; Ian Jackson <ian.jack...@citrix.com>; Konrad
> Rzeszutek Wilk <konrad.w...@oracle.com>; Stefano Stabellini
> <sstabell...@kernel.org>; Tim (Xen.org) <t...@xen.org>; Wei Liu
> <wei.l...@citrix.com>
> Subject: Re: [PATCH v12 5/9] memory: add check_get_page_from_gfn() as a
> wrapper...
> 
> Hi Paul,
> 
> On 09/27/2018 03:33 PM, Paul Durrant wrote:
> > ...for some uses of get_page_from_gfn().
> >
> > There are many occurrences of the following pattern in the code:
> >
> >      q = <readonly look-up> ? P2M_ALLOC : P2M_UNSHARE;
> >      page = get_page_from_gfn(d, gfn, &p2mt, q);
> >
> >      if ( p2m_is_paging(p2mt) )
> >      {
> >          if ( page )
> >              put_page(page);
> >
> >          p2m_mem_paging_populate(d, gfn);
> >          return <-EAGAIN or equivalent>;
> >      }
> >
> >      if ( (q & P2M_UNSHARE) && p2m_is_shared(p2mt) )
> >      {
> >          if ( page )
> >              put_page(page);
> >
> >          return <-EAGAIN or equivalent>;
> >      }
> >
> >      if ( !page )
> >          return <-EINVAL or equivalent>;
> >
> > There are some small differences between the exact way the occurrences
> > are coded but the desired semantic is the same.
> >
> > This patch introduces a new common implementation of this code in
> > check_get_page_from_gfn() and then converts the various open-coded
> patterns
> > into calls to this new function.
> >
> > Signed-off-by: Paul Durrant <paul.durr...@citrix.com>
> > Reviewed-by: Roger Pau Monne <roger....@citrix.com>
> > Reviewed-by: Jan Beulich <jbeul...@suse.com>
> > ---
> > Cc: Andrew Cooper <andrew.coop...@citrix.com>
> > Cc: George Dunlap <george.dun...@eu.citrix.com>
> > Cc: Ian Jackson <ian.jack...@eu.citrix.com>
> > Cc: Julien Grall <julien.gr...@arm.com>
> > Cc: Konrad Rzeszutek Wilk <konrad.w...@oracle.com>
> > Cc: Stefano Stabellini <sstabell...@kernel.org>
> > Cc: Tim Deegan <t...@xen.org>
> > Cc: Wei Liu <wei.l...@citrix.com>
> >
> > v11:
> >   - Forward declare p2m_type_t in p2m-common.h to allow the duplicate
> >     declarations of check_get_page_from_gfn() to be removed, and hence
> add
> >     Jan's R-b.
> 
> I think this would be worth adding a word in the commit message about
> the forward declaration.

Ok. I'll add something to v12.

> 
> For the Arm bits:
> 
> Acked-by: Julien Grall <julien.gr...@arm.com>
> 

Thanks,

  Paul

> Cheers,
> 
> --
> Julien Grall
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

Reply via email to