ia64/xen-unstable

changeset 3714:41be211173f0

bitkeeper revision 1.1159.223.79 (42082ea1obdbIutzD0IY-9Fdcf7Exw)

Fix to memory debugging audit code.

Signed-off-by: ian@xensource.com
author iap10@labyrinth.cl.cam.ac.uk
date Tue Feb 08 03:14:41 2005 +0000 (2005-02-08)
parents d683070e3e97
children a95bb5c8b8be 0823f72cd071
files xen/arch/x86/memory.c
line diff
     1.1 --- a/xen/arch/x86/memory.c	Tue Feb 08 01:16:50 2005 +0000
     1.2 +++ b/xen/arch/x86/memory.c	Tue Feb 08 03:14:41 2005 +0000
     1.3 @@ -2279,7 +2279,6 @@ void audit_domain(struct domain *d)
     1.4      }
     1.5  
     1.6      /* PHASE 3 */
     1.7 -
     1.8      list_ent = d->page_list.next;
     1.9      for ( i = 0; (list_ent != &d->page_list); i++ )
    1.10      {
    1.11 @@ -2300,7 +2299,12 @@ void audit_domain(struct domain *d)
    1.12                  if ( pt[i] & _PAGE_PRESENT )
    1.13                  {
    1.14                      unsigned long l1pfn = pt[i]>>PAGE_SHIFT;
    1.15 -                    struct pfn_info *l1page = &frame_table[l1pfn];
    1.16 +                    struct pfn_info *l1page;
    1.17 +
    1.18 +                    if (l1pfn>max_page)
    1.19 +                        continue;
    1.20 +
    1.21 +                    l1page = &frame_table[l1pfn];
    1.22  
    1.23                      if ( l1page->u.inuse.domain == d)
    1.24                          adjust(l1page, 1, 1);
    1.25 @@ -2321,7 +2325,12 @@ void audit_domain(struct domain *d)
    1.26                  if ( pt[i] & _PAGE_PRESENT )
    1.27                  {
    1.28                      unsigned long l1pfn = pt[i]>>PAGE_SHIFT;
    1.29 -                    struct pfn_info *l1page = &frame_table[l1pfn];
    1.30 +                    struct pfn_info *l1page;
    1.31 +
    1.32 +                    if (l1pfn>max_page)
    1.33 +                        continue;
    1.34 +
    1.35 +                    l1page = &frame_table[l1pfn];
    1.36  
    1.37                      if ( (l1page->u.inuse.domain != d) ||
    1.38                           (l1pfn < 0x100) || (l1pfn > max_page) )