ia64/xen-unstable

changeset 683:6137a63f86c4

bitkeeper revision 1.398 (3f4f43e5cA3wYdxQVO2zbUFb51Fpew)

mm.c:
Fixes to descriptor-checking stuff.
author kaf24@scramble.cl.cam.ac.uk
date Fri Aug 29 12:15:33 2003 +0000 (2003-08-29)
parents 29c5d712802c
children fde23d1ba47e fa3fe148e5b9
files xen/arch/i386/mm.c
line diff
     1.1 --- a/xen/arch/i386/mm.c	Thu Aug 28 13:23:40 2003 +0000
     1.2 +++ b/xen/arch/i386/mm.c	Fri Aug 29 12:15:33 2003 +0000
     1.3 @@ -170,7 +170,7 @@ int check_descriptor(unsigned long a, un
     1.4      if ( (b & _SEGMENT_G) )
     1.5          limit <<= 12;
     1.6      if ( ((base + limit) <= base) || 
     1.7 -         ((base + limit) >= PAGE_OFFSET) )
     1.8 +         ((base + limit) > PAGE_OFFSET) )
     1.9          goto bad;
    1.10  
    1.11   good:
    1.12 @@ -183,7 +183,7 @@ int check_descriptor(unsigned long a, un
    1.13  long do_set_gdt(unsigned long *frame_list, unsigned int entries)
    1.14  {
    1.15      /* NB. There are 512 8-byte entries per GDT page. */
    1.16 -    unsigned int i, nr_pages = (entries + 511) / 512;
    1.17 +    unsigned int i, j, nr_pages = (entries + 511) / 512;
    1.18      unsigned long frames[16], pfn, *gdt_page, flags;
    1.19      long ret = -EINVAL;
    1.20      struct pfn_info *page;
    1.21 @@ -213,8 +213,8 @@ long do_set_gdt(unsigned long *frame_lis
    1.22  
    1.23              /* Check all potential GDT entries in the page. */
    1.24              gdt_page = map_domain_mem(frames[0] << PAGE_SHIFT);
    1.25 -            for ( i = 0; i < 512; i++ )
    1.26 -                if ( !check_descriptor(gdt_page[i*2], gdt_page[i*2+1]) )
    1.27 +            for ( j = 0; j < 512; j++ )
    1.28 +                if ( !check_descriptor(gdt_page[j*2], gdt_page[j*2+1]) )
    1.29                      goto out;
    1.30              unmap_domain_mem(gdt_page);
    1.31          }