ia64/xen-unstable

changeset 18509:9ab9dadf4876

x86-64: enforce memory limits imposed by virtual memory layout

... which currently means:
- The 1:1 map cannot deal with more than 1Tb.
- The m2p table can handle at most 8Tb.
- The page_info array can cover up to e.g. 1.6Gb (<=3D 64 CPUs) or
1Tb (193-256 CPUs).

Signed-off-by: Jan Beulich <jbeulich@novell.com>
author Keir Fraser <keir.fraser@citrix.com>
date Tue Sep 16 15:57:22 2008 +0100 (2008-09-16)
parents 15efb62ecf09
children 7424f989fe01
files xen/arch/x86/e820.c
line diff
     1.1 --- a/xen/arch/x86/e820.c	Tue Sep 16 15:54:17 2008 +0100
     1.2 +++ b/xen/arch/x86/e820.c	Tue Sep 16 15:57:22 2008 +0100
     1.3 @@ -4,6 +4,7 @@
     1.4  #include <xen/compat.h>
     1.5  #include <xen/dmi.h>
     1.6  #include <asm/e820.h>
     1.7 +#include <asm/mm.h>
     1.8  #include <asm/page.h>
     1.9  
    1.10  /* opt_mem: Limit of physical RAM. Any RAM beyond this point is ignored. */
    1.11 @@ -327,7 +328,7 @@ static void __init clip_to_limit(uint64_
    1.12              continue;
    1.13          if ( warnmsg )
    1.14          {
    1.15 -            snprintf(_warnmsg, sizeof(_warnmsg), warnmsg, (int)(limit>>30));
    1.16 +            snprintf(_warnmsg, sizeof(_warnmsg), warnmsg, (long)(limit>>30));
    1.17              printk("WARNING: %s\n", _warnmsg);
    1.18          }
    1.19          printk("Truncating memory map to %lukB\n",
    1.20 @@ -366,8 +367,25 @@ static void __init machine_specific_memo
    1.21  
    1.22  #ifdef __i386__
    1.23      clip_to_limit((1ULL << 30) * MACHPHYS_MBYTES,
    1.24 -                  "Only the first %u GB of the physical memory map "
    1.25 +                  "Only the first %lu GB of the physical memory map "
    1.26                    "can be accessed by Xen in 32-bit mode.");
    1.27 +#else
    1.28 +    {
    1.29 +        unsigned long limit, mpt_limit, pft_limit;
    1.30 +
    1.31 +        limit = DIRECTMAP_VIRT_END - DIRECTMAP_VIRT_START;
    1.32 +        mpt_limit = ((RDWR_MPT_VIRT_END - RDWR_MPT_VIRT_START)
    1.33 +                     / sizeof(unsigned long)) << PAGE_SHIFT;
    1.34 +        pft_limit = ((FRAMETABLE_VIRT_END - FRAMETABLE_VIRT_START)
    1.35 +                     / sizeof(struct page_info)) << PAGE_SHIFT;
    1.36 +        if ( limit > mpt_limit )
    1.37 +            limit = mpt_limit;
    1.38 +        if ( limit > pft_limit )
    1.39 +            limit = pft_limit;
    1.40 +        clip_to_limit(limit,
    1.41 +                      "Only the first %lu GB of the physical "
    1.42 +                      "memory map can be accessed by Xen.");
    1.43 +    }
    1.44  #endif
    1.45  
    1.46      reserve_dmi_region();