ia64/xen-unstable

changeset 875:ad4db8b417c1

bitkeeper revision 1.547 (3fa3dd2aH8eamu3ONvYovJgq8wBNbQ)

Many files:
Fixes to the DOM0 interface and domain building code. Ready for new save/restore dom0_ops.
author kaf24@scramble.cl.cam.ac.uk
date Sat Nov 01 16:19:54 2003 +0000 (2003-11-01)
parents 64754ee21add
children 15ec5cad58d1
files tools/internal/xi_build.c tools/internal/xi_start.c tools/internal/xi_stop.c xen/arch/i386/Rules.mk xen/common/dom0_ops.c xen/common/domain.c xen/common/memory.c xen/common/schedule.c xen/include/hypervisor-ifs/dom0_ops.h xen/include/xeno/sched.h
line diff
     1.1 --- a/tools/internal/xi_build.c	Fri Oct 31 16:36:13 2003 +0000
     1.2 +++ b/tools/internal/xi_build.c	Sat Nov 01 16:19:54 2003 +0000
     1.3 @@ -146,7 +146,8 @@ static int copy_to_domain_page(unsigned 
     1.4  
     1.5  static int setup_guestos(
     1.6      int dom, int kernel_fd, int initrd_fd, unsigned long tot_pages,
     1.7 -    unsigned long virt_load_addr, size_t ksize, dom_meminfo_t *meminfo)
     1.8 +    unsigned long virt_load_addr, size_t ksize, 
     1.9 +    dom0_builddomain_t *builddomain)
    1.10  {
    1.11      l1_pgentry_t *vl1tab = NULL, *vl1e = NULL;
    1.12      l2_pgentry_t *vl2tab = NULL, *vl2e = NULL;
    1.13 @@ -158,7 +159,7 @@ static int setup_guestos(
    1.14      unsigned long num_pgt_updates = 0;
    1.15      unsigned long count, pt_start, i, j;
    1.16  
    1.17 -    memset(meminfo, 0, sizeof(*meminfo));
    1.18 +    memset(builddomain, 0, sizeof(*builddomain));
    1.19  
    1.20      if ( init_pfn_mapper() < 0 )
    1.21          goto error_out;
    1.22 @@ -211,8 +212,8 @@ static int setup_guestos(
    1.23          }
    1.24  
    1.25          /* 'i' is 'ksize' rounded up to a page boundary. */
    1.26 -        meminfo->virt_mod_addr = virt_load_addr + i;
    1.27 -        meminfo->virt_mod_len  = isize;
    1.28 +        builddomain->virt_mod_addr = virt_load_addr + i;
    1.29 +        builddomain->virt_mod_len  = isize;
    1.30  
    1.31          for ( j = 0; j < isize; j += PAGE_SIZE, i += PAGE_SIZE )
    1.32          {
    1.33 @@ -245,7 +246,7 @@ static int setup_guestos(
    1.34       */
    1.35      l2tab = page_array[alloc_index] << PAGE_SHIFT;
    1.36      alloc_index--;
    1.37 -    meminfo->l2_pgt_addr = l2tab;
    1.38 +    builddomain->l2_pgt_addr = l2tab;
    1.39  
    1.40      /*
    1.41       * Pin down l2tab addr as page dir page - causes hypervisor to provide
    1.42 @@ -307,7 +308,7 @@ static int setup_guestos(
    1.43          num_pgt_updates++;
    1.44      }
    1.45  
    1.46 -    meminfo->virt_startinfo_addr =
    1.47 +    builddomain->virt_startinfo_addr =
    1.48          virt_load_addr + ((alloc_index-1)<<PAGE_SHIFT);
    1.49  
    1.50      /* Send the page update requests down to the hypervisor. */
    1.51 @@ -397,17 +398,17 @@ int main(int argc, char **argv)
    1.52      }
    1.53  
    1.54      if ( setup_guestos(domain_id, kernel_fd, initrd_fd, tot_pages,
    1.55 -                       load_addr, ksize, &launch_op.u.meminfo) < 0 )
    1.56 +                       load_addr, ksize, &launch_op.u.builddomain) < 0 )
    1.57          return 1;
    1.58  
    1.59      if ( initrd_fd >= 0 )
    1.60  	close(initrd_fd);
    1.61      close(kernel_fd);
    1.62  
    1.63 -    launch_op.u.meminfo.domain         = domain_id;
    1.64 -    launch_op.u.meminfo.virt_load_addr = load_addr;
    1.65 -    launch_op.u.meminfo.num_vifs       = atoi(argv[3]);
    1.66 -    launch_op.u.meminfo.cmd_line[0]    = '\0';
    1.67 +    launch_op.u.builddomain.domain         = domain_id;
    1.68 +    launch_op.u.builddomain.virt_load_addr = load_addr;
    1.69 +    launch_op.u.builddomain.num_vifs       = atoi(argv[3]);
    1.70 +    launch_op.u.builddomain.cmd_line[0]    = '\0';
    1.71      cmd_len = 0;
    1.72      for ( count = args_start; count < argc; count++ )
    1.73      {
    1.74 @@ -416,8 +417,8 @@ int main(int argc, char **argv)
    1.75              ERROR("Size of image boot params too big!\n");
    1.76              break;
    1.77          }
    1.78 -        strcat(launch_op.u.meminfo.cmd_line, argv[count]);
    1.79 -        strcat(launch_op.u.meminfo.cmd_line, " ");
    1.80 +        strcat(launch_op.u.builddomain.cmd_line, argv[count]);
    1.81 +        strcat(launch_op.u.builddomain.cmd_line, " ");
    1.82          cmd_len += strlen(argv[count] + 1);
    1.83      }
    1.84  
     2.1 --- a/tools/internal/xi_start.c	Fri Oct 31 16:36:13 2003 +0000
     2.2 +++ b/tools/internal/xi_start.c	Sat Nov 01 16:19:54 2003 +0000
     2.3 @@ -10,7 +10,7 @@ static int start_domain(int id)
     2.4      dom0_op_t op;
     2.5  
     2.6      op.cmd = DOM0_STARTDOMAIN;
     2.7 -    op.u.meminfo.domain = id;
     2.8 +    op.u.startdomain.domain = id;
     2.9  
    2.10      err = do_dom0_op(&op);
    2.11  
     3.1 --- a/tools/internal/xi_stop.c	Fri Oct 31 16:36:13 2003 +0000
     3.2 +++ b/tools/internal/xi_stop.c	Sat Nov 01 16:19:54 2003 +0000
     3.3 @@ -10,7 +10,7 @@ static int stop_domain(int id)
     3.4      dom0_op_t op;
     3.5  
     3.6      op.cmd = DOM0_STOPDOMAIN;
     3.7 -    op.u.meminfo.domain = id;
     3.8 +    op.u.stopdomain.domain = id;
     3.9  
    3.10      err = do_dom0_op(&op);
    3.11  
     4.1 --- a/xen/arch/i386/Rules.mk	Fri Oct 31 16:36:13 2003 +0000
     4.2 +++ b/xen/arch/i386/Rules.mk	Sat Nov 01 16:19:54 2003 +0000
     4.3 @@ -7,9 +7,9 @@ LD := ld
     4.4  MONITOR_BASE := 0xFC500000
     4.5  # Bootloader should load monitor to this real address
     4.6  LOAD_BASE    := 0x00100000
     4.7 -CFLAGS  := -nostdinc -fno-builtin -O3 -Wall -DMONITOR_BASE=$(MONITOR_BASE) 
     4.8 +#CFLAGS  := -nostdinc -fno-builtin -O3 -Wall -DMONITOR_BASE=$(MONITOR_BASE) 
     4.9  CFLAGS  += -fomit-frame-pointer -I$(BASEDIR)/include -D__KERNEL__ -DNDEBUG
    4.10 -#CFLAGS  += -fomit-frame-pointer -I$(BASEDIR)/include -D__KERNEL__
    4.11 +CFLAGS  += -fomit-frame-pointer -I$(BASEDIR)/include -D__KERNEL__
    4.12  LDFLAGS := -T xeno.lds -N
    4.13  
    4.14  
     5.1 --- a/xen/common/dom0_ops.c	Fri Oct 31 16:36:13 2003 +0000
     5.2 +++ b/xen/common/dom0_ops.c	Sat Nov 01 16:19:54 2003 +0000
     5.3 @@ -97,11 +97,11 @@ long do_dom0_op(dom0_op_t *u_dom0_op)
     5.4  
     5.5      case DOM0_BUILDDOMAIN:
     5.6      {
     5.7 -        struct task_struct * p = find_domain_by_id(op.u.meminfo.domain);
     5.8 +        struct task_struct * p = find_domain_by_id(op.u.builddomain.domain);
     5.9          ret = -EINVAL;
    5.10          if ( p != NULL )
    5.11          {
    5.12 -            if ( (ret = final_setup_guestos(p, &op.u.meminfo)) == 0 )
    5.13 +            if ( (ret = final_setup_guestos(p, &op.u.builddomain)) == 0 )
    5.14                  ret = p->domain;
    5.15              put_task_struct(p);
    5.16          }
    5.17 @@ -110,7 +110,7 @@ long do_dom0_op(dom0_op_t *u_dom0_op)
    5.18  
    5.19      case DOM0_STARTDOMAIN:
    5.20      {
    5.21 -        struct task_struct * p = find_domain_by_id(op.u.meminfo.domain);
    5.22 +        struct task_struct * p = find_domain_by_id(op.u.startdomain.domain);
    5.23          ret = -EINVAL;
    5.24          if ( p != NULL )
    5.25          {
    5.26 @@ -127,7 +127,7 @@ long do_dom0_op(dom0_op_t *u_dom0_op)
    5.27  
    5.28      case DOM0_STOPDOMAIN:
    5.29      {
    5.30 -        ret = stop_other_domain(op.u.meminfo.domain);
    5.31 +        ret = stop_other_domain(op.u.stopdomain.domain);
    5.32      }
    5.33      break;
    5.34  
    5.35 @@ -268,12 +268,38 @@ long do_dom0_op(dom0_op_t *u_dom0_op)
    5.36              op.u.getdominfo.mcu_advance = p->mcu_advance;
    5.37              op.u.getdominfo.tot_pages   = p->tot_pages;
    5.38              op.u.getdominfo.cpu_time    = p->cpu_time;
    5.39 +            memcpy(&op.u.getdominfo.ctxt, 
    5.40 +                   &p->shared_info->execution_context,
    5.41 +                   sizeof(execution_context_t));
    5.42          }
    5.43  
    5.44          read_unlock_irqrestore(&tasklist_lock, flags);
    5.45          copy_to_user(u_dom0_op, &op, sizeof(op));
    5.46 -        break;
    5.47      }
    5.48 +    break;
    5.49 +
    5.50 +    case DOM0_GETPAGEFRAMEINFO:
    5.51 +    {
    5.52 +        struct pfn_info *page = frame_table + op.u.getpageframeinfo.pfn;
    5.53 +        
    5.54 +        op.u.getpageframeinfo.domain = page->flags & PG_domain_mask;
    5.55 +        op.u.getpageframeinfo.type   = NONE;
    5.56 +        if ( page->type_count & REFCNT_PIN_BIT )
    5.57 +        {
    5.58 +            switch ( page->flags & PG_type_mask )
    5.59 +            {
    5.60 +            case PGT_l1_page_table:
    5.61 +                op.u.getpageframeinfo.type = L1TAB;
    5.62 +                break;
    5.63 +            case PGT_l2_page_table:
    5.64 +                op.u.getpageframeinfo.type = L2TAB;
    5.65 +                break;
    5.66 +            }
    5.67 +        }
    5.68 +
    5.69 +        copy_to_user(u_dom0_op, &op, sizeof(op));
    5.70 +    }
    5.71 +    break;
    5.72  
    5.73      case DOM0_IOPL:
    5.74      {
     6.1 --- a/xen/common/domain.c	Fri Oct 31 16:36:13 2003 +0000
     6.2 +++ b/xen/common/domain.c	Sat Nov 01 16:19:54 2003 +0000
     6.3 @@ -343,9 +343,8 @@ void release_task(struct task_struct *p)
     6.4   *      <one page>
     6.5   */
     6.6  
     6.7 -int final_setup_guestos(struct task_struct * p, dom_meminfo_t * meminfo)
     6.8 +int final_setup_guestos(struct task_struct *p, dom0_builddomain_t *builddomain)
     6.9  {
    6.10 -    l2_pgentry_t * l2tab;
    6.11      start_info_t * virt_startinfo_addr;
    6.12      unsigned long virt_stack_addr;
    6.13      unsigned long phys_l2tab;
    6.14 @@ -356,28 +355,18 @@ int final_setup_guestos(struct task_stru
    6.15      if ( (p->flags & PF_CONSTRUCTED) )
    6.16          return -EINVAL;
    6.17  
    6.18 -    /* High entries in page table must contain hypervisor
    6.19 -     * mem mappings - set them up.
    6.20 -     */
    6.21 -    phys_l2tab = meminfo->l2_pgt_addr;
    6.22 -    l2tab = map_domain_mem(phys_l2tab); 
    6.23 -    memcpy(&l2tab[DOMAIN_ENTRIES_PER_L2_PAGETABLE], 
    6.24 -        &idle_pg_table[DOMAIN_ENTRIES_PER_L2_PAGETABLE],
    6.25 -        (ENTRIES_PER_L2_PAGETABLE - DOMAIN_ENTRIES_PER_L2_PAGETABLE) 
    6.26 -        * sizeof(l2_pgentry_t));
    6.27 -    l2tab[PERDOMAIN_VIRT_START >> L2_PAGETABLE_SHIFT] = 
    6.28 -        mk_l2_pgentry(__pa(p->mm.perdomain_pt) | __PAGE_HYPERVISOR);
    6.29 -    l2tab[LINEAR_PT_VIRT_START >> L2_PAGETABLE_SHIFT] =
    6.30 -        mk_l2_pgentry(phys_l2tab | __PAGE_HYPERVISOR);
    6.31 +    /* NB. Page base must already be pinned! */
    6.32 +    phys_l2tab = builddomain->l2_pgt_addr;
    6.33      p->mm.pagetable = mk_pagetable(phys_l2tab);
    6.34 -    unmap_domain_mem(l2tab);
    6.35 +    get_page_type(&frame_table[phys_l2tab>>PAGE_SHIFT]);
    6.36 +    get_page_tot(&frame_table[phys_l2tab>>PAGE_SHIFT]);
    6.37  
    6.38      /* set up the shared info structure */
    6.39      update_dom_time(p->shared_info);
    6.40      p->shared_info->domain_time = 0;
    6.41  
    6.42      /* we pass start info struct to guest os as function parameter on stack */
    6.43 -    virt_startinfo_addr = (start_info_t *)meminfo->virt_startinfo_addr;
    6.44 +    virt_startinfo_addr = (start_info_t *)builddomain->virt_startinfo_addr;
    6.45      virt_stack_addr = (unsigned long)virt_startinfo_addr;       
    6.46  
    6.47      /* we need to populate start_info struct within the context of the
    6.48 @@ -390,19 +379,19 @@ int final_setup_guestos(struct task_stru
    6.49      memset(virt_startinfo_addr, 0, sizeof(*virt_startinfo_addr));
    6.50      virt_startinfo_addr->nr_pages = p->tot_pages;
    6.51      virt_startinfo_addr->shared_info = virt_to_phys(p->shared_info);
    6.52 -    virt_startinfo_addr->pt_base = meminfo->virt_load_addr + 
    6.53 +    virt_startinfo_addr->pt_base = builddomain->virt_load_addr + 
    6.54                      ((p->tot_pages - 1) << PAGE_SHIFT);
    6.55     
    6.56      /* module size and length */
    6.57  
    6.58 -    virt_startinfo_addr->mod_start = meminfo->virt_mod_addr;
    6.59 -    virt_startinfo_addr->mod_len   = meminfo->virt_mod_len;
    6.60 +    virt_startinfo_addr->mod_start = builddomain->virt_mod_addr;
    6.61 +    virt_startinfo_addr->mod_len   = builddomain->virt_mod_len;
    6.62  
    6.63      virt_startinfo_addr->dom_id = p->domain;
    6.64      virt_startinfo_addr->flags  = IS_PRIV(p) ? SIF_PRIVILEGED : 0;
    6.65  
    6.66      /* Add virtual network interfaces and point to them in startinfo. */
    6.67 -    while (meminfo->num_vifs-- > 0) {
    6.68 +    while (builddomain->num_vifs-- > 0) {
    6.69          net_vif = create_net_vif(p->domain);
    6.70          shared_rings = net_vif->shared_rings;
    6.71          if (!shared_rings) panic("no network ring!\n");
    6.72 @@ -421,7 +410,7 @@ int final_setup_guestos(struct task_stru
    6.73      virt_startinfo_addr->blk_ring = virt_to_phys(p->blk_ring_base);
    6.74  
    6.75      /* Copy the command line */
    6.76 -    strcpy(virt_startinfo_addr->cmd_line, meminfo->cmd_line);
    6.77 +    strcpy(virt_startinfo_addr->cmd_line, builddomain->cmd_line);
    6.78  
    6.79      /* Reinstate the caller's page tables. */
    6.80      __asm__ __volatile__ (
    6.81 @@ -431,7 +420,7 @@ int final_setup_guestos(struct task_stru
    6.82      p->flags |= PF_CONSTRUCTED;
    6.83      
    6.84      new_thread(p, 
    6.85 -               (unsigned long)meminfo->virt_load_addr, 
    6.86 +               (unsigned long)builddomain->virt_load_addr, 
    6.87                 (unsigned long)virt_stack_addr, 
    6.88                 (unsigned long)virt_startinfo_addr);
    6.89  
    6.90 @@ -571,17 +560,6 @@ int setup_guestos(struct task_struct *p,
    6.91      unmap_domain_mem(l1start);
    6.92  
    6.93      /* pages that are part of page tables must be read only */
    6.94 -    cur_address = list_entry(p->pg_head.next, struct pfn_info, list) -
    6.95 -        frame_table;
    6.96 -    cur_address <<= PAGE_SHIFT;
    6.97 -    for ( count = 0; count < alloc_index; count++ ) 
    6.98 -    {
    6.99 -        list_ent = frame_table[cur_address >> PAGE_SHIFT].list.next;
   6.100 -        cur_address = list_entry(list_ent, struct pfn_info, list) -
   6.101 -            frame_table;
   6.102 -        cur_address <<= PAGE_SHIFT;
   6.103 -    }
   6.104 -
   6.105      l2tab = l2start + l2_table_offset(virt_load_address + 
   6.106          (alloc_index << PAGE_SHIFT));
   6.107      l1start = l1tab = map_domain_mem(l2_pgentry_to_phys(*l2tab));
   6.108 @@ -589,21 +567,17 @@ int setup_guestos(struct task_struct *p,
   6.109      l2tab++;
   6.110      for ( count = alloc_index; count < p->tot_pages; count++ ) 
   6.111      {
   6.112 -        *l1tab++ = mk_l1_pgentry(l1_pgentry_val(*l1tab) & ~_PAGE_RW);
   6.113 +        *l1tab = mk_l1_pgentry(l1_pgentry_val(*l1tab) & ~_PAGE_RW);
   6.114 +        page = frame_table + l1_pgentry_to_pagenr(*l1tab);
   6.115 +        page->flags = dom | PGT_l1_page_table;
   6.116 +        page->tot_count++;
   6.117 +        l1tab++;
   6.118          if( !((unsigned long)l1tab & (PAGE_SIZE - 1)) )
   6.119          {
   6.120              unmap_domain_mem(l1start);
   6.121              l1start = l1tab = map_domain_mem(l2_pgentry_to_phys(*l2tab));
   6.122              l2tab++;
   6.123          }
   6.124 -        page = frame_table + (cur_address >> PAGE_SHIFT);
   6.125 -        page->flags = dom | PGT_l1_page_table;
   6.126 -        page->tot_count++;
   6.127 -        
   6.128 -        list_ent = frame_table[cur_address >> PAGE_SHIFT].list.next;
   6.129 -        cur_address = list_entry(list_ent, struct pfn_info, list) -
   6.130 -            frame_table;
   6.131 -        cur_address <<= PAGE_SHIFT;
   6.132      }
   6.133      page->type_count |= REFCNT_PIN_BIT;
   6.134      page->tot_count  |= REFCNT_PIN_BIT;
     7.1 --- a/xen/common/memory.c	Fri Oct 31 16:36:13 2003 +0000
     7.2 +++ b/xen/common/memory.c	Sat Nov 01 16:19:54 2003 +0000
     7.3 @@ -363,7 +363,7 @@ static int dec_page_refcnt(unsigned long
     7.4                  type);
     7.5          return -1;
     7.6      }
     7.7 -    ASSERT(page_type_count(page) != 0);
     7.8 +    ASSERT((page_type_count(page) & ~REFCNT_PIN_BIT) != 0);
     7.9      put_page_tot(page);
    7.10      return put_page_type(page);
    7.11  }
    7.12 @@ -568,7 +568,7 @@ static void put_page(unsigned long page_
    7.13      page = frame_table + page_nr;
    7.14      ASSERT(DOMAIN_OKAY(page->flags));
    7.15      ASSERT((!writeable) || 
    7.16 -           ((page_type_count(page) != 0) && 
    7.17 +           (((page_type_count(page) & ~REFCNT_PIN_BIT) != 0) && 
    7.18              ((page->flags & PG_type_mask) == PGT_writeable_page) &&
    7.19              ((page->flags & PG_need_flush) == PG_need_flush)));
    7.20      if ( writeable )
     8.1 --- a/xen/common/schedule.c	Fri Oct 31 16:36:13 2003 +0000
     8.2 +++ b/xen/common/schedule.c	Sat Nov 01 16:19:54 2003 +0000
     8.3 @@ -328,7 +328,6 @@ asmlinkage void __enter_scheduler(void)
     8.4  
     8.5      /* do some accounting */
     8.6      ranfor = (s32)(now - prev->lastschd);
     8.7 -    ASSERT((ranfor>0));
     8.8      prev->cpu_time += ranfor;
     8.9      
    8.10      /* calculate mcu and update avt */
     9.1 --- a/xen/include/hypervisor-ifs/dom0_ops.h	Fri Oct 31 16:36:13 2003 +0000
     9.2 +++ b/xen/include/hypervisor-ifs/dom0_ops.h	Sat Nov 01 16:19:54 2003 +0000
     9.3 @@ -10,23 +10,13 @@
     9.4  #ifndef __DOM0_OPS_H__
     9.5  #define __DOM0_OPS_H__
     9.6  
     9.7 -#define DOM0_GETMEMLIST     2
     9.8 -#define DOM0_BVTCTL         6
     9.9 -#define DOM0_ADJUSTDOM      7
    9.10 -#define DOM0_CREATEDOMAIN   8
    9.11 -#define DOM0_DESTROYDOMAIN  9
    9.12 -#define DOM0_STARTDOMAIN   10
    9.13 -#define DOM0_STOPDOMAIN    11
    9.14 -#define DOM0_GETDOMAININFO 12
    9.15 -#define DOM0_BUILDDOMAIN   13
    9.16 -#define DOM0_IOPL          14
    9.17 -#define DOM0_MSR           15
    9.18 -#define DOM0_DEBUG         16
    9.19 -#define DOM0_SETTIME       17
    9.20 +#include "hypervisor-if.h"
    9.21 +
    9.22  
    9.23  #define MAX_CMD_LEN       256
    9.24  #define MAX_DOMAIN_NAME    16
    9.25  
    9.26 +#define DOM0_CREATEDOMAIN      8
    9.27  typedef struct dom0_newdomain_st 
    9.28  {
    9.29      /* IN parameters. */
    9.30 @@ -36,12 +26,29 @@ typedef struct dom0_newdomain_st
    9.31      unsigned int domain; 
    9.32  } dom0_newdomain_t;
    9.33  
    9.34 +#define DOM0_STARTDOMAIN      10
    9.35 +typedef struct dom0_startdomain_st
    9.36 +{
    9.37 +    /* IN parameters. */
    9.38 +    unsigned int domain;
    9.39 +} dom0_startdomain_t;
    9.40 +
    9.41 +#define DOM0_STOPDOMAIN       11
    9.42 +typedef struct dom0_stopdomain_st
    9.43 +{
    9.44 +    /* IN parameters. */
    9.45 +    unsigned int domain;
    9.46 +} dom0_stopdomain_t;
    9.47 +
    9.48 +#define DOM0_DESTROYDOMAIN     9
    9.49  typedef struct dom0_killdomain_st
    9.50  {
    9.51 +    /* IN variables. */
    9.52      unsigned int domain;
    9.53      int          force;
    9.54  } dom0_killdomain_t;
    9.55  
    9.56 +#define DOM0_GETMEMLIST        2
    9.57  typedef struct dom0_getmemlist_st
    9.58  {
    9.59      /* IN variables. */
    9.60 @@ -52,8 +59,10 @@ typedef struct dom0_getmemlist_st
    9.61      unsigned long num_pfns;
    9.62  } dom0_getmemlist_t;
    9.63  
    9.64 -typedef struct domain_launch
    9.65 +#define DOM0_BUILDDOMAIN      13
    9.66 +typedef struct dom0_builddomain_st
    9.67  {
    9.68 +    /* IN variables. */
    9.69      unsigned int  domain;
    9.70      unsigned long l2_pgt_addr;
    9.71      unsigned long virt_load_addr;
    9.72 @@ -62,22 +71,28 @@ typedef struct domain_launch
    9.73      char cmd_line[MAX_CMD_LEN];
    9.74      unsigned long virt_mod_addr;
    9.75      unsigned long virt_mod_len;
    9.76 -} dom_meminfo_t;
    9.77 +    execution_context_t ctxt;
    9.78 +} dom0_builddomain_t;
    9.79  
    9.80 +#define DOM0_BVTCTL            6
    9.81  typedef struct dom0_bvtctl_st
    9.82  {
    9.83 -    unsigned long ctx_allow;	/* context switch allowance */
    9.84 +    /* IN variables. */
    9.85 +    unsigned long ctx_allow;  /* context switch allowance */
    9.86  } dom0_bvtctl_t;
    9.87  
    9.88 +#define DOM0_ADJUSTDOM         7
    9.89  typedef struct dom0_adjustdom_st
    9.90  {
    9.91 -    unsigned int  domain;	/* domain id */
    9.92 -    unsigned long mcu_adv;	/* mcu advance: inverse of weight */
    9.93 -    unsigned long warp;     /* time warp */
    9.94 -    unsigned long warpl;    /* warp limit */
    9.95 -    unsigned long warpu;    /* unwarp time requirement */
    9.96 +    /* IN variables. */
    9.97 +    unsigned int  domain;     /* domain id */
    9.98 +    unsigned long mcu_adv;    /* mcu advance: inverse of weight */
    9.99 +    unsigned long warp;       /* time warp */
   9.100 +    unsigned long warpl;      /* warp limit */
   9.101 +    unsigned long warpu;      /* unwarp time requirement */
   9.102  } dom0_adjustdom_t;
   9.103  
   9.104 +#define DOM0_GETDOMAININFO    12
   9.105  typedef struct dom0_getdominfo_st
   9.106  {
   9.107      /* IN variables. */
   9.108 @@ -91,14 +106,27 @@ typedef struct dom0_getdominfo_st
   9.109      unsigned long mcu_advance;
   9.110      unsigned int tot_pages;
   9.111      long long cpu_time;
   9.112 +    execution_context_t ctxt;
   9.113  } dom0_getdominfo_t;
   9.114  
   9.115 +#define DOM0_GETPAGEFRAMEINFO 18
   9.116 +typedef struct dom0_getpageframeinfo_st
   9.117 +{
   9.118 +    /* IN variables. */
   9.119 +    unsigned long pfn;          /* Machine page frame number to query.       */
   9.120 +    /* OUT variables. */
   9.121 +    unsigned int domain;        /* To which domain does the frame belong?    */
   9.122 +    enum { NONE, L1TAB, L2TAB } type; /* Is the page PINNED to a type?       */
   9.123 +} dom0_getpageframeinfo_t;
   9.124 +
   9.125 +#define DOM0_IOPL             14
   9.126  typedef struct dom0_iopl_st
   9.127  {
   9.128      unsigned int domain;
   9.129      unsigned int iopl;
   9.130  } dom0_iopl_t;
   9.131  
   9.132 +#define DOM0_MSR              15
   9.133  typedef struct dom0_msr_st
   9.134  {
   9.135      /* IN variables. */
   9.136 @@ -108,6 +136,7 @@ typedef struct dom0_msr_st
   9.137      unsigned int out1, out2;
   9.138  } dom0_msr_t;
   9.139  
   9.140 +#define DOM0_DEBUG            16
   9.141  typedef struct dom0_debug_st
   9.142  {
   9.143      /* IN variables. */
   9.144 @@ -121,6 +150,7 @@ typedef struct dom0_debug_st
   9.145   * Set clock such that it would read <secs,usecs> after 00:00:00 UTC,
   9.146   * 1 January, 1970 if the current system time was <system_time>.
   9.147   */
   9.148 +#define DOM0_SETTIME          17
   9.149  typedef struct dom0_settime_st
   9.150  {
   9.151      /* IN variables. */
   9.152 @@ -134,12 +164,15 @@ typedef struct dom0_op_st
   9.153      union
   9.154      {
   9.155          dom0_newdomain_t newdomain;
   9.156 +        dom0_startdomain_t startdomain;
   9.157 +        dom0_stopdomain_t stopdomain;
   9.158          dom0_killdomain_t killdomain;
   9.159          dom0_getmemlist_t getmemlist;
   9.160          dom0_bvtctl_t bvtctl;
   9.161          dom0_adjustdom_t adjustdom;
   9.162 -        dom_meminfo_t meminfo;
   9.163 +        dom0_builddomain_t builddomain;
   9.164          dom0_getdominfo_t getdominfo;
   9.165 +        dom0_getpageframeinfo_t getpageframeinfo;
   9.166          dom0_iopl_t iopl;
   9.167  	dom0_msr_t msr;
   9.168  	dom0_debug_t debug;
    10.1 --- a/xen/include/xeno/sched.h	Fri Oct 31 16:36:13 2003 +0000
    10.2 +++ b/xen/include/xeno/sched.h	Sat Nov 01 16:19:54 2003 +0000
    10.3 @@ -223,7 +223,7 @@ extern int setup_guestos(
    10.4      struct task_struct *p, dom0_newdomain_t *params, unsigned int num_vifs,
    10.5      char *data_start, unsigned long data_len, 
    10.6      char *cmdline, unsigned long initrd_len);
    10.7 -extern int final_setup_guestos(struct task_struct *p, dom_meminfo_t *);
    10.8 +extern int final_setup_guestos(struct task_struct *p, dom0_builddomain_t *);
    10.9  
   10.10  struct task_struct *find_domain_by_id(unsigned int dom);
   10.11  extern void release_task(struct task_struct *);