[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] xensetup.c, domain.c, config.h, hypercall.c:



ChangeSet 1.1365, 2005/03/24 15:16:25-07:00, djm@xxxxxxxxxxxxxxx

        xensetup.c, domain.c, config.h, hypercall.c:
          Add (tmp) domain loading hypercalls



 arch/ia64/domain.c        |   52 ++++++++++++++++++++++++++++++++++++++--------
 arch/ia64/hypercall.c     |   13 +++++++++--
 arch/ia64/xensetup.c      |    3 ++
 include/asm-ia64/config.h |    1 
 4 files changed, 59 insertions(+), 10 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:05:55 -05:00
+++ b/xen/arch/ia64/domain.c    2005-03-25 19:05:55 -05:00
@@ -38,6 +38,12 @@
 unsigned long dom0_size = 512*1024*1024; //FIXME: Should be configurable
 //FIXME: alignment should be 256MB, lest Linux use a 256MB page size
 unsigned long dom0_align = 64*1024*1024;
+#ifdef DOMU_BUILD_STAGING
+unsigned long domU_staging_size = 32*1024*1024; //FIXME: Should be configurable
+unsigned long domU_staging_start;
+unsigned long domU_staging_align = 64*1024;
+unsigned long *domU_staging_area;
+#endif
 
 // initialized by arch/ia64/setup.c:find_initrd()
 unsigned long initrd_start = 0, initrd_end = 0;
@@ -542,6 +548,37 @@
 
 }
 
+#ifdef DOMU_BUILD_STAGING
+void alloc_domU_staging(void)
+{
+       domU_staging_size = 32*1024*1024; //FIXME: Should be configurable
+       printf("alloc_domU_staging: starting (initializing %d 
MB...)\n",domU_staging_size/(1024*1024));
+       domU_staging_start= 
alloc_boot_pages(domU_staging_size,domU_staging_align);
+       if (!domU_staging_size) {
+               printf("alloc_domU_staging: can't allocate, spinning...\n");
+               while(1);
+       }
+       else domU_staging_area = (unsigned long *)__va(domU_staging_start);
+       printf("alloc_domU_staging: 
domU_staging_start=%p\n",domU_staging_start);
+
+}
+
+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;
+       domU_staging_area[at++] = a;
+       domU_staging_area[at++] = b;
+       domU_staging_area[at++] = c;
+       domU_staging_area[at] = d;
+       return 0;
+       
+}
+#endif
+
 int construct_dom0(struct domain *d, 
                       unsigned long image_start, unsigned long image_len, 
                       unsigned long initrd_start, unsigned long initrd_len,
@@ -722,7 +759,7 @@
 }
 
 // FIXME: When dom0 can construct domains, this goes away (or is rewritten)
-int construct_domN(struct domain *d,
+int construct_domU(struct domain *d,
                   unsigned long image_start, unsigned long image_len,
                   unsigned long initrd_start, unsigned long initrd_len,
                   char *cmdline)
@@ -774,20 +811,19 @@
 }
 
 // FIXME: When dom0 can construct domains, this goes away (or is rewritten)
-int launch_domainN(unsigned long start, unsigned long len,
-                  unsigned long initrd_start, unsigned long initrd_len,
-                  char *cmdline)
+int launch_domainU(unsigned long size)
 {
        static int next = 100;  // FIXME
 
        struct domain *d = do_createdomain(next,0);
        if (!d) {
-               printf("launch_domainN: couldn't create\n");
+               printf("launch_domainU: couldn't create\n");
                return 1;
        }
-       if (construct_domN(d, start, len, 0, 0, 0)) {
-               printf("launch_domainN: couldn't construct(id=%d,%lx,%lx)\n",
-                       d->id,start,len);
+       else next++;
+       if (construct_domU(d, (unsigned long)domU_staging_area, size,0,0,0)) {
+               printf("launch_domainU: couldn't construct(id=%d,%lx,%lx)\n",
+                       d->id,domU_staging_area,size);
                return 2;
        }
        domain_unpause_by_systemcontroller(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:05:55 -05:00
+++ b/xen/arch/ia64/hypercall.c 2005-03-25 19:05:55 -05:00
@@ -89,10 +89,19 @@
                        vcpu_get_gr(ed,32),
                        vcpu_get_gr(ed,33));
                break;
+#ifdef DOMU_BUILD_STAGING
            case 0xfffd: // test dummy hypercall
-               regs->r8 = launch_domainN(
+               regs->r8 = launch_domainU(
+                       vcpu_get_gr(ed,32));
+               break;
+           case 0xfffc: // test dummy hypercall
+               regs->r8 = domU_staging_write_32(
                        vcpu_get_gr(ed,32),
-                       vcpu_get_gr(ed,33), 0, 0, 0);
+                       vcpu_get_gr(ed,33),
+                       vcpu_get_gr(ed,34),
+                       vcpu_get_gr(ed,35),
+                       vcpu_get_gr(ed,36));
                break;
+#endif
        }
 }
diff -Nru a/xen/arch/ia64/xensetup.c b/xen/arch/ia64/xensetup.c
--- a/xen/arch/ia64/xensetup.c  2005-03-25 19:05:55 -05:00
+++ b/xen/arch/ia64/xensetup.c  2005-03-25 19:05:55 -05:00
@@ -224,6 +224,9 @@
     init_frametable();
 
     alloc_dom0();
+#ifdef DOMU_BUILD_STAGING
+    alloc_domU_staging();
+#endif
 
     end_boot_allocator();
 
diff -Nru a/xen/include/asm-ia64/config.h b/xen/include/asm-ia64/config.h
--- a/xen/include/asm-ia64/config.h     2005-03-25 19:05:55 -05:00
+++ b/xen/include/asm-ia64/config.h     2005-03-25 19:05:55 -05:00
@@ -1,6 +1,7 @@
 // control flags for turning on/off features under test
 #undef CLONE_DOMAIN0
 //#define CLONE_DOMAIN0 5
+#define DOMU_BUILD_STAGING
 
 // manufactured from component pieces
 


-------------------------------------------------------
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


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.