[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [Xen-devel] [PATCH v2 1/2] arm/mem_access: adjust check_and_get_page to not rely on current
On Fri, 9 Dec 2016, Tamas K Lengyel wrote: > The only caller of this function is get_page_from_gva which already takes > a vcpu pointer as input. Pass this along to make the function in-line with > its intended use-case. > > Signed-off-by: Tamas K Lengyel <tamas.lengyel@xxxxxxxxxxxx> Reviewed-by: Stefano Stabellini <sstabellini@xxxxxxxxxx> > --- > Cc: Stefano Stabellini <sstabellini@xxxxxxxxxx> > Cc: Julien Grall <julien.grall@xxxxxxx> > --- > xen/arch/arm/p2m.c | 11 ++++++----- > 1 file changed, 6 insertions(+), 5 deletions(-) > > diff --git a/xen/arch/arm/p2m.c b/xen/arch/arm/p2m.c > index cc5634b..837be1d 100644 > --- a/xen/arch/arm/p2m.c > +++ b/xen/arch/arm/p2m.c > @@ -1461,7 +1461,8 @@ mfn_t gfn_to_mfn(struct domain *d, gfn_t gfn) > * we indeed found a conflicting mem_access setting. > */ > static struct page_info* > -p2m_mem_access_check_and_get_page(vaddr_t gva, unsigned long flag) > +p2m_mem_access_check_and_get_page(vaddr_t gva, unsigned long flag, > + const struct vcpu *v) > { > long rc; > paddr_t ipa; > @@ -1470,7 +1471,7 @@ p2m_mem_access_check_and_get_page(vaddr_t gva, unsigned > long flag) > xenmem_access_t xma; > p2m_type_t t; > struct page_info *page = NULL; > - struct p2m_domain *p2m = ¤t->domain->arch.p2m; > + struct p2m_domain *p2m = &v->domain->arch.p2m; > > rc = gva_to_ipa(gva, &ipa, flag); > if ( rc < 0 ) > @@ -1482,7 +1483,7 @@ p2m_mem_access_check_and_get_page(vaddr_t gva, unsigned > long flag) > * We do this first as this is faster in the default case when no > * permission is set on the page. > */ > - rc = __p2m_get_mem_access(current->domain, gfn, &xma); > + rc = __p2m_get_mem_access(v->domain, gfn, &xma); > if ( rc < 0 ) > goto err; > > @@ -1546,7 +1547,7 @@ p2m_mem_access_check_and_get_page(vaddr_t gva, unsigned > long flag) > > page = mfn_to_page(mfn_x(mfn)); > > - if ( unlikely(!get_page(page, current->domain)) ) > + if ( unlikely(!get_page(page, v->domain)) ) > page = NULL; > > err: > @@ -1587,7 +1588,7 @@ struct page_info *get_page_from_gva(struct vcpu *v, > vaddr_t va, > > err: > if ( !page && p2m->mem_access_enabled ) > - page = p2m_mem_access_check_and_get_page(va, flags); > + page = p2m_mem_access_check_and_get_page(va, flags, v); > > p2m_read_unlock(p2m); > > -- > 2.10.2 > _______________________________________________ Xen-devel mailing list Xen-devel@xxxxxxxxxxxxx https://lists.xen.org/xen-devel
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |