ia64/xen-unstable

changeset 2053:a20a79b5e608

bitkeeper revision 1.1129 (410f8f068yUe_4bOJPta4zmjURkvJQ)

Catch up with ``Reformat the pfn_info structure''.
author cl349@freefall.cl.cam.ac.uk
date Tue Aug 03 13:11:34 2004 +0000 (2004-08-03)
parents dae98734f12e
children 689f558de2f2
files xen/arch/x86/memory.c
line diff
     1.1 --- a/xen/arch/x86/memory.c	Tue Aug 03 12:28:49 2004 +0000
     1.2 +++ b/xen/arch/x86/memory.c	Tue Aug 03 13:11:34 2004 +0000
     1.3 @@ -514,8 +514,8 @@ static inline void set_l1_page_va(unsign
     1.4      struct pfn_info *page;
     1.5      
     1.6      page = &frame_table[pfn];
     1.7 -    page->type_and_flags &= ~PGT_va_mask;
     1.8 -    page->type_and_flags |= va_idx << PGT_va_shift;
     1.9 +    page->u.inuse.type_info &= ~PGT_va_mask;
    1.10 +    page->u.inuse.type_info |= va_idx << PGT_va_shift;
    1.11  }
    1.12  
    1.13  
    1.14 @@ -1280,9 +1280,9 @@ void ptwr_reconnect_disconnected(unsigne
    1.15                  l2_pgentry_val(*pl2e),
    1.16                  l1_pgentry_val(linear_pg_table[(unsigned long)pl2e >>
    1.17                                                 PAGE_SHIFT]) >> PAGE_SHIFT,
    1.18 -                frame_table[pfn].type_and_flags,
    1.19 -                frame_table[pfn].count_and_flags,
    1.20 -                frame_table[pfn].u.domain->domain);
    1.21 +                frame_table[pfn].u.inuse.type_info,
    1.22 +                frame_table[pfn].u.inuse.count_info,
    1.23 +                frame_table[pfn].u.inuse.domain->domain);
    1.24  
    1.25      nl2e = mk_l2_pgentry((l2_pgentry_val(*pl2e) & ~0x800) |
    1.26                           _PAGE_PRESENT);
    1.27 @@ -1299,7 +1299,7 @@ void ptwr_reconnect_disconnected(unsigne
    1.28              struct pfn_info *page = &frame_table[l1_pgentry_to_pagenr(nl1e)];
    1.29              printk("%03x: %08lx != %08lx %08x/%08x\n", i,
    1.30                     l1_pgentry_val(ol1e), l1_pgentry_val(nl1e),
    1.31 -                   page->type_and_flags, page->count_and_flags);
    1.32 +                   page->u.inuse.type_info, page->u.inuse.count_info);
    1.33  #endif
    1.34              if (likely(readonly_page_from_l1e(nl1e)))
    1.35                  continue;
    1.36 @@ -1318,17 +1318,17 @@ void ptwr_reconnect_disconnected(unsigne
    1.37      update_l2e(pl2e, *pl2e, nl2e);
    1.38  
    1.39  #if 0
    1.40 -    if (page->count_and_flags & PGC_guest_pinned) {
    1.41 -        if ((page->type_and_flags & PGT_count_mask) != 1)
    1.42 +    if (page->u.inuse.count_info & PGC_guest_pinned) {
    1.43 +        if ((page->u.inuse.type_info & PGT_count_mask) != 1)
    1.44              BUG();
    1.45 -        page->type_and_flags++;
    1.46 +        page->u.inuse.type_info++;
    1.47      }
    1.48  #endif
    1.49      PTWR_PRINTK("now pl2e %p l2e %08lx              taf %08x/%08x/%u\n", pl2e,
    1.50                  l2_pgentry_val(*pl2e),
    1.51 -                frame_table[pfn].type_and_flags,
    1.52 -                frame_table[pfn].count_and_flags,
    1.53 -                frame_table[pfn].u.domain->domain);
    1.54 +                frame_table[pfn].u.inuse.type_info,
    1.55 +                frame_table[pfn].u.inuse.count_info,
    1.56 +                frame_table[pfn].u.inuse.domain->domain);
    1.57      ptwr_disconnected[cpu] = ENTRIES_PER_L2_PAGETABLE;
    1.58      /* make pt page write protected */
    1.59      if (__get_user(pte, ptwr_writable_l1[cpu]))
    1.60 @@ -1380,7 +1380,7 @@ void ptwr_flush_inactive(void)
    1.61                  struct pfn_info *page = &frame_table[l1_pgentry_to_pagenr(nl1e)];
    1.62                  printk("%03x: %08lx != %08lx %08x/%08x\n", i,
    1.63                         l1_pgentry_val(ol1e), l1_pgentry_val(nl1e),
    1.64 -                       page->type_and_flags, page->count_and_flags);
    1.65 +                       page->u.inuse.type_info, page->u.inuse.count_info);
    1.66  #endif
    1.67                  if (readonly_page_from_l1e(nl1e))
    1.68                      continue;
    1.69 @@ -1398,10 +1398,10 @@ void ptwr_flush_inactive(void)
    1.70          unmap_domain_mem(pl1e);
    1.71  
    1.72  #if 0
    1.73 -        if (page->count_and_flags & PGC_guest_pinned) {
    1.74 -            if ((page->type_and_flags & PGT_count_mask) != 1)
    1.75 +        if (page->u.inuse.count_info & PGC_guest_pinned) {
    1.76 +            if ((page->u.inuse.type_info & PGT_count_mask) != 1)
    1.77                  BUG();
    1.78 -            page->type_and_flags++;
    1.79 +            page->u.inuse.type_info++;
    1.80          }
    1.81  #endif
    1.82          /* make pt page writable */
    1.83 @@ -1439,36 +1439,36 @@ int ptwr_do_page_fault(unsigned long add
    1.84                      addr);
    1.85  #endif
    1.86          page = &frame_table[pfn];
    1.87 -        if ((page->type_and_flags & PGT_type_mask) == PGT_l1_page_table) {
    1.88 +        if ((page->u.inuse.type_info & PGT_type_mask) == PGT_l1_page_table) {
    1.89  #ifdef TRACK_PTWR_DOMAIN
    1.90              if (ptwr_domain[cpu] != get_current()->domain)
    1.91                  printk("ptwr_do_page_fault domain mismatch %d != %d\n",
    1.92                         ptwr_domain[cpu], get_current()->domain);
    1.93  #endif
    1.94 -            pl2e = &linear_l2_table[(page->type_and_flags &
    1.95 +            pl2e = &linear_l2_table[(page->u.inuse.type_info &
    1.96                                       PGT_va_mask) >> PGT_va_shift];
    1.97              PTWR_PRINTK("page_fault on l1 pt at va %08lx, pt for %08x, pfn %08lx\n",
    1.98 -                        addr, ((page->type_and_flags & PGT_va_mask) >>
    1.99 +                        addr, ((page->u.inuse.type_info & PGT_va_mask) >>
   1.100                                 PGT_va_shift) << L2_PAGETABLE_SHIFT, pfn);
   1.101  #if 0
   1.102 -            if (page->count_and_flags & PGC_guest_pinned) {
   1.103 +            if (page->u.inuse.count_info & PGC_guest_pinned) {
   1.104                  PTWR_PRINTK(" pinned l1 page %p taf %08x/%08x\n", page,
   1.105 -                            page->type_and_flags, page->count_and_flags);
   1.106 -                if ((page->type_and_flags & PGT_count_mask) != 2)
   1.107 +                            page->u.inuse.type_info, page->u.inuse.count_info);
   1.108 +                if ((page->u.inuse.type_info & PGT_count_mask) != 2)
   1.109                      BUG();
   1.110 -                page->type_and_flags--;
   1.111 +                page->u.inuse.type_info--;
   1.112              }
   1.113  #endif
   1.114              if (l2_pgentry_val(*pl2e) >> PAGE_SHIFT != pfn) {
   1.115                  l1_pgentry_t *pl1e;
   1.116                  PTWR_PRINTK("freeing l1 page %p taf %08x/%08x\n", page,
   1.117 -                            page->type_and_flags, page->count_and_flags);
   1.118 +                            page->u.inuse.type_info, page->u.inuse.count_info);
   1.119                  if (ptwr_writable_idx[cpu] == PTWR_NR_WRITABLES)
   1.120                      ptwr_flush_inactive();
   1.121                  ptwr_writables[cpu][ptwr_writable_idx[cpu]] = (unsigned long *)
   1.122                      &linear_pg_table[addr>>PAGE_SHIFT];
   1.123  #if 0
   1.124 -                if ((page->type_and_flags & PGT_count_mask) != 1)
   1.125 +                if ((page->u.inuse.type_info & PGT_count_mask) != 1)
   1.126                      BUG();
   1.127  #endif
   1.128  
   1.129 @@ -1488,21 +1488,21 @@ int ptwr_do_page_fault(unsigned long add
   1.130                              l1_pgentry_val(linear_pg_table[(unsigned long)pl2e
   1.131                                                             >> PAGE_SHIFT]) >>
   1.132                              PAGE_SHIFT,
   1.133 -                            frame_table[pfn].type_and_flags,
   1.134 -                            frame_table[pfn].count_and_flags,
   1.135 -                            frame_table[pfn].u.domain->domain);
   1.136 +                            frame_table[pfn].u.inuse.type_info,
   1.137 +                            frame_table[pfn].u.inuse.count_info,
   1.138 +                            frame_table[pfn].u.inuse.domain->domain);
   1.139                  /* disconnect l1 page */
   1.140                  nl2e = mk_l2_pgentry((l2_pgentry_val(*pl2e) &
   1.141                                        ~_PAGE_PRESENT) | 0x800);
   1.142                  update_l2e(pl2e, *pl2e, nl2e);
   1.143  
   1.144 -                ptwr_disconnected[cpu] = (page->type_and_flags & PGT_va_mask)
   1.145 +                ptwr_disconnected[cpu] = (page->u.inuse.type_info & PGT_va_mask)
   1.146                      >> PGT_va_shift;
   1.147                  PTWR_PRINTK("now pl2e %p l2e %08lx              taf %08x/%08x/%u\n",
   1.148                              pl2e, l2_pgentry_val(*pl2e),
   1.149 -                            frame_table[pfn].type_and_flags,
   1.150 -                            frame_table[pfn].count_and_flags,
   1.151 -                            frame_table[pfn].u.domain->domain);
   1.152 +                            frame_table[pfn].u.inuse.type_info,
   1.153 +                            frame_table[pfn].u.inuse.count_info,
   1.154 +                            frame_table[pfn].u.inuse.domain->domain);
   1.155                  ptwr_writable_l1[cpu] = (unsigned long *)
   1.156                      &linear_pg_table[addr>>PAGE_SHIFT];
   1.157                  pl1e = map_domain_mem(l2_pgentry_to_pagenr(nl2e) <<
   1.158 @@ -1559,6 +1559,6 @@ void ptwr_status(void)
   1.159                  l2_pgentry_val(*pl2e),
   1.160                  l1_pgentry_val(linear_pg_table[(unsigned long)pl2e >>
   1.161                                                 PAGE_SHIFT]) >> PAGE_SHIFT,
   1.162 -                frame_table[l2_pgentry_to_pagenr(*pl2e)].type_and_flags,
   1.163 -                frame_table[pfn].type_and_flags, frame_table[pfn].u.domain->domain);
   1.164 +                frame_table[l2_pgentry_to_pagenr(*pl2e)].u.inuse.type_info,
   1.165 +                frame_table[pfn].u.inuse.type_info, frame_table[pfn].u.inuse.domain->domain);
   1.166  }