ia64/xen-unstable

changeset 9270:9c0123c8a1b4

[IA64] use of max_addr= & command line

Use 'max_addr' option to limit the amount of physical memory. The
default is 4G (the same as the previous hard limit). The hard-coded
limit is removed. dom0_command_line now contains the cmdline for
dom0 linux. saved_command_line now contains the cmdline for Xen (it
is used in Xen).

Signed-off-by: Tristan Gingold <tristan.gingold@bull.net>
author awilliam@xenbuild.aw
date Thu Mar 16 12:06:48 2006 -0700 (2006-03-16)
parents edbfa36f2451
children d75f733f328c
files xen/arch/ia64/linux-xen/efi.c xen/arch/ia64/linux-xen/setup.c xen/arch/ia64/xen/domain.c xen/arch/ia64/xen/xensetup.c
line diff
     1.1 --- a/xen/arch/ia64/linux-xen/efi.c	Thu Mar 16 12:02:39 2006 -0700
     1.2 +++ b/xen/arch/ia64/linux-xen/efi.c	Thu Mar 16 12:06:48 2006 -0700
     1.3 @@ -42,7 +42,12 @@ extern unsigned long long memparse (char
     1.4  struct efi efi;
     1.5  EXPORT_SYMBOL(efi);
     1.6  static efi_runtime_services_t *runtime;
     1.7 +#ifdef XEN
     1.8 +// this is a temporary hack to avoid CONFIG_VIRTUAL_MEM_MAP
     1.9 +static unsigned long mem_limit = ~0UL, max_addr = 0x100000000;
    1.10 +#else
    1.11  static unsigned long mem_limit = ~0UL, max_addr = ~0UL;
    1.12 +#endif
    1.13  
    1.14  #define efi_call_virt(f, args...)	(*(f))(args)
    1.15  
    1.16 @@ -329,8 +334,6 @@ efi_memmap_walk (efi_freemem_callback_t 
    1.17  		if (running_on_sim && md->type != EFI_CONVENTIONAL_MEMORY)
    1.18  			continue;
    1.19  }
    1.20 -// this is a temporary hack to avoid CONFIG_VIRTUAL_MEM_MAP
    1.21 -		if (md->phys_addr >= 0x100000000) continue;
    1.22  #endif
    1.23  		/*
    1.24  		 * granule_addr is the base of md's first granule.
     2.1 --- a/xen/arch/ia64/linux-xen/setup.c	Thu Mar 16 12:02:39 2006 -0700
     2.2 +++ b/xen/arch/ia64/linux-xen/setup.c	Thu Mar 16 12:06:48 2006 -0700
     2.3 @@ -384,6 +384,9 @@ setup_arch (char **cmdline_p)
     2.4  	*cmdline_p = __va(ia64_boot_param->command_line);
     2.5  #ifndef XEN
     2.6  	strlcpy(saved_command_line, *cmdline_p, COMMAND_LINE_SIZE);
     2.7 +#else
     2.8 +	early_cmdline_parse(cmdline_p);
     2.9 +	cmdline_parse(*cmdline_p);
    2.10  #endif
    2.11  
    2.12  	efi_init();
    2.13 @@ -414,10 +417,6 @@ setup_arch (char **cmdline_p)
    2.14  	}
    2.15  #endif
    2.16  
    2.17 -#ifdef XEN
    2.18 -	early_cmdline_parse(cmdline_p);
    2.19 -	cmdline_parse(*cmdline_p);
    2.20 -#endif
    2.21  	if (early_console_setup(*cmdline_p) == 0)
    2.22  		mark_bsp_online();
    2.23  
     3.1 --- a/xen/arch/ia64/xen/domain.c	Thu Mar 16 12:02:39 2006 -0700
     3.2 +++ b/xen/arch/ia64/xen/domain.c	Thu Mar 16 12:06:48 2006 -0700
     3.3 @@ -26,6 +26,7 @@
     3.4  #include <asm/processor.h>
     3.5  #include <asm/desc.h>
     3.6  #include <asm/hw_irq.h>
     3.7 +#include <asm/setup.h>
     3.8  //#include <asm/mpspec.h>
     3.9  #include <xen/irq.h>
    3.10  #include <xen/event.h>
    3.11 @@ -36,7 +37,6 @@
    3.12  #include <xen/elf.h>
    3.13  //#include <asm/page.h>
    3.14  #include <asm/pgalloc.h>
    3.15 -#include <asm/dma.h>	/* for MAX_DMA_ADDRESS */
    3.16  
    3.17  #include <asm/asm-offsets.h>  /* for IA64_THREAD_INFO_SIZE */
    3.18  
    3.19 @@ -49,6 +49,7 @@
    3.20  #include <asm/pal.h>
    3.21  #include <asm/vhpt.h>
    3.22  #include <public/hvm/ioreq.h>
    3.23 +#include <public/arch-ia64.h>
    3.24  #include <asm/tlbflush.h>
    3.25  #include <asm/regionreg.h>
    3.26  
    3.27 @@ -415,7 +416,7 @@ void new_thread(struct vcpu *v,
    3.28  {
    3.29  	struct domain *d = v->domain;
    3.30  	struct pt_regs *regs;
    3.31 -	extern char saved_command_line[];
    3.32 +	extern char dom0_command_line[];
    3.33  
    3.34  #ifdef CONFIG_DOMAIN0_CONTIGUOUS
    3.35  	if (d == dom0) start_pc += dom0_start;
    3.36 @@ -439,24 +440,27 @@ void new_thread(struct vcpu *v,
    3.37  	if (VMX_DOMAIN(v)) {
    3.38  		vmx_init_all_rr(v);
    3.39  		if (d == dom0)
    3.40 -//		    VCPU(v,vgr[12]) = dom_fw_setup(d,saved_command_line,256L);
    3.41 -		    regs->r28 = dom_fw_setup(d,saved_command_line,256L);
    3.42 +		    regs->r28 = dom_fw_setup(d,dom0_command_line,
    3.43 +					     COMMAND_LINE_SIZE);
    3.44  		/* Virtual processor context setup */
    3.45  		VCPU(v, vpsr) = IA64_PSR_BN;
    3.46  		VCPU(v, dcr) = 0;
    3.47  	} else {
    3.48  		init_all_rr(v);
    3.49  		if (d == dom0) 
    3.50 -		    regs->r28 = dom_fw_setup(d,saved_command_line,256L);
    3.51 +		    regs->r28 = dom_fw_setup(d,dom0_command_line,
    3.52 +					     COMMAND_LINE_SIZE);
    3.53  		else {
    3.54  		    regs->ar_rsc |= (2 << 2); /* force PL2/3 */
    3.55  		    if (*d->arch.cmdline == '\0') {
    3.56  #define DEFAULT_CMDLINE "nomca nosmp xencons=tty0 console=tty0 root=/dev/hda1"
    3.57 -			regs->r28 = dom_fw_setup(d,DEFAULT_CMDLINE,256L);
    3.58 +			regs->r28 = dom_fw_setup(d,DEFAULT_CMDLINE,
    3.59 +						 sizeof (DEFAULT_CMDLINE));
    3.60  			printf("domU command line defaulted to"
    3.61  				DEFAULT_CMDLINE "\n");
    3.62  		    }
    3.63 -		    else regs->r28 = dom_fw_setup(d,d->arch.cmdline,256L);
    3.64 +		    else regs->r28 = dom_fw_setup(d,d->arch.cmdline, 
    3.65 +						  IA64_COMMAND_LINE_SIZE);
    3.66  		}
    3.67  		VCPU(v, banknum) = 1;
    3.68  		VCPU(v, metaphysical_mode) = 1;
    3.69 @@ -645,12 +649,13 @@ unsigned long lookup_domain_mpa(struct d
    3.70  
    3.71  #ifdef CONFIG_DOMAIN0_CONTIGUOUS
    3.72  	if (d == dom0) {
    3.73 +		pte_t pteval;
    3.74  		if (mpaddr < dom0_start || mpaddr >= dom0_start + dom0_size) {
    3.75  			//printk("lookup_domain_mpa: bad dom0 mpaddr 0x%lx!\n",mpaddr);
    3.76  			//printk("lookup_domain_mpa: start=0x%lx,end=0x%lx!\n",dom0_start,dom0_start+dom0_size);
    3.77  			mpafoo(mpaddr);
    3.78  		}
    3.79 -		pte_t pteval = pfn_pte(mpaddr >> PAGE_SHIFT,
    3.80 +		pteval = pfn_pte(mpaddr >> PAGE_SHIFT,
    3.81  			__pgprot(__DIRTY_BITS | _PAGE_PL_2 | _PAGE_AR_RWX));
    3.82  		pte = &pteval;
    3.83  		return *(unsigned long *)pte;
     4.1 --- a/xen/arch/ia64/xen/xensetup.c	Thu Mar 16 12:02:39 2006 -0700
     4.2 +++ b/xen/arch/ia64/xen/xensetup.c	Thu Mar 16 12:06:48 2006 -0700
     4.3 @@ -27,6 +27,7 @@
     4.4  unsigned long xenheap_phys_end;
     4.5  
     4.6  char saved_command_line[COMMAND_LINE_SIZE];
     4.7 +char dom0_command_line[COMMAND_LINE_SIZE];
     4.8  
     4.9  struct vcpu *idle_vcpu[NR_CPUS];
    4.10  
    4.11 @@ -119,11 +120,12 @@ static char null[4] = { 0 };
    4.12  void early_cmdline_parse(char **cmdline_p)
    4.13  {
    4.14      char *guest_cmd;
    4.15 -    char *split = "--";
    4.16 +    static const char * const split = "--";
    4.17  
    4.18      if (*cmdline_p == NULL) {
    4.19  	*cmdline_p = &null[0];
    4.20  	saved_command_line[0] = '\0';
    4.21 +	dom0_command_line[0] = '\0';
    4.22  	return;
    4.23      }
    4.24  
    4.25 @@ -138,7 +140,8 @@ void early_cmdline_parse(char **cmdline_
    4.26  	while (*guest_cmd == ' ') guest_cmd++;
    4.27      }
    4.28  
    4.29 -    strlcpy(saved_command_line, guest_cmd, COMMAND_LINE_SIZE);
    4.30 +    strlcpy(saved_command_line, *cmdline_p, COMMAND_LINE_SIZE);
    4.31 +    strlcpy(dom0_command_line, guest_cmd, COMMAND_LINE_SIZE);
    4.32      return;
    4.33  }
    4.34