]> xenbits.xensource.com Git - people/hx242/xen.git/commitdiff
x86/mapcache: initialise the mapcache even for the idle domain
authorHongyan Xia <hongyax@amazon.com>
Wed, 11 Sep 2019 09:37:14 +0000 (10:37 +0100)
committerHongyan Xia <hongyax@amazon.com>
Wed, 16 Oct 2019 12:25:06 +0000 (13:25 +0100)
In situations where PMAP cannot be used or the mapcache of a domain is
simply not ready, we need to have a mapcache in the idle domain to map
pages when there is no direct map.

Signed-off-by: Hongyan Xia <hongyax@amazon.com>
xen/arch/x86/mm.c
xen/common/schedule.c

index 032617b052cd3617c96512ca4309a9069f574dd1..fd40ff797b9419ac3f76f95787eb5fa1d6d522e4 100644 (file)
@@ -5852,6 +5852,9 @@ int create_perdomain_mapping(struct domain *d, unsigned long va,
         l3tab = __map_domain_page(pg);
         clear_page(l3tab);
         d->arch.perdomain_l3_pg = pg;
+        if ( is_idle_domain(d) )
+            idle_pg_table[l4_table_offset(PERDOMAIN_VIRT_START)] =
+                    l4e_from_page(pg, __PAGE_HYPERVISOR_RW);
         if ( !nr )
         {
             unmap_domain_page(l3tab);
index c327c40b921d5e21abe6b3bcee9a947fc9e11a10..735764ea879185a600faf4b2213ea137b6c1f8b4 100644 (file)
@@ -2740,6 +2740,9 @@ void __init scheduler_init(void)
     BUG_ON(nr_cpu_ids > ARRAY_SIZE(idle_vcpu));
     idle_domain->vcpu = idle_vcpu;
     idle_domain->max_vcpus = nr_cpu_ids;
+#ifndef CONFIG_DIRECTMAP
+    mapcache_domain_init(idle_domain);
+#endif
     if ( vcpu_create(idle_domain, 0) == NULL )
         BUG();