Turn down debug a bit, and generally tidy hings up a little.
authorsos22@douglas.cl.cam.ac.uk <sos22@douglas.cl.cam.ac.uk>
Fri, 27 Jan 2006 20:57:07 +0000 (21:57 +0100)
committersos22@douglas.cl.cam.ac.uk <sos22@douglas.cl.cam.ac.uk>
Fri, 27 Jan 2006 20:57:07 +0000 (21:57 +0100)
Signed-off-by: Steven Smith, sos22@cam.ac.uk
13 files changed:
linux-2.6-xen-sparse/arch/xen/i386/kernel/setup.c
linux-2.6-xen-sparse/arch/xen/i386/mm/init.c
linux-2.6-xen-sparse/arch/xen/i386/mm/pgtable.c
linux-2.6-xen-sparse/drivers/xen/balloon/balloon.c
linux-2.6-xen-sparse/drivers/xen/netfront/netfront.c
linux-2.6-xen-sparse/mm/memory.c
tools/libxc/xc_linux_build.c
xen/arch/x86/mm.c
xen/arch/x86/shadow32.c
xen/common/grant_table.c
xen/common/memory.c
xen/include/asm-x86/shadow.h
xen/include/public/dom0_ops.h

index 7248d447e9d043c47af1631c0e4be0f25ed61e31..df8c72221f58f850aff7b0d260b955e3fc0bc311 100644 (file)
@@ -1605,7 +1605,6 @@ void __init setup_arch(char **cmdline_p)
 
        copy_edd();
 
-       /* Make the PFNs in the Xen hole reserved. */
        if (!MOUNT_ROOT_RDONLY)
                root_mountflags &= ~MS_RDONLY;
        init_mm.start_code = (unsigned long) _text;
@@ -1768,8 +1767,6 @@ void __init setup_arch(char **cmdline_p)
                console_use_vt = 0;
 #endif
        }
-
-
 }
 
 static int
index 79ba906e7cc0486b82589c5549cb37f93f0801e9..7989992b1e7cb9d7fbae7bc6c4877d81080da1b9 100644 (file)
@@ -597,6 +597,7 @@ void __init mem_init(void)
        int tmp;
        int bad_ppro;
        unsigned long pfn;
+        unsigned long hole_start, hole_size;
 
        contiguous_bitmap = alloc_bootmem_low_pages(
                (max_low_pfn + 2*BITS_PER_LONG) >> 3);
@@ -645,15 +646,10 @@ void __init mem_init(void)
        }
 
         /* Make the Xen hole reserved. */
-        unsigned long hole_start, hole_size;
         hole_size = xen_pfn_hole_size();
         hole_start = xen_pfn_hole_start();
-        for (pfn = hole_start; pfn < hole_start + hole_size; pfn++) {
-                printk("<0>Reserve %lx for hole.\n",
-                       pfn);
+        for (pfn = hole_start; pfn < hole_start + hole_size; pfn++)
                 SetPageReserved(pfn_to_page(pfn));
-                BUG_ON(!PageReserved(pfn_to_page(pfn)));
-        }
 
        reservedpages = 0;
        for (tmp = 0; tmp < max_low_pfn; tmp++)
index 5de23b700cdc6503731347ab8976e4997273cac6..b4fa05eef8e3a5116518b2e0d3c704362f2af018 100644 (file)
@@ -317,7 +317,6 @@ pgd_t *pgd_alloc(struct mm_struct *mm)
 
        pgd_test_and_unpin(pgd);
 
-       memset(pgd, 0, 10);
        if (PTRS_PER_PMD == 1 || !pgd)
                return pgd;
 
index 4741892722ca6b5d979284ae4a9ce7c49898ce5f..7702db0d4d5af3df00b0c82fbb95a774a26669cb 100644 (file)
@@ -113,8 +113,6 @@ static int page_is_xen_hole(unsigned long pfn)
        if (hole_len == -1) {
                hole_start = xen_pfn_hole_start();
                hole_len = xen_pfn_hole_size();
-               printk("<0>Xen hole at [%lx,%lx).\n", hole_start,
-                      hole_start + hole_len);
        }
        return pfn >= hole_start && pfn < hole_start + hole_len;
 }
