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

Re: [Xen-devel] [RFC PATCH v2 10/22] xen/arm: Add helper function to get domain page



Hello Vijay,

On 19/03/2015 14:37, vijay.kilari@xxxxxxxxx wrote:
+struct page_info *get_page_from_paddr(struct domain *d, paddr_t paddr,
+                                      unsigned long flags)
+{
+    struct p2m_domain *p2m = &d->arch.p2m;
+    struct page_info *page = NULL;
+
+    ASSERT(d == current->domain);
+
+    spin_lock(&p2m->lock);
+
+    if ( !mfn_valid(paddr >> PAGE_SHIFT) )

If I understand correctly this function is to get a page from an IPA, right?

Firstly, this function is wrong because you assume IPA == MFN. This is not valid for guest and may not be for DOM0.

Secondly, we already have a function which does this job (see get_page_from_gfn). Why can't you use it?

Regards,

--
Julien Grall

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


 


Rackspace

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