ia64/xen-unstable

changeset 2046:37da92a66bd8

bitkeeper revision 1.1108.33.41 (410f5cae_2UrWZA0rcb91kIdTgrTFg)

Debug builds of Xen now reverse DOM0's address space, to trigger
those hard-to-find bugs.
author kaf24@scramble.cl.cam.ac.uk
date Tue Aug 03 09:36:46 2004 +0000 (2004-08-03)
parents 5f6716a0d4a5
children 4ab908608402 6bd1a212061d
files xen/arch/x86/domain.c
line diff
     1.1 --- a/xen/arch/x86/domain.c	Tue Aug 03 09:36:19 2004 +0000
     1.2 +++ b/xen/arch/x86/domain.c	Tue Aug 03 09:36:46 2004 +0000
     1.3 @@ -772,11 +772,14 @@ int construct_dom0(struct domain *p,
     1.4      si->mfn_list     = vphysmap_start;
     1.5  
     1.6      /* Write the phys->machine and machine->phys table entries. */
     1.7 -    for ( mfn = (alloc_start>>PAGE_SHIFT); 
     1.8 -          mfn < (alloc_end>>PAGE_SHIFT); 
     1.9 -          mfn++ )
    1.10 +    for ( pfn = 0; pfn < p->tot_pages; pfn++ )
    1.11      {
    1.12 -        pfn = mfn - (alloc_start>>PAGE_SHIFT);
    1.13 +        mfn = pfn + (alloc_start>>PAGE_SHIFT);
    1.14 +#ifndef NDEBUG
    1.15 +#define REVERSE_START ((v_end - v_start) >> PAGE_SHIFT)
    1.16 +        if ( pfn > REVERSE_START )
    1.17 +            mfn = (alloc_end>>PAGE_SHIFT) - (pfn - REVERSE_START);
    1.18 +#endif
    1.19          ((unsigned long *)vphysmap_start)[pfn] = mfn;
    1.20          machine_to_phys_mapping[mfn] = pfn;
    1.21      }