@@ -122,12 +120,9 @@ static int page_is_xen_hole(unsigned long pfn)
 /* balloon_append: add the given page to the balloon. */
 static void balloon_append(struct page *page)
 {
-       BUG_ON(PageReserved(page));
-       if (page_is_xen_hole(page_to_pfn(page))) {
-               printk("<0>Attempt to add reserved pfn %lx to balloon.\n",
+       if (page_is_xen_hole(page_to_pfn(page)))
+               panic("Attempt to add Xen-reserved pfn %lx to balloon.\n",
                       page_to_pfn(page));
-               BUG();
-       }
        /* Lowmem is re-populated first, so highmem pages go at list tail. */
        if (PageHighMem(page)) {
                list_add_tail(PAGE_TO_LIST(page), &ballooned_pages);
@@ -243,25 +238,14 @@ static int increase_reservation(unsigned long nr_pages)
                xen_machphys_update(frame_list[i], pfn);
 #endif
 
-               printk("<0>Balloon allocated %lx.\n", pfn);
                /* Link back into the page tables if not highmem. */
                if (pfn < max_low_pfn) {
                        int ret;
-                       pgd_t *pgd = pgd_offset_k((unsigned long)__va(pfn << PAGE_SHIFT));
-                       printk("pgd is %lx.\n", *(unsigned long *)pgd);
-                       (void)copy_from_user(&ret,
-                                            (unsigned long *)__va(pfn << PAGE_SHIFT),
-                                            4);
                        ret = HYPERVISOR_update_va_mapping(
                                (unsigned long)__va(pfn << PAGE_SHIFT),
                                pfn_pte_ma(frame_list[i], PAGE_KERNEL),
                                0);
                        BUG_ON(ret);
-                       printk("<0>Rehooked va; pte now %lx.\n",
-                              *(unsigned long *)virt_to_ptep(__va(pfn << PAGE_SHIFT)));
-                       *(unsigned long *)__va(pfn << PAGE_SHIFT) =
-                               0xf001;
-                       printk("<0>Touched va.\n");
                }
 
                /* Relinquish the page back to the allocator. */
index 333dd3ad3f02f83c5cf3b8b177a7c43ddf73a258..58475090736455c454bbce14876416114e5dc8cf 100644 (file)
@@ -614,7 +614,7 @@ static void network_alloc_rx_buffers(struct net_device *dev)
        reservation.domid        = DOMID_SELF;
 
        /* Tell the ballon driver what is going on. */
-//SOS22        balloon_update_driver_allowance(i);
+       balloon_update_driver_allowance(i);
 
        /* Zap PTEs and give away pages in one big multicall. */
        (void)HYPERVISOR_multicall(rx_mcl, i+1);
@@ -818,7 +818,7 @@ static int netif_poll(struct net_device *dev, int *pbudget)
        }
 
        /* Some pages are no longer absent... */
-//SOS22        balloon_update_driver_allowance(-work_done);
+       balloon_update_driver_allowance(-work_done);
 
        /* Do all the remapping work, and M2P updates, in one big hypercall. */
        if (likely((mcl - rx_mcl) != 0)) {
index 862ea5c6a98330f1d42de883f8234269a3b770af..e3e1451ea062374b083f66d962f8671ad468b8ad 100644 (file)
@@ -291,7 +291,6 @@ pte_t fastcall *pte_alloc_map(struct mm_struct *mm, pmd_t *pmd,
                spin_lock(&mm->page_table_lock);
                if (!new)
                        return NULL;
-
                /*
                 * Because we dropped the lock, we should re-check the
                 * entry, as somebody else could have populated it..
index 30e7abd5acc1d3b7b2ce91614a7a844f04b5beb1..9ad93e27bd4506a4a09af2c254f654b83b5f3372 100644 (file)
@@ -33,8 +33,6 @@
 #define L4_PROT (_PAGE_PRESENT|_PAGE_RW|_PAGE_ACCESSED|_PAGE_DIRTY|_PAGE_USER)
 #endif
 
-#define NR_GRANT_FRAMES 4
-
 #ifdef __ia64__
 #define get_tot_pages xc_get_max_pages
 #else
index e9e49192dda2061ece36c80b0930ae4f0bc67116..ad89d5fdec8d9e93fd1c3bc3c86b4fc246f9af8a 100644 (file)
@@ -1041,7 +1041,7 @@ static inline int update_l1e(l1_pgentry_t *pl1e,
     if ( unlikely(cmpxchg_user(pl1e, o, n) != 0) ||
          unlikely(o != l1e_get_intpte(ol1e)) )
     {
-        printf("Failed to update %" PRIpte " -> %" PRIpte
+        MEM_LOG("Failed to update %" PRIpte " -> %" PRIpte
                 ": saw %" PRIpte,
                 l1e_get_intpte(ol1e),
                 l1e_get_intpte(nl1e),
@@ -1058,16 +1058,11 @@ static int mod_l1_entry(l1_pgentry_t *pl1e, l1_pgentry_t nl1e)
     l1_pgentry_t ol1e;
     struct domain *d = current->domain;
 
-    shadow_sync_all(d);
-    if ( unlikely(__copy_from_user(&ol1e, pl1e, sizeof(ol1e)) != 0) ) {
-        printf("copy_from_user1 failed %p, l2 %lx.\n", pl1e,
-               *(unsigned long *)&__linear_l2_table[l2_table_offset((unsigned long)pl1e)]);
+    if ( unlikely(__copy_from_user(&ol1e, pl1e, sizeof(ol1e)) != 0) )
         return 0;
-    }
 
-    if ( unlikely(shadow_mode_refcounts(d)) ) {
+    if ( unlikely(shadow_mode_refcounts(d)) )
         return update_l1e(pl1e, ol1e, nl1e);
-    }
 
     if ( l1e_get_flags(nl1e) & _PAGE_PRESENT )
     {
@@ -2545,10 +2540,8 @@ int do_update_va_mapping(unsigned long va, u64 val64,
 
     perfc_incrc(calls_to_update_va);
 
-    if ( unlikely(!__addr_ok(va) && !shadow_mode_external(d)) ) {
-        printf("Bad update_va_mapping.\n");
+    if ( unlikely(!__addr_ok(va) && !shadow_mode_external(d)) )
         return -EINVAL;
-    }
 
     LOCK_BIGLOCK(d);
 
@@ -2557,13 +2550,9 @@ int do_update_va_mapping(unsigned long va, u64 val64,
     if ( unlikely(shadow_mode_enabled(d)) )
         check_pagetable(v, "pre-va"); /* debug */
 
-    shadow_sync_all(d);
-
     if ( unlikely(!mod_l1_entry(&linear_pg_table[l1_linear_offset(va)],
-                                val)) ) {
-        printf("mod_l1_entry failed.\n");
+                                val)) )
         rc = -EINVAL;
-    }
 
     if ( likely(rc == 0) && unlikely(shadow_mode_enabled(d)) )
     {
@@ -2580,8 +2569,7 @@ int do_update_va_mapping(unsigned long va, u64 val64,
         }
     
         rc = shadow_do_update_va_mapping(va, val, v);
-        if (rc)
-            printf("shadow_do_update_va_mapping says %d.\n", rc);
+
         check_pagetable(v, "post-va"); /* debug */
     }
 
index 352e93b2703dfe8cc7d83e8f2fe36444b5465038..547cd83b264dadf3eb56dc9b94e2b85abf501b6a 100644 (file)
@@ -2502,8 +2502,6 @@ static int resync_all(struct domain *d, u32 stype)
             l2_pgentry_t *snapshot2 = snapshot;
             l1_pgentry_t *shadow2 = shadow;
 
-            printf("Update hl2 shadow.\n");
-
             ASSERT(shadow_mode_write_all(d) || shadow_mode_wr_pt_pte(d));
             BUG_ON(!shadow_mode_refcounts(d)); // not yet implemented
 
index 6bdbca6269c9b932d82b0c879b57f492ab6e14c3..30ac6a5f0c09f8eb0b36c72323ec8ee5f69c385d 100644 (file)
@@ -522,9 +522,7 @@ gnttab_setup_table(
         ASSERT(d->grant_table != NULL);
         (void)put_user(GNTST_okay, &uop->status);
         for ( i = 0; i < op.nr_frames; i++ ) {
-            mfn = gnttab_shared_mfn(d, d->grant_table, i);
-            if (shadow_mode_translate(d))
-                mfn = __mfn_to_gpfn(d, mfn);
+            mfn = __mfn_to_gpfn(d, gnttab_shared_mfn(d, d->grant_table, i));
             (void)put_user(mfn, &op.frame_list[i]);
         }
     }
index bb5f49374cfdb77fdbc7f1066867e676d4bad492..b4ab57593fcb8bbc6ade375bb0ce53e7f6c4cada 100644 (file)
@@ -115,8 +115,6 @@ populate_physmap(
             goto out;
 
         for ( j = 0; j < (1 << extent_order); j++ ) {
-            printf("Populating %lx with %lx.\n",
-                   pfn + j, mfn + j);
             if (shadow_mode_translate(d))
                 set_p2m_entry(d, pfn + j, mfn + j, &cache1, &cache2);
             set_pfn_from_mfn(mfn + j, pfn + j);
index bdb6d8e57e0a61d66a7a6f31d630fb6db5a122db..6d36d111171a215cd25a431ae12b0c21699eba27 100644 (file)
@@ -326,7 +326,7 @@ struct out_of_sync_entry {
 #define SHADOW_SNAPSHOT_ELSEWHERE (-1L)
 
 /************************************************************************/
-#define SHADOW_DEBUG 1
+#define SHADOW_DEBUG 0
 #define SHADOW_VERBOSE_DEBUG 0
 #define SHADOW_VVERBOSE_DEBUG 0
 #define SHADOW_VVVERBOSE_DEBUG 0
index 6e99efcd10ed897521c0d50dd3e8081c76db7573..4a70a77e490a13da118c4af99e32b1be81488db8 100644 (file)
@@ -430,7 +430,7 @@ typedef struct {
     domid_t  domain;          /* domain to be affected */
     unsigned long mfn;        /* machine frame to be initialised */
 } dom0_hypercall_init_t;
-
 typedef struct {
     uint32_t cmd;
     uint32_t interface_version; /* DOM0_INTERFACE_VERSION */