ia64/xen-unstable

changeset 8690:a47b7a464f09

Turn down debug a bit, and generally tidy hings up a little.

Signed-off-by: Steven Smith, sos22@cam.ac.uk
author sos22@douglas.cl.cam.ac.uk
date Fri Jan 27 21:57:07 2006 +0100 (2006-01-27)
parents e9770d41e5bd
children 5a9efc35feb2
files 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
line diff
     1.1 --- a/linux-2.6-xen-sparse/arch/xen/i386/kernel/setup.c	Fri Jan 27 21:38:55 2006 +0100
     1.2 +++ b/linux-2.6-xen-sparse/arch/xen/i386/kernel/setup.c	Fri Jan 27 21:57:07 2006 +0100
     1.3 @@ -1605,7 +1605,6 @@ void __init setup_arch(char **cmdline_p)
     1.4  
     1.5  	copy_edd();
     1.6  
     1.7 -	/* Make the PFNs in the Xen hole reserved. */
     1.8  	if (!MOUNT_ROOT_RDONLY)
     1.9  		root_mountflags &= ~MS_RDONLY;
    1.10  	init_mm.start_code = (unsigned long) _text;
    1.11 @@ -1768,8 +1767,6 @@ void __init setup_arch(char **cmdline_p)
    1.12  		console_use_vt = 0;
    1.13  #endif
    1.14  	}
    1.15 -
    1.16 -
    1.17  }
    1.18  
    1.19  static int
     2.1 --- a/linux-2.6-xen-sparse/arch/xen/i386/mm/init.c	Fri Jan 27 21:38:55 2006 +0100
     2.2 +++ b/linux-2.6-xen-sparse/arch/xen/i386/mm/init.c	Fri Jan 27 21:57:07 2006 +0100
     2.3 @@ -597,6 +597,7 @@ void __init mem_init(void)
     2.4  	int tmp;
     2.5  	int bad_ppro;
     2.6  	unsigned long pfn;
     2.7 +        unsigned long hole_start, hole_size;
     2.8  
     2.9  	contiguous_bitmap = alloc_bootmem_low_pages(
    2.10  		(max_low_pfn + 2*BITS_PER_LONG) >> 3);
    2.11 @@ -645,15 +646,10 @@ void __init mem_init(void)
    2.12  	}
    2.13  
    2.14          /* Make the Xen hole reserved. */
    2.15 -        unsigned long hole_start, hole_size;
    2.16          hole_size = xen_pfn_hole_size();
    2.17          hole_start = xen_pfn_hole_start();
    2.18 -        for (pfn = hole_start; pfn < hole_start + hole_size; pfn++) {
    2.19 -                printk("<0>Reserve %lx for hole.\n",
    2.20 -                       pfn);
    2.21 +        for (pfn = hole_start; pfn < hole_start + hole_size; pfn++)
    2.22                  SetPageReserved(pfn_to_page(pfn));
    2.23 -                BUG_ON(!PageReserved(pfn_to_page(pfn)));
    2.24 -        }
    2.25  
    2.26  	reservedpages = 0;
    2.27  	for (tmp = 0; tmp < max_low_pfn; tmp++)
     3.1 --- a/linux-2.6-xen-sparse/arch/xen/i386/mm/pgtable.c	Fri Jan 27 21:38:55 2006 +0100
     3.2 +++ b/linux-2.6-xen-sparse/arch/xen/i386/mm/pgtable.c	Fri Jan 27 21:57:07 2006 +0100
     3.3 @@ -317,7 +317,6 @@ pgd_t *pgd_alloc(struct mm_struct *mm)
     3.4  
     3.5  	pgd_test_and_unpin(pgd);
     3.6  
     3.7 -	memset(pgd, 0, 10);
     3.8  	if (PTRS_PER_PMD == 1 || !pgd)
     3.9  		return pgd;
    3.10  
     4.1 --- a/linux-2.6-xen-sparse/drivers/xen/balloon/balloon.c	Fri Jan 27 21:38:55 2006 +0100
     4.2 +++ b/linux-2.6-xen-sparse/drivers/xen/balloon/balloon.c	Fri Jan 27 21:57:07 2006 +0100
     4.3 @@ -113,8 +113,6 @@ static int page_is_xen_hole(unsigned lon
     4.4  	if (hole_len == -1) {
     4.5  		hole_start = xen_pfn_hole_start();
     4.6  		hole_len = xen_pfn_hole_size();
     4.7 -		printk("<0>Xen hole at [%lx,%lx).\n", hole_start,
     4.8 -		       hole_start + hole_len);
     4.9  	}
    4.10  	return pfn >= hole_start && pfn < hole_start + hole_len;
    4.11  }
    4.12 @@ -122,12 +120,9 @@ static int page_is_xen_hole(unsigned lon
    4.13  /* balloon_append: add the given page to the balloon. */
    4.14  static void balloon_append(struct page *page)
    4.15  {
    4.16 -	BUG_ON(PageReserved(page));
    4.17 -	if (page_is_xen_hole(page_to_pfn(page))) {
    4.18 -		printk("<0>Attempt to add reserved pfn %lx to balloon.\n",
    4.19 +	if (page_is_xen_hole(page_to_pfn(page)))
    4.20 +		panic("Attempt to add Xen-reserved pfn %lx to balloon.\n",
    4.21  		       page_to_pfn(page));
    4.22 -		BUG();
    4.23 -	}
    4.24  	/* Lowmem is re-populated first, so highmem pages go at list tail. */
    4.25  	if (PageHighMem(page)) {
    4.26  		list_add_tail(PAGE_TO_LIST(page), &ballooned_pages);
    4.27 @@ -243,25 +238,14 @@ static int increase_reservation(unsigned
    4.28  		xen_machphys_update(frame_list[i], pfn);
    4.29  #endif
    4.30  
    4.31 -		printk("<0>Balloon allocated %lx.\n", pfn);
    4.32  		/* Link back into the page tables if not highmem. */
    4.33  		if (pfn < max_low_pfn) {
    4.34  			int ret;
    4.35 -			pgd_t *pgd = pgd_offset_k((unsigned long)__va(pfn << PAGE_SHIFT));
    4.36 -			printk("pgd is %lx.\n", *(unsigned long *)pgd);
    4.37 -			(void)copy_from_user(&ret,
    4.38 -					     (unsigned long *)__va(pfn << PAGE_SHIFT),
    4.39 -					     4);
    4.40  			ret = HYPERVISOR_update_va_mapping(
    4.41  				(unsigned long)__va(pfn << PAGE_SHIFT),
    4.42  				pfn_pte_ma(frame_list[i], PAGE_KERNEL),
    4.43  				0);
    4.44  			BUG_ON(ret);
    4.45 -			printk("<0>Rehooked va; pte now %lx.\n",
    4.46 -			       *(unsigned long *)virt_to_ptep(__va(pfn << PAGE_SHIFT)));
    4.47 -			*(unsigned long *)__va(pfn << PAGE_SHIFT) =
    4.48 -				0xf001;
    4.49 -			printk("<0>Touched va.\n");
    4.50  		}
    4.51  
    4.52  		/* Relinquish the page back to the allocator. */
     5.1 --- a/linux-2.6-xen-sparse/drivers/xen/netfront/netfront.c	Fri Jan 27 21:38:55 2006 +0100
     5.2 +++ b/linux-2.6-xen-sparse/drivers/xen/netfront/netfront.c	Fri Jan 27 21:57:07 2006 +0100
     5.3 @@ -614,7 +614,7 @@ static void network_alloc_rx_buffers(str
     5.4  	reservation.domid        = DOMID_SELF;
     5.5  
     5.6  	/* Tell the ballon driver what is going on. */
     5.7 -//SOS22	balloon_update_driver_allowance(i);
     5.8 +	balloon_update_driver_allowance(i);
     5.9  
    5.10  	/* Zap PTEs and give away pages in one big multicall. */
    5.11  	(void)HYPERVISOR_multicall(rx_mcl, i+1);
    5.12 @@ -818,7 +818,7 @@ static int netif_poll(struct net_device 
    5.13  	}
    5.14  
    5.15  	/* Some pages are no longer absent... */
    5.16 -//SOS22	balloon_update_driver_allowance(-work_done);
    5.17 +	balloon_update_driver_allowance(-work_done);
    5.18  
    5.19  	/* Do all the remapping work, and M2P updates, in one big hypercall. */
    5.20  	if (likely((mcl - rx_mcl) != 0)) {
     6.1 --- a/linux-2.6-xen-sparse/mm/memory.c	Fri Jan 27 21:38:55 2006 +0100
     6.2 +++ b/linux-2.6-xen-sparse/mm/memory.c	Fri Jan 27 21:57:07 2006 +0100
     6.3 @@ -291,7 +291,6 @@ pte_t fastcall *pte_alloc_map(struct mm_
     6.4  		spin_lock(&mm->page_table_lock);
     6.5  		if (!new)
     6.6  			return NULL;
     6.7 -
     6.8  		/*
     6.9  		 * Because we dropped the lock, we should re-check the
    6.10  		 * entry, as somebody else could have populated it..
     7.1 --- a/tools/libxc/xc_linux_build.c	Fri Jan 27 21:38:55 2006 +0100
     7.2 +++ b/tools/libxc/xc_linux_build.c	Fri Jan 27 21:57:07 2006 +0100
     7.3 @@ -33,8 +33,6 @@
     7.4  #define L4_PROT (_PAGE_PRESENT|_PAGE_RW|_PAGE_ACCESSED|_PAGE_DIRTY|_PAGE_USER)
     7.5  #endif
     7.6  
     7.7 -#define NR_GRANT_FRAMES 4
     7.8 -
     7.9  #ifdef __ia64__
    7.10  #define get_tot_pages xc_get_max_pages
    7.11  #else
     8.1 --- a/xen/arch/x86/mm.c	Fri Jan 27 21:38:55 2006 +0100
     8.2 +++ b/xen/arch/x86/mm.c	Fri Jan 27 21:57:07 2006 +0100
     8.3 @@ -1041,7 +1041,7 @@ static inline int update_l1e(l1_pgentry_
     8.4      if ( unlikely(cmpxchg_user(pl1e, o, n) != 0) ||
     8.5           unlikely(o != l1e_get_intpte(ol1e)) )
     8.6      {
     8.7 -        printf("Failed to update %" PRIpte " -> %" PRIpte
     8.8 +        MEM_LOG("Failed to update %" PRIpte " -> %" PRIpte
     8.9                  ": saw %" PRIpte,
    8.10                  l1e_get_intpte(ol1e),
    8.11                  l1e_get_intpte(nl1e),
    8.12 @@ -1058,16 +1058,11 @@ static int mod_l1_entry(l1_pgentry_t *pl
    8.13      l1_pgentry_t ol1e;
    8.14      struct domain *d = current->domain;
    8.15  
    8.16 -    shadow_sync_all(d);
    8.17 -    if ( unlikely(__copy_from_user(&ol1e, pl1e, sizeof(ol1e)) != 0) ) {
    8.18 -        printf("copy_from_user1 failed %p, l2 %lx.\n", pl1e,
    8.19 -               *(unsigned long *)&__linear_l2_table[l2_table_offset((unsigned long)pl1e)]);
    8.20 +    if ( unlikely(__copy_from_user(&ol1e, pl1e, sizeof(ol1e)) != 0) )
    8.21          return 0;
    8.22 -    }
    8.23 -
    8.24 -    if ( unlikely(shadow_mode_refcounts(d)) ) {
    8.25 +
    8.26 +    if ( unlikely(shadow_mode_refcounts(d)) )
    8.27          return update_l1e(pl1e, ol1e, nl1e);
    8.28 -    }
    8.29  
    8.30      if ( l1e_get_flags(nl1e) & _PAGE_PRESENT )
    8.31      {
    8.32 @@ -2545,10 +2540,8 @@ int do_update_va_mapping(unsigned long v
    8.33  
    8.34      perfc_incrc(calls_to_update_va);
    8.35  
    8.36 -    if ( unlikely(!__addr_ok(va) && !shadow_mode_external(d)) ) {
    8.37 -        printf("Bad update_va_mapping.\n");
    8.38 +    if ( unlikely(!__addr_ok(va) && !shadow_mode_external(d)) )
    8.39          return -EINVAL;
    8.40 -    }
    8.41  
    8.42      LOCK_BIGLOCK(d);
    8.43  
    8.44 @@ -2557,13 +2550,9 @@ int do_update_va_mapping(unsigned long v
    8.45      if ( unlikely(shadow_mode_enabled(d)) )
    8.46          check_pagetable(v, "pre-va"); /* debug */
    8.47  
    8.48 -    shadow_sync_all(d);
    8.49 -
    8.50      if ( unlikely(!mod_l1_entry(&linear_pg_table[l1_linear_offset(va)],
    8.51 -                                val)) ) {
    8.52 -        printf("mod_l1_entry failed.\n");
    8.53 +                                val)) )
    8.54          rc = -EINVAL;
    8.55 -    }
    8.56  
    8.57      if ( likely(rc == 0) && unlikely(shadow_mode_enabled(d)) )
    8.58      {
    8.59 @@ -2580,8 +2569,7 @@ int do_update_va_mapping(unsigned long v
    8.60          }
    8.61      
    8.62          rc = shadow_do_update_va_mapping(va, val, v);
    8.63 -        if (rc)
    8.64 -            printf("shadow_do_update_va_mapping says %d.\n", rc);
    8.65 +
    8.66          check_pagetable(v, "post-va"); /* debug */
    8.67      }
    8.68  
     9.1 --- a/xen/arch/x86/shadow32.c	Fri Jan 27 21:38:55 2006 +0100
     9.2 +++ b/xen/arch/x86/shadow32.c	Fri Jan 27 21:57:07 2006 +0100
     9.3 @@ -2502,8 +2502,6 @@ static int resync_all(struct domain *d, 
     9.4              l2_pgentry_t *snapshot2 = snapshot;
     9.5              l1_pgentry_t *shadow2 = shadow;
     9.6  
     9.7 -            printf("Update hl2 shadow.\n");
     9.8 -
     9.9              ASSERT(shadow_mode_write_all(d) || shadow_mode_wr_pt_pte(d));
    9.10              BUG_ON(!shadow_mode_refcounts(d)); // not yet implemented
    9.11  
    10.1 --- a/xen/common/grant_table.c	Fri Jan 27 21:38:55 2006 +0100
    10.2 +++ b/xen/common/grant_table.c	Fri Jan 27 21:57:07 2006 +0100
    10.3 @@ -522,9 +522,7 @@ gnttab_setup_table(
    10.4          ASSERT(d->grant_table != NULL);
    10.5          (void)put_user(GNTST_okay, &uop->status);
    10.6          for ( i = 0; i < op.nr_frames; i++ ) {
    10.7 -            mfn = gnttab_shared_mfn(d, d->grant_table, i);
    10.8 -            if (shadow_mode_translate(d))
    10.9 -                mfn = __mfn_to_gpfn(d, mfn);
   10.10 +            mfn = __mfn_to_gpfn(d, gnttab_shared_mfn(d, d->grant_table, i));
   10.11              (void)put_user(mfn, &op.frame_list[i]);
   10.12          }
   10.13      }
    11.1 --- a/xen/common/memory.c	Fri Jan 27 21:38:55 2006 +0100
    11.2 +++ b/xen/common/memory.c	Fri Jan 27 21:57:07 2006 +0100
    11.3 @@ -115,8 +115,6 @@ populate_physmap(
    11.4              goto out;
    11.5  
    11.6          for ( j = 0; j < (1 << extent_order); j++ ) {
    11.7 -            printf("Populating %lx with %lx.\n",
    11.8 -                   pfn + j, mfn + j);
    11.9              if (shadow_mode_translate(d))
   11.10                  set_p2m_entry(d, pfn + j, mfn + j, &cache1, &cache2);
   11.11              set_pfn_from_mfn(mfn + j, pfn + j);
    12.1 --- a/xen/include/asm-x86/shadow.h	Fri Jan 27 21:38:55 2006 +0100
    12.2 +++ b/xen/include/asm-x86/shadow.h	Fri Jan 27 21:57:07 2006 +0100
    12.3 @@ -326,7 +326,7 @@ struct out_of_sync_entry {
    12.4  #define SHADOW_SNAPSHOT_ELSEWHERE (-1L)
    12.5  
    12.6  /************************************************************************/
    12.7 -#define SHADOW_DEBUG 1
    12.8 +#define SHADOW_DEBUG 0
    12.9  #define SHADOW_VERBOSE_DEBUG 0
   12.10  #define SHADOW_VVERBOSE_DEBUG 0
   12.11  #define SHADOW_VVVERBOSE_DEBUG 0
    13.1 --- a/xen/include/public/dom0_ops.h	Fri Jan 27 21:38:55 2006 +0100
    13.2 +++ b/xen/include/public/dom0_ops.h	Fri Jan 27 21:57:07 2006 +0100
    13.3 @@ -430,7 +430,7 @@ typedef struct {
    13.4      domid_t  domain;          /* domain to be affected */
    13.5      unsigned long mfn;        /* machine frame to be initialised */
    13.6  } dom0_hypercall_init_t;
    13.7 -
    13.8 + 
    13.9  typedef struct {
   13.10      uint32_t cmd;
   13.11      uint32_t interface_version; /* DOM0_INTERFACE_VERSION */