[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] [xen-unstable] [IA64] remove CONFIG_DOMAIN0_CONTIGUOUS and dom0_start



# HG changeset patch
# User awilliam@xxxxxxxxxxx
# Node ID 6c67ca1e1c1acbb37d88f0d39a068aefbb448342
# Parent  571022d5afa2627e0662f5916edb947d362eeeef
[IA64] remove CONFIG_DOMAIN0_CONTIGUOUS and dom0_start

Remove unused build option CONFIG_DOMAIN0_CONTIGUOUS, thereby
making dom0_start obsolete.

Signed-off-by: Alex Williamson <alex.williamson@xxxxxx>
---
 xen/arch/ia64/xen/dom_fw.c    |    1 
 xen/arch/ia64/xen/domain.c    |   55 +++--------------------------------
 xen/arch/ia64/xen/mm.c        |   65 +++++-------------------------------------
 xen/include/asm-ia64/config.h |    1 
 4 files changed, 15 insertions(+), 107 deletions(-)

diff -r 571022d5afa2 -r 6c67ca1e1c1a xen/arch/ia64/xen/dom_fw.c
--- a/xen/arch/ia64/xen/dom_fw.c        Mon Aug 07 14:11:58 2006 -0600
+++ b/xen/arch/ia64/xen/dom_fw.c        Tue Aug 08 14:31:48 2006 -0600
@@ -28,7 +28,6 @@ static void dom_fw_init (struct domain *
 static void dom_fw_init (struct domain *d, struct ia64_boot_param *bp, char 
*fw_mem, int fw_mem_size, unsigned long maxmem);
 
 extern struct domain *dom0;
-extern unsigned long dom0_start;
 
 extern unsigned long running_on_sim;
 
diff -r 571022d5afa2 -r 6c67ca1e1c1a xen/arch/ia64/xen/domain.c
--- a/xen/arch/ia64/xen/domain.c        Mon Aug 07 14:11:58 2006 -0600
+++ b/xen/arch/ia64/xen/domain.c        Tue Aug 08 14:31:48 2006 -0600
@@ -49,7 +49,6 @@
 #include <asm/shadow.h>
 #include <asm/privop_stat.h>
 
-unsigned long dom0_start = -1L;
 unsigned long dom0_size = 512*1024*1024;
 unsigned long dom0_align = 64*1024*1024;
 
@@ -782,24 +781,6 @@ static void loaddomainelfimage(struct do
                elfaddr = (unsigned long) elfbase + phdr.p_offset;
                dom_mpaddr = phdr.p_paddr;
 
-//printf("p_offset: %x, size=%x\n",elfaddr,filesz);
-#ifdef CONFIG_DOMAIN0_CONTIGUOUS
-               if (d == dom0) {
-                       if (dom_mpaddr+memsz>dom0_size)
-                               panic("Dom0 doesn't fit in memory space!\n");
-                       dom_imva = __va_ul(dom_mpaddr + dom0_start);
-                       memcpy((void *)dom_imva, (void *)elfaddr, filesz);
-                       if (memsz > filesz)
-                               memset((void *)dom_imva+filesz, 0,
-                                      memsz-filesz);
-//FIXME: This test for code seems to find a lot more than objdump -x does
-                       if (phdr.p_flags & PF_X) {
-                               privify_memory(dom_imva,filesz);
-                               flush_icache_range (dom_imva, dom_imva+filesz);
-                       }
-               }
-               else
-#endif
                while (memsz > 0) {
                        p = assign_new_domain_page(d,dom_mpaddr);
                        BUG_ON (unlikely(p == NULL));
@@ -864,27 +845,10 @@ void alloc_dom0(void)
        if (running_on_sim) {
                dom0_size = 128*1024*1024; //FIXME: Should be configurable
        }
-#ifdef CONFIG_DOMAIN0_CONTIGUOUS
-       printf("alloc_dom0: starting (initializing %lu 
MB...)\n",dom0_size/(1024*1024));
- 
-       /* FIXME: The first trunk (say 256M) should always be assigned to
-        * Dom0, since Dom0's physical == machine address for DMA purpose.
-        * Some old version linux, like 2.4, assumes physical memory existing
-        * in 2nd 64M space.
+
+       /* no need to allocate pages for now
+        * pages are allocated by map_new_domain_page() via loaddomainelfimage()
         */
-       dom0_start = alloc_boot_pages(dom0_size >> PAGE_SHIFT, dom0_align >> 
PAGE_SHIFT);
-       dom0_start <<= PAGE_SHIFT;
-       if (!dom0_start) {
-         panic("alloc_dom0: can't allocate contiguous memory size=%lu\n",
-               dom0_size);
-       }
-       printf("alloc_dom0: dom0_start=0x%lx\n", dom0_start);
-#else
-       // no need to allocate pages for now
-       // pages are allocated by map_new_domain_page() via loaddomainelfimage()
-       dom0_start = 0;
-#endif
-
 }
 
 
@@ -910,7 +874,6 @@ int construct_dom0(struct domain *d,
                       char *cmdline)
 {
        int i, rc;
-       unsigned long alloc_start, alloc_end;
        start_info_t *si;
        struct vcpu *v = d->vcpu[0];
        unsigned long max_pages;
@@ -943,8 +906,6 @@ int construct_dom0(struct domain *d,
 
        printk("*** LOADING DOMAIN 0 ***\n");
 
-       alloc_start = dom0_start;
-       alloc_end = dom0_start + dom0_size;
        max_pages = dom0_size / PAGE_SIZE;
        d->max_pages = max_pages;
        d->tot_pages = 0;
@@ -988,8 +949,7 @@ int construct_dom0(struct domain *d,
        if(initrd_start && initrd_len){
            unsigned long offset;
 
-           pinitrd_start= (dom0_start + dom0_size) -
-                          (PAGE_ALIGN(initrd_len) + 4*1024*1024);
+           pinitrd_start= dom0_size - (PAGE_ALIGN(initrd_len) + 4*1024*1024);
            if (pinitrd_start <= pstart_info)
                panic("%s:enough memory is not assigned to dom0", __func__);
 
@@ -1095,17 +1055,14 @@ int construct_dom0(struct domain *d,
        bp->console_info.orig_y = bp->console_info.num_rows == 0 ?
                                  0 : bp->console_info.num_rows - 1;
 
-       bp->initrd_start = (dom0_start+dom0_size) -
-         (PAGE_ALIGN(ia64_boot_param->initrd_size) + 4*1024*1024);
+       bp->initrd_start = dom0_size -
+                    (PAGE_ALIGN(ia64_boot_param->initrd_size) + 4*1024*1024);
        bp->initrd_size = ia64_boot_param->initrd_size;
 
        vcpu_init_regs (v);
 
        vcpu_regs(v)->r28 = bp_mpa;
 
-#ifdef CONFIG_DOMAIN0_CONTIGUOUS
-       pkern_entry += dom0_start;
-#endif
        vcpu_regs (v)->cr_iip = pkern_entry;
 
        physdev_init_dom0(d);
diff -r 571022d5afa2 -r 6c67ca1e1c1a xen/arch/ia64/xen/mm.c
--- a/xen/arch/ia64/xen/mm.c    Mon Aug 07 14:11:58 2006 -0600
+++ b/xen/arch/ia64/xen/mm.c    Tue Aug 08 14:31:48 2006 -0600
@@ -648,21 +648,8 @@ unsigned long lookup_domain_mpa(struct d
 unsigned long lookup_domain_mpa(struct domain *d, unsigned long mpaddr,
                                 struct p2m_entry* entry)
 {
-    volatile pte_t *pte;
-
-#ifdef CONFIG_DOMAIN0_CONTIGUOUS
-    if (d == dom0) {
-        pte_t pteval;
-        if (mpaddr < dom0_start || mpaddr >= dom0_start + dom0_size) {
-            //printk("lookup_domain_mpa: bad dom0 mpaddr 0x%lx!\n",mpaddr);
-            //printk("lookup_domain_mpa: 
start=0x%lx,end=0x%lx!\n",dom0_start,dom0_start+dom0_size);
-        }
-        pteval = pfn_pte(mpaddr >> PAGE_SHIFT,
-            __pgprot(__DIRTY_BITS | _PAGE_PL_2 | _PAGE_AR_RWX));
-        return pte_val(pteval);
-    }
-#endif
-    pte = lookup_noalloc_domain_pte(d, mpaddr);
+    volatile pte_t *pte = lookup_noalloc_domain_pte(d, mpaddr);
+
     if (pte != NULL) {
         pte_t tmp_pte = *pte;// pte is volatile. copy the value.
         if (pte_present(tmp_pte)) {
@@ -716,27 +703,11 @@ static struct page_info *
 static struct page_info *
 __assign_new_domain_page(struct domain *d, unsigned long mpaddr, pte_t* pte)
 {
-    struct page_info *p = NULL;
+    struct page_info *p;
     unsigned long maddr;
     int ret;
 
     BUG_ON(!pte_none(*pte));
-
-#ifdef CONFIG_DOMAIN0_CONTIGUOUS
-    if (d == dom0) {
-#if 0
-        if (mpaddr < dom0_start || mpaddr >= dom0_start + dom0_size) {
-            /* FIXME: is it true ?
-               dom0 memory is not contiguous!  */
-            panic("assign_new_domain_page: bad domain0 "
-                  "mpaddr=%lx, start=%lx, end=%lx!\n",
-                  mpaddr, dom0_start, dom0_start+dom0_size);
-        }
-#endif
-        p = mfn_to_page((mpaddr >> PAGE_SHIFT));
-        return p;
-    }
-#endif
 
     p = alloc_domheap_page(d);
     if (unlikely(!p)) {
@@ -771,25 +742,17 @@ struct page_info *
 struct page_info *
 assign_new_domain_page(struct domain *d, unsigned long mpaddr)
 {
-#ifdef CONFIG_DOMAIN0_CONTIGUOUS
-    pte_t dummy_pte = __pte(0);
-    return __assign_new_domain_page(d, mpaddr, &dummy_pte);
-#else
-    struct page_info *p = NULL;
-    pte_t *pte;
-
-    pte = __lookup_alloc_domain_pte(d, mpaddr);
-    if (pte_none(*pte))
-        p = __assign_new_domain_page(d, mpaddr, pte);
-
-    return p;
-#endif
+    pte_t *pte = __lookup_alloc_domain_pte(d, mpaddr);
+
+    if (!pte_none(*pte))
+        return NULL;
+
+    return __assign_new_domain_page(d, mpaddr, pte);
 }
 
 void
 assign_new_domain0_page(struct domain *d, unsigned long mpaddr)
 {
-#ifndef CONFIG_DOMAIN0_CONTIGUOUS
     pte_t *pte;
 
     BUG_ON(d != dom0);
@@ -800,7 +763,6 @@ assign_new_domain0_page(struct domain *d
             panic("%s: can't allocate page for dom0", __func__);
         }
     }
-#endif
 }
 
 static unsigned long
@@ -1538,15 +1500,6 @@ void domain_cache_flush (struct domain *
     else
         flush_func = &flush_dcache_range;
 
-#ifdef CONFIG_DOMAIN0_CONTIGUOUS
-    if (d == dom0) {
-        /* This is not fully correct (because of hole), but it should
-           be enough for now.  */
-        (*flush_func)(__va_ul (dom0_start),
-                  __va_ul (dom0_start + dom0_size));
-        return;
-    }
-#endif
     for (i = 0; i < PTRS_PER_PGD; pgd++, i++) {
         pud_t *pud;
         if (!pgd_present(*pgd))
diff -r 571022d5afa2 -r 6c67ca1e1c1a xen/include/asm-ia64/config.h
--- a/xen/include/asm-ia64/config.h     Mon Aug 07 14:11:58 2006 -0600
+++ b/xen/include/asm-ia64/config.h     Tue Aug 08 14:31:48 2006 -0600
@@ -66,7 +66,6 @@ extern unsigned long xen_pstart;
 extern unsigned long xen_pstart;
 extern unsigned long xenheap_size;
 //extern struct domain *dom0;
-extern unsigned long dom0_start;
 extern unsigned long dom0_size;
 
 // from linux/include/linux/mm.h

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.