]> xenbits.xensource.com Git - people/hx242/xen.git/commitdiff
xen/page_alloc: destroy the direct map when initialising allocators directnonmap-v2.2
authorHongyan Xia <hongyax@amazon.com>
Tue, 1 Oct 2019 13:14:24 +0000 (14:14 +0100)
committerHongyan Xia <hongyax@amazon.com>
Wed, 2 Oct 2019 16:16:31 +0000 (17:16 +0100)
If configured without the direct map, the allocators will ensure there
are no direct map mappings when new memory is received.

Signed-off-by: Hongyan Xia <hongyax@amazon.com>
xen/common/page_alloc.c

index 88123f54b65f5c146c41d425c45693cc246c33ca..cbce9453fbdb53ed47150ce30a1446ef8047c2d5 100644 (file)
@@ -385,6 +385,9 @@ void __init init_boot_pages(paddr_t ps, paddr_t pe)
 
         bootmem_region_zap(bad_spfn, bad_epfn+1);
     }
+#ifndef DIRECTMAP
+    destroy_xen_mappings((unsigned long)__va(ps), (unsigned long)__va(pe));
+#endif
 }
 
 mfn_t __init alloc_boot_pages(unsigned long nr_pfns, unsigned long pfn_align)
@@ -2134,6 +2137,9 @@ void init_xenheap_pages(paddr_t ps, paddr_t pe)
     memguard_guard_range(maddr_to_virt(ps), pe - ps);
 
     init_heap_pages(maddr_to_page(ps), (pe - ps) >> PAGE_SHIFT);
+#ifndef DIRECTMAP
+    destroy_xen_mappings((unsigned long)__va(ps), (unsigned long)__va(pe));
+#endif
 }
 
 
@@ -2265,6 +2271,9 @@ void init_domheap_pages(paddr_t ps, paddr_t pe)
         return;
 
     init_heap_pages(mfn_to_page(smfn), mfn_x(emfn) - mfn_x(smfn));
+#ifndef DIRECTMAP
+    destroy_xen_mappings((unsigned long)__va(ps), (unsigned long)__va(pe));
+#endif
 }