]> xenbits.xensource.com Git - people/sstabellini/xen-unstable.git/.git/commitdiff
xen/arm: remove allocate_colored_memory
authorStefano Stabellini <sstabellini@kernel.org>
Mon, 9 Dec 2019 21:50:51 +0000 (13:50 -0800)
committerLuca Miccio <206497@studenti.unimore.it>
Mon, 6 Jan 2020 14:07:35 +0000 (15:07 +0100)
allocate_colored_memory is superflous as the regular allocate_memory can
be used for dom0 too.

Signed-off-by: Stefano Stabellini <stefano.stabellini@xilinx.com>
xen/arch/arm/domain_build.c

index 4980bd5b1ed33d7a8f3c2554dcc5a0034992ff8b..8dcc4bf373f5a8457ab008a25051e87845015ab6 100644 (file)
@@ -473,41 +473,6 @@ fail:
           " %ldKB unallocated. Fix the VMs configurations.\n",
           (unsigned long)kinfo->unassigned_mem >> 10);
 }
-#ifdef CONFIG_COLORING
-static void __init allocate_colored_memory(
-    struct domain *d, struct kernel_info *kinfo)
-{
-    int res;
-    struct page_info *pg;
-    struct membank *bank;
-    gfn_t sgfn = gaddr_to_gfn(GUEST_RAM0_BASE);
-
-    bank = &kinfo->mem.bank[kinfo->mem.nr_banks];
-    bank->size = kinfo->unassigned_mem;
-    bank->start = GUEST_RAM0_BASE;
-    printk("Allocating colored mappings totalling %ldMB for DOM %d:\n",
-           (unsigned long)(kinfo->unassigned_mem >> 20), d->domain_id);
-
-    while ( kinfo->unassigned_mem > 0 )
-    {
-        pg = alloc_col_domheap_page(d, 0);
-        if ( !pg )
-            panic("ERROR: Failed alloc pages to DOM: %d\n", d->domain_id);
-
-        res = guest_physmap_add_page(d, sgfn, page_to_mfn(pg), 0);
-
-        if ( res )
-        {
-            printk("ERROR: Failed map pages to DOM: %d", d->domain_id);
-            BUG();
-        }
-        sgfn = gfn_add(sgfn,1);
-        kinfo->unassigned_mem -= PAGE_SIZE;
-    }
-
-    kinfo->mem.nr_banks++;
-}
-#endif
 static int __init write_properties(struct domain *d, struct kernel_info *kinfo,
                                    const struct dt_device_node *node)
 {
@@ -2591,7 +2556,7 @@ int __init construct_dom0(struct domain *d)
 #endif
 #ifdef CONFIG_COLORING
     if ( d->max_colors )
-        allocate_colored_memory(d, &kinfo);
+        allocate_memory(d, &kinfo);
     else
 #endif
         allocate_memory_11(d, &kinfo);