ia64/xen-unstable

changeset 2710:ed0f5b1a41ba

bitkeeper revision 1.1159.1.259 (4178e733n0FQir55loK8zwEyWTnclA)

Rename domid field in Xen domain struct.
author kaf24@freefall.cl.cam.ac.uk
date Fri Oct 22 10:55:47 2004 +0000 (2004-10-22)
parents 8aa9d487a8dd
children 7275617d86ce 06527e1d6757
files xen/arch/x86/domain.c xen/arch/x86/idle0_task.c xen/arch/x86/memory.c xen/common/dom0_ops.c xen/common/dom_mem_ops.c xen/common/domain.c xen/common/event_channel.c xen/common/grant_table.c xen/common/keyhandler.c xen/common/page_alloc.c xen/common/physdev.c xen/common/sched_atropos.c xen/common/sched_bvt.c xen/common/sched_rrobin.c xen/common/schedule.c xen/drivers/char/console.c xen/include/asm-x86/shadow.h xen/include/xen/sched.h
line diff
     1.1 --- a/xen/arch/x86/domain.c	Fri Oct 22 00:11:28 2004 +0000
     1.2 +++ b/xen/arch/x86/domain.c	Fri Oct 22 10:55:47 2004 +0000
     1.3 @@ -90,7 +90,7 @@ void continue_cpu_idle_loop(void)
     1.4  void startup_cpu_idle_loop(void)
     1.5  {
     1.6      /* Just some sanity to ensure that the scheduler is set up okay. */
     1.7 -    ASSERT(current->domain == IDLE_DOMAIN_ID);
     1.8 +    ASSERT(current->id == IDLE_DOMAIN_ID);
     1.9      domain_unpause_by_systemcontroller(current);
    1.10      __enter_scheduler();
    1.11  
    1.12 @@ -595,7 +595,7 @@ int construct_dom0(struct domain *p,
    1.13      extern void physdev_init_dom0(struct domain *);
    1.14  
    1.15      /* Sanity! */
    1.16 -    if ( p->domain != 0 ) 
    1.17 +    if ( p->id != 0 ) 
    1.18          BUG();
    1.19      if ( test_bit(DF_CONSTRUCTED, &p->flags) ) 
    1.20          BUG();
     2.1 --- a/xen/arch/x86/idle0_task.c	Fri Oct 22 00:11:28 2004 +0000
     2.2 +++ b/xen/arch/x86/idle0_task.c	Fri Oct 22 10:55:47 2004 +0000
     2.3 @@ -5,7 +5,7 @@
     2.4  #define IDLE0_TASK(_t)           \
     2.5  {                                \
     2.6      processor:   0,              \
     2.7 -    domain:      IDLE_DOMAIN_ID, \
     2.8 +    id:          IDLE_DOMAIN_ID, \
     2.9      mm:          IDLE0_MM,       \
    2.10      thread:      INIT_THREAD,    \
    2.11      flags:       1<<DF_IDLETASK, \
     3.1 --- a/xen/arch/x86/memory.c	Fri Oct 22 00:11:28 2004 +0000
     3.2 +++ b/xen/arch/x86/memory.c	Fri Oct 22 10:55:47 2004 +0000
     3.3 @@ -104,7 +104,7 @@
     3.4  #ifdef VERBOSE
     3.5  #define MEM_LOG(_f, _a...)                           \
     3.6    printk("DOM%u: (file=memory.c, line=%d) " _f "\n", \
     3.7 -         current->domain , __LINE__ , ## _a )
     3.8 +         current->id , __LINE__ , ## _a )
     3.9  #else
    3.10  #define MEM_LOG(_f, _a...) ((void)0)
    3.11  #endif
    3.12 @@ -174,7 +174,7 @@ void arch_init_memory(void)
    3.13       */
    3.14      dom_xen = alloc_domain_struct();
    3.15      atomic_set(&dom_xen->refcnt, 1);
    3.16 -    dom_xen->domain = DOMID_XEN;
    3.17 +    dom_xen->id = DOMID_XEN;
    3.18  
    3.19      /*
    3.20       * Initialise our DOMID_IO domain.
    3.21 @@ -183,7 +183,7 @@ void arch_init_memory(void)
    3.22       */
    3.23      dom_io = alloc_domain_struct();
    3.24      atomic_set(&dom_io->refcnt, 1);
    3.25 -    dom_io->domain = DOMID_IO;
    3.26 +    dom_io->id = DOMID_IO;
    3.27  
    3.28      /* M2P table is mappable read-only by privileged domains. */
    3.29      for ( mfn = virt_to_phys(&machine_to_phys_mapping[0<<20])>>PAGE_SHIFT;
    3.30 @@ -1071,7 +1071,7 @@ static int do_extended_command(unsigned 
    3.31                  percpu_info[cpu].foreign = dom_io;
    3.32                  break;
    3.33              default:
    3.34 -                MEM_LOG("Dom %u cannot set foreign dom\n", d->domain);
    3.35 +                MEM_LOG("Dom %u cannot set foreign dom\n", d->id);
    3.36                  okay = 0;
    3.37                  break;
    3.38              }
    3.39 @@ -1130,7 +1130,7 @@ static int do_extended_command(unsigned 
    3.40              {
    3.41                  MEM_LOG("Bad page values %08lx: ed=%p(%u), sd=%p,"
    3.42                          " caf=%08x, taf=%08x\n", page_to_pfn(page),
    3.43 -                        d, d->domain, nd, x, page->u.inuse.type_info);
    3.44 +                        d, d->id, nd, x, page->u.inuse.type_info);
    3.45                  spin_unlock(&d->page_alloc_lock);
    3.46                  put_domain(e);
    3.47                  return 0;
    3.48 @@ -1189,7 +1189,7 @@ static int do_extended_command(unsigned 
    3.49      case MMUEXT_REASSIGN_PAGE:
    3.50          if ( unlikely(!IS_PRIV(d)) )
    3.51          {
    3.52 -            MEM_LOG("Dom %u has no reassignment priv", d->domain);
    3.53 +            MEM_LOG("Dom %u has no reassignment priv", d->id);
    3.54              okay = 0;
    3.55              break;
    3.56          }
    3.57 @@ -1242,7 +1242,7 @@ static int do_extended_command(unsigned 
    3.58              {
    3.59                  MEM_LOG("Bad page values %08lx: ed=%p(%u), sd=%p,"
    3.60                          " caf=%08x, taf=%08x\n", page_to_pfn(page),
    3.61 -                        d, d->domain, nd, x, page->u.inuse.type_info);
    3.62 +                        d, d->id, nd, x, page->u.inuse.type_info);
    3.63                  okay = 0;
    3.64                  goto reassign_fail;
    3.65              }
    3.66 @@ -1887,7 +1887,7 @@ void audit_domain(struct domain *d)
    3.67                  /* This will only come out once. */
    3.68                  printk("Audit %d: type count whent below zero pfn=%x "
    3.69                         "taf=%x otaf=%x\n",
    3.70 -                       d->domain, page-frame_table,
    3.71 +                       d->id, page-frame_table,
    3.72                         page->u.inuse.type_info,
    3.73                         page->tlbflush_timestamp);
    3.74              }
    3.75 @@ -1904,7 +1904,7 @@ void audit_domain(struct domain *d)
    3.76              /* This will only come out once. */
    3.77              printk("Audit %d: general count whent below zero pfn=%x "
    3.78                     "taf=%x otaf=%x\n",
    3.79 -                   d->domain, page-frame_table,
    3.80 +                   d->id, page-frame_table,
    3.81                     page->u.inuse.type_info,
    3.82                     page->tlbflush_timestamp);
    3.83          }
    3.84 @@ -1937,7 +1937,7 @@ void audit_domain(struct domain *d)
    3.85                      if ( (pt[i] & _PAGE_PRESENT) &&
    3.86                           ((pt[i] >> PAGE_SHIFT) == xpfn) )
    3.87                          printk("     found dom=%d i=%x pfn=%lx t=%x c=%x\n",
    3.88 -                               d->domain, i, pfn, page->u.inuse.type_info,
    3.89 +                               d->id, i, pfn, page->u.inuse.type_info,
    3.90                                 page->count_info);
    3.91                  unmap_domain_mem(pt);           
    3.92              }
    3.93 @@ -2032,11 +2032,11 @@ void audit_domain(struct domain *d)
    3.94  
    3.95              if ( (page->u.inuse.type_info & PGT_validated) != PGT_validated )
    3.96                  printk("Audit %d: L2 not validated %x\n",
    3.97 -                       d->domain, page->u.inuse.type_info);
    3.98 +                       d->id, page->u.inuse.type_info);
    3.99  
   3.100              if ( (page->u.inuse.type_info & PGT_pinned) != PGT_pinned )
   3.101                  printk("Audit %d: L2 not pinned %x\n",
   3.102 -                       d->domain, page->u.inuse.type_info);
   3.103 +                       d->id, page->u.inuse.type_info);
   3.104              else
   3.105                  adjust( page, -1, 1 );
   3.106             
   3.107 @@ -2059,14 +2059,14 @@ void audit_domain(struct domain *d)
   3.108                      if ( (l1page->u.inuse.type_info & PGT_type_mask) ==
   3.109                           PGT_l2_page_table )
   3.110                          printk("Audit %d: [%x] Found %s Linear PT "
   3.111 -                               "t=%x pfn=%lx\n", d->domain, i, 
   3.112 +                               "t=%x pfn=%lx\n", d->id, i, 
   3.113                                 (l1pfn==pfn) ? "Self" : "Other",
   3.114                                 l1page->u.inuse.type_info,
   3.115                                 l1pfn);
   3.116                      else if ( (l1page->u.inuse.type_info & PGT_type_mask) !=
   3.117                                PGT_l1_page_table )
   3.118                          printk("Audit %d: [%x] Expected L1 t=%x pfn=%lx\n",
   3.119 -                               d->domain, i,
   3.120 +                               d->id, i,
   3.121                                 l1page->u.inuse.type_info,
   3.122                                 l1pfn);
   3.123  
   3.124 @@ -2086,11 +2086,11 @@ void audit_domain(struct domain *d)
   3.125  
   3.126              if ( (page->u.inuse.type_info & PGT_validated) != PGT_validated )
   3.127                  printk("Audit %d: L1 not validated %x\n",
   3.128 -                       d->domain, page->u.inuse.type_info);
   3.129 +                       d->id, page->u.inuse.type_info);
   3.130  #if 0
   3.131              if ( (page->u.inuse.type_info & PGT_pinned) != PGT_pinned )
   3.132                  printk("Audit %d: L1 not pinned %x\n",
   3.133 -                       d->domain, page->u.inuse.type_info);
   3.134 +                       d->id, page->u.inuse.type_info);
   3.135  #endif
   3.136              pt = map_domain_mem( pfn<<PAGE_SHIFT );
   3.137  
   3.138 @@ -2121,7 +2121,7 @@ void audit_domain(struct domain *d)
   3.139                               (l1page->u.inuse.type_info & PGT_type_mask) ==
   3.140                               PGT_l2_page_table )
   3.141                              printk("Audit %d: [%x] Ilegal RW t=%x pfn=%lx\n",
   3.142 -                                   d->domain, i,
   3.143 +                                   d->id, i,
   3.144                                     l1page->u.inuse.type_info,
   3.145                                     l1pfn);
   3.146  
   3.147 @@ -2131,7 +2131,7 @@ void audit_domain(struct domain *d)
   3.148                      {
   3.149                          printk("Audit %d: [%lx,%x] Skip foreign page dom=%lx "
   3.150                                 "pfn=%lx c=%08x t=%08x m2p=%lx\n",
   3.151 -                               d->domain, pfn, i,
   3.152 +                               d->id, pfn, i,
   3.153                                 (unsigned long)l1page->u.inuse.domain,
   3.154                                 l1pfn,
   3.155                                 l1page->count_info,
   3.156 @@ -2154,7 +2154,7 @@ void audit_domain(struct domain *d)
   3.157  
   3.158      if ( (io_mappings > 0) || (lowmem_mappings > 0) )
   3.159          printk("Audit %d: Found %d lowmem mappings and %d io mappings\n",
   3.160 -               d->domain, lowmem_mappings, io_mappings);
   3.161 +               d->id, lowmem_mappings, io_mappings);
   3.162  
   3.163      /* PHASE 2 */
   3.164  
   3.165 @@ -2172,7 +2172,7 @@ void audit_domain(struct domain *d)
   3.166              if ( (page->u.inuse.type_info & PGT_count_mask) != 0 )
   3.167              {
   3.168                  printk("Audit %d: type count!=0 t=%x ot=%x c=%x pfn=%lx\n",
   3.169 -                       d->domain, page->u.inuse.type_info, 
   3.170 +                       d->id, page->u.inuse.type_info, 
   3.171                         page->tlbflush_timestamp,
   3.172                         page->count_info, pfn );
   3.173                  scan_for_pfn_remote(pfn);
   3.174 @@ -2181,7 +2181,7 @@ void audit_domain(struct domain *d)
   3.175              if ( (page->count_info & PGC_count_mask) != 1 )
   3.176              {
   3.177                  printk("Audit %d: gen count!=1 (c=%x) t=%x ot=%x pfn=%lx\n",
   3.178 -                       d->domain, 
   3.179 +                       d->id, 
   3.180                         page->count_info,
   3.181                         page->u.inuse.type_info, 
   3.182                         page->tlbflush_timestamp, pfn );
   3.183 @@ -2260,7 +2260,7 @@ void audit_domain(struct domain *d)
   3.184  
   3.185      adjust(&frame_table[pagetable_val(d->mm.pagetable)>>PAGE_SHIFT], 1, 1);
   3.186  
   3.187 -    printk("Audit %d: Done. ctot=%d ttot=%d\n",d->domain, ctot, ttot );
   3.188 +    printk("Audit %d: Done. ctot=%d ttot=%d\n", d->id, ctot, ttot );
   3.189  
   3.190      if ( d != current )
   3.191          domain_unpause(d);
     4.1 --- a/xen/common/dom0_ops.c	Fri Oct 22 00:11:28 2004 +0000
     4.2 +++ b/xen/common/dom0_ops.c	Fri Oct 22 10:55:47 2004 +0000
     4.3 @@ -218,7 +218,7 @@ long do_dom0_op(dom0_op_t *u_dom0_op)
     4.4  
     4.5          ret = 0;
     4.6          
     4.7 -        op->u.createdomain.domain = d->domain;
     4.8 +        op->u.createdomain.domain = d->id;
     4.9          copy_to_user(u_dom0_op, op, sizeof(*op));
    4.10      }
    4.11      break;
    4.12 @@ -340,7 +340,7 @@ long do_dom0_op(dom0_op_t *u_dom0_op)
    4.13  
    4.14          for_each_domain ( d )
    4.15          {
    4.16 -            if ( d->domain >= op->u.getdomaininfo.domain )
    4.17 +            if ( d->id >= op->u.getdomaininfo.domain )
    4.18                  break;
    4.19          }
    4.20  
    4.21 @@ -353,7 +353,7 @@ long do_dom0_op(dom0_op_t *u_dom0_op)
    4.22  
    4.23          read_unlock_irqrestore(&tasklist_lock, flags);
    4.24  
    4.25 -        op->u.getdomaininfo.domain = d->domain;
    4.26 +        op->u.getdomaininfo.domain = d->id;
    4.27          
    4.28          op->u.getdomaininfo.flags =
    4.29              (test_bit(DF_DYING,     &d->flags) ? DOMFLAGS_DYING    : 0) |
     5.1 --- a/xen/common/dom_mem_ops.c	Fri Oct 22 00:11:28 2004 +0000
     5.2 +++ b/xen/common/dom_mem_ops.c	Fri Oct 22 10:55:47 2004 +0000
     5.3 @@ -71,14 +71,14 @@ static long free_dom_mem(struct domain *
     5.4              if ( unlikely((mpfn + j) >= max_page) )
     5.5              {
     5.6                  DPRINTK("Domain %u page number out of range (%08lx>=%08lx)\n", 
     5.7 -                        d->domain, mpfn + j, max_page);
     5.8 +                        d->id, mpfn + j, max_page);
     5.9                  return i;
    5.10              }
    5.11              
    5.12              page = &frame_table[mpfn + j];
    5.13              if ( unlikely(!get_page(page, d)) )
    5.14              {
    5.15 -                DPRINTK("Bad page free for domain %u\n", d->domain);
    5.16 +                DPRINTK("Bad page free for domain %u\n", d->id);
    5.17                  return i;
    5.18              }
    5.19  
     6.1 --- a/xen/common/domain.c	Fri Oct 22 00:11:28 2004 +0000
     6.2 +++ b/xen/common/domain.c	Fri Oct 22 10:55:47 2004 +0000
     6.3 @@ -35,8 +35,8 @@ struct domain *do_createdomain(domid_t d
     6.4  
     6.5      shadow_lock_init(d);
     6.6  
     6.7 -    d->domain    = dom_id;
     6.8 -    d->processor = cpu;
     6.9 +    d->id          = dom_id;
    6.10 +    d->processor   = cpu;
    6.11      d->create_time = NOW();
    6.12   
    6.13      memcpy(&d->thread, &idle0_task.thread, sizeof(d->thread));
    6.14 @@ -49,7 +49,7 @@ struct domain *do_createdomain(domid_t d
    6.15      spin_lock_init(&d->pcidev_lock);
    6.16      INIT_LIST_HEAD(&d->pcidev_list);
    6.17  
    6.18 -    if ( d->domain != IDLE_DOMAIN_ID )
    6.19 +    if ( d->id != IDLE_DOMAIN_ID )
    6.20      {
    6.21          if ( (init_event_channels(d) != 0) || (grant_table_create(d) != 0) )
    6.22          {
    6.23 @@ -65,7 +65,7 @@ struct domain *do_createdomain(domid_t d
    6.24          write_lock_irqsave(&tasklist_lock, flags);
    6.25          pd = &task_list; /* NB. task_list is maintained in order of dom_id. */
    6.26          for ( pd = &task_list; *pd != NULL; pd = &(*pd)->next_list )
    6.27 -            if ( (*pd)->domain > d->domain )
    6.28 +            if ( (*pd)->id > d->id )
    6.29                  break;
    6.30          d->next_list = *pd;
    6.31          *pd = d;
    6.32 @@ -91,7 +91,7 @@ struct domain *find_domain_by_id(domid_t
    6.33      d = task_hash[TASK_HASH(dom)];
    6.34      while ( d != NULL )
    6.35      {
    6.36 -        if ( d->domain == dom )
    6.37 +        if ( d->id == dom )
    6.38          {
    6.39              if ( unlikely(!get_domain(d)) )
    6.40                  d = NULL;
    6.41 @@ -144,7 +144,7 @@ void domain_crash(void)
    6.42  {
    6.43      struct domain *d;
    6.44  
    6.45 -    if ( current->domain == 0 )
    6.46 +    if ( current->id == 0 )
    6.47          BUG();
    6.48  
    6.49      set_bit(DF_CRASHED, &current->flags);
    6.50 @@ -161,7 +161,7 @@ void domain_shutdown(u8 reason)
    6.51  {
    6.52      struct domain *d;
    6.53  
    6.54 -    if ( current->domain == 0 )
    6.55 +    if ( current->id == 0 )
    6.56      {
    6.57          extern void machine_restart(char *);
    6.58          extern void machine_halt(void);
    6.59 @@ -212,7 +212,7 @@ unsigned int alloc_new_dom_mem(struct do
    6.60          {
    6.61              /* Initialise with magic marker if in DEBUG mode. */
    6.62              void *a = map_domain_mem((page-frame_table)<<PAGE_SHIFT);
    6.63 -            memset(a, 0x80 | (char)d->domain, PAGE_SIZE);
    6.64 +            memset(a, 0x80 | (char)d->id, PAGE_SIZE);
    6.65              unmap_domain_mem(a);
    6.66          }
    6.67  #endif
    6.68 @@ -239,7 +239,7 @@ void domain_destruct(struct domain *d)
    6.69      if ( _atomic_read(old) != 0 )
    6.70          return;
    6.71  
    6.72 -    DPRINTK("Releasing task %u\n", d->domain);
    6.73 +    DPRINTK("Releasing task %u\n", d->id);
    6.74  
    6.75      /* Delete from task list and task hashtable. */
    6.76      write_lock_irqsave(&tasklist_lock, flags);
    6.77 @@ -247,7 +247,7 @@ void domain_destruct(struct domain *d)
    6.78      while ( *pd != d ) 
    6.79          pd = &(*pd)->next_list;
    6.80      *pd = d->next_list;
    6.81 -    pd = &task_hash[TASK_HASH(d->domain)];
    6.82 +    pd = &task_hash[TASK_HASH(d->id)];
    6.83      while ( *pd != d ) 
    6.84          pd = &(*pd)->next_hash;
    6.85      *pd = d->next_hash;
     7.1 --- a/xen/common/event_channel.c	Fri Oct 22 00:11:28 2004 +0000
     7.2 +++ b/xen/common/event_channel.c	Fri Oct 22 10:55:47 2004 +0000
     7.3 @@ -78,9 +78,9 @@ static long evtchn_bind_interdomain(evtc
     7.4          return -EPERM;
     7.5  
     7.6      if ( dom1 == DOMID_SELF )
     7.7 -        dom1 = current->domain;
     7.8 +        dom1 = current->id;
     7.9      if ( dom2 == DOMID_SELF )
    7.10 -        dom2 = current->domain;
    7.11 +        dom2 = current->id;
    7.12  
    7.13      if ( ((d1 = find_domain_by_id(dom1)) == NULL) ||
    7.14           ((d2 = find_domain_by_id(dom2)) == NULL) )
    7.15 @@ -119,12 +119,12 @@ static long evtchn_bind_interdomain(evtc
    7.16          goto out;
    7.17      }
    7.18  
    7.19 -    d1->event_channel[port1].u.remote.dom  = d2;
    7.20 -    d1->event_channel[port1].u.remote.port = (u16)port2;
    7.21 +    d1->event_channel[port1].u.interdomain.remote_dom  = d2;
    7.22 +    d1->event_channel[port1].u.interdomain.remote_port = (u16)port2;
    7.23  
    7.24 -    d2->event_channel[port2].u.remote.dom  = d1;
    7.25 -    d2->event_channel[port2].u.remote.port = (u16)port1;
    7.26 -    d2->event_channel[port2].state         = ECS_INTERDOMAIN;
    7.27 +    d2->event_channel[port2].u.interdomain.remote_dom  = d1;
    7.28 +    d2->event_channel[port2].u.interdomain.remote_port = (u16)port1;
    7.29 +    d2->event_channel[port2].state                     = ECS_INTERDOMAIN;
    7.30  
    7.31   out:
    7.32      spin_unlock(&d1->event_channel_lock);
    7.33 @@ -254,7 +254,7 @@ static long __evtchn_close(struct domain
    7.34      case ECS_INTERDOMAIN:
    7.35          if ( d2 == NULL )
    7.36          {
    7.37 -            d2 = chn1[port1].u.remote.dom;
    7.38 +            d2 = chn1[port1].u.interdomain.remote_dom;
    7.39  
    7.40              /* If we unlock d1 then we could lose d2. Must get a reference. */
    7.41              if ( unlikely(!get_domain(d2)) )
    7.42 @@ -278,20 +278,20 @@ static long __evtchn_close(struct domain
    7.43                  goto again;
    7.44              }
    7.45          }
    7.46 -        else if ( d2 != chn1[port1].u.remote.dom )
    7.47 +        else if ( d2 != chn1[port1].u.interdomain.remote_dom )
    7.48          {
    7.49              rc = -EINVAL;
    7.50              goto out;
    7.51          }
    7.52      
    7.53          chn2  = d2->event_channel;
    7.54 -        port2 = chn1[port1].u.remote.port;
    7.55 +        port2 = chn1[port1].u.interdomain.remote_port;
    7.56  
    7.57          if ( port2 >= d2->max_event_channel )
    7.58              BUG();
    7.59          if ( chn2[port2].state != ECS_INTERDOMAIN )
    7.60              BUG();
    7.61 -        if ( chn2[port2].u.remote.dom != d1 )
    7.62 +        if ( chn2[port2].u.interdomain.remote_dom != d1 )
    7.63              BUG();
    7.64  
    7.65          chn2[port2].state = ECS_UNBOUND;
    7.66 @@ -324,7 +324,7 @@ static long evtchn_close(evtchn_close_t 
    7.67      domid_t        dom = close->dom;
    7.68  
    7.69      if ( dom == DOMID_SELF )
    7.70 -        dom = current->domain;
    7.71 +        dom = current->id;
    7.72      else if ( !IS_PRIV(current) )
    7.73          return -EPERM;
    7.74  
    7.75 @@ -353,8 +353,8 @@ static long evtchn_send(int lport)
    7.76          return -EINVAL;
    7.77      }
    7.78  
    7.79 -    rd    = ld->event_channel[lport].u.remote.dom;
    7.80 -    rport = ld->event_channel[lport].u.remote.port;
    7.81 +    rd    = ld->event_channel[lport].u.interdomain.remote_dom;
    7.82 +    rport = ld->event_channel[lport].u.interdomain.remote_port;
    7.83  
    7.84      evtchn_set_pending(rd, rport);
    7.85  
    7.86 @@ -373,7 +373,7 @@ static long evtchn_status(evtchn_status_
    7.87      long             rc = 0;
    7.88  
    7.89      if ( dom == DOMID_SELF )
    7.90 -        dom = current->domain;
    7.91 +        dom = current->id;
    7.92      else if ( !IS_PRIV(current) )
    7.93          return -EPERM;
    7.94  
    7.95 @@ -400,8 +400,8 @@ static long evtchn_status(evtchn_status_
    7.96          break;
    7.97      case ECS_INTERDOMAIN:
    7.98          status->status = EVTCHNSTAT_interdomain;
    7.99 -        status->u.interdomain.dom  = chn[port].u.remote.dom->domain;
   7.100 -        status->u.interdomain.port = chn[port].u.remote.port;
   7.101 +        status->u.interdomain.dom  = chn[port].u.interdomain.remote_dom->id;
   7.102 +        status->u.interdomain.port = chn[port].u.interdomain.remote_port;
   7.103          break;
   7.104      case ECS_PIRQ:
   7.105          status->status = EVTCHNSTAT_pirq;
     8.1 --- a/xen/common/grant_table.c	Fri Oct 22 00:11:28 2004 +0000
     8.2 +++ b/xen/common/grant_table.c	Fri Oct 22 10:55:47 2004 +0000
     8.3 @@ -128,10 +128,10 @@ static void
     8.4              u32 scombo, prev_scombo, new_scombo;
     8.5  
     8.6              if ( unlikely((sflags & GTF_type_mask) != GTF_permit_access) ||
     8.7 -                 unlikely(sdom != ld->domain) )
     8.8 +                 unlikely(sdom != ld->id) )
     8.9                  PIN_FAIL(GNTST_general_error,
    8.10                           "Bad flags (%x) or dom (%d). (NB. expected dom %d)\n",
    8.11 -                        sflags, sdom, ld->domain);
    8.12 +                        sflags, sdom, ld->id);
    8.13  
    8.14              /* Merge two 16-bit values into a 32-bit combined update. */
    8.15              /* NB. Endianness! */
    8.16 @@ -404,7 +404,7 @@ gnttab_setup_table(
    8.17  
    8.18      if ( op.dom == DOMID_SELF )
    8.19      {
    8.20 -        op.dom = current->domain;
    8.21 +        op.dom = current->id;
    8.22      }
    8.23      else if ( unlikely(!IS_PRIV(current)) )
    8.24      {
    8.25 @@ -486,7 +486,7 @@ gnttab_prepare_for_transfer(
    8.26      if ( unlikely((t = rd->grant_table) == NULL) ||
    8.27           unlikely(ref >= NR_GRANT_ENTRIES) )
    8.28      {
    8.29 -        DPRINTK("Dom %d has no g.t., or ref is bad (%d).\n", rd->domain, ref);
    8.30 +        DPRINTK("Dom %d has no g.t., or ref is bad (%d).\n", rd->id, ref);
    8.31          return 0;
    8.32      }
    8.33  
    8.34 @@ -500,10 +500,10 @@ gnttab_prepare_for_transfer(
    8.35      for ( ; ; )
    8.36      {
    8.37          if ( unlikely(sflags != GTF_accept_transfer) ||
    8.38 -             unlikely(sdom != ld->domain) )
    8.39 +             unlikely(sdom != ld->id) )
    8.40          {
    8.41              DPRINTK("Bad flags (%x) or dom (%d). (NB. expected dom %d)\n",
    8.42 -                    sflags, sdom, ld->domain);
    8.43 +                    sflags, sdom, ld->id);
    8.44              goto fail;
    8.45          }
    8.46  
    8.47 @@ -565,10 +565,11 @@ grant_table_create(
    8.48      memset(t, 0, sizeof(*t));
    8.49      spin_lock_init(&t->lock);
    8.50  
    8.51 -    /* Active grant-table page. */
    8.52 +    /* Active grant table. */
    8.53      if ( (t->active = xmalloc(sizeof(active_grant_entry_t) * 
    8.54                                NR_GRANT_ENTRIES)) == NULL )
    8.55          goto no_mem;
    8.56 +    memset(t->active, 0, sizeof(active_grant_entry_t) * NR_GRANT_ENTRIES);
    8.57  
    8.58      if ( (t->maptrack = (void *)alloc_xenheap_page()) == NULL )
    8.59          goto no_mem;
    8.60 @@ -576,7 +577,7 @@ grant_table_create(
    8.61      for ( i = 0; i < NR_MAPTRACK_ENTRIES; i++ )
    8.62          t->maptrack[i].ref_and_flags = (i+1) << MAPTRACK_REF_SHIFT;
    8.63  
    8.64 -    /* Set up shared grant-table page. */
    8.65 +    /* Shared grant table. */
    8.66      if ( (t->shared = (void *)alloc_xenheap_page()) == NULL )
    8.67          goto no_mem;
    8.68      memset(t->shared, 0, PAGE_SIZE);
     9.1 --- a/xen/common/keyhandler.c	Fri Oct 22 00:11:28 2004 +0000
     9.2 +++ b/xen/common/keyhandler.c	Fri Oct 22 10:55:47 2004 +0000
     9.3 @@ -72,7 +72,7 @@ void do_task_queues(unsigned char key, v
     9.4      {
     9.5          printk("Xen: DOM %u, CPU %d [has=%c] flags=%lx refcnt=%d nr_pages=%d "
     9.6                 "xenheap_pages=%d\n",
     9.7 -               d->domain, d->processor, 
     9.8 +               d->id, d->processor, 
     9.9                 test_bit(DF_RUNNING, &d->flags) ? 'T':'F', d->flags,
    9.10                 atomic_read(&d->refcnt), d->tot_pages, d->xenheap_pages);
    9.11  
    10.1 --- a/xen/common/page_alloc.c	Fri Oct 22 00:11:28 2004 +0000
    10.2 +++ b/xen/common/page_alloc.c	Fri Oct 22 10:55:47 2004 +0000
    10.3 @@ -398,7 +398,7 @@ struct pfn_info *alloc_domheap_pages(str
    10.4           unlikely((d->tot_pages + (1 << order)) > d->max_pages) )
    10.5      {
    10.6          DPRINTK("Over-allocation for domain %u: %u > %u\n",
    10.7 -                d->domain, d->tot_pages + (1 << order), d->max_pages);
    10.8 +                d->id, d->tot_pages + (1 << order), d->max_pages);
    10.9          DPRINTK("...or the domain is dying (%d)\n", 
   10.10                  !!test_bit(DF_DYING, &d->flags));
   10.11          spin_unlock(&d->page_alloc_lock);
    11.1 --- a/xen/common/physdev.c	Fri Oct 22 00:11:28 2004 +0000
    11.2 +++ b/xen/common/physdev.c	Fri Oct 22 10:55:47 2004 +0000
    11.3 @@ -220,7 +220,7 @@ int domain_iomem_in_pfn(struct domain *p
    11.4      struct list_head *l;
    11.5  
    11.6      VERBOSE_INFO("Checking if physdev-capable domain %u needs access to "
    11.7 -                 "pfn %08lx\n", p->domain, pfn);
    11.8 +                 "pfn %08lx\n", p->id, pfn);
    11.9      
   11.10      spin_lock(&p->pcidev_lock);
   11.11  
   11.12 @@ -248,7 +248,7 @@ int domain_iomem_in_pfn(struct domain *p
   11.13      spin_unlock(&p->pcidev_lock);
   11.14  
   11.15      VERBOSE_INFO("Domain %u %s mapping of pfn %08lx\n",
   11.16 -                 p->domain, ret ? "allowed" : "disallowed", pfn);
   11.17 +                 p->id, ret ? "allowed" : "disallowed", pfn);
   11.18  
   11.19      return ret;
   11.20  }
   11.21 @@ -331,7 +331,7 @@ static int do_base_address_access(phys_d
   11.22           * anyway if this write fails.  Hopefully the printk will give us a
   11.23           * clue what went wrong. */
   11.24          INFO("Guest %u attempting sub-dword %s to BASE_ADDRESS %d\n",
   11.25 -             pdev->owner->domain, (acc == ACC_READ) ? "read" : "write", idx);
   11.26 +             pdev->owner->id, (acc == ACC_READ) ? "read" : "write", idx);
   11.27          
   11.28          return -EPERM;
   11.29      }
    12.1 --- a/xen/common/sched_atropos.c	Fri Oct 22 00:11:28 2004 +0000
    12.2 +++ b/xen/common/sched_atropos.c	Fri Oct 22 10:55:47 2004 +0000
    12.3 @@ -212,7 +212,7 @@ static void at_add_task(struct domain *p
    12.4      p->lastschd = now;
    12.5   
    12.6      /* DOM 0's parameters must be set here for it to boot the system! */
    12.7 -    if(p->domain == 0)
    12.8 +    if(p->id == 0)
    12.9      {
   12.10          DOM_INFO(p)->remain = MILLISECS(15);
   12.11          DOM_INFO(p)->nat_period =
   12.12 @@ -250,7 +250,7 @@ static void dequeue(struct domain *sdom)
   12.13  {
   12.14      struct at_dom_info *inf = DOM_INFO(sdom);
   12.15      
   12.16 -    ASSERT(sdom->domain != IDLE_DOMAIN_ID);
   12.17 +    ASSERT(sdom->id != IDLE_DOMAIN_ID);
   12.18      
   12.19      /* just delete it from all the queues! */
   12.20      list_del(&inf->waitq);
   12.21 @@ -482,7 +482,7 @@ deschedule_done:
   12.22      /* MAW - the idle domain is always on the run queue.  We run from the
   12.23       * runqueue if it's NOT the idle domain or if there's nothing on the wait
   12.24       * queue */
   12.25 -    if (cur_sdom->domain == IDLE_DOMAIN_ID && !list_empty(WAITQ(cpu)))
   12.26 +    if (cur_sdom->id == IDLE_DOMAIN_ID && !list_empty(WAITQ(cpu)))
   12.27      {
   12.28          struct list_head *item;
   12.29  
   12.30 @@ -564,7 +564,7 @@ deschedule_done:
   12.31      ret.task = cur_sdom;
   12.32      ret.time = newtime - time;
   12.33  
   12.34 -    TRACE_1D(0, cur_sdom->domain);
   12.35 +    TRACE_1D(0, cur_sdom->id);
   12.36   
   12.37      return ret;
   12.38  }
   12.39 @@ -616,7 +616,7 @@ static void at_dump_cpu_state(int cpu)
   12.40      {
   12.41          d_inf = list_entry(list, struct at_dom_info, run_list);
   12.42          d = d_inf->owner;
   12.43 -        printk("%3d: %d has=%c ", loop++, d->domain, 
   12.44 +        printk("%3d: %d has=%c ", loop++, d->id, 
   12.45                                      test_bit(DF_RUNNING, &d->flags) ? 'T':'F');
   12.46          at_dump_runq_el(d);
   12.47          printk("c=0x%X%08X\n", (u32)(d->cpu_time>>32), (u32)d->cpu_time);
   12.48 @@ -634,7 +634,7 @@ static void at_dump_cpu_state(int cpu)
   12.49      {
   12.50          d_inf = list_entry(list, struct at_dom_info, waitq);
   12.51          d = d_inf->owner;
   12.52 -        printk("%3d: %d has=%c ", loop++, d->domain, 
   12.53 +        printk("%3d: %d has=%c ", loop++, d->id, 
   12.54                                      test_bit(DF_RUNNING, &d->flags) ? 'T':'F');
   12.55          at_dump_runq_el(d);
   12.56          printk("c=0x%X%08X\n", (u32)(d->cpu_time>>32), (u32)d->cpu_time);
    13.1 --- a/xen/common/sched_bvt.c	Fri Oct 22 00:11:28 2004 +0000
    13.2 +++ b/xen/common/sched_bvt.c	Fri Oct 22 10:55:47 2004 +0000
    13.3 @@ -194,7 +194,7 @@ void bvt_add_task(struct domain *d)
    13.4      inf->unwarp_timer.data = (unsigned long)inf;
    13.5      inf->unwarp_timer.function = &unwarp_timer_fn;
    13.6      
    13.7 -    if ( d->domain == IDLE_DOMAIN_ID )
    13.8 +    if ( d->id == IDLE_DOMAIN_ID )
    13.9      {
   13.10          inf->avt = inf->evt = ~0U;
   13.11      } 
   13.12 @@ -308,7 +308,7 @@ int bvt_adjdom(
   13.13          
   13.14          DPRINTK("Get domain %u bvt mcu_adv=%u, warpback=%d, warpvalue=%d, "
   13.15                  "warpl=%lld, warpu=%lld\n",
   13.16 -                d->domain, inf->mcu_advance, inf->warpback, inf->warp_value,
   13.17 +                d->id, inf->mcu_advance, inf->warpback, inf->warp_value,
   13.18                  inf->warpl, inf->warpu);
   13.19  
   13.20          /* Sanity -- this can avoid divide-by-zero. */
   13.21 @@ -331,7 +331,7 @@ int bvt_adjdom(
   13.22          
   13.23          DPRINTK("Get domain %u bvt mcu_adv=%u, warpback=%d, warpvalue=%d, "
   13.24                  "warpl=%lld, warpu=%lld\n",
   13.25 -                d->domain, inf->mcu_advance, inf->warpback, inf->warp_value,
   13.26 +                d->id, inf->mcu_advance, inf->warpback, inf->warp_value,
   13.27                  inf->warpl, inf->warpu);
   13.28                  
   13.29      }
   13.30 @@ -531,7 +531,7 @@ static void bvt_dump_cpu_state(int i)
   13.31      {
   13.32          d_inf = list_entry(list, struct bvt_dom_info, run_list);
   13.33          d = d_inf->domain;
   13.34 -        printk("%3d: %u has=%c ", loop++, d->domain,
   13.35 +        printk("%3d: %u has=%c ", loop++, d->id,
   13.36                 test_bit(DF_RUNNING, &d->flags) ? 'T':'F');
   13.37          bvt_dump_runq_el(d);
   13.38          printk("c=0x%X%08X\n", (u32)(d->cpu_time>>32), (u32)d->cpu_time);
    14.1 --- a/xen/common/sched_rrobin.c	Fri Oct 22 00:11:28 2004 +0000
    14.2 +++ b/xen/common/sched_rrobin.c	Fri Oct 22 10:55:47 2004 +0000
    14.3 @@ -180,7 +180,7 @@ void rr_wake(struct domain *d)
    14.4  
    14.5  static void rr_dump_domain(struct domain *d)
    14.6  {
    14.7 -    printk("%u has=%c ", d->domain,
    14.8 +    printk("%u has=%c ", d->id,
    14.9             test_bit(DF_RUNNING, &d->flags) ? 'T':'F');
   14.10      printk("c=0x%X%08X\n", (u32)(d->cpu_time>>32), (u32)d->cpu_time);
   14.11  }
    15.1 --- a/xen/common/schedule.c	Fri Oct 22 00:11:28 2004 +0000
    15.2 +++ b/xen/common/schedule.c	Fri Oct 22 10:55:47 2004 +0000
    15.3 @@ -127,7 +127,7 @@ void sched_add_domain(struct domain *d)
    15.4      /* Must be unpaused by control software to start execution. */
    15.5      set_bit(DF_CTRLPAUSE, &d->flags);
    15.6  
    15.7 -    if ( d->domain != IDLE_DOMAIN_ID )
    15.8 +    if ( d->id != IDLE_DOMAIN_ID )
    15.9      {
   15.10          /* Initialise the per-domain timer. */
   15.11          init_ac_timer(&d->timer);
   15.12 @@ -142,14 +142,14 @@ void sched_add_domain(struct domain *d)
   15.13  
   15.14      SCHED_OP(add_task, d);
   15.15  
   15.16 -    TRACE_2D(TRC_SCHED_DOM_ADD, d->domain, d);
   15.17 +    TRACE_2D(TRC_SCHED_DOM_ADD, d->id, d);
   15.18  }
   15.19  
   15.20  void sched_rem_domain(struct domain *d) 
   15.21  {
   15.22      rem_ac_timer(&d->timer);
   15.23      SCHED_OP(rem_task, d);
   15.24 -    TRACE_2D(TRC_SCHED_DOM_REM, d->domain, d);
   15.25 +    TRACE_2D(TRC_SCHED_DOM_REM, d->id, d);
   15.26  }
   15.27  
   15.28  void init_idle_task(void)
   15.29 @@ -185,7 +185,7 @@ void domain_wake(struct domain *d)
   15.30  
   15.31      if ( likely(domain_runnable(d)) )
   15.32      {
   15.33 -        TRACE_2D(TRC_SCHED_WAKE, d->domain, d);
   15.34 +        TRACE_2D(TRC_SCHED_WAKE, d->id, d);
   15.35          SCHED_OP(wake, d);
   15.36  #ifdef WAKE_HISTO
   15.37          d->wokenup = NOW();
   15.38 @@ -200,10 +200,10 @@ void domain_wake(struct domain *d)
   15.39  /* Block the currently-executing domain until a pertinent event occurs. */
   15.40  long do_block(void)
   15.41  {
   15.42 -    ASSERT(current->domain != IDLE_DOMAIN_ID);
   15.43 +    ASSERT(current->id != IDLE_DOMAIN_ID);
   15.44      current->shared_info->vcpu_data[0].evtchn_upcall_mask = 0;
   15.45      set_bit(DF_BLOCKED, &current->flags);
   15.46 -    TRACE_2D(TRC_SCHED_BLOCK, current->domain, current);
   15.47 +    TRACE_2D(TRC_SCHED_BLOCK, current->id, current);
   15.48      __enter_scheduler();
   15.49      return 0;
   15.50  }
   15.51 @@ -211,7 +211,7 @@ long do_block(void)
   15.52  /* Voluntarily yield the processor for this allocation. */
   15.53  static long do_yield(void)
   15.54  {
   15.55 -    TRACE_2D(TRC_SCHED_YIELD, current->domain, current);
   15.56 +    TRACE_2D(TRC_SCHED_YIELD, current->id, current);
   15.57      __enter_scheduler();
   15.58      return 0;
   15.59  }
   15.60 @@ -264,7 +264,7 @@ long do_set_timer_op(unsigned long timeo
   15.61          add_ac_timer(&p->timer);
   15.62      }
   15.63  
   15.64 -    TRACE_4D(TRC_SCHED_SET_TIMER, p->domain, p, timeout_hi, timeout_lo);
   15.65 +    TRACE_4D(TRC_SCHED_SET_TIMER, p->id, p, timeout_hi, timeout_lo);
   15.66  
   15.67      return 0;
   15.68  }
   15.69 @@ -301,7 +301,7 @@ long sched_adjdom(struct sched_adjdom_cm
   15.70      if ( d == NULL )
   15.71          return -ESRCH;
   15.72  
   15.73 -    TRACE_1D(TRC_SCHED_ADJDOM, d->domain);
   15.74 +    TRACE_1D(TRC_SCHED_ADJDOM, d->id);
   15.75  
   15.76      spin_lock_irq(&schedule_data[d->processor].schedule_lock);
   15.77      SCHED_OP(adjdom, d, cmd);
   15.78 @@ -394,7 +394,7 @@ void __enter_scheduler(void)
   15.79      }
   15.80  #endif
   15.81  
   15.82 -    TRACE_2D(TRC_SCHED_SWITCH, next->domain, next);
   15.83 +    TRACE_2D(TRC_SCHED_SWITCH, next->id, next);
   15.84  
   15.85      switch_to(prev, next);
   15.86  
    16.1 --- a/xen/drivers/char/console.c	Fri Oct 22 00:11:28 2004 +0000
    16.2 +++ b/xen/drivers/char/console.c	Fri Oct 22 10:55:47 2004 +0000
    16.3 @@ -294,7 +294,7 @@ long do_console_io(int cmd, int count, c
    16.4  
    16.5  #ifndef VERBOSE
    16.6      /* Only domain-0 may access the emergency console. */
    16.7 -    if ( current->domain != 0 )
    16.8 +    if ( current->id != 0 )
    16.9          return -EPERM;
   16.10  #endif
   16.11  
    17.1 --- a/xen/include/asm-x86/shadow.h	Fri Oct 22 00:11:28 2004 +0000
    17.2 +++ b/xen/include/asm-x86/shadow.h	Fri Oct 22 10:55:47 2004 +0000
    17.3 @@ -62,7 +62,7 @@ struct shadow_status {
    17.4  #ifdef VERBOSE
    17.5  #define SH_LOG(_f, _a...)                             \
    17.6  printk("DOM%u: (file=shadow.c, line=%d) " _f "\n",    \
    17.7 -       current->domain , __LINE__ , ## _a )
    17.8 +       current->id , __LINE__ , ## _a )
    17.9  #else
   17.10  #define SH_LOG(_f, _a...) 
   17.11  #endif
   17.12 @@ -70,7 +70,7 @@ printk("DOM%u: (file=shadow.c, line=%d) 
   17.13  #if SHADOW_DEBUG
   17.14  #define SH_VLOG(_f, _a...)                             \
   17.15      printk("DOM%u: (file=shadow.c, line=%d) " _f "\n", \
   17.16 -           current->domain , __LINE__ , ## _a )
   17.17 +           current->id , __LINE__ , ## _a )
   17.18  #else
   17.19  #define SH_VLOG(_f, _a...) 
   17.20  #endif
   17.21 @@ -78,7 +78,7 @@ printk("DOM%u: (file=shadow.c, line=%d) 
   17.22  #if 0
   17.23  #define SH_VVLOG(_f, _a...)                             \
   17.24      printk("DOM%u: (file=shadow.c, line=%d) " _f "\n",  \
   17.25 -           current->domain , __LINE__ , ## _a )
   17.26 +           current->id , __LINE__ , ## _a )
   17.27  #else
   17.28  #define SH_VVLOG(_f, _a...) 
   17.29  #endif
    18.1 --- a/xen/include/xen/sched.h	Fri Oct 22 00:11:28 2004 +0000
    18.2 +++ b/xen/include/xen/sched.h	Fri Oct 22 10:55:47 2004 +0000
    18.3 @@ -29,16 +29,19 @@ struct domain;
    18.4  typedef struct event_channel_st
    18.5  {
    18.6  #define ECS_FREE         0 /* Channel is available for use.                  */
    18.7 -#define ECS_UNBOUND      1 /* Channel is not bound to a particular source.   */
    18.8 +#define ECS_UNBOUND      1 /* Channel is waiting to bind to a remote domain. */
    18.9  #define ECS_INTERDOMAIN  2 /* Channel is bound to another domain.            */
   18.10  #define ECS_PIRQ         3 /* Channel is bound to a physical IRQ line.       */
   18.11  #define ECS_VIRQ         4 /* Channel is bound to a virtual IRQ line.        */
   18.12      u16 state;
   18.13      union {
   18.14          struct {
   18.15 -            u16 port;
   18.16 -            struct domain *dom;
   18.17 -        } __attribute__ ((packed)) remote; /* state == ECS_CONNECTED */
   18.18 +            domid_t remote_domid;
   18.19 +        } __attribute__ ((packed)) unbound; /* state == ECS_UNBOUND */
   18.20 +        struct {
   18.21 +            u16            remote_port;
   18.22 +            struct domain *remote_dom;
   18.23 +        } __attribute__ ((packed)) interdomain; /* state == ECS_INTERDOMAIN */
   18.24          u16 pirq; /* state == ECS_PIRQ */
   18.25          u16 virq; /* state == ECS_VIRQ */
   18.26      } u;
   18.27 @@ -83,7 +86,7 @@ struct domain
   18.28       * From here on things can be added and shuffled without special attention
   18.29       */
   18.30  
   18.31 -    domid_t  domain;
   18.32 +    domid_t  id;
   18.33      s_time_t create_time;
   18.34  
   18.35      spinlock_t       page_alloc_lock; /* protects all the following fields  */