]> xenbits.xensource.com Git - people/pauldu/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)
committerPaul Durrant <pdurrant@amazon.com>
Mon, 2 Dec 2019 10:22:36 +0000 (10:22 +0000)
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 df62b9d7bc26ac82ea14e67d7e059762856f6ad3..a199a46b550ff74647d18afd2a6010c680657b11 100644 (file)
@@ -6025,6 +6025,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 e70cc70a65ac47dc7c6e914c427e6320f8d0ed3e..f151b7109bced4ab603642e7534c9a6e774ad1b4 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();