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

Re: [Xen-devel] [PATCH v6 12/14] memory: add get_paged_gfn() as a wrapper...



> -----Original Message-----
> From: Julien Grall [mailto:julien.grall@xxxxxxx]
> Sent: 23 August 2018 11:25
> To: Paul Durrant <Paul.Durrant@xxxxxxxxxx>; xen-devel@xxxxxxxxxxxxxxxxxxxx
> Cc: Jan Beulich <jbeulich@xxxxxxxx>; Andrew Cooper
> <Andrew.Cooper3@xxxxxxxxxx>; George Dunlap
> <George.Dunlap@xxxxxxxxxx>; Ian Jackson <Ian.Jackson@xxxxxxxxxx>; Konrad
> Rzeszutek Wilk <konrad.wilk@xxxxxxxxxx>; Stefano Stabellini
> <sstabellini@xxxxxxxxxx>; Tim (Xen.org) <tim@xxxxxxx>; Wei Liu
> <wei.liu2@xxxxxxxxxx>
> 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@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/xen-devel

 


Rackspace

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