ia64/xen-unstable

changeset 3713:b37e9180a101

bitkeeper revision 1.1159.212.124 (42082d88aeY4pFTDqfgHMrvhse0-PA)

Fix to memory debugging audit code.

Signed-off-by: ian@xensource.com
author iap10@labyrinth.cl.cam.ac.uk
date Tue Feb 08 03:10:00 2005 +0000 (2005-02-08)
parents 0703289cadc8
children a95bb5c8b8be
files xen/arch/x86/memory.c
line diff
     1.1 --- a/xen/arch/x86/memory.c	Tue Feb 08 02:12:21 2005 +0000
     1.2 +++ b/xen/arch/x86/memory.c	Tue Feb 08 03:10:00 2005 +0000
     1.3 @@ -2313,7 +2313,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 @@ -2334,7 +2333,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 ( page_get_owner(l1page) == d )
    1.24                          adjust(l1page, 1, 1);
    1.25 @@ -2355,7 +2359,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 ( (page_get_owner(l1page) != d) ||
    1.38                           (l1pfn < 0x100) || (l1pfn > max_page) )