ia64/xen-unstable

changeset 4197:b786214604fd

bitkeeper revision 1.1236.31.7 (423a2555c55pAD5hNwWY6wV2-lsKfg)

Fix timer tick before its due problem (again)
Split out hypercall code into separate module
First step implementation of domain creation via hypercall
author djm@kirby.fc.hp.com
date Fri Mar 18 00:48:21 2005 +0000 (2005-03-18)
parents c7589ea2a4c0
children 2f89618be8d4
files .rootkeys xen/arch/ia64/Makefile xen/arch/ia64/domain.c xen/arch/ia64/hypercall.c xen/arch/ia64/process.c xen/arch/ia64/vcpu.c xen/arch/ia64/xensetup.c xen/include/public/arch-ia64.h
line diff
     1.1 --- a/.rootkeys	Thu Mar 17 00:47:40 2005 +0000
     1.2 +++ b/.rootkeys	Fri Mar 18 00:48:21 2005 +0000
     1.3 @@ -895,6 +895,7 @@ 421098b26C_0yoypoHqjDcJA9UrG_g xen/arch/
     1.4  421098b2PHgzf_Gg4R65YRNi_QzMKQ xen/arch/ia64/dom0_ops.c
     1.5  421098b2O7jsNfzQXA1v3rbAc1QhpA xen/arch/ia64/dom_fw.c
     1.6  421098b2ZlaBcyiuuPr3WpzaSDwg6Q xen/arch/ia64/domain.c
     1.7 +4239e98a_HX-FCIcXtVqY0BbrDqVug xen/arch/ia64/hypercall.c
     1.8  421098b3LYAS8xJkQiGP7tiTlyBt0Q xen/arch/ia64/idle0_task.c
     1.9  421098b3ys5GAr4z6_H1jD33oem82g xen/arch/ia64/irq.c
    1.10  421098b3Heh72KuoVlND3CH6c0B0aA xen/arch/ia64/lib/Makefile
     2.1 --- a/xen/arch/ia64/Makefile	Thu Mar 17 00:47:40 2005 +0000
     2.2 +++ b/xen/arch/ia64/Makefile	Fri Mar 18 00:48:21 2005 +0000
     2.3 @@ -3,7 +3,7 @@ include $(BASEDIR)/Rules.mk
     2.4  # libs-y	+= arch/ia64/lib/lib.a
     2.5  
     2.6  OBJS = xensetup.o setup.o time.o irq.o ia64_ksyms.o process.o smp.o \
     2.7 -	xenmisc.o pdb-stub.o acpi.o \
     2.8 +	xenmisc.o pdb-stub.o acpi.o hypercall.o \
     2.9  	machvec.o dom0_ops.o domain.o \
    2.10  	idle0_task.o pal.o hpsim.o efi.o efi_stub.o ivt.o mm_contig.o \
    2.11  	mm_bootmem.o sal.o cmdline.o mm_init.o tlb.o page_alloc.o slab.o \
     3.1 --- a/xen/arch/ia64/domain.c	Thu Mar 17 00:47:40 2005 +0000
     3.2 +++ b/xen/arch/ia64/domain.c	Fri Mar 18 00:48:21 2005 +0000
     3.3 @@ -44,9 +44,11 @@ extern kmem_cache_t *domain_struct_cache
     3.4  // initialized by arch/ia64/setup.c:find_initrd()
     3.5  unsigned long initrd_start = 0, initrd_end = 0;
     3.6  
     3.7 +#define IS_XEN_ADDRESS(d,a) ((a >= d->xen_vastart) && (a <= d->xen_vaend))
     3.8 +
     3.9  extern int loadelfimage(char *);
    3.10  extern int readelfimage_base_and_size(char *, unsigned long,
    3.11 -                  unsigned long *, unsigned long *, unsigned long *);
    3.12 +	              unsigned long *, unsigned long *, unsigned long *);
    3.13  
    3.14  unsigned long map_domain_page0(struct domain *);
    3.15  extern unsigned long dom_fw_setup(struct domain *, char *, int);
    3.16 @@ -54,63 +56,63 @@ extern unsigned long dom_fw_setup(struct
    3.17  /* this belongs in include/asm, but there doesn't seem to be a suitable place */
    3.18  void free_perdomain_pt(struct domain *d)
    3.19  {
    3.20 -    dummy();
    3.21 -    //free_page((unsigned long)d->mm.perdomain_pt);
    3.22 +	dummy();
    3.23 +	//free_page((unsigned long)d->mm.perdomain_pt);
    3.24  }
    3.25  
    3.26  int hlt_counter;
    3.27  
    3.28  void disable_hlt(void)
    3.29  {
    3.30 -    hlt_counter++;
    3.31 +	hlt_counter++;
    3.32  }
    3.33  
    3.34  void enable_hlt(void)
    3.35  {
    3.36 -    hlt_counter--;
    3.37 +	hlt_counter--;
    3.38  }
    3.39  
    3.40  static void default_idle(void)
    3.41  {
    3.42 -    if ( hlt_counter == 0 )
    3.43 -    {
    3.44 +	if ( hlt_counter == 0 )
    3.45 +	{
    3.46  	local_irq_disable();
    3.47 -        if ( !softirq_pending(smp_processor_id()) )
    3.48 -            safe_halt();
    3.49 -        //else
    3.50 +	    if ( !softirq_pending(smp_processor_id()) )
    3.51 +	        safe_halt();
    3.52 +	    //else
    3.53  		local_irq_enable();
    3.54 -    }
    3.55 +	}
    3.56  }
    3.57  
    3.58  void continue_cpu_idle_loop(void)
    3.59  {
    3.60 -    int cpu = smp_processor_id();
    3.61 -    for ( ; ; )
    3.62 -    {
    3.63 +	int cpu = smp_processor_id();
    3.64 +	for ( ; ; )
    3.65 +	{
    3.66  #ifdef IA64
    3.67  //        __IRQ_STAT(cpu, idle_timestamp) = jiffies
    3.68  #else
    3.69 -        irq_stat[cpu].idle_timestamp = jiffies;
    3.70 +	    irq_stat[cpu].idle_timestamp = jiffies;
    3.71  #endif
    3.72 -        while ( !softirq_pending(cpu) )
    3.73 -            default_idle();
    3.74 -        do_softirq();
    3.75 -    }
    3.76 +	    while ( !softirq_pending(cpu) )
    3.77 +	        default_idle();
    3.78 +	    do_softirq();
    3.79 +	}
    3.80  }
    3.81  
    3.82  void startup_cpu_idle_loop(void)
    3.83  {
    3.84 -    /* Just some sanity to ensure that the scheduler is set up okay. */
    3.85 -    ASSERT(current->domain == IDLE_DOMAIN_ID);
    3.86 -    domain_unpause_by_systemcontroller(current->domain);
    3.87 -    __enter_scheduler();
    3.88 +	/* Just some sanity to ensure that the scheduler is set up okay. */
    3.89 +	ASSERT(current->domain == IDLE_DOMAIN_ID);
    3.90 +	domain_unpause_by_systemcontroller(current->domain);
    3.91 +	__enter_scheduler();
    3.92  
    3.93 -    /*
    3.94 -     * Declares CPU setup done to the boot processor.
    3.95 -     * Therefore memory barrier to ensure state is visible.
    3.96 -     */
    3.97 -    smp_mb();
    3.98 -    init_idle();
    3.99 +	/*
   3.100 +	 * Declares CPU setup done to the boot processor.
   3.101 +	 * Therefore memory barrier to ensure state is visible.
   3.102 +	 */
   3.103 +	smp_mb();
   3.104 +	init_idle();
   3.105  #if 0
   3.106  //do we have to ensure the idle task has a shared page so that, for example,
   3.107  //region registers can be loaded from it.  Apparently not...
   3.108 @@ -129,7 +131,7 @@ void startup_cpu_idle_loop(void)
   3.109  	}
   3.110  #endif
   3.111  
   3.112 -    continue_cpu_idle_loop();
   3.113 +	continue_cpu_idle_loop();
   3.114  }
   3.115  
   3.116  struct domain *arch_alloc_domain_struct(void)
   3.117 @@ -214,9 +216,9 @@ void domain_relinquish_memory(struct dom
   3.118  // heavily leveraged from linux/arch/ia64/kernel/process.c:copy_thread()
   3.119  // and linux/arch/ia64/kernel/process.c:kernel_thread()
   3.120  void new_thread(struct exec_domain *ed,
   3.121 -                unsigned long start_pc,
   3.122 -                unsigned long start_stack,
   3.123 -                unsigned long start_info)
   3.124 +	            unsigned long start_pc,
   3.125 +	            unsigned long start_stack,
   3.126 +	            unsigned long start_info)
   3.127  {
   3.128  	struct domain *d = ed->domain;
   3.129  	struct switch_stack *sw;
   3.130 @@ -393,24 +395,38 @@ int elf_sanity_check(Elf_Ehdr *ehdr)
   3.131  	return (IS_ELF(*ehdr));
   3.132  }
   3.133  
   3.134 +static void copy_memory(void *dst, void *src, int size)
   3.135 +{
   3.136 +	if (IS_XEN_ADDRESS(dom0,src)) {
   3.137 +		memcpy(dst,src,size);
   3.138 +	}
   3.139 +	else {
   3.140 +		if (__copy_from_user(dst,src,size))
   3.141 +			printf("incomplete user copy\n");
   3.142 +	}
   3.143 +}
   3.144 +
   3.145  void loaddomainelfimage(struct domain *d, unsigned long image_start)
   3.146  {
   3.147 -    char *elfbase = image_start;
   3.148 -    Elf_Ehdr *ehdr = (Elf_Ehdr *)image_start;
   3.149 -    Elf_Phdr *phdr;
   3.150 -    int h, filesz, memsz, paddr;
   3.151 -    unsigned long elfaddr, dom_mpaddr, dom_imva;
   3.152 -    struct page *p;
   3.153 +	char *elfbase = image_start;
   3.154 +	//Elf_Ehdr *ehdr = (Elf_Ehdr *)image_start;
   3.155 +	Elf_Ehdr ehdr;
   3.156 +	Elf_Phdr phdr;
   3.157 +	int h, filesz, memsz, paddr;
   3.158 +	unsigned long elfaddr, dom_mpaddr, dom_imva;
   3.159 +	struct page *p;
   3.160    
   3.161 -    for ( h = 0; h < ehdr->e_phnum; h++ ) {
   3.162 -        phdr = (Elf_Phdr *)(elfbase + ehdr->e_phoff + (h*ehdr->e_phentsize));
   3.163 -        //if ( !is_loadable_phdr(phdr) )
   3.164 -        if ((phdr->p_type != PT_LOAD)) {
   3.165 -            continue;
   3.166 +	copy_memory(&ehdr,image_start,sizeof(Elf_Ehdr));
   3.167 +	for ( h = 0; h < ehdr.e_phnum; h++ ) {
   3.168 +		copy_memory(&phdr,elfbase + ehdr.e_phoff + (h*ehdr.e_phentsize),
   3.169 +		sizeof(Elf_Phdr));
   3.170 +	    //if ( !is_loadable_phdr(phdr) )
   3.171 +	    if ((phdr.p_type != PT_LOAD)) {
   3.172 +	        continue;
   3.173  	}
   3.174 -	filesz = phdr->p_filesz; memsz = phdr->p_memsz;
   3.175 -	elfaddr = elfbase + phdr->p_offset;
   3.176 -	dom_mpaddr = phdr->p_paddr;
   3.177 +	filesz = phdr.p_filesz; memsz = phdr.p_memsz;
   3.178 +	elfaddr = elfbase + phdr.p_offset;
   3.179 +	dom_mpaddr = phdr.p_paddr;
   3.180  //printf("p_offset: %x, size=%x\n",elfaddr,filesz);
   3.181  #ifdef CONFIG_DOMAIN0_CONTIGUOUS
   3.182  	if (d == dom0) {
   3.183 @@ -419,10 +435,10 @@ void loaddomainelfimage(struct domain *d
   3.184  			while(1);
   3.185  		}
   3.186  		dom_imva = __va(dom_mpaddr + dom0_start);
   3.187 -		memcpy(dom_imva,elfaddr,filesz);
   3.188 +		copy_memory(dom_imva,elfaddr,filesz);
   3.189  		if (memsz > filesz) memset(dom_imva+filesz,0,memsz-filesz);
   3.190  //FIXME: This test for code seems to find a lot more than objdump -x does
   3.191 -		if (phdr->p_flags & PF_X) privify_memory(dom_imva,filesz);
   3.192 +		if (phdr.p_flags & PF_X) privify_memory(dom_imva,filesz);
   3.193  	}
   3.194  	else
   3.195  #endif
   3.196 @@ -432,13 +448,13 @@ void loaddomainelfimage(struct domain *d
   3.197  		dom_imva = __va(page_to_phys(p));
   3.198  		if (filesz > 0) {
   3.199  			if (filesz >= PAGE_SIZE)
   3.200 -				memcpy(dom_imva,elfaddr,PAGE_SIZE);
   3.201 +				copy_memory(dom_imva,elfaddr,PAGE_SIZE);
   3.202  			else { // copy partial page, zero the rest of page
   3.203 -				memcpy(dom_imva,elfaddr,filesz);
   3.204 +				copy_memory(dom_imva,elfaddr,filesz);
   3.205  				memset(dom_imva+filesz,0,PAGE_SIZE-filesz);
   3.206  			}
   3.207  //FIXME: This test for code seems to find a lot more than objdump -x does
   3.208 -			if (phdr->p_flags & PF_X)
   3.209 +			if (phdr.p_flags & PF_X)
   3.210  				privify_memory(dom_imva,PAGE_SIZE);
   3.211  		}
   3.212  		else if (memsz > 0) // always zero out entire page
   3.213 @@ -446,66 +462,102 @@ void loaddomainelfimage(struct domain *d
   3.214  		memsz -= PAGE_SIZE; filesz -= PAGE_SIZE;
   3.215  		elfaddr += PAGE_SIZE; dom_mpaddr += PAGE_SIZE;
   3.216  	}
   3.217 -    }
   3.218 +	}
   3.219 +}
   3.220 +
   3.221 +int
   3.222 +parsedomainelfimage(char *elfbase, unsigned long elfsize, unsigned long *entry)
   3.223 +{
   3.224 +	Elf_Ehdr ehdr;
   3.225 +
   3.226 +	copy_memory(&ehdr,elfbase,sizeof(Elf_Ehdr));
   3.227 +
   3.228 +	if ( !elf_sanity_check(&ehdr) ) {
   3.229 +	    printk("ELF sanity check failed.\n");
   3.230 +	    return -EINVAL;
   3.231 +	}
   3.232 +
   3.233 +	if ( (ehdr.e_phoff + (ehdr.e_phnum * ehdr.e_phentsize)) > elfsize )
   3.234 +	{
   3.235 +	    printk("ELF program headers extend beyond end of image.\n");
   3.236 +	    return -EINVAL;
   3.237 +	}
   3.238 +
   3.239 +	if ( (ehdr.e_shoff + (ehdr.e_shnum * ehdr.e_shentsize)) > elfsize )
   3.240 +	{
   3.241 +	    printk("ELF section headers extend beyond end of image.\n");
   3.242 +	    return -EINVAL;
   3.243 +	}
   3.244 +
   3.245 +	/* Find the section-header strings table. */
   3.246 +	if ( ehdr.e_shstrndx == SHN_UNDEF )
   3.247 +	{
   3.248 +	    printk("ELF image has no section-header strings table (shstrtab).\n");
   3.249 +	    return -EINVAL;
   3.250 +	}
   3.251 +
   3.252 +	*entry = ehdr.e_entry;
   3.253 +
   3.254 +	return 0;
   3.255  }
   3.256  
   3.257  
   3.258  void alloc_dom0(void)
   3.259  {
   3.260  #ifdef CONFIG_DOMAIN0_CONTIGUOUS
   3.261 -    if (platform_is_hp_ski()) {
   3.262 +	if (platform_is_hp_ski()) {
   3.263  	dom0_size = 128*1024*1024; //FIXME: Should be configurable
   3.264 -    }
   3.265 -    printf("alloc_dom0: starting (initializing %d MB...)\n",dom0_size/(1024*1024));
   3.266 -    dom0_start = __alloc_bootmem(dom0_size,dom0_align,__pa(MAX_DMA_ADDRESS));
   3.267 -    if (!dom0_start) {
   3.268 +	}
   3.269 +	printf("alloc_dom0: starting (initializing %d MB...)\n",dom0_size/(1024*1024));
   3.270 +	dom0_start = __alloc_bootmem(dom0_size,dom0_align,__pa(MAX_DMA_ADDRESS));
   3.271 +	if (!dom0_start) {
   3.272  	printf("construct_dom0: can't allocate contiguous memory size=%p\n",
   3.273  		dom0_size);
   3.274  	while(1);
   3.275 -    }
   3.276 -    printf("alloc_dom0: dom0_start=%p\n",dom0_start);
   3.277 +	}
   3.278 +	printf("alloc_dom0: dom0_start=%p\n",dom0_start);
   3.279  #else
   3.280 -    dom0_start = 0;
   3.281 +	dom0_start = 0;
   3.282  #endif
   3.283  
   3.284  }
   3.285  
   3.286  int construct_dom0(struct domain *d, 
   3.287 -                   unsigned long image_start, unsigned long image_len, 
   3.288 -                   unsigned long initrd_start, unsigned long initrd_len,
   3.289 -                   char *cmdline)
   3.290 +	               unsigned long image_start, unsigned long image_len, 
   3.291 +	               unsigned long initrd_start, unsigned long initrd_len,
   3.292 +	               char *cmdline)
   3.293  {
   3.294 -    char *dst;
   3.295 -    int i, rc;
   3.296 -    unsigned long pfn, mfn;
   3.297 -    unsigned long nr_pt_pages;
   3.298 -    unsigned long count;
   3.299 -    //l2_pgentry_t *l2tab, *l2start;
   3.300 -    //l1_pgentry_t *l1tab = NULL, *l1start = NULL;
   3.301 -    struct pfn_info *page = NULL;
   3.302 -    start_info_t *si;
   3.303 -    struct exec_domain *ed = d->exec_domain[0];
   3.304 +	char *dst;
   3.305 +	int i, rc;
   3.306 +	unsigned long pfn, mfn;
   3.307 +	unsigned long nr_pt_pages;
   3.308 +	unsigned long count;
   3.309 +	//l2_pgentry_t *l2tab, *l2start;
   3.310 +	//l1_pgentry_t *l1tab = NULL, *l1start = NULL;
   3.311 +	struct pfn_info *page = NULL;
   3.312 +	start_info_t *si;
   3.313 +	struct exec_domain *ed = d->exec_domain[0];
   3.314  
   3.315 -    struct domain_setup_info dsi;
   3.316 -    unsigned long p_start;
   3.317 -    unsigned long pkern_start;
   3.318 -    unsigned long pkern_entry;
   3.319 -    unsigned long pkern_end;
   3.320 +	struct domain_setup_info dsi;
   3.321 +	unsigned long p_start;
   3.322 +	unsigned long pkern_start;
   3.323 +	unsigned long pkern_entry;
   3.324 +	unsigned long pkern_end;
   3.325  
   3.326 -    extern void physdev_init_dom0(struct domain *);
   3.327 +	extern void physdev_init_dom0(struct domain *);
   3.328  
   3.329  //printf("construct_dom0: starting\n");
   3.330 -    /* Sanity! */
   3.331 +	/* Sanity! */
   3.332  #ifndef CLONE_DOMAIN0
   3.333 -    if ( d != dom0 ) 
   3.334 -        BUG();
   3.335 -    if ( test_bit(DF_CONSTRUCTED, &d->d_flags) ) 
   3.336 -        BUG();
   3.337 +	if ( d != dom0 ) 
   3.338 +	    BUG();
   3.339 +	if ( test_bit(DF_CONSTRUCTED, &d->d_flags) ) 
   3.340 +	    BUG();
   3.341  #endif
   3.342  
   3.343 -    memset(&dsi, 0, sizeof(struct domain_setup_info));
   3.344 +	memset(&dsi, 0, sizeof(struct domain_setup_info));
   3.345  
   3.346 -    printk("*** LOADING DOMAIN 0 ***\n");
   3.347 +	printk("*** LOADING DOMAIN 0 ***\n");
   3.348  
   3.349  	d->max_pages = dom0_size/PAGE_SIZE;
   3.350  	image_start = __va(ia64_boot_param->initrd_start);
   3.351 @@ -514,139 +566,211 @@ int construct_dom0(struct domain *d,
   3.352  //printk("First word of image: %lx\n",*(unsigned long *)image_start);
   3.353  
   3.354  //printf("construct_dom0: about to call parseelfimage\n");
   3.355 -    rc = parseelfimage(image_start, image_len, &dsi);
   3.356 -    if ( rc != 0 )
   3.357 -        return rc;
   3.358 +	rc = parseelfimage(image_start, image_len, &dsi);
   3.359 +	if ( rc != 0 )
   3.360 +	    return rc;
   3.361  
   3.362 -    p_start = dsi.v_start;
   3.363 -    pkern_start = dsi.v_kernstart;
   3.364 -    pkern_end = dsi.v_kernend;
   3.365 -    pkern_entry = dsi.v_kernentry;
   3.366 +	p_start = dsi.v_start;
   3.367 +	pkern_start = dsi.v_kernstart;
   3.368 +	pkern_end = dsi.v_kernend;
   3.369 +	pkern_entry = dsi.v_kernentry;
   3.370  
   3.371  //printk("p_start=%lx, pkern_start=%lx, pkern_end=%lx, pkern_entry=%lx\n",p_start,pkern_start,pkern_end,pkern_entry);
   3.372  
   3.373 -    if ( (p_start & (PAGE_SIZE-1)) != 0 )
   3.374 -    {
   3.375 -        printk("Initial guest OS must load to a page boundary.\n");
   3.376 -        return -EINVAL;
   3.377 -    }
   3.378 -
   3.379 -    printk("METAPHYSICAL MEMORY ARRANGEMENT:\n"
   3.380 -           " Kernel image:  %lx->%lx\n"
   3.381 -           " Entry address: %lx\n"
   3.382 -           " Init. ramdisk:   (NOT IMPLEMENTED YET)\n",
   3.383 -           pkern_start, pkern_end, pkern_entry);
   3.384 +	if ( (p_start & (PAGE_SIZE-1)) != 0 )
   3.385 +	{
   3.386 +	    printk("Initial guest OS must load to a page boundary.\n");
   3.387 +	    return -EINVAL;
   3.388 +	}
   3.389  
   3.390 -    if ( (pkern_end - pkern_start) > (d->max_pages * PAGE_SIZE) )
   3.391 -    {
   3.392 -        printk("Initial guest OS requires too much space\n"
   3.393 -               "(%luMB is greater than %luMB limit)\n",
   3.394 -               (pkern_end-pkern_start)>>20, (d->max_pages<<PAGE_SHIFT)>>20);
   3.395 -        return -ENOMEM;
   3.396 -    }
   3.397 +	printk("METAPHYSICAL MEMORY ARRANGEMENT:\n"
   3.398 +	       " Kernel image:  %lx->%lx\n"
   3.399 +	       " Entry address: %lx\n"
   3.400 +	       " Init. ramdisk:   (NOT IMPLEMENTED YET)\n",
   3.401 +	       pkern_start, pkern_end, pkern_entry);
   3.402  
   3.403 -    // if high 3 bits of pkern start are non-zero, error
   3.404 +	if ( (pkern_end - pkern_start) > (d->max_pages * PAGE_SIZE) )
   3.405 +	{
   3.406 +	    printk("Initial guest OS requires too much space\n"
   3.407 +	           "(%luMB is greater than %luMB limit)\n",
   3.408 +	           (pkern_end-pkern_start)>>20, (d->max_pages<<PAGE_SHIFT)>>20);
   3.409 +	    return -ENOMEM;
   3.410 +	}
   3.411  
   3.412 -    // if pkern end is after end of metaphysical memory, error
   3.413 -    //  (we should be able to deal with this... later)
   3.414 +	// if high 3 bits of pkern start are non-zero, error
   3.415 +
   3.416 +	// if pkern end is after end of metaphysical memory, error
   3.417 +	//  (we should be able to deal with this... later)
   3.418  
   3.419  
   3.420 -    //
   3.421 +	//
   3.422  
   3.423  #if 0
   3.424 -    strcpy(d->name,"Domain0");
   3.425 +	strcpy(d->name,"Domain0");
   3.426  #endif
   3.427  
   3.428  	// prepare domain0 pagetable (maps METAphysical to physical)
   3.429  	// following is roughly mm_init() in linux/kernel/fork.c
   3.430  	d->arch.mm = kmem_cache_alloc(mm_cachep, SLAB_KERNEL);
   3.431  	if (unlikely(!d->arch.mm)) {
   3.432 -        	printk("Can't allocate mm_struct for domain0\n");
   3.433 -        	return -ENOMEM;
   3.434 +	    	printk("Can't allocate mm_struct for domain0\n");
   3.435 +	    	return -ENOMEM;
   3.436  	}
   3.437  	memset(d->arch.mm, 0, sizeof(*d->arch.mm));
   3.438  	d->arch.mm->pgd = pgd_alloc(d->arch.mm);
   3.439  	if (unlikely(!d->arch.mm->pgd)) {
   3.440 -        	printk("Can't allocate pgd for domain0\n");
   3.441 -        	return -ENOMEM;
   3.442 +	    	printk("Can't allocate pgd for domain0\n");
   3.443 +	    	return -ENOMEM;
   3.444  	}
   3.445  
   3.446  
   3.447 -    /* Mask all upcalls... */
   3.448 -    for ( i = 0; i < MAX_VIRT_CPUS; i++ )
   3.449 -        d->shared_info->vcpu_data[i].evtchn_upcall_mask = 1;
   3.450 +	/* Mask all upcalls... */
   3.451 +	for ( i = 0; i < MAX_VIRT_CPUS; i++ )
   3.452 +	    d->shared_info->vcpu_data[i].evtchn_upcall_mask = 1;
   3.453  
   3.454 -    /* Copy the OS image. */
   3.455 -    //(void)loadelfimage(image_start);
   3.456 +	/* Copy the OS image. */
   3.457 +	//(void)loadelfimage(image_start);
   3.458  	loaddomainelfimage(d,image_start);
   3.459  
   3.460 -    /* Copy the initial ramdisk. */
   3.461 -    //if ( initrd_len != 0 )
   3.462 -    //    memcpy((void *)vinitrd_start, initrd_start, initrd_len);
   3.463 +	/* Copy the initial ramdisk. */
   3.464 +	//if ( initrd_len != 0 )
   3.465 +	//    memcpy((void *)vinitrd_start, initrd_start, initrd_len);
   3.466  
   3.467  #if 0
   3.468 -    /* Set up start info area. */
   3.469 -    //si = (start_info_t *)vstartinfo_start;
   3.470 -    memset(si, 0, PAGE_SIZE);
   3.471 -    si->nr_pages     = d->tot_pages;
   3.472 -    si->shared_info  = virt_to_phys(d->shared_info);
   3.473 -    si->flags        = SIF_PRIVILEGED | SIF_INITDOMAIN;
   3.474 -    //si->pt_base      = vpt_start;
   3.475 -    //si->nr_pt_frames = nr_pt_pages;
   3.476 -    //si->mfn_list     = vphysmap_start;
   3.477 +	/* Set up start info area. */
   3.478 +	//si = (start_info_t *)vstartinfo_start;
   3.479 +	memset(si, 0, PAGE_SIZE);
   3.480 +	si->nr_pages     = d->tot_pages;
   3.481 +	si->shared_info  = virt_to_phys(d->shared_info);
   3.482 +	si->flags        = SIF_PRIVILEGED | SIF_INITDOMAIN;
   3.483 +	//si->pt_base      = vpt_start;
   3.484 +	//si->nr_pt_frames = nr_pt_pages;
   3.485 +	//si->mfn_list     = vphysmap_start;
   3.486  
   3.487 -    if ( initrd_len != 0 )
   3.488 -    {
   3.489 -        //si->mod_start = vinitrd_start;
   3.490 -        si->mod_len   = initrd_len;
   3.491 -        printk("Initrd len 0x%lx, start at 0x%08lx\n",
   3.492 -               si->mod_len, si->mod_start);
   3.493 -    }
   3.494 +	if ( initrd_len != 0 )
   3.495 +	{
   3.496 +	    //si->mod_start = vinitrd_start;
   3.497 +	    si->mod_len   = initrd_len;
   3.498 +	    printk("Initrd len 0x%lx, start at 0x%08lx\n",
   3.499 +	           si->mod_len, si->mod_start);
   3.500 +	}
   3.501  
   3.502 -    dst = si->cmd_line;
   3.503 -    if ( cmdline != NULL )
   3.504 -    {
   3.505 -        for ( i = 0; i < 255; i++ )
   3.506 -        {
   3.507 -            if ( cmdline[i] == '\0' )
   3.508 -                break;
   3.509 -            *dst++ = cmdline[i];
   3.510 -        }
   3.511 -    }
   3.512 -    *dst = '\0';
   3.513 +	dst = si->cmd_line;
   3.514 +	if ( cmdline != NULL )
   3.515 +	{
   3.516 +	    for ( i = 0; i < 255; i++ )
   3.517 +	    {
   3.518 +	        if ( cmdline[i] == '\0' )
   3.519 +	            break;
   3.520 +	        *dst++ = cmdline[i];
   3.521 +	    }
   3.522 +	}
   3.523 +	*dst = '\0';
   3.524  
   3.525 -    zap_low_mappings(); /* Do the same for the idle page tables. */
   3.526 +	zap_low_mappings(); /* Do the same for the idle page tables. */
   3.527  #endif
   3.528 -    
   3.529 -    /* Give up the VGA console if DOM0 is configured to grab it. */
   3.530 +	
   3.531 +	/* Give up the VGA console if DOM0 is configured to grab it. */
   3.532  #ifdef IA64
   3.533  	if (cmdline != NULL)
   3.534  #endif
   3.535 -    console_endboot(strstr(cmdline, "tty0") != NULL);
   3.536 +	console_endboot(strstr(cmdline, "tty0") != NULL);
   3.537  
   3.538 -    /* DOM0 gets access to everything. */
   3.539 +	/* DOM0 gets access to everything. */
   3.540  #ifdef CLONE_DOMAIN0
   3.541  if (d == dom0)
   3.542  #endif
   3.543 -    physdev_init_dom0(d);
   3.544 +	physdev_init_dom0(d);
   3.545  
   3.546 -    set_bit(DF_CONSTRUCTED, &d->d_flags);
   3.547 +	set_bit(DF_CONSTRUCTED, &d->d_flags);
   3.548  
   3.549 -    new_thread(ed, pkern_entry, 0, 0);
   3.550 -    // FIXME: Hack for keyboard input
   3.551 +	new_thread(ed, pkern_entry, 0, 0);
   3.552 +	// FIXME: Hack for keyboard input
   3.553  #ifdef CLONE_DOMAIN0
   3.554  if (d == dom0)
   3.555  #endif
   3.556 -    serial_input_init();
   3.557 -    if (d == dom0) {
   3.558 -    	ed->vcpu_info->arch.delivery_mask[0] = -1L;
   3.559 -    	ed->vcpu_info->arch.delivery_mask[1] = -1L;
   3.560 -    	ed->vcpu_info->arch.delivery_mask[2] = -1L;
   3.561 -    	ed->vcpu_info->arch.delivery_mask[3] = -1L;
   3.562 -    }
   3.563 -    else __set_bit(0x30,ed->vcpu_info->arch.delivery_mask);
   3.564 +	serial_input_init();
   3.565 +	if (d == dom0) {
   3.566 +		ed->vcpu_info->arch.delivery_mask[0] = -1L;
   3.567 +		ed->vcpu_info->arch.delivery_mask[1] = -1L;
   3.568 +		ed->vcpu_info->arch.delivery_mask[2] = -1L;
   3.569 +		ed->vcpu_info->arch.delivery_mask[3] = -1L;
   3.570 +	}
   3.571 +	else __set_bit(0x30,ed->vcpu_info->arch.delivery_mask);
   3.572  
   3.573 -    return 0;
   3.574 +	return 0;
   3.575 +}
   3.576 +
   3.577 +// FIXME: When dom0 can construct domains, this goes away (or is rewritten)
   3.578 +int construct_domN(struct domain *d,
   3.579 +		   unsigned long image_start, unsigned long image_len,
   3.580 +	           unsigned long initrd_start, unsigned long initrd_len,
   3.581 +	           char *cmdline)
   3.582 +{
   3.583 +	int i, rc;
   3.584 +	struct exec_domain *ed = d->exec_domain[0];
   3.585 +	unsigned long pkern_entry;
   3.586 +
   3.587 +	if ( test_bit(DF_CONSTRUCTED, &d->d_flags) ) BUG();
   3.588 +
   3.589 +	printk("*** LOADING DOMAIN %d ***\n",d->id);
   3.590 +
   3.591 +	d->max_pages = dom0_size/PAGE_SIZE;	// FIXME: use dom0 size
   3.592 +	// FIXME: use domain0 command line
   3.593 +	rc = parsedomainelfimage(image_start, image_len, &pkern_entry);
   3.594 +	printk("parsedomainelfimage returns %d\n",rc);
   3.595 +	if ( rc != 0 ) return rc;
   3.596 +
   3.597 +	d->arch.mm = kmem_cache_alloc(mm_cachep, SLAB_KERNEL);
   3.598 +	if (unlikely(!d->arch.mm)) {
   3.599 +	    	printk("Can't allocate mm_struct for domain %d\n",d->id);
   3.600 +	    	return -ENOMEM;
   3.601 +	}
   3.602 +	memset(d->arch.mm, 0, sizeof(*d->arch.mm));
   3.603 +	d->arch.mm->pgd = pgd_alloc(d->arch.mm);
   3.604 +	if (unlikely(!d->arch.mm->pgd)) {
   3.605 +	    	printk("Can't allocate pgd for domain %d\n",d->id);
   3.606 +	    	return -ENOMEM;
   3.607 +	}
   3.608 +
   3.609 +
   3.610 +	/* Mask all upcalls... */
   3.611 +	for ( i = 0; i < MAX_VIRT_CPUS; i++ )
   3.612 +		d->shared_info->vcpu_data[i].evtchn_upcall_mask = 1;
   3.613 +
   3.614 +	/* Copy the OS image. */
   3.615 +	printk("calling loaddomainelfimage\n");
   3.616 +	loaddomainelfimage(d,image_start);
   3.617 +	printk("loaddomainelfimage returns\n");
   3.618 +
   3.619 +	set_bit(DF_CONSTRUCTED, &d->d_flags);
   3.620 +
   3.621 +	printk("calling new_thread\n");
   3.622 +	new_thread(ed, pkern_entry, 0, 0);
   3.623 +	printk("new_thread returns\n");
   3.624 +	__set_bit(0x30,ed->vcpu_info->arch.delivery_mask);
   3.625 +
   3.626 +	return 0;
   3.627 +}
   3.628 +
   3.629 +// FIXME: When dom0 can construct domains, this goes away (or is rewritten)
   3.630 +int launch_domainN(unsigned long start, unsigned long len,
   3.631 +		   unsigned long initrd_start, unsigned long initrd_len,
   3.632 +		   char *cmdline)
   3.633 +{
   3.634 +	static int next = 100;  // FIXME
   3.635 +
   3.636 +	struct domain *d = do_createdomain(next,0);
   3.637 +	if (!d) {
   3.638 +		printf("launch_domainN: couldn't create\n");
   3.639 +		return 1;
   3.640 +	}
   3.641 +	if (construct_domN(d, start, len, 0, 0, 0)) {
   3.642 +		printf("launch_domainN: couldn't construct(id=%d,%lx,%lx)\n",
   3.643 +			d->id,start,len);
   3.644 +		return 2;
   3.645 +	}
   3.646 +	domain_unpause_by_systemcontroller(d);
   3.647  }
   3.648  
   3.649  void machine_restart(char * __unused)
     4.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     4.2 +++ b/xen/arch/ia64/hypercall.c	Fri Mar 18 00:48:21 2005 +0000
     4.3 @@ -0,0 +1,98 @@
     4.4 +/*
     4.5 + * Hypercall implementations
     4.6 + * 
     4.7 + * Copyright (C) 2005 Hewlett-Packard Co.
     4.8 + *	Dan Magenheimer (dan.magenheimer@hp.com)
     4.9 + *
    4.10 + */
    4.11 +
    4.12 +#include <xen/config.h>
    4.13 +#include <xen/sched.h>
    4.14 +
    4.15 +#include <linux/efi.h>	/* FOR EFI_UNIMPLEMENTED */
    4.16 +#include <asm/sal.h>	/* FOR struct ia64_sal_retval */
    4.17 +
    4.18 +#include <asm/vcpu.h>
    4.19 +#include <asm/dom_fw.h>
    4.20 +
    4.21 +extern unsigned long translate_domain_mpaddr(unsigned long);
    4.22 +extern struct ia64_sal_retval pal_emulator_static(UINT64);
    4.23 +extern struct ia64_sal_retval sal_emulator(UINT64,UINT64,UINT64,UINT64,UINT64,UINT64,UINT64,UINT64);
    4.24 +
    4.25 +void fooefi(void) {}
    4.26 +
    4.27 +void
    4.28 +ia64_hypercall (struct pt_regs *regs)
    4.29 +{
    4.30 +	struct exec_domain *ed = (struct domain *) current;
    4.31 +	struct ia64_sal_retval x;
    4.32 +	unsigned long *tv, *tc;
    4.33 +
    4.34 +	switch (regs->r2) {
    4.35 +	    case FW_HYPERCALL_PAL_CALL:
    4.36 +		//printf("*** PAL hypercall: index=%d\n",regs->r28);
    4.37 +		//FIXME: This should call a C routine
    4.38 +		x = pal_emulator_static(regs->r28);
    4.39 +		regs->r8 = x.status; regs->r9 = x.v0;
    4.40 +		regs->r10 = x.v1; regs->r11 = x.v2;
    4.41 +		break;
    4.42 +	    case FW_HYPERCALL_SAL_CALL:
    4.43 +		x = sal_emulator(vcpu_get_gr(ed,32),vcpu_get_gr(ed,33),
    4.44 +			vcpu_get_gr(ed,34),vcpu_get_gr(ed,35),
    4.45 +			vcpu_get_gr(ed,36),vcpu_get_gr(ed,37),
    4.46 +			vcpu_get_gr(ed,38),vcpu_get_gr(ed,39));
    4.47 +		regs->r8 = x.status; regs->r9 = x.v0;
    4.48 +		regs->r10 = x.v1; regs->r11 = x.v2;
    4.49 +		break;
    4.50 +	    case FW_HYPERCALL_EFI_RESET_SYSTEM:
    4.51 +		printf("efi.reset_system called ");
    4.52 +		if (current->domain == dom0) {
    4.53 +			printf("(by dom0)\n ");
    4.54 +			(*efi.reset_system)(EFI_RESET_WARM,0,0,NULL);
    4.55 +		}
    4.56 +		printf("(not supported for non-0 domain)\n");
    4.57 +		regs->r8 = EFI_UNSUPPORTED;
    4.58 +		break;
    4.59 +	    case FW_HYPERCALL_EFI_GET_TIME:
    4.60 +		fooefi();
    4.61 +		tv = vcpu_get_gr(ed,32);
    4.62 +		tc = vcpu_get_gr(ed,33);
    4.63 +		//printf("efi_get_time(%p,%p) called...",tv,tc);
    4.64 +		tv = __va(translate_domain_mpaddr(tv));
    4.65 +		if (tc) tc = __va(translate_domain_mpaddr(tc));
    4.66 +		regs->r8 = (*efi.get_time)(tv,tc);
    4.67 +		//printf("and returns %lx\n",regs->r8);
    4.68 +		break;
    4.69 +	    case FW_HYPERCALL_EFI_SET_TIME:
    4.70 +	    case FW_HYPERCALL_EFI_GET_WAKEUP_TIME:
    4.71 +	    case FW_HYPERCALL_EFI_SET_WAKEUP_TIME:
    4.72 +		// FIXME: need fixes in efi.h from 2.6.9
    4.73 +	    case FW_HYPERCALL_EFI_SET_VIRTUAL_ADDRESS_MAP:
    4.74 +		// FIXME: WARNING!! IF THIS EVER GETS IMPLEMENTED
    4.75 +		// SOME OF THE OTHER EFI EMULATIONS WILL CHANGE AS 
    4.76 +		// POINTER ARGUMENTS WILL BE VIRTUAL!!
    4.77 +	    case FW_HYPERCALL_EFI_GET_VARIABLE:
    4.78 +		// FIXME: need fixes in efi.h from 2.6.9
    4.79 +	    case FW_HYPERCALL_EFI_GET_NEXT_VARIABLE:
    4.80 +	    case FW_HYPERCALL_EFI_SET_VARIABLE:
    4.81 +	    case FW_HYPERCALL_EFI_GET_NEXT_HIGH_MONO_COUNT:
    4.82 +		// FIXME: need fixes in efi.h from 2.6.9
    4.83 +		regs->r8 = EFI_UNSUPPORTED;
    4.84 +		break;
    4.85 +	    case 0xffff: // test dummy hypercall
    4.86 +		regs->r8 = dump_privop_counts_to_user(
    4.87 +			vcpu_get_gr(ed,32),
    4.88 +			vcpu_get_gr(ed,33));
    4.89 +		break;
    4.90 +	    case 0xfffe: // test dummy hypercall
    4.91 +		regs->r8 = zero_privop_counts_to_user(
    4.92 +			vcpu_get_gr(ed,32),
    4.93 +			vcpu_get_gr(ed,33));
    4.94 +		break;
    4.95 +	    case 0xfffd: // test dummy hypercall
    4.96 +		regs->r8 = launch_domainN(
    4.97 +			vcpu_get_gr(ed,32),
    4.98 +			vcpu_get_gr(ed,33), 0, 0, 0);
    4.99 +		break;
   4.100 +	}
   4.101 +}
     5.1 --- a/xen/arch/ia64/process.c	Thu Mar 17 00:47:40 2005 +0000
     5.2 +++ b/xen/arch/ia64/process.c	Fri Mar 18 00:48:21 2005 +0000
     5.3 @@ -696,8 +696,6 @@ if (!running_on_sim) { printf("SSC_OPEN,
     5.4  	vcpu_increment_iip(current);
     5.5  }
     5.6  
     5.7 -void fooefi(void) {}
     5.8 -
     5.9  void
    5.10  ia64_handle_break (unsigned long ifa, struct pt_regs *regs, unsigned long isr, unsigned long iim)
    5.11  {
    5.12 @@ -716,72 +714,7 @@ ia64_handle_break (unsigned long ifa, st
    5.13  		else do_ssc(vcpu_get_gr(current,36), regs);
    5.14  	}
    5.15  	else if (iim == d->breakimm) {
    5.16 -		struct ia64_sal_retval x;
    5.17 -		switch (regs->r2) {
    5.18 -		    case FW_HYPERCALL_PAL_CALL:
    5.19 -			//printf("*** PAL hypercall: index=%d\n",regs->r28);
    5.20 -			//FIXME: This should call a C routine
    5.21 -			x = pal_emulator_static(regs->r28);
    5.22 -			regs->r8 = x.status; regs->r9 = x.v0;
    5.23 -			regs->r10 = x.v1; regs->r11 = x.v2;
    5.24 -			break;
    5.25 -		    case FW_HYPERCALL_SAL_CALL:
    5.26 -			x = sal_emulator(vcpu_get_gr(ed,32),vcpu_get_gr(ed,33),
    5.27 -				vcpu_get_gr(ed,34),vcpu_get_gr(ed,35),
    5.28 -				vcpu_get_gr(ed,36),vcpu_get_gr(ed,37),
    5.29 -				vcpu_get_gr(ed,38),vcpu_get_gr(ed,39));
    5.30 -			regs->r8 = x.status; regs->r9 = x.v0;
    5.31 -			regs->r10 = x.v1; regs->r11 = x.v2;
    5.32 -			break;
    5.33 -		    case FW_HYPERCALL_EFI_RESET_SYSTEM:
    5.34 -			printf("efi.reset_system called ");
    5.35 -			if (current->domain == dom0) {
    5.36 -				printf("(by dom0)\n ");
    5.37 -				(*efi.reset_system)(EFI_RESET_WARM,0,0,NULL);
    5.38 -			}
    5.39 -			printf("(not supported for non-0 domain)\n");
    5.40 -			regs->r8 = EFI_UNSUPPORTED;
    5.41 -			break;
    5.42 -		    case FW_HYPERCALL_EFI_GET_TIME:
    5.43 -			{
    5.44 -			unsigned long *tv, *tc;
    5.45 -			fooefi();
    5.46 -			tv = vcpu_get_gr(ed,32);
    5.47 -			tc = vcpu_get_gr(ed,33);
    5.48 -			//printf("efi_get_time(%p,%p) called...",tv,tc);
    5.49 -			tv = __va(translate_domain_mpaddr(tv));
    5.50 -			if (tc) tc = __va(translate_domain_mpaddr(tc));
    5.51 -			regs->r8 = (*efi.get_time)(tv,tc);
    5.52 -			//printf("and returns %lx\n",regs->r8);
    5.53 -			}
    5.54 -			break;
    5.55 -		    case FW_HYPERCALL_EFI_SET_TIME:
    5.56 -		    case FW_HYPERCALL_EFI_GET_WAKEUP_TIME:
    5.57 -		    case FW_HYPERCALL_EFI_SET_WAKEUP_TIME:
    5.58 -			// FIXME: need fixes in efi.h from 2.6.9
    5.59 -		    case FW_HYPERCALL_EFI_SET_VIRTUAL_ADDRESS_MAP:
    5.60 -			// FIXME: WARNING!! IF THIS EVER GETS IMPLEMENTED
    5.61 -			// SOME OF THE OTHER EFI EMULATIONS WILL CHANGE AS 
    5.62 -			// POINTER ARGUMENTS WILL BE VIRTUAL!!
    5.63 -		    case FW_HYPERCALL_EFI_GET_VARIABLE:
    5.64 -			// FIXME: need fixes in efi.h from 2.6.9
    5.65 -		    case FW_HYPERCALL_EFI_GET_NEXT_VARIABLE:
    5.66 -		    case FW_HYPERCALL_EFI_SET_VARIABLE:
    5.67 -		    case FW_HYPERCALL_EFI_GET_NEXT_HIGH_MONO_COUNT:
    5.68 -			// FIXME: need fixes in efi.h from 2.6.9
    5.69 -			regs->r8 = EFI_UNSUPPORTED;
    5.70 -			break;
    5.71 -		    case 0xffff: // test dummy hypercall
    5.72 -			regs->r8 = dump_privop_counts_to_user(
    5.73 -				vcpu_get_gr(ed,32),
    5.74 -				vcpu_get_gr(ed,33));
    5.75 -			break;
    5.76 -		    case 0xfffe: // test dummy hypercall
    5.77 -			regs->r8 = zero_privop_counts_to_user(
    5.78 -				vcpu_get_gr(ed,32),
    5.79 -				vcpu_get_gr(ed,33));
    5.80 -			break;
    5.81 -		}
    5.82 +		ia64_hypercall(regs);
    5.83  		vcpu_increment_iip(current);
    5.84  	}
    5.85  	else reflect_interruption(ifa,isr,iim,regs,IA64_BREAK_VECTOR);
     6.1 --- a/xen/arch/ia64/vcpu.c	Thu Mar 17 00:47:40 2005 +0000
     6.2 +++ b/xen/arch/ia64/vcpu.c	Fri Mar 18 00:48:21 2005 +0000
     6.3 @@ -639,6 +639,10 @@ IA64FAULT vcpu_get_ivr(VCPU *vcpu, UINT6
     6.4  	PSCB(vcpu,irr[i]) &= ~mask;
     6.5  	PSCB(vcpu,pending_interruption)--;
     6.6  	*pval = vector;
     6.7 +	// if delivering a timer interrupt, remember domain_itm
     6.8 +	if (vector == (PSCB(vcpu,itv) & 0xff)) {
     6.9 +		PSCB(vcpu,domain_itm_last) = PSCB(vcpu,domain_itm);
    6.10 +	}
    6.11  	return IA64_NO_FAULT;
    6.12  }
    6.13  
    6.14 @@ -978,8 +982,13 @@ void vcpu_pend_timer(VCPU *vcpu)
    6.15  	UINT64 itv = PSCB(vcpu,itv) & 0xff;
    6.16  
    6.17  	if (vcpu_timer_disabled(vcpu)) return;
    6.18 -	if (vcpu_timer_inservice(vcpu)) return;
    6.19 -#if 1
    6.20 +	//if (vcpu_timer_inservice(vcpu)) return;
    6.21 +	if (PSCB(vcpu,domain_itm_last) == PSCB(vcpu,domain_itm)) {
    6.22 +		// already delivered an interrupt for this so
    6.23 +		// don't deliver another
    6.24 +		return;
    6.25 +	}
    6.26 +#if 0
    6.27  	// attempt to flag "timer tick before its due" source
    6.28  	{
    6.29  	UINT64 itm = PSCB(vcpu,domain_itm);
     7.1 --- a/xen/arch/ia64/xensetup.c	Thu Mar 17 00:47:40 2005 +0000
     7.2 +++ b/xen/arch/ia64/xensetup.c	Fri Mar 18 00:48:21 2005 +0000
     7.3 @@ -362,9 +362,11 @@ printk("About to call construct_dom0()\n
     7.4  #ifdef CLONE_DOMAIN0
     7.5      {
     7.6      int i;
     7.7 +    dom0_memory_start = __va(ia64_boot_param->initrd_start);
     7.8 +    dom0_memory_end = ia64_boot_param->initrd_size;
     7.9      for (i = 0; i < CLONE_DOMAIN0; i++) {
    7.10  printk("CONSTRUCTING DOMAIN0 CLONE #%d\n",i+1);
    7.11 -        if ( construct_dom0(clones[i], dom0_memory_start, dom0_memory_end,
    7.12 +        if ( construct_domN(clones[i], dom0_memory_start, dom0_memory_end,
    7.13                          0, 
    7.14                          0,
    7.15  			0) != 0)
     8.1 --- a/xen/include/public/arch-ia64.h	Thu Mar 17 00:47:40 2005 +0000
     8.2 +++ b/xen/include/public/arch-ia64.h	Fri Mar 18 00:48:21 2005 +0000
     8.3 @@ -78,7 +78,7 @@ typedef struct {
     8.4  	unsigned long dcr;
     8.5  	unsigned long itc;
     8.6  	unsigned long domain_itm;
     8.7 -	unsigned long domain_timer_interval;
     8.8 +	unsigned long domain_itm_last;
     8.9  	unsigned long xen_itm;
    8.10  	unsigned long xen_timer_interval;
    8.11  //} PACKED arch_shared_info_t;