]> xenbits.xensource.com Git - people/hx242/xen.git/commitdiff
x86/domain_page: use PMAP when d/vcache is not ready
authorHongyan Xia <hongyax@amazon.com>
Mon, 30 Sep 2019 17:06:51 +0000 (18:06 +0100)
committerHongyan Xia <hongyax@amazon.com>
Wed, 2 Oct 2019 16:16:31 +0000 (17:16 +0100)
Signed-off-by: Hongyan Xia <hongyax@amazon.com>
xen/arch/x86/domain_page.c

index 195290f106525c82bb51dd106276ab971bb7be2f..9af6d42954e91ac99b09e9b654004b4d336dd898 100644 (file)
@@ -17,6 +17,8 @@
 #include <asm/flushtlb.h>
 #include <asm/hardirq.h>
 #include <asm/setup.h>
+#include <asm/pmap.h>
+#include <asm/fixmap.h>
 
 static DEFINE_PER_CPU(struct vcpu *, override);
 
@@ -83,12 +85,12 @@ void *map_domain_page(mfn_t mfn)
 
     v = mapcache_current_vcpu();
     if ( !v )
-        return mfn_to_virt(mfn_x(mfn));
+        return pmap_map(mfn);
 
     dcache = &v->domain->arch.mapcache;
     vcache = &v->arch.mapcache;
     if ( !dcache->inuse )
-        return mfn_to_virt(mfn_x(mfn));
+        return pmap_map(mfn);
 
     perfc_incr(map_domain_page_count);
 
@@ -184,6 +186,12 @@ void unmap_domain_page(const void *ptr)
     if ( va >= DIRECTMAP_VIRT_START )
         return;
 
+    if ( va >= FIXADDR_START && va < FIXADDR_TOP )
+    {
+        pmap_unmap((void *)ptr);
+        return;
+    }
+
     ASSERT(va >= MAPCACHE_VIRT_START && va < MAPCACHE_VIRT_END);
 
     v = mapcache_current_vcpu();