ia64/xen-unstable

changeset 2452:69045df0ee90

bitkeeper revision 1.1159.1.132 (413de4a3QR-RvHT7TfYwUW7cOo0nzg)

Merge freefall.cl.cam.ac.uk:/auto/groups/xeno/BK/xeno.bk
into freefall.cl.cam.ac.uk:/auto/groups/xeno/users/cl349/BK/xeno.bk-26dom0
author cl349@freefall.cl.cam.ac.uk
date Tue Sep 07 16:41:07 2004 +0000 (2004-09-07)
parents 7809f000f2f0 426891ca6a6f
children 72423979c7cd
files xen/arch/x86/memory.c
line diff
     1.1 --- a/xen/arch/x86/memory.c	Tue Sep 07 16:05:53 2004 +0000
     1.2 +++ b/xen/arch/x86/memory.c	Tue Sep 07 16:41:07 2004 +0000
     1.3 @@ -380,6 +380,19 @@ get_linear_pagetable(
     1.4  }
     1.5  
     1.6  
     1.7 +static inline int
     1.8 +readonly_page_from_l1e(
     1.9 +    l1_pgentry_t l1e)
    1.10 +{
    1.11 +    struct pfn_info *page = &frame_table[l1_pgentry_to_pagenr(l1e)];
    1.12 +    unsigned long    l1v  = l1_pgentry_val(l1e);
    1.13 +
    1.14 +    if ( !(l1v & _PAGE_PRESENT) || !pfn_is_ram(l1v >> PAGE_SHIFT) )
    1.15 +        return 0;
    1.16 +    put_page_type(page);
    1.17 +    return 1;
    1.18 +}
    1.19 +
    1.20  static int
    1.21  get_page_from_l1e(
    1.22      l1_pgentry_t l1e, struct domain *d)
    1.23 @@ -1540,6 +1553,11 @@ void ptwr_reconnect_disconnected(unsigne
    1.24          nl1e = pl1e[i];
    1.25          if (likely(l1_pgentry_val(nl1e) == l1_pgentry_val(ol1e)))
    1.26              continue;
    1.27 +        if (likely(l1_pgentry_val(nl1e) == (l1_pgentry_val(ol1e) | _PAGE_RW)))
    1.28 +        {
    1.29 +            if (likely(readonly_page_from_l1e(nl1e)))
    1.30 +                continue;
    1.31 +        }
    1.32          if (unlikely(l1_pgentry_val(ol1e) & _PAGE_PRESENT))
    1.33              put_page_from_l1e(ol1e, current);
    1.34          if (unlikely(!get_page_from_l1e(nl1e, current))) {