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

[Xen-changelog] [xen master] xen/arm: Retrieve p2m type in get_page_from_gfn



commit bc10bb6134e858722177ca60ea06574fa9911ab8
Author:     Julien Grall <julien.grall@xxxxxxxxxx>
AuthorDate: Tue Dec 17 16:27:54 2013 +0000
Commit:     Ian Campbell <ian.campbell@xxxxxxxxxx>
CommitDate: Wed Dec 18 14:32:48 2013 +0000

    xen/arm: Retrieve p2m type in get_page_from_gfn
    
    Signed-off-by: Julien Grall <julien.grall@xxxxxxxxxx>
    Acked-by: Ian Campbell <ian.campbell@xxxxxxxxxx>
---
 xen/include/asm-arm/p2m.h |   12 +++++++++---
 1 files changed, 9 insertions(+), 3 deletions(-)

diff --git a/xen/include/asm-arm/p2m.h b/xen/include/asm-arm/p2m.h
index 9d0d1e7..0eb07a8 100644
--- a/xen/include/asm-arm/p2m.h
+++ b/xen/include/asm-arm/p2m.h
@@ -109,11 +109,17 @@ static inline struct page_info *get_page_from_gfn(
     struct domain *d, unsigned long gfn, p2m_type_t *t, p2m_query_t q)
 {
     struct page_info *page;
-    unsigned long mfn = gmfn_to_mfn(d, gfn);
+    p2m_type_t p2mt;
+    paddr_t maddr = p2m_lookup(d, pfn_to_paddr(gfn), &p2mt);
+    unsigned long mfn = maddr >> PAGE_SHIFT;
 
-    ASSERT(t == NULL);
+    if (t)
+        *t = p2mt;
 
-    if (!mfn_valid(mfn))
+    if ( p2mt == p2m_invalid || p2mt == p2m_mmio_direct )
+        return NULL;
+
+    if ( !mfn_valid(mfn) )
         return NULL;
     page = mfn_to_page(mfn);
     if ( !get_page(page, d) )
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog


 


Rackspace

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