ia64/xen-unstable

changeset 9772:ddcd9c267612

[IA64] Reseve memory of domain0 (fix dom0 boot panic)

Our patch fix domain0 boot panic on large memory system.
(e.g. amount of installed memory is 16GB)

Memory of domain0 is not reserved now.
Our patch can make this memory reserved.
And we clean up initrd_start of domain0.

Signed-off-by: Kouya Shimura <kouya@jp.fujitsu.com>
Signed-off-by: Akio Takebe <takebe_akio@jp.fujitsu.com>
author awilliam@xenbuild.aw
date Tue Apr 25 22:52:49 2006 -0600 (2006-04-25)
parents 9d88feed1189
children 9a915e2828f3
files xen/arch/ia64/linux-xen/setup.c xen/arch/ia64/xen/dom_fw.c xen/arch/ia64/xen/xensetup.c xen/include/asm-ia64/linux-xen/asm/README.origin xen/include/asm-ia64/linux-xen/asm/meminit.h xen/include/asm-ia64/linux/asm/README.origin xen/include/asm-ia64/linux/asm/meminit.h
line diff
     1.1 --- a/xen/arch/ia64/linux-xen/setup.c	Tue Apr 25 22:38:25 2006 -0600
     1.2 +++ b/xen/arch/ia64/linux-xen/setup.c	Tue Apr 25 22:52:49 2006 -0600
     1.3 @@ -235,7 +235,13 @@ reserve_memory (void)
     1.4  #endif
     1.5  	n++;
     1.6  
     1.7 -#ifdef CONFIG_BLK_DEV_INITRD
     1.8 +#ifdef XEN
     1.9 +	rsvd_region[n].start = (unsigned long) __va(ia64_boot_param->domain_start);
    1.10 +	rsvd_region[n].end   = (rsvd_region[n].start + ia64_boot_param->domain_size);
    1.11 +	n++;
    1.12 +#endif
    1.13 +
    1.14 +#if defined(XEN)||defined(CONFIG_BLK_DEV_INITRD)
    1.15  	if (ia64_boot_param->initrd_start) {
    1.16  		rsvd_region[n].start = (unsigned long)__va(ia64_boot_param->initrd_start);
    1.17  		rsvd_region[n].end   = rsvd_region[n].start + ia64_boot_param->initrd_size;
     2.1 --- a/xen/arch/ia64/xen/dom_fw.c	Tue Apr 25 22:38:25 2006 -0600
     2.2 +++ b/xen/arch/ia64/xen/dom_fw.c	Tue Apr 25 22:52:49 2006 -0600
     2.3 @@ -1019,8 +1019,7 @@ dom_fw_init (struct domain *d, const cha
     2.4  	if (d == dom0) {
     2.5  		// XXX CONFIG_XEN_IA64_DOM0_VP
     2.6  		// initrd_start address is hard coded in start_kernel()
     2.7 -		bp->initrd_start = (dom0_start+dom0_size) -
     2.8 -		  (PAGE_ALIGN(ia64_boot_param->initrd_size) + 4*1024*1024);
     2.9 +		bp->initrd_start = ia64_boot_param->initrd_start;
    2.10  		bp->initrd_size = ia64_boot_param->initrd_size;
    2.11  	}
    2.12  	else {
     3.1 --- a/xen/arch/ia64/xen/xensetup.c	Tue Apr 25 22:38:25 2006 -0600
     3.2 +++ b/xen/arch/ia64/xen/xensetup.c	Tue Apr 25 22:52:49 2006 -0600
     3.3 @@ -279,16 +279,17 @@ void start_kernel(void)
     3.4      memmove(__va(initial_images_start),
     3.5            __va(ia64_boot_param->domain_start),
     3.6            ia64_boot_param->domain_size);
     3.7 -//    ia64_boot_param->domain_start = initial_images_start;
     3.8 +    ia64_boot_param->domain_start = initial_images_start;
     3.9  
    3.10      printk("ready to move initrd to 0x%lx with len %lx...",
    3.11            initial_images_start+PAGE_ALIGN(ia64_boot_param->domain_size),
    3.12            ia64_boot_param->initrd_size);
    3.13      memmove(__va(initial_images_start+PAGE_ALIGN(ia64_boot_param->domain_size)),
    3.14 -
    3.15  	   __va(ia64_boot_param->initrd_start),
    3.16  	   ia64_boot_param->initrd_size);
    3.17      printk("Done\n");
    3.18 +    ia64_boot_param->initrd_start = initial_images_start +
    3.19 +	PAGE_ALIGN(ia64_boot_param->domain_size);
    3.20  
    3.21      /* first find highest page frame number */
    3.22      max_page = 0;
     4.1 --- a/xen/include/asm-ia64/linux-xen/asm/README.origin	Tue Apr 25 22:38:25 2006 -0600
     4.2 +++ b/xen/include/asm-ia64/linux-xen/asm/README.origin	Tue Apr 25 22:52:49 2006 -0600
     4.3 @@ -11,6 +11,7 @@ ia64regs.h		-> linux/include/asm-ia64/ia
     4.4  io.h			-> linux/include/asm-ia64/io.h
     4.5  kregs.h			-> linux/include/asm-ia64/kregs.h
     4.6  mca_asm.h		-> linux/include/asm-ia64/mca_asm.h
     4.7 +meminit.h		-> linux/include/asm-ia64/meminit.h
     4.8  page.h			-> linux/include/asm-ia64/page.h
     4.9  pal.h			-> linux/include/asm-ia64/pal.h
    4.10  pgalloc.h		-> linux/include/asm-ia64/pgalloc.h
     5.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     5.2 +++ b/xen/include/asm-ia64/linux-xen/asm/meminit.h	Tue Apr 25 22:52:49 2006 -0600
     5.3 @@ -0,0 +1,70 @@
     5.4 +#ifndef meminit_h
     5.5 +#define meminit_h
     5.6 +
     5.7 +/*
     5.8 + * This file is subject to the terms and conditions of the GNU General Public
     5.9 + * License.  See the file "COPYING" in the main directory of this archive
    5.10 + * for more details.
    5.11 + */
    5.12 +
    5.13 +#include <linux/config.h>
    5.14 +
    5.15 +/*
    5.16 + * Entries defined so far:
    5.17 + * 	- boot param structure itself
    5.18 + * 	- memory map
    5.19 +#ifndef XEN
    5.20 + * 	- initrd (optional)
    5.21 +#endif
    5.22 + * 	- command line string
    5.23 + * 	- kernel code & data
    5.24 +#ifdef XEN
    5.25 + * 	- dom0 code & data
    5.26 + * 	- initrd (optional)
    5.27 +#endif
    5.28 + *
    5.29 + * More could be added if necessary
    5.30 + */
    5.31 +#ifndef XEN
    5.32 +#define IA64_MAX_RSVD_REGIONS 5
    5.33 +#else
    5.34 +#define IA64_MAX_RSVD_REGIONS 6
    5.35 +#endif
    5.36 +
    5.37 +struct rsvd_region {
    5.38 +	unsigned long start;	/* virtual address of beginning of element */
    5.39 +	unsigned long end;	/* virtual address of end of element + 1 */
    5.40 +};
    5.41 +
    5.42 +extern struct rsvd_region rsvd_region[IA64_MAX_RSVD_REGIONS + 1];
    5.43 +extern int num_rsvd_regions;
    5.44 +
    5.45 +extern void find_memory (void);
    5.46 +extern void reserve_memory (void);
    5.47 +extern void find_initrd (void);
    5.48 +extern int filter_rsvd_memory (unsigned long start, unsigned long end, void *arg);
    5.49 +
    5.50 +/*
    5.51 + * For rounding an address to the next IA64_GRANULE_SIZE or order
    5.52 + */
    5.53 +#define GRANULEROUNDDOWN(n)	((n) & ~(IA64_GRANULE_SIZE-1))
    5.54 +#define GRANULEROUNDUP(n)	(((n)+IA64_GRANULE_SIZE-1) & ~(IA64_GRANULE_SIZE-1))
    5.55 +#define ORDERROUNDDOWN(n)	((n) & ~((PAGE_SIZE<<MAX_ORDER)-1))
    5.56 +
    5.57 +#ifdef CONFIG_DISCONTIGMEM
    5.58 +  extern void call_pernode_memory (unsigned long start, unsigned long len, void *func);
    5.59 +#else
    5.60 +# define call_pernode_memory(start, len, func)	(*func)(start, len, 0)
    5.61 +#endif
    5.62 +
    5.63 +#define IGNORE_PFN0	1	/* XXX fix me: ignore pfn 0 until TLB miss handler is updated... */
    5.64 +
    5.65 +#ifdef CONFIG_VIRTUAL_MEM_MAP
    5.66 +# define LARGE_GAP	0x40000000 /* Use virtual mem map if hole is > than this */
    5.67 +  extern unsigned long vmalloc_end;
    5.68 +  extern struct page *vmem_map;
    5.69 +  extern int find_largest_hole (u64 start, u64 end, void *arg);
    5.70 +  extern int create_mem_map_page_table (u64 start, u64 end, void *arg);
    5.71 +#endif
    5.72 +
    5.73 +#endif /* meminit_h */
     6.1 --- a/xen/include/asm-ia64/linux/asm/README.origin	Tue Apr 25 22:38:25 2006 -0600
     6.2 +++ b/xen/include/asm-ia64/linux/asm/README.origin	Tue Apr 25 22:52:49 2006 -0600
     6.3 @@ -27,7 +27,6 @@ linkage.h		-> linux/include/asm-ia64/lin
     6.4  machvec.h		-> linux/include/asm-ia64/machvec.h
     6.5  machvec_hpsim.h		-> linux/include/asm-ia64/machvec_hpsim.h
     6.6  mca.h			-> linux/include/asm-ia64/mca.h
     6.7 -meminit.h		-> linux/include/asm-ia64/meminit.h
     6.8  numa.h			-> linux/include/asm-ia64/numa.h
     6.9  numnodes.h		-> linux/include/asm-ia64/numnodes.h
    6.10  param.h			-> linux/include/asm-ia64/param.h
     7.1 --- a/xen/include/asm-ia64/linux/asm/meminit.h	Tue Apr 25 22:38:25 2006 -0600
     7.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     7.3 @@ -1,60 +0,0 @@
     7.4 -#ifndef meminit_h
     7.5 -#define meminit_h
     7.6 -
     7.7 -/*
     7.8 - * This file is subject to the terms and conditions of the GNU General Public
     7.9 - * License.  See the file "COPYING" in the main directory of this archive
    7.10 - * for more details.
    7.11 - */
    7.12 -
    7.13 -#include <linux/config.h>
    7.14 -
    7.15 -/*
    7.16 - * Entries defined so far:
    7.17 - * 	- boot param structure itself
    7.18 - * 	- memory map
    7.19 - * 	- initrd (optional)
    7.20 - * 	- command line string
    7.21 - * 	- kernel code & data
    7.22 - *
    7.23 - * More could be added if necessary
    7.24 - */
    7.25 -#define IA64_MAX_RSVD_REGIONS 5
    7.26 -
    7.27 -struct rsvd_region {
    7.28 -	unsigned long start;	/* virtual address of beginning of element */
    7.29 -	unsigned long end;	/* virtual address of end of element + 1 */
    7.30 -};
    7.31 -
    7.32 -extern struct rsvd_region rsvd_region[IA64_MAX_RSVD_REGIONS + 1];
    7.33 -extern int num_rsvd_regions;
    7.34 -
    7.35 -extern void find_memory (void);
    7.36 -extern void reserve_memory (void);
    7.37 -extern void find_initrd (void);
    7.38 -extern int filter_rsvd_memory (unsigned long start, unsigned long end, void *arg);
    7.39 -
    7.40 -/*
    7.41 - * For rounding an address to the next IA64_GRANULE_SIZE or order
    7.42 - */
    7.43 -#define GRANULEROUNDDOWN(n)	((n) & ~(IA64_GRANULE_SIZE-1))
    7.44 -#define GRANULEROUNDUP(n)	(((n)+IA64_GRANULE_SIZE-1) & ~(IA64_GRANULE_SIZE-1))
    7.45 -#define ORDERROUNDDOWN(n)	((n) & ~((PAGE_SIZE<<MAX_ORDER)-1))
    7.46 -
    7.47 -#ifdef CONFIG_DISCONTIGMEM
    7.48 -  extern void call_pernode_memory (unsigned long start, unsigned long len, void *func);
    7.49 -#else
    7.50 -# define call_pernode_memory(start, len, func)	(*func)(start, len, 0)
    7.51 -#endif
    7.52 -
    7.53 -#define IGNORE_PFN0	1	/* XXX fix me: ignore pfn 0 until TLB miss handler is updated... */
    7.54 -
    7.55 -#ifdef CONFIG_VIRTUAL_MEM_MAP
    7.56 -# define LARGE_GAP	0x40000000 /* Use virtual mem map if hole is > than this */
    7.57 -  extern unsigned long vmalloc_end;
    7.58 -  extern struct page *vmem_map;
    7.59 -  extern int find_largest_hole (u64 start, u64 end, void *arg);
    7.60 -  extern int create_mem_map_page_table (u64 start, u64 end, void *arg);
    7.61 -#endif
    7.62 -
    7.63 -#endif /* meminit_h */