[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Xen-changelog] DomainU's can now be loaded from domain0 using hypercalls
ChangeSet 1.1366, 2005/03/25 21:24:24-07:00, djm@xxxxxxxxxxxxxxxxxx DomainU's can now be loaded from domain0 using hypercalls domain.c | 26 +++++++++++++++++++++----- hypercall.c | 5 +++-- xenmisc.c | 11 ++++++++++- xensetup.c | 2 +- 4 files changed, 35 insertions(+), 9 deletions(-) diff -Nru a/xen/arch/ia64/domain.c b/xen/arch/ia64/domain.c --- a/xen/arch/ia64/domain.c 2005-03-25 19:06:11 -05:00 +++ b/xen/arch/ia64/domain.c 2005-03-25 19:06:11 -05:00 @@ -311,7 +311,8 @@ pmd = pmd_offset(pgd, mpaddr); if (pmd_none(*pmd)) - pmd_populate(mm, pmd, pte_alloc_one(mm,mpaddr)); + pmd_populate_kernel(mm, pmd, pte_alloc_one_kernel(mm,mpaddr)); +// pmd_populate(mm, pmd, pte_alloc_one(mm,mpaddr)); pte = pte_offset_map(pmd, mpaddr); if (pte_none(*pte)) { @@ -509,14 +510,17 @@ return -EINVAL; } +#if 0 /* Find the section-header strings table. */ if ( ehdr.e_shstrndx == SHN_UNDEF ) { printk("ELF image has no section-header strings table (shstrtab).\n"); return -EINVAL; } +#endif *entry = ehdr.e_entry; +printf("parsedomainelfimage: entry point = %p\n",*entry); return 0; } @@ -559,17 +563,25 @@ while(1); } else domU_staging_area = (unsigned long *)__va(domU_staging_start); - printf("alloc_domU_staging: domU_staging_start=%p\n",domU_staging_start); + printf("alloc_domU_staging: domU_staging_area=%p\n",domU_staging_area); } unsigned long +domU_staging_read_8(unsigned long at) +{ + // no way to return errors so just do it + return domU_staging_area[at>>3]; + +} + +unsigned long domU_staging_write_32(unsigned long at, unsigned long a, unsigned long b, unsigned long c, unsigned long d) { if (at + 32 > domU_staging_size) return -1; if (at & 0x1f) return -1; - at >>= 5; + at >>= 3; domU_staging_area[at++] = a; domU_staging_area[at++] = b; domU_staging_area[at++] = c; @@ -796,7 +808,7 @@ d->shared_info->vcpu_data[i].evtchn_upcall_mask = 1; /* Copy the OS image. */ - printk("calling loaddomainelfimage\n"); + printk("calling loaddomainelfimage(%p,%p)\n",d,image_start); loaddomainelfimage(d,image_start); printk("loaddomainelfimage returns\n"); @@ -813,7 +825,11 @@ // FIXME: When dom0 can construct domains, this goes away (or is rewritten) int launch_domainU(unsigned long size) { - static int next = 100; // FIXME +#ifdef CLONE_DOMAIN0 + static int next = CLONE_DOMAIN0+1; +#else + static int next = 1; +#endif struct domain *d = do_createdomain(next,0); if (!d) { diff -Nru a/xen/arch/ia64/hypercall.c b/xen/arch/ia64/hypercall.c --- a/xen/arch/ia64/hypercall.c 2005-03-25 19:06:11 -05:00 +++ b/xen/arch/ia64/hypercall.c 2005-03-25 19:06:11 -05:00 @@ -89,7 +89,6 @@ vcpu_get_gr(ed,32), vcpu_get_gr(ed,33)); break; -#ifdef DOMU_BUILD_STAGING case 0xfffd: // test dummy hypercall regs->r8 = launch_domainU( vcpu_get_gr(ed,32)); @@ -102,6 +101,8 @@ vcpu_get_gr(ed,35), vcpu_get_gr(ed,36)); break; -#endif + case 0xfffb: // test dummy hypercall + regs->r8 = domU_staging_read_8(vcpu_get_gr(ed,32)); + break; } } diff -Nru a/xen/arch/ia64/xenmisc.c b/xen/arch/ia64/xenmisc.c --- a/xen/arch/ia64/xenmisc.c 2005-03-25 19:06:11 -05:00 +++ b/xen/arch/ia64/xenmisc.c 2005-03-25 19:06:11 -05:00 @@ -247,10 +247,19 @@ //printk("@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@\n"); //printk("@@@@@@ context switch from domain %d (%x) to domain %d (%x)\n", //prev->domain->id,(long)prev&0xffffff,next->domain->id,(long)next&0xffffff); -//printk("@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@\n"); //if (prev->domain->id == 1 && next->domain->id == 0) cs10foo(); //if (prev->domain->id == 0 && next->domain->id == 1) cs01foo(); +//printk("@@sw %d->%d\n",prev->domain->id,next->domain->id); switch_to(prev,next,prev); +// leave this debug for now: it acts as a heartbeat when more than +// one domain is active +{ +static long cnt[16] = { 50,50,50,50,50,50,50,50,50,50,50,50,50,50,50,50}; +static int i = 100; +int id = ((struct exec_domain *)current)->domain->id & 0xf; +if (!cnt[id]--) { printk("%x",id); cnt[id] = 50; } +if (!i--) { printk("+",id); cnt[id] = 100; } +} clear_bit(EDF_RUNNING, &prev->ed_flags); //if (!is_idle_task(next->domain) ) //send_guest_virq(next, VIRQ_TIMER); diff -Nru a/xen/arch/ia64/xensetup.c b/xen/arch/ia64/xensetup.c --- a/xen/arch/ia64/xensetup.c 2005-03-25 19:06:11 -05:00 +++ b/xen/arch/ia64/xensetup.c 2005-03-25 19:06:11 -05:00 @@ -297,7 +297,7 @@ dom0_memory_end = ia64_boot_param->initrd_size; for (i = 0; i < CLONE_DOMAIN0; i++) { printk("CONSTRUCTING DOMAIN0 CLONE #%d\n",i+1); - if ( construct_domN(clones[i], dom0_memory_start, dom0_memory_end, + if ( construct_domU(clones[i], dom0_memory_start, dom0_memory_end, 0, 0, 0) != 0) ------------------------------------------------------- SF email is sponsored by - The IT Product Guide Read honest & candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now. http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click _______________________________________________ Xen-changelog mailing list Xen-changelog@xxxxxxxxxxxxxxxxxxxxx https://lists.sourceforge.net/lists/listinfo/xen-changelog
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |