ia64/xen-unstable

changeset 6042:69b7c9c3a9fd

Fix mach2phys table allocation for 32-bit PAE Xen.
Found by Gerd Knorr.
author kaf24@firebug.cl.cam.ac.uk
date Fri Aug 05 15:11:46 2005 +0000 (2005-08-05)
parents b63577ff53a3
children 0538ec1fe5b2
files xen/arch/x86/x86_32/mm.c
line diff
     1.1 --- a/xen/arch/x86/x86_32/mm.c	Fri Aug 05 14:57:43 2005 +0000
     1.2 +++ b/xen/arch/x86/x86_32/mm.c	Fri Aug 05 15:11:46 2005 +0000
     1.3 @@ -98,8 +98,10 @@ void __init paging_init(void)
     1.4       * installed, but at least 4MB to cover 4GB address space.  This is needed 
     1.5       * to make PCI I/O memory address lookups work in guests.
     1.6       */
     1.7 -    if ( (mpt_size = max_page * 4) < (4*1024*1024) )
     1.8 -        mpt_size = 4*1024*1024;
     1.9 +    mpt_size  = (max_page * 4) + (1UL << L2_PAGETABLE_SHIFT) - 1UL;
    1.10 +    mpt_size &= ~((1UL << L2_PAGETABLE_SHIFT) - 1UL);
    1.11 +    if ( mpt_size < (4 << 20) )
    1.12 +        mpt_size = 4 << 20;
    1.13      for ( i = 0; i < (mpt_size >> L2_PAGETABLE_SHIFT); i++ )
    1.14      {
    1.15          if ( (pg = alloc_domheap_pages(NULL, PAGETABLE_ORDER, 0)) == NULL )