> -----Original Message-----
> From: Julien Grall [mailto:julien.gr...@arm.com]
> Sent: 23 August 2018 11:25
> To: Paul Durrant <paul.durr...@citrix.com>; xen-devel@lists.xenproject.org
> Cc: Jan Beulich <jbeul...@suse.com>; 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 v6 12/14] memory: add get_paged_gfn() as a wrapper...
> 
> Hi Paul,
> 
> On 08/23/2018 10:47 AM, Paul Durrant wrote:
> > ...for some uses of get_page_from_gfn().
> >
> > There are many occurences of the following pattern in the code:
> 
> NIT: s/occurences/occurences/
> 
> [...]
> 
> > +int get_paged_gfn(struct domain *d, gfn_t gfn, bool readonly,
> > +                  p2m_type_t *p2mt_p, struct page_info **page_p)
> >   {
> > -    struct page_info *page;
> > +    p2m_query_t q = readonly ? P2M_ALLOC : P2M_UNSHARE;
> >       p2m_type_t p2mt;
> > -    void *va;
> > +    struct page_info *page;
> >
> > -    page = get_page_from_gfn(d, gmfn, &p2mt, P2M_UNSHARE);
> > +    page = get_page_from_gfn(d, gfn_x(gfn), &p2mt, q);
> >
> >   #ifdef CONFIG_HAS_MEM_PAGING
> >       if ( p2m_is_paging(p2mt) )
> >       {
> >           if ( page )
> >               put_page(page);
> > -        p2m_mem_paging_populate(d, gmfn);
> > -        return -ENOENT;
> > +
> > +        p2m_mem_paging_populate(d, gfn_x(gfn));
> > +        return -EAGAIN;
> >       }
> >   #endif
> >   #ifdef CONFIG_HAS_MEM_SHARING
> > -    if ( p2m_is_shared(p2mt) )
> > +    if ( (q & P2M_UNSHARE) && p2m_is_shared(p2mt) )
> >       {
> >           if ( page )
> >               put_page(page);
> > -        return -ENOENT;
> > +
> > +        return -EAGAIN;
> >       }
> >   #endif
> >
> >       if ( !page )
> >           return -EINVAL;
> >
> > +    if ( !p2m_is_ram(p2mt) || (!readonly && p2m_is_readonly(p2mt)) )
> 
> p2m_is_readonly does not exist on Arm. Can you please make sure this
> code build on Arm?
> 

Ok. Will do.

  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