ia64/xen-unstable

changeset 2054:689f558de2f2

bitkeeper revision 1.1130 (410f9501K6OhOLCCwkWJvX9f13KEZw)

cleanup
author cl349@freefall.cl.cam.ac.uk
date Tue Aug 03 13:37:05 2004 +0000 (2004-08-03)
parents a20a79b5e608
children 5dc17e68374c
files xen/arch/x86/memory.c xen/common/schedule.c
line diff
     1.1 --- a/xen/arch/x86/memory.c	Tue Aug 03 13:11:34 2004 +0000
     1.2 +++ b/xen/arch/x86/memory.c	Tue Aug 03 13:37:05 2004 +0000
     1.3 @@ -1244,7 +1244,7 @@ static unsigned long *ptwr_writable_l1[N
     1.4  static unsigned long *ptwr_writables[NR_CPUS][PTWR_NR_WRITABLES] __cacheline_aligned;
     1.5  int ptwr_writable_idx[NR_CPUS] __cacheline_aligned = { 0, };
     1.6  static l1_pgentry_t ptwr_writable_page[NR_CPUS][PTWR_NR_WRITABLES][ENTRIES_PER_L1_PAGETABLE] __cacheline_aligned;
     1.7 -#ifdef TRACK_PTWR_DOMAIN
     1.8 +#ifdef PTWR_TRACK_DOMAIN
     1.9  domid_t ptwr_domain[NR_CPUS] = { 0, };
    1.10  #endif
    1.11  
    1.12 @@ -1261,7 +1261,7 @@ void ptwr_reconnect_disconnected(unsigne
    1.13      int cpu = smp_processor_id();
    1.14      int i;
    1.15  
    1.16 -#ifdef TRACK_PTWR_DOMAIN
    1.17 +#ifdef PTWR_TRACK_DOMAIN
    1.18      if (ptwr_domain[cpu] != get_current()->domain)
    1.19          printk("ptwr_reconnect_disconnected domain mismatch %d != %d\n",
    1.20                 ptwr_domain[cpu], get_current()->domain);
    1.21 @@ -1295,20 +1295,9 @@ void ptwr_reconnect_disconnected(unsigne
    1.22              continue;
    1.23          if (likely((l1_pgentry_val(nl1e) ^ l1_pgentry_val(ol1e)) ==
    1.24                     _PAGE_RW)) {
    1.25 -#if 0
    1.26 -            struct pfn_info *page = &frame_table[l1_pgentry_to_pagenr(nl1e)];
    1.27 -            printk("%03x: %08lx != %08lx %08x/%08x\n", i,
    1.28 -                   l1_pgentry_val(ol1e), l1_pgentry_val(nl1e),
    1.29 -                   page->u.inuse.type_info, page->u.inuse.count_info);
    1.30 -#endif
    1.31              if (likely(readonly_page_from_l1e(nl1e)))
    1.32                  continue;
    1.33          }
    1.34 -#if 0
    1.35 -        printk("%03x: %08lx != %08lx\n", i,
    1.36 -               l1_pgentry_val(ptwr_disconnected_page[cpu][i]),
    1.37 -               l1_pgentry_val(pl1e[i]));
    1.38 -#endif
    1.39          if (unlikely(l1_pgentry_val(ol1e) & _PAGE_PRESENT))
    1.40              put_page_from_l1e(ol1e);
    1.41          if (unlikely(!get_page_from_l1e(nl1e)))
    1.42 @@ -1317,13 +1306,6 @@ void ptwr_reconnect_disconnected(unsigne
    1.43      unmap_domain_mem(pl1e);
    1.44      update_l2e(pl2e, *pl2e, nl2e);
    1.45  
    1.46 -#if 0
    1.47 -    if (page->u.inuse.count_info & PGC_guest_pinned) {
    1.48 -        if ((page->u.inuse.type_info & PGT_count_mask) != 1)
    1.49 -            BUG();
    1.50 -        page->u.inuse.type_info++;
    1.51 -    }
    1.52 -#endif
    1.53      PTWR_PRINTK("now pl2e %p l2e %08lx              taf %08x/%08x/%u\n", pl2e,
    1.54                  l2_pgentry_val(*pl2e),
    1.55                  frame_table[pfn].u.inuse.type_info,
    1.56 @@ -1351,7 +1333,7 @@ void ptwr_flush_inactive(void)
    1.57      int i, idx;
    1.58      static int maxidx = 0;
    1.59  
    1.60 -#ifdef TRACK_PTWR_DOMAIN
    1.61 +#ifdef PTWR_TRACK_DOMAIN
    1.62      if (ptwr_domain[cpu] != get_current()->domain)
    1.63          printk("ptwr_flush_inactive domain mismatch %d != %d\n",
    1.64                 ptwr_domain[cpu], get_current()->domain);
    1.65 @@ -1374,22 +1356,6 @@ void ptwr_flush_inactive(void)
    1.66              nl1e = pl1e[i];
    1.67              if (likely(l1_pgentry_val(ol1e) == l1_pgentry_val(nl1e)))
    1.68                  continue;
    1.69 -#if 0
    1.70 -            if ((l1_pgentry_val(ol1e) ^ l1_pgentry_val(nl1e)) == _PAGE_RW) {
    1.71 -#if 01
    1.72 -                struct pfn_info *page = &frame_table[l1_pgentry_to_pagenr(nl1e)];
    1.73 -                printk("%03x: %08lx != %08lx %08x/%08x\n", i,
    1.74 -                       l1_pgentry_val(ol1e), l1_pgentry_val(nl1e),
    1.75 -                       page->u.inuse.type_info, page->u.inuse.count_info);
    1.76 -#endif
    1.77 -                if (readonly_page_from_l1e(nl1e))
    1.78 -                    continue;
    1.79 -            }
    1.80 -#endif
    1.81 -#if 0
    1.82 -            printk("%03x: %08lx != %08lx\n", i,
    1.83 -                   l1_pgentry_val(ol1e), l1_pgentry_val(nl1e));
    1.84 -#endif
    1.85              if (unlikely(l1_pgentry_val(ol1e) & _PAGE_PRESENT))
    1.86                  put_page_from_l1e(ol1e);
    1.87              if (unlikely(!get_page_from_l1e(nl1e)))
    1.88 @@ -1397,13 +1363,6 @@ void ptwr_flush_inactive(void)
    1.89          }
    1.90          unmap_domain_mem(pl1e);
    1.91  
    1.92 -#if 0
    1.93 -        if (page->u.inuse.count_info & PGC_guest_pinned) {
    1.94 -            if ((page->u.inuse.type_info & PGT_count_mask) != 1)
    1.95 -                BUG();
    1.96 -            page->u.inuse.type_info++;
    1.97 -        }
    1.98 -#endif
    1.99          /* make pt page writable */
   1.100          PTWR_PRINTK("writable_l1 at %p is %08lx\n", ptwr_writables[cpu][idx],
   1.101                      pte);
   1.102 @@ -1440,25 +1399,17 @@ int ptwr_do_page_fault(unsigned long add
   1.103  #endif
   1.104          page = &frame_table[pfn];
   1.105          if ((page->u.inuse.type_info & PGT_type_mask) == PGT_l1_page_table) {
   1.106 -#ifdef TRACK_PTWR_DOMAIN
   1.107 +#ifdef PTWR_TRACK_DOMAIN
   1.108              if (ptwr_domain[cpu] != get_current()->domain)
   1.109                  printk("ptwr_do_page_fault domain mismatch %d != %d\n",
   1.110                         ptwr_domain[cpu], get_current()->domain);
   1.111  #endif
   1.112              pl2e = &linear_l2_table[(page->u.inuse.type_info &
   1.113                                       PGT_va_mask) >> PGT_va_shift];
   1.114 -            PTWR_PRINTK("page_fault on l1 pt at va %08lx, pt for %08x, pfn %08lx\n",
   1.115 -                        addr, ((page->u.inuse.type_info & PGT_va_mask) >>
   1.116 -                               PGT_va_shift) << L2_PAGETABLE_SHIFT, pfn);
   1.117 -#if 0
   1.118 -            if (page->u.inuse.count_info & PGC_guest_pinned) {
   1.119 -                PTWR_PRINTK(" pinned l1 page %p taf %08x/%08x\n", page,
   1.120 -                            page->u.inuse.type_info, page->u.inuse.count_info);
   1.121 -                if ((page->u.inuse.type_info & PGT_count_mask) != 2)
   1.122 -                    BUG();
   1.123 -                page->u.inuse.type_info--;
   1.124 -            }
   1.125 -#endif
   1.126 +            PTWR_PRINTK("page_fault on l1 pt at va %08lx, pt for %08x, "
   1.127 +			"pfn %08lx\n", addr,
   1.128 +			((page->u.inuse.type_info & PGT_va_mask) >>
   1.129 +			 PGT_va_shift) << L2_PAGETABLE_SHIFT, pfn);
   1.130              if (l2_pgentry_val(*pl2e) >> PAGE_SHIFT != pfn) {
   1.131                  l1_pgentry_t *pl1e;
   1.132                  PTWR_PRINTK("freeing l1 page %p taf %08x/%08x\n", page,
   1.133 @@ -1467,10 +1418,6 @@ int ptwr_do_page_fault(unsigned long add
   1.134                      ptwr_flush_inactive();
   1.135                  ptwr_writables[cpu][ptwr_writable_idx[cpu]] = (unsigned long *)
   1.136                      &linear_pg_table[addr>>PAGE_SHIFT];
   1.137 -#if 0
   1.138 -                if ((page->u.inuse.type_info & PGT_count_mask) != 1)
   1.139 -                    BUG();
   1.140 -#endif
   1.141  
   1.142                  pl1e = map_domain_mem(pfn << PAGE_SHIFT);
   1.143                  memcpy(&ptwr_writable_page[cpu][ptwr_writable_idx[cpu]][0],
   1.144 @@ -1524,6 +1471,7 @@ int ptwr_do_page_fault(unsigned long add
   1.145      return 0;
   1.146  }
   1.147  
   1.148 +#ifndef NDEBUG
   1.149  void ptwr_status(void)
   1.150  {
   1.151      int i;
   1.152 @@ -1562,3 +1510,4 @@ void ptwr_status(void)
   1.153                  frame_table[l2_pgentry_to_pagenr(*pl2e)].u.inuse.type_info,
   1.154                  frame_table[pfn].u.inuse.type_info, frame_table[pfn].u.inuse.domain->domain);
   1.155  }
   1.156 +#endif
     2.1 --- a/xen/common/schedule.c	Tue Aug 03 13:11:34 2004 +0000
     2.2 +++ b/xen/common/schedule.c	Tue Aug 03 13:37:05 2004 +0000
     2.3 @@ -372,7 +372,8 @@ void __enter_scheduler(void)
     2.4          return;
     2.5      
     2.6      cleanup_writable_pagetable(PTRW_CLEANUP_ACTIVE | PTRW_CLEANUP_INACTIVE);
     2.7 -#ifdef TRACK_PTWR_DOMAIN
     2.8 +
     2.9 +#ifdef PTWR_TRACK_DOMAIN
    2.10      {
    2.11          extern domid_t ptwr_domain[];
    2.12          int cpu = smp_processor_id();