]> xenbits.xensource.com Git - people/hx242/xen.git/commitdiff
x86/mm: create the range for per-domain stacks
authorHongyan Xia <hongyxia@amazon.com>
Tue, 23 Jun 2020 22:04:11 +0000 (23:04 +0100)
committerHongyan Xia <hongyxia@amazon.com>
Tue, 23 Jun 2020 22:04:11 +0000 (23:04 +0100)
Also, since even the idle domain needs the per-domain range now, connect
the L3 page table when create_perdomain_mappings() is called.

Signed-off-by: Hongyan Xia <hongyxia@amazon.com>
xen/arch/x86/mm.c
xen/include/asm-x86/config.h

index e376fc7e8fcc6f57094dc15ab14249d28ebd2c14..a9fb983b1d53a63e9e56f30f9cfaefab5aab15ad 100644 (file)
@@ -5766,6 +5766,10 @@ 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 2ba234383d9a545b593896d3dc010115617ded5b..90e18ddc3defe17473a7c2af7c617245ee4c87d2 100644 (file)
@@ -208,7 +208,7 @@ extern unsigned char boot_edid_info[128];
 /* Slot 260: per-domain mappings (including map cache). */
 #define PERDOMAIN_VIRT_START    (PML4_ADDR(260))
 #define PERDOMAIN_SLOT_MBYTES   (PML4_ENTRY_BYTES >> (20 + PAGETABLE_ORDER))
-#define PERDOMAIN_SLOTS         3
+#define PERDOMAIN_SLOTS         4
 #define PERDOMAIN_VIRT_SLOT(s)  (PERDOMAIN_VIRT_START + (s) * \
                                  (PERDOMAIN_SLOT_MBYTES << 20))
 /* Slot 261: machine-to-phys conversion table (256GB). */
@@ -311,6 +311,9 @@ extern unsigned long xen_phys_start;
 #define ARG_XLAT_START(v)        \
     (ARG_XLAT_VIRT_START + ((v)->vcpu_id << ARG_XLAT_VA_SHIFT))
 
+#define PERDOMAIN_STACK_BOTTOM   PERDOMAIN_VIRT_SLOT(3)
+#define PERDOMAIN_STACK_TOP      PERDOMAIN_STACK_BOTTOM + STACK_SIZE
+
 #define ELFSIZE 64
 
 #define ARCH_CRASH_SAVE_VMCOREINFO