ia64/xen-unstable

changeset 1889:07a02b25fad4

bitkeeper revision 1.1125 (4100f393WAo42w5ww75pCOZ8hRPj6Q)

more code rearranging
author cl349@freefall.cl.cam.ac.uk
date Fri Jul 23 11:16:35 2004 +0000 (2004-07-23)
parents a50c804416c5
children bf53c6ec6e23
files xen/arch/x86/memory.c
line diff
     1.1 --- a/xen/arch/x86/memory.c	Fri Jul 23 11:01:03 2004 +0000
     1.2 +++ b/xen/arch/x86/memory.c	Fri Jul 23 11:16:35 2004 +0000
     1.3 @@ -1288,6 +1288,9 @@ void ptwr_reconnect_disconnected(unsigne
     1.4                           _PAGE_PRESENT);
     1.5      pl1e = map_domain_mem(l2_pgentry_to_pagenr(nl2e) << PAGE_SHIFT);
     1.6      for ( i = 0; i < ENTRIES_PER_L1_PAGETABLE; i++ ) {
     1.7 +        if (likely(l1_pgentry_val(pl1e[i]) ==
     1.8 +                   l1_pgentry_val(ptwr_disconnected_page[cpu][i])))
     1.9 +            continue;
    1.10          if (likely((l1_pgentry_val(pl1e[i]) ^
    1.11                      l1_pgentry_val(ptwr_disconnected_page[cpu][i])) ==
    1.12                     _PAGE_RW)) {
    1.13 @@ -1301,18 +1304,16 @@ void ptwr_reconnect_disconnected(unsigne
    1.14              if (likely(readonly_page_from_l1e(pl1e[i])))
    1.15                  continue;
    1.16          }
    1.17 -        if (l1_pgentry_val(pl1e[i]) != l1_pgentry_val(ptwr_disconnected_page[cpu][i])) {
    1.18  #if 0
    1.19 -            printk("%03x: %08lx != %08lx\n", i,
    1.20 -                   l1_pgentry_val(ptwr_disconnected_page[cpu][i]),
    1.21 -                   l1_pgentry_val(pl1e[i]));
    1.22 +        printk("%03x: %08lx != %08lx\n", i,
    1.23 +               l1_pgentry_val(ptwr_disconnected_page[cpu][i]),
    1.24 +               l1_pgentry_val(pl1e[i]));
    1.25  #endif
    1.26 -            if (unlikely(l1_pgentry_val(ptwr_disconnected_page[cpu][i]) &
    1.27 -                         _PAGE_PRESENT))
    1.28 -                put_page_from_l1e(ptwr_disconnected_page[cpu][i]);
    1.29 -            if (unlikely(!get_page_from_l1e(pl1e[i])))
    1.30 -                BUG();
    1.31 -        }
    1.32 +        if (unlikely(l1_pgentry_val(ptwr_disconnected_page[cpu][i]) &
    1.33 +                     _PAGE_PRESENT))
    1.34 +            put_page_from_l1e(ptwr_disconnected_page[cpu][i]);
    1.35 +        if (unlikely(!get_page_from_l1e(pl1e[i])))
    1.36 +            BUG();
    1.37      }
    1.38      unmap_domain_mem(pl1e);
    1.39      update_l2e(pl2e, *pl2e, nl2e);
    1.40 @@ -1367,6 +1368,9 @@ void ptwr_flush_inactive(void)
    1.41  
    1.42          pl1e = map_domain_mem(pfn << PAGE_SHIFT);
    1.43          for ( i = 0; i < ENTRIES_PER_L1_PAGETABLE; i++ ) {
    1.44 +            if (likely(l1_pgentry_val(pl1e[i]) ==
    1.45 +                       l1_pgentry_val(ptwr_writable_page[cpu][idx][i])))
    1.46 +                continue;
    1.47  #if 0
    1.48              if ((l1_pgentry_val(pl1e[i]) ^
    1.49                   l1_pgentry_val(ptwr_writable_page[cpu][idx][i])) == _PAGE_RW) {
    1.50 @@ -1381,19 +1385,16 @@ void ptwr_flush_inactive(void)
    1.51                      continue;
    1.52              }
    1.53  #endif
    1.54 -            if (l1_pgentry_val(pl1e[i]) !=
    1.55 -                l1_pgentry_val(ptwr_writable_page[cpu][idx][i])) {
    1.56  #if 0
    1.57 -                printk("%03x: %08lx != %08lx\n", i,
    1.58 -                       l1_pgentry_val(ptwr_writable_page[cpu][idx][i]),
    1.59 -                       l1_pgentry_val(pl1e[i]));
    1.60 +            printk("%03x: %08lx != %08lx\n", i,
    1.61 +                   l1_pgentry_val(ptwr_writable_page[cpu][idx][i]),
    1.62 +                   l1_pgentry_val(pl1e[i]));
    1.63  #endif
    1.64 -                if (unlikely(l1_pgentry_val(ptwr_writable_page[cpu][idx][i]) &
    1.65 -                             _PAGE_PRESENT))
    1.66 -                    put_page_from_l1e(ptwr_writable_page[cpu][idx][i]);
    1.67 -                if (unlikely(!get_page_from_l1e(pl1e[i])))
    1.68 -                    BUG();
    1.69 -            }
    1.70 +            if (unlikely(l1_pgentry_val(ptwr_writable_page[cpu][idx][i]) &
    1.71 +                         _PAGE_PRESENT))
    1.72 +                put_page_from_l1e(ptwr_writable_page[cpu][idx][i]);
    1.73 +            if (unlikely(!get_page_from_l1e(pl1e[i])))
    1.74 +                BUG();
    1.75          }
    1.76          unmap_domain_mem(pl1e);
    1.77