ia64/xen-unstable

changeset 4877:357faeff6316

bitkeeper revision 1.1389.20.1 (42836117f2yEkILParltXJcom3kTeA)

More descriptive 'flags' and 'id' field names for exec_domain/domain
structures seems a good idea after all. At the same time, I've renamed
the flag macros to be a bit neater and more descriptive, and more in
keeping with the style of such definitions in asm/mm.h, for example.
Signed-off-by: Keir Fraser <keir@xensource.com>
author kaf24@firebug.cl.cam.ac.uk
date Thu May 12 13:58:47 2005 +0000 (2005-05-12)
parents fcec698401ea
children afa3a2c51d40
files xen/arch/ia64/domain.c xen/arch/ia64/idle0_task.c xen/arch/ia64/patch/linux-2.6.7/init_task.h xen/arch/ia64/process.c xen/arch/ia64/xenmisc.c xen/arch/ia64/xensetup.c xen/arch/x86/audit.c xen/arch/x86/dom0_ops.c xen/arch/x86/domain.c xen/arch/x86/domain_build.c xen/arch/x86/i387.c xen/arch/x86/idle0_task.c xen/arch/x86/mm.c xen/arch/x86/physdev.c xen/arch/x86/setup.c xen/arch/x86/shadow.c xen/arch/x86/smpboot.c xen/arch/x86/traps.c xen/arch/x86/vmx.c xen/arch/x86/vmx_vmcs.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/sched_bvt.c xen/common/sched_sedf.c xen/common/schedule.c xen/drivers/char/console.c xen/include/asm-x86/config.h xen/include/asm-x86/debugger.h xen/include/asm-x86/i387.h xen/include/asm-x86/shadow.h xen/include/xen/event.h xen/include/xen/sched.h
line diff
     1.1 --- a/xen/arch/ia64/domain.c	Thu May 12 13:28:39 2005 +0000
     1.2 +++ b/xen/arch/ia64/domain.c	Thu May 12 13:58:47 2005 +0000
     1.3 @@ -626,7 +626,7 @@ int construct_dom0(struct domain *d,
     1.4  #ifndef CLONE_DOMAIN0
     1.5  	if ( d != dom0 ) 
     1.6  	    BUG();
     1.7 -	if ( test_bit(DF_CONSTRUCTED, &d->flags) ) 
     1.8 +	if ( test_bit(_DOMF_constructed, &d->domain_flags) ) 
     1.9  	    BUG();
    1.10  #endif
    1.11  
    1.12 @@ -753,7 +753,7 @@ int construct_dom0(struct domain *d,
    1.13  #endif
    1.14  	console_endboot(strstr(cmdline, "tty0") != NULL);
    1.15  
    1.16 -	set_bit(DF_CONSTRUCTED, &d->flags);
    1.17 +	set_bit(_DOMF_constructed, &d->domain_flags);
    1.18  
    1.19  	new_thread(ed, pkern_entry, 0, 0);
    1.20  	// FIXME: Hack for keyboard input
    1.21 @@ -783,10 +783,10 @@ int construct_domU(struct domain *d,
    1.22  	unsigned long pkern_entry;
    1.23  
    1.24  #ifndef DOMU_AUTO_RESTART
    1.25 -	if ( test_bit(DF_CONSTRUCTED, &d->flags) ) BUG();
    1.26 +	if ( test_bit(_DOMF_constructed, &d->domain_flags) ) BUG();
    1.27  #endif
    1.28  
    1.29 -	printk("*** LOADING DOMAIN %d ***\n",d->id);
    1.30 +	printk("*** LOADING DOMAIN %d ***\n",d->domain_id);
    1.31  
    1.32  	d->max_pages = dom0_size/PAGE_SIZE;	// FIXME: use dom0 size
    1.33  	// FIXME: use domain0 command line
    1.34 @@ -796,13 +796,13 @@ int construct_domU(struct domain *d,
    1.35  
    1.36  	d->arch.mm = xmalloc(struct mm_struct);
    1.37  	if (unlikely(!d->arch.mm)) {
    1.38 -	    	printk("Can't allocate mm_struct for domain %d\n",d->id);
    1.39 +	    	printk("Can't allocate mm_struct for domain %d\n",d->domain_id);
    1.40  	    	return -ENOMEM;
    1.41  	}
    1.42  	memset(d->arch.mm, 0, sizeof(*d->arch.mm));
    1.43  	d->arch.mm->pgd = pgd_alloc(d->arch.mm);
    1.44  	if (unlikely(!d->arch.mm->pgd)) {
    1.45 -	    	printk("Can't allocate pgd for domain %d\n",d->id);
    1.46 +	    	printk("Can't allocate pgd for domain %d\n",d->domain_id);
    1.47  	    	return -ENOMEM;
    1.48  	}
    1.49  
    1.50 @@ -816,7 +816,7 @@ int construct_domU(struct domain *d,
    1.51  	loaddomainelfimage(d,image_start);
    1.52  	printk("loaddomainelfimage returns\n");
    1.53  
    1.54 -	set_bit(DF_CONSTRUCTED, &d->flags);
    1.55 +	set_bit(_DOMF_constructed, &d->domain_flags);
    1.56  
    1.57  	printk("calling new_thread, entry=%p\n",pkern_entry);
    1.58  #ifdef DOMU_AUTO_RESTART
    1.59 @@ -836,7 +836,7 @@ void reconstruct_domU(struct exec_domain
    1.60  {
    1.61  	/* re-copy the OS image to reset data values to original */
    1.62  	printk("reconstruct_domU: restarting domain %d...\n",
    1.63 -		ed->domain->id);
    1.64 +		ed->domain->domain_id);
    1.65  	loaddomainelfimage(ed->domain,ed->domain->arch.image_start);
    1.66  	new_thread(ed, ed->domain->arch.entry, 0, 0);
    1.67  }
    1.68 @@ -859,7 +859,7 @@ int launch_domainU(unsigned long size)
    1.69  	else next++;
    1.70  	if (construct_domU(d, (unsigned long)domU_staging_area, size,0,0,0)) {
    1.71  		printf("launch_domainU: couldn't construct(id=%d,%lx,%lx)\n",
    1.72 -			d->id,domU_staging_area,size);
    1.73 +			d->domain_id,domU_staging_area,size);
    1.74  		return 2;
    1.75  	}
    1.76  	domain_unpause_by_systemcontroller(d);
     2.1 --- a/xen/arch/ia64/idle0_task.c	Thu May 12 13:28:39 2005 +0000
     2.2 +++ b/xen/arch/ia64/idle0_task.c	Thu May 12 13:58:47 2005 +0000
     2.3 @@ -21,8 +21,8 @@
     2.4  
     2.5  #define IDLE0_DOMAIN(_t)             \
     2.6  {                                    \
     2.7 -    id:          IDLE_DOMAIN_ID,     \
     2.8 -    flags:     1<<DF_IDLETASK,       \
     2.9 +    domain_id:   IDLE_DOMAIN_ID,     \
    2.10 +    domain_flags:DOMF_idle_domain,   \
    2.11      refcnt:      ATOMIC_INIT(1)      \
    2.12  }
    2.13  
     3.1 --- a/xen/arch/ia64/patch/linux-2.6.7/init_task.h	Thu May 12 13:28:39 2005 +0000
     3.2 +++ b/xen/arch/ia64/patch/linux-2.6.7/init_task.h	Thu May 12 13:58:47 2005 +0000
     3.3 @@ -35,8 +35,8 @@
     3.4  +#define INIT_TASK(tsk) \
     3.5  +{							\
     3.6  +	/*processor:	0,*/				\
     3.7 -+	/*id:		IDLE_DOMAIN_ID,*/		\
     3.8 -+	/*flags:	1<<DF_IDLETASK,*/		\
     3.9 ++	/*domain_id:	IDLE_DOMAIN_ID,*/		\
    3.10 ++	/*domain_flags:	DOMF_idle_domain,*/		\
    3.11  +	refcnt:		ATOMIC_INIT(1)			\
    3.12  +}
    3.13  +#else
     4.1 --- a/xen/arch/ia64/process.c	Thu May 12 13:28:39 2005 +0000
     4.2 +++ b/xen/arch/ia64/process.c	Thu May 12 13:58:47 2005 +0000
     4.3 @@ -214,7 +214,7 @@ void deliver_pending_interrupt(struct pt
     4.4  		if (vcpu_deliverable_interrupts(ed)) {
     4.5  			unsigned long isr = regs->cr_ipsr & IA64_PSR_RI;
     4.6  			if (vcpu_timer_pending_early(ed))
     4.7 -printf("*#*#*#* about to deliver early timer to domain %d!!!\n",ed->domain->id);
     4.8 +printf("*#*#*#* about to deliver early timer to domain %d!!!\n",ed->domain->domain_id);
     4.9  			reflect_interruption(0,isr,0,regs,IA64_EXTINT_VECTOR);
    4.10  		}
    4.11  	}
     5.1 --- a/xen/arch/ia64/xenmisc.c	Thu May 12 13:28:39 2005 +0000
     5.2 +++ b/xen/arch/ia64/xenmisc.c	Thu May 12 13:58:47 2005 +0000
     5.3 @@ -234,21 +234,21 @@ void context_switch(struct exec_domain *
     5.4  {
     5.5  //printk("@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@\n");
     5.6  //printk("@@@@@@ context switch from domain %d (%x) to domain %d (%x)\n",
     5.7 -//prev->domain->id,(long)prev&0xffffff,next->domain->id,(long)next&0xffffff);
     5.8 -//if (prev->domain->id == 1 && next->domain->id == 0) cs10foo();
     5.9 -//if (prev->domain->id == 0 && next->domain->id == 1) cs01foo();
    5.10 -//printk("@@sw %d->%d\n",prev->domain->id,next->domain->id);
    5.11 +//prev->domain->domain_id,(long)prev&0xffffff,next->domain->domain_id,(long)next&0xffffff);
    5.12 +//if (prev->domain->domain_id == 1 && next->domain->domain_id == 0) cs10foo();
    5.13 +//if (prev->domain->domain_id == 0 && next->domain->domain_id == 1) cs01foo();
    5.14 +//printk("@@sw %d->%d\n",prev->domain->domain_id,next->domain->domain_id);
    5.15  	switch_to(prev,next,prev);
    5.16  // leave this debug for now: it acts as a heartbeat when more than
    5.17  // one domain is active
    5.18  {
    5.19  static long cnt[16] = { 50,50,50,50,50,50,50,50,50,50,50,50,50,50,50,50};
    5.20  static int i = 100;
    5.21 -int id = ((struct exec_domain *)current)->domain->id & 0xf;
    5.22 +int id = ((struct exec_domain *)current)->domain->domain_id & 0xf;
    5.23  if (!cnt[id]--) { printk("%x",id); cnt[id] = 50; }
    5.24  if (!i--) { printk("+",id); cnt[id] = 100; }
    5.25  }
    5.26 -	clear_bit(EDF_RUNNING, &prev->flags);
    5.27 +	clear_bit(_VCPUF_running, &prev->vcpu_flags);
    5.28  	//if (!is_idle_task(next->domain) )
    5.29  		//send_guest_virq(next, VIRQ_TIMER);
    5.30  	load_region_regs(current);
    5.31 @@ -271,15 +271,15 @@ void panic_domain(struct pt_regs *regs, 
    5.32      
    5.33  loop:
    5.34  	printf("$$$$$ PANIC in domain %d (k6=%p): ",
    5.35 -		ed->domain->id, ia64_get_kr(IA64_KR_CURRENT));
    5.36 +		ed->domain->domain_id, ia64_get_kr(IA64_KR_CURRENT));
    5.37  	va_start(args, fmt);
    5.38  	(void)vsnprintf(buf, sizeof(buf), fmt, args);
    5.39  	va_end(args);
    5.40  	printf(buf);
    5.41  	if (regs) show_registers(regs);
    5.42  	domain_pause_by_systemcontroller(current->domain);
    5.43 -	set_bit(DF_CRASHED, ed->domain->flags);
    5.44 -	if (ed->domain->id == 0) {
    5.45 +	set_bit(_DOMF_crashed, ed->domain->domain_flags);
    5.46 +	if (ed->domain->domain_id == 0) {
    5.47  		int i = 1000000000L;
    5.48  		// if domain0 crashes, just periodically print out panic
    5.49  		// message to make post-mortem easier
     6.1 --- a/xen/arch/ia64/xensetup.c	Thu May 12 13:28:39 2005 +0000
     6.2 +++ b/xen/arch/ia64/xensetup.c	Thu May 12 13:58:47 2005 +0000
     6.3 @@ -262,7 +262,7 @@ printk("About to call init_idle_task()\n
     6.4      if ( dom0 == NULL )
     6.5          panic("Error creating domain 0\n");
     6.6  
     6.7 -    set_bit(DF_PRIVILEGED, &dom0->flags);
     6.8 +    set_bit(_DOMF_privileged, &dom0->domain_flags);
     6.9  
    6.10      /*
    6.11       * We're going to setup domain0 using the module(s) that we stashed safely
     7.1 --- a/xen/arch/x86/audit.c	Thu May 12 13:28:39 2005 +0000
     7.2 +++ b/xen/arch/x86/audit.c	Thu May 12 13:58:47 2005 +0000
     7.3 @@ -74,7 +74,7 @@ int audit_adjust_pgtables(struct domain 
     7.4              {
     7.5                  APRINTK("Audit %d: type count went below zero "
     7.6                          "mfn=%lx t=%x ot=%x",
     7.7 -                        d->id, page_to_pfn(page),
     7.8 +                        d->domain_id, page_to_pfn(page),
     7.9                          page->u.inuse.type_info,
    7.10                          page->tlbflush_timestamp);
    7.11                  errors++;
    7.12 @@ -83,7 +83,7 @@ int audit_adjust_pgtables(struct domain 
    7.13              {
    7.14                  APRINTK("Audit %d: type count overflowed "
    7.15                          "mfn=%lx t=%x ot=%x",
    7.16 -                        d->id, page_to_pfn(page),
    7.17 +                        d->domain_id, page_to_pfn(page),
    7.18                          page->u.inuse.type_info,
    7.19                          page->tlbflush_timestamp);
    7.20                  errors++;
    7.21 @@ -102,7 +102,7 @@ int audit_adjust_pgtables(struct domain 
    7.22          {
    7.23              APRINTK("Audit %d: general count went below zero "
    7.24                      "mfn=%lx t=%x ot=%x",
    7.25 -                    d->id, page_to_pfn(page),
    7.26 +                    d->domain_id, page_to_pfn(page),
    7.27                      page->u.inuse.type_info,
    7.28                      page->tlbflush_timestamp);
    7.29              errors++;
    7.30 @@ -111,7 +111,7 @@ int audit_adjust_pgtables(struct domain 
    7.31          {
    7.32              APRINTK("Audit %d: general count overflowed "
    7.33                      "mfn=%lx t=%x ot=%x",
    7.34 -                    d->id, page_to_pfn(page),
    7.35 +                    d->domain_id, page_to_pfn(page),
    7.36                      page->u.inuse.type_info,
    7.37                      page->tlbflush_timestamp);
    7.38              errors++;
    7.39 @@ -142,7 +142,7 @@ int audit_adjust_pgtables(struct domain 
    7.40                                     "belonging to a domain %p (id=%d)\n",
    7.41                                     l1mfn,
    7.42                                     page_get_owner(l1page),
    7.43 -                                   page_get_owner(l1page)->id);
    7.44 +                                   page_get_owner(l1page)->domain_id);
    7.45                              errors++;
    7.46                              continue;
    7.47                          }
    7.48 @@ -153,7 +153,7 @@ int audit_adjust_pgtables(struct domain 
    7.49                          {
    7.50                              printk("Audit %d: [Shadow L2 mfn=%lx i=%x] "
    7.51                                     "Expected Shadow L1 t=%x mfn=%lx\n",
    7.52 -                                   d->id, mfn, i,
    7.53 +                                   d->domain_id, mfn, i,
    7.54                                     l1page->u.inuse.type_info, l1mfn);
    7.55                              errors++;
    7.56                          }
    7.57 @@ -167,7 +167,7 @@ int audit_adjust_pgtables(struct domain 
    7.58                                     l1mfn,
    7.59                                     page_get_owner(l1page),
    7.60                                     (page_get_owner(l1page)
    7.61 -                                    ? page_get_owner(l1page)->id
    7.62 +                                    ? page_get_owner(l1page)->domain_id
    7.63                                      : -1));
    7.64                              errors++;
    7.65                              continue;
    7.66 @@ -179,14 +179,14 @@ int audit_adjust_pgtables(struct domain 
    7.67                          {
    7.68                              printk("Audit %d: [%x] Found %s Linear PT "
    7.69                                     "t=%x mfn=%lx\n",
    7.70 -                                   d->id, i, (l1mfn==mfn) ? "Self" : "Other",
    7.71 +                                   d->domain_id, i, (l1mfn==mfn) ? "Self" : "Other",
    7.72                                     l1page->u.inuse.type_info, l1mfn);
    7.73                          }
    7.74                          else if ( page_type != PGT_l1_page_table )
    7.75                          {
    7.76                              printk("Audit %d: [L2 mfn=%lx i=%x] "
    7.77                                     "Expected L1 t=%x mfn=%lx\n",
    7.78 -                                   d->id, mfn, i,
    7.79 +                                   d->domain_id, mfn, i,
    7.80                                     l1page->u.inuse.type_info, l1mfn);
    7.81                              errors++;
    7.82                          }
    7.83 @@ -238,9 +238,9 @@ int audit_adjust_pgtables(struct domain 
    7.84                      {
    7.85                          printk("Audit %d: [hl2mfn=%lx,i=%x] Skip foreign page "
    7.86                                 "dom=%p (id=%d) mfn=%lx c=%08x t=%08x\n",
    7.87 -                               d->id, hl2mfn, i,
    7.88 +                               d->domain_id, hl2mfn, i,
    7.89                                 page_get_owner(gpage),
    7.90 -                               page_get_owner(gpage)->id,
    7.91 +                               page_get_owner(gpage)->domain_id,
    7.92                                 gmfn,
    7.93                                 gpage->count_info,
    7.94                                 gpage->u.inuse.type_info);
    7.95 @@ -289,7 +289,7 @@ int audit_adjust_pgtables(struct domain 
    7.96                          {
    7.97                              printk("Audit %d: [l1mfn=%lx, i=%x] Illegal RW "
    7.98                                     "t=%x mfn=%lx\n",
    7.99 -                                   d->id, l1mfn, i,
   7.100 +                                   d->domain_id, l1mfn, i,
   7.101                                     gpage->u.inuse.type_info, gmfn);
   7.102                              errors++;
   7.103                          }
   7.104 @@ -300,7 +300,7 @@ int audit_adjust_pgtables(struct domain 
   7.105                          {
   7.106                              printk("Audit %d: [l1mfn=%lx, i=%x] Illegal RW of "
   7.107                                     "page table gmfn=%lx\n",
   7.108 -                                   d->id, l1mfn, i, gmfn);
   7.109 +                                   d->domain_id, l1mfn, i, gmfn);
   7.110                              errors++;
   7.111                          }
   7.112                      }		   
   7.113 @@ -309,9 +309,9 @@ int audit_adjust_pgtables(struct domain 
   7.114                      {
   7.115                          printk("Audit %d: [l1mfn=%lx,i=%x] Skip foreign page "
   7.116                                 "dom=%p (id=%d) mfn=%lx c=%08x t=%08x\n",
   7.117 -                               d->id, l1mfn, i,
   7.118 +                               d->domain_id, l1mfn, i,
   7.119                                 page_get_owner(gpage),
   7.120 -                               page_get_owner(gpage)->id,
   7.121 +                               page_get_owner(gpage)->domain_id,
   7.122                                 gmfn,
   7.123                                 gpage->count_info,
   7.124                                 gpage->u.inuse.type_info);
   7.125 @@ -455,7 +455,7 @@ int audit_adjust_pgtables(struct domain 
   7.126                      {
   7.127                          printk("Audit %d: found an L2 guest page "
   7.128                                 "mfn=%lx t=%08x c=%08x while in shadow mode\n",
   7.129 -                               d->id, mfn, page->u.inuse.type_info,
   7.130 +                               d->domain_id, mfn, page->u.inuse.type_info,
   7.131                                 page->count_info);
   7.132                          errors++;
   7.133                      }
   7.134 @@ -466,14 +466,14 @@ int audit_adjust_pgtables(struct domain 
   7.135                               PGT_validated )
   7.136                          {
   7.137                              printk("Audit %d: L2 mfn=%lx not validated %08x\n",
   7.138 -                                   d->id, mfn, page->u.inuse.type_info);
   7.139 +                                   d->domain_id, mfn, page->u.inuse.type_info);
   7.140                              errors++;
   7.141                          }
   7.142  
   7.143                          if ( (page->u.inuse.type_info & PGT_pinned) != PGT_pinned )
   7.144                          {
   7.145                              printk("Audit %d: L2 mfn=%lx not pinned t=%08x\n",
   7.146 -                                   d->id, mfn, page->u.inuse.type_info);
   7.147 +                                   d->domain_id, mfn, page->u.inuse.type_info);
   7.148                              errors++;
   7.149                          }
   7.150                      }
   7.151 @@ -506,7 +506,7 @@ int audit_adjust_pgtables(struct domain 
   7.152                               PGT_validated )
   7.153                          {
   7.154                              printk("Audit %d: L1 not validated mfn=%lx t=%08x\n",
   7.155 -                                   d->id, mfn, page->u.inuse.type_info);
   7.156 +                                   d->domain_id, mfn, page->u.inuse.type_info);
   7.157                              errors++;
   7.158                          }
   7.159  
   7.160 @@ -515,7 +515,7 @@ int audit_adjust_pgtables(struct domain 
   7.161                              if ( !VM_ASSIST(d, VMASST_TYPE_writable_pagetables) )
   7.162                              {
   7.163                                  printk("Audit %d: L1 mfn=%lx not pinned t=%08x\n",
   7.164 -                                       d->id, mfn, page->u.inuse.type_info);
   7.165 +                                       d->domain_id, mfn, page->u.inuse.type_info);
   7.166                              }
   7.167                          }
   7.168                      }
   7.169 @@ -601,7 +601,7 @@ void audit_pagelist(struct domain *d)
   7.170      if ( xenpages != d->xenheap_pages ||
   7.171           totpages != d->tot_pages )
   7.172      {
   7.173 -        printk("ARGH! dom %d: xen=%d %d, pages=%d %d\n", d->id,
   7.174 +        printk("ARGH! dom %d: xen=%d %d, pages=%d %d\n", d->domain_id,
   7.175                 xenpages, d->xenheap_pages, 
   7.176                 totpages, d->tot_pages );
   7.177      }
   7.178 @@ -623,7 +623,7 @@ void _audit_domain(struct domain *d, int
   7.179              if ( (pt[i] & _PAGE_PRESENT) && ((pt[i] >> PAGE_SHIFT) == xmfn) )
   7.180                  printk("     found dom=%d mfn=%lx t=%08x c=%08x "
   7.181                         "pt[i=%x]=%lx\n",
   7.182 -                       d->id, mfn, page->u.inuse.type_info,
   7.183 +                       d->domain_id, mfn, page->u.inuse.type_info,
   7.184                         page->count_info, i, pt[i]);
   7.185          }
   7.186  
   7.187 @@ -721,7 +721,7 @@ void _audit_domain(struct domain *d, int
   7.188      {
   7.189          printk("skipping audit domain of translated domain %d "
   7.190                 "from other context\n",
   7.191 -               d->id);
   7.192 +               d->domain_id);
   7.193          return;
   7.194      }
   7.195  
   7.196 @@ -832,7 +832,7 @@ void _audit_domain(struct domain *d, int
   7.197      if ( !(flags & AUDIT_QUIET) &&
   7.198           ((io_mappings > 0) || (lowmem_mappings > 0)) )
   7.199          printk("Audit %d: Found %d lowmem mappings and %d io mappings\n",
   7.200 -               d->id, lowmem_mappings, io_mappings);
   7.201 +               d->domain_id, lowmem_mappings, io_mappings);
   7.202  
   7.203      /* PHASE 2 */
   7.204  
   7.205 @@ -849,7 +849,7 @@ void _audit_domain(struct domain *d, int
   7.206              if ( (page->u.inuse.type_info & PGT_count_mask) != 0 )
   7.207              {
   7.208                  printk("Audit %d: type count!=0 t=%x ot=%x c=%x mfn=%lx\n",
   7.209 -                       d->id, page->u.inuse.type_info, 
   7.210 +                       d->domain_id, page->u.inuse.type_info, 
   7.211                         page->tlbflush_timestamp,
   7.212                         page->count_info, mfn);
   7.213                  errors++;
   7.214 @@ -863,7 +863,7 @@ void _audit_domain(struct domain *d, int
   7.215              if ( (page->u.inuse.type_info & PGT_count_mask) != 0 )
   7.216              {
   7.217                  printk("Audit %d: type count!=0 t=%x ot=%x c=%x mfn=%lx\n",
   7.218 -                       d->id, page->u.inuse.type_info, 
   7.219 +                       d->domain_id, page->u.inuse.type_info, 
   7.220                         page->tlbflush_timestamp,
   7.221                         page->count_info, mfn);
   7.222                  //errors++;
   7.223 @@ -876,7 +876,7 @@ void _audit_domain(struct domain *d, int
   7.224          if ( (page->count_info & PGC_count_mask) != 1 )
   7.225          {
   7.226              printk("Audit %d: gen count!=1 (c=%x) t=%x ot=%x mfn=%lx\n",
   7.227 -                   d->id,
   7.228 +                   d->domain_id,
   7.229                     page->count_info,
   7.230                     page->u.inuse.type_info, 
   7.231                     page->tlbflush_timestamp, mfn );
   7.232 @@ -912,7 +912,7 @@ void _audit_domain(struct domain *d, int
   7.233                      {
   7.234                          printk("Audit %d: shadow page counts wrong "
   7.235                                 "mfn=%lx t=%08x c=%08x\n",
   7.236 -                               d->id, page_to_pfn(page),
   7.237 +                               d->domain_id, page_to_pfn(page),
   7.238                                 page->u.inuse.type_info,
   7.239                                 page->count_info);
   7.240                          printk("a->gpfn_and_flags=%p\n",
   7.241 @@ -950,7 +950,7 @@ void _audit_domain(struct domain *d, int
   7.242      if ( !(flags & AUDIT_QUIET) )
   7.243          printk("Audit dom%d Done. "
   7.244                 "pages=%d oos=%d l1=%d l2=%d ctot=%d ttot=%d\n",
   7.245 -               d->id, page_count, oos_count, l1, l2, ctot, ttot);
   7.246 +               d->domain_id, page_count, oos_count, l1, l2, ctot, ttot);
   7.247  
   7.248      if ( !(flags & AUDIT_SHADOW_ALREADY_LOCKED) )
   7.249          shadow_unlock(d);
     8.1 --- a/xen/arch/x86/dom0_ops.c	Thu May 12 13:28:39 2005 +0000
     8.2 +++ b/xen/arch/x86/dom0_ops.c	Thu May 12 13:58:47 2005 +0000
     8.3 @@ -397,7 +397,7 @@ void arch_getdomaininfo_ctxt(
     8.4  #endif
     8.5  
     8.6      c->flags = 0;
     8.7 -    if ( test_bit(EDF_DONEFPUINIT, &ed->flags) )
     8.8 +    if ( test_bit(_VCPUF_fpu_initialised, &ed->vcpu_flags) )
     8.9          c->flags |= VGCF_I387_VALID;
    8.10      if ( KERNEL_MODE(ed, &ed->arch.guest_context.user_regs) )
    8.11          c->flags |= VGCF_IN_KERNEL;
     9.1 --- a/xen/arch/x86/domain.c	Thu May 12 13:28:39 2005 +0000
     9.2 +++ b/xen/arch/x86/domain.c	Thu May 12 13:58:47 2005 +0000
     9.3 @@ -100,7 +100,7 @@ void startup_cpu_idle_loop(void)
     9.4      struct exec_domain *ed = current;
     9.5  
     9.6      /* Just some sanity to ensure that the scheduler is set up okay. */
     9.7 -    ASSERT(ed->domain->id == IDLE_DOMAIN_ID);
     9.8 +    ASSERT(ed->domain->domain_id == IDLE_DOMAIN_ID);
     9.9      percpu_ctxt[smp_processor_id()].curr_ed = ed;
    9.10      set_bit(smp_processor_id(), &ed->domain->cpuset);
    9.11      domain_unpause_by_systemcontroller(ed->domain);
    9.12 @@ -246,13 +246,13 @@ void arch_do_createdomain(struct exec_do
    9.13  
    9.14      ed->arch.flags = TF_kernel_mode;
    9.15  
    9.16 -    if ( d->id != IDLE_DOMAIN_ID )
    9.17 +    if ( d->domain_id != IDLE_DOMAIN_ID )
    9.18      {
    9.19          ed->arch.schedule_tail = continue_nonidle_task;
    9.20  
    9.21          d->shared_info = (void *)alloc_xenheap_page();
    9.22          memset(d->shared_info, 0, PAGE_SIZE);
    9.23 -        ed->vcpu_info = &d->shared_info->vcpu_data[ed->id];
    9.24 +        ed->vcpu_info = &d->shared_info->vcpu_data[ed->vcpu_id];
    9.25          ed->cpumap = CPUMAP_RUNANYWHERE;
    9.26          SHARE_PFN_WITH_DOMAIN(virt_to_page(d->shared_info), d);
    9.27          machine_to_phys_mapping[virt_to_phys(d->shared_info) >> 
    9.28 @@ -295,7 +295,7 @@ void arch_do_boot_vcpu(struct exec_domai
    9.29      struct domain *d = ed->domain;
    9.30      ed->arch.schedule_tail = d->exec_domain[0]->arch.schedule_tail;
    9.31      ed->arch.perdomain_ptes = 
    9.32 -        d->arch.mm_perdomain_pt + (ed->id << PDPT_VCPU_SHIFT);
    9.33 +        d->arch.mm_perdomain_pt + (ed->vcpu_id << PDPT_VCPU_SHIFT);
    9.34      ed->arch.flags = TF_kernel_mode;
    9.35  }
    9.36  
    9.37 @@ -399,9 +399,9 @@ int arch_set_info_guest(
    9.38                  return -EINVAL;
    9.39      }
    9.40  
    9.41 -    clear_bit(EDF_DONEFPUINIT, &ed->flags);
    9.42 +    clear_bit(_VCPUF_fpu_initialised, &ed->vcpu_flags);
    9.43      if ( c->flags & VGCF_I387_VALID )
    9.44 -        set_bit(EDF_DONEFPUINIT, &ed->flags);
    9.45 +        set_bit(_VCPUF_fpu_initialised, &ed->vcpu_flags);
    9.46  
    9.47      ed->arch.flags &= ~TF_kernel_mode;
    9.48      if ( c->flags & VGCF_IN_KERNEL )
    9.49 @@ -419,7 +419,7 @@ int arch_set_info_guest(
    9.50          ed->arch.guest_context.user_regs.eflags |= EF_IE;
    9.51      }
    9.52  
    9.53 -    if ( test_bit(EDF_DONEINIT, &ed->flags) )
    9.54 +    if ( test_bit(_VCPUF_initialised, &ed->vcpu_flags) )
    9.55          return 0;
    9.56  
    9.57      if ( (rc = (int)set_fast_trap(ed, c->fast_trap_idx)) != 0 )
    9.58 @@ -430,7 +430,7 @@ int arch_set_info_guest(
    9.59      for ( i = 0; i < 8; i++ )
    9.60          (void)set_debugreg(ed, i, c->debugreg[i]);
    9.61  
    9.62 -    if ( ed->id == 0 )
    9.63 +    if ( ed->vcpu_id == 0 )
    9.64          d->vm_assist = c->vm_assist;
    9.65  
    9.66      phys_basetab = c->pt_base;
    9.67 @@ -482,7 +482,7 @@ int arch_set_info_guest(
    9.68      update_pagetables(ed);
    9.69      
    9.70      /* Don't redo final setup */
    9.71 -    set_bit(EDF_DONEINIT, &ed->flags);
    9.72 +    set_bit(_VCPUF_initialised, &ed->vcpu_flags);
    9.73  
    9.74      return 0;
    9.75  }
    9.76 @@ -800,7 +800,7 @@ void context_switch(struct exec_domain *
    9.77       * 'prev' (after this point, a dying domain's info structure may be freed
    9.78       * without warning). 
    9.79       */
    9.80 -    clear_bit(EDF_RUNNING, &prev->flags);
    9.81 +    clear_bit(_VCPUF_running, &prev->vcpu_flags);
    9.82  
    9.83      schedule_tail(next);
    9.84      BUG();
    10.1 --- a/xen/arch/x86/domain_build.c	Thu May 12 13:28:39 2005 +0000
    10.2 +++ b/xen/arch/x86/domain_build.c	Thu May 12 13:58:47 2005 +0000
    10.3 @@ -122,9 +122,9 @@ int construct_dom0(struct domain *d,
    10.4      extern void translate_l2pgtable(struct domain *d, l1_pgentry_t *p2m, unsigned long l2mfn);
    10.5  
    10.6      /* Sanity! */
    10.7 -    if ( d->id != 0 ) 
    10.8 +    if ( d->domain_id != 0 ) 
    10.9          BUG();
   10.10 -    if ( test_bit(DF_CONSTRUCTED, &d->flags) ) 
   10.11 +    if ( test_bit(_DOMF_constructed, &d->domain_flags) ) 
   10.12          BUG();
   10.13  
   10.14      memset(&dsi, 0, sizeof(struct domain_setup_info));
   10.15 @@ -550,7 +550,7 @@ int construct_dom0(struct domain *d,
   10.16      /* DOM0 gets access to everything. */
   10.17      physdev_init_dom0(d);
   10.18  
   10.19 -    set_bit(DF_CONSTRUCTED, &d->flags);
   10.20 +    set_bit(_DOMF_constructed, &d->domain_flags);
   10.21  
   10.22      new_thread(ed, dsi.v_kernentry, vstack_end, vstartinfo_start);
   10.23  
    11.1 --- a/xen/arch/x86/i387.c	Thu May 12 13:28:39 2005 +0000
    11.2 +++ b/xen/arch/x86/i387.c	Thu May 12 13:58:47 2005 +0000
    11.3 @@ -18,7 +18,7 @@ void init_fpu(void)
    11.4      __asm__ __volatile__ ( "fninit" );
    11.5      if ( cpu_has_xmm )
    11.6          load_mxcsr(0x1f80);
    11.7 -    set_bit(EDF_DONEFPUINIT, &current->flags);
    11.8 +    set_bit(_VCPUF_fpu_initialised, &current->vcpu_flags);
    11.9  }
   11.10  
   11.11  void save_init_fpu(struct exec_domain *tsk)
   11.12 @@ -28,7 +28,7 @@ void save_init_fpu(struct exec_domain *t
   11.13       * This causes us to set the real flag, so we'll need
   11.14       * to temporarily clear it while saving f-p state.
   11.15       */
   11.16 -    if ( test_bit(EDF_GUEST_STTS, &tsk->flags) )
   11.17 +    if ( test_bit(_VCPUF_guest_stts, &tsk->vcpu_flags) )
   11.18          clts();
   11.19  
   11.20      if ( cpu_has_fxsr )
   11.21 @@ -40,7 +40,7 @@ void save_init_fpu(struct exec_domain *t
   11.22              "fnsave %0 ; fwait"
   11.23              : "=m" (tsk->arch.guest_context.fpu_ctxt) );
   11.24  
   11.25 -    clear_bit(EDF_USEDFPU, &tsk->flags);
   11.26 +    clear_bit(_VCPUF_fpu_dirtied, &tsk->vcpu_flags);
   11.27      stts();
   11.28  }
   11.29  
    12.1 --- a/xen/arch/x86/idle0_task.c	Thu May 12 13:28:39 2005 +0000
    12.2 +++ b/xen/arch/x86/idle0_task.c	Thu May 12 13:58:47 2005 +0000
    12.3 @@ -4,8 +4,8 @@
    12.4  #include <asm/desc.h>
    12.5  
    12.6  struct domain idle0_domain = {
    12.7 -    id:          IDLE_DOMAIN_ID,
    12.8 -    flags:       1<<DF_IDLETASK,
    12.9 +    domain_id:   IDLE_DOMAIN_ID,
   12.10 +    domain_flags:DOMF_idle_domain,
   12.11      refcnt:      ATOMIC_INIT(1)
   12.12  };
   12.13  
    13.1 --- a/xen/arch/x86/mm.c	Thu May 12 13:28:39 2005 +0000
    13.2 +++ b/xen/arch/x86/mm.c	Thu May 12 13:58:47 2005 +0000
    13.3 @@ -106,7 +106,7 @@
    13.4  #ifdef VERBOSE
    13.5  #define MEM_LOG(_f, _a...)                           \
    13.6    printk("DOM%u: (file=mm.c, line=%d) " _f "\n", \
    13.7 -         current->domain->id , __LINE__ , ## _a )
    13.8 +         current->domain->domain_id , __LINE__ , ## _a )
    13.9  #else
   13.10  #define MEM_LOG(_f, _a...) ((void)0)
   13.11  #endif
   13.12 @@ -183,7 +183,7 @@ void arch_init_memory(void)
   13.13       */
   13.14      dom_xen = alloc_domain_struct();
   13.15      atomic_set(&dom_xen->refcnt, 1);
   13.16 -    dom_xen->id = DOMID_XEN;
   13.17 +    dom_xen->domain_id = DOMID_XEN;
   13.18  
   13.19      /*
   13.20       * Initialise our DOMID_IO domain.
   13.21 @@ -192,7 +192,7 @@ void arch_init_memory(void)
   13.22       */
   13.23      dom_io = alloc_domain_struct();
   13.24      atomic_set(&dom_io->refcnt, 1);
   13.25 -    dom_io->id = DOMID_IO;
   13.26 +    dom_io->domain_id = DOMID_IO;
   13.27  
   13.28      /* First 1MB of RAM is historically marked as I/O. */
   13.29      for ( i = 0; i < 0x100; i++ )
   13.30 @@ -1162,7 +1162,7 @@ void put_page_type(struct pfn_info *page
   13.31           * See domain.c:relinquish_list().
   13.32           */
   13.33          ASSERT((x & PGT_validated) || 
   13.34 -               test_bit(DF_DYING, &page_get_owner(page)->flags));
   13.35 +               test_bit(_DOMF_dying, &page_get_owner(page)->domain_flags));
   13.36  
   13.37          if ( unlikely((nx & PGT_count_mask) == 0) )
   13.38          {
   13.39 @@ -1392,7 +1392,7 @@ static int set_foreigndom(unsigned int c
   13.40              percpu_info[cpu].foreign = dom_io;
   13.41              break;
   13.42          default:
   13.43 -            MEM_LOG("Dom %u cannot set foreign dom\n", d->id);
   13.44 +            MEM_LOG("Dom %u cannot set foreign dom\n", d->domain_id);
   13.45              okay = 0;
   13.46              break;
   13.47          }
   13.48 @@ -1645,7 +1645,7 @@ int do_mmuext_op(
   13.49              if ( shadow_mode_external(d) )
   13.50              {
   13.51                  MEM_LOG("ignoring SET_LDT hypercall from external "
   13.52 -                        "domain %u\n", d->id);
   13.53 +                        "domain %u\n", d->domain_id);
   13.54                  okay = 0;
   13.55                  break;
   13.56              }
   13.57 @@ -1676,7 +1676,7 @@ int do_mmuext_op(
   13.58          case MMUEXT_REASSIGN_PAGE:
   13.59              if ( unlikely(!IS_PRIV(d)) )
   13.60              {
   13.61 -                MEM_LOG("Dom %u has no reassignment priv", d->id);
   13.62 +                MEM_LOG("Dom %u has no reassignment priv", d->domain_id);
   13.63                  okay = 0;
   13.64                  break;
   13.65              }
   13.66 @@ -1711,13 +1711,13 @@ int do_mmuext_op(
   13.67               * it is dying. 
   13.68               */
   13.69              ASSERT(e->tot_pages <= e->max_pages);
   13.70 -            if ( unlikely(test_bit(DF_DYING, &e->flags)) ||
   13.71 +            if ( unlikely(test_bit(_DOMF_dying, &e->domain_flags)) ||
   13.72                   unlikely(e->tot_pages == e->max_pages) ||
   13.73                   unlikely(IS_XEN_HEAP_FRAME(page)) )
   13.74              {
   13.75                  MEM_LOG("Transferee has no reservation headroom (%d,%d), or "
   13.76                          "page is in Xen heap (%lx), or dom is dying (%ld).\n",
   13.77 -                        e->tot_pages, e->max_pages, op.mfn, e->flags);
   13.78 +                        e->tot_pages, e->max_pages, op.mfn, e->domain_flags);
   13.79                  okay = 0;
   13.80                  goto reassign_fail;
   13.81              }
   13.82 @@ -1738,7 +1738,7 @@ int do_mmuext_op(
   13.83                  {
   13.84                      MEM_LOG("Bad page values %lx: ed=%p(%u), sd=%p,"
   13.85                              " caf=%08x, taf=%08x\n", page_to_pfn(page),
   13.86 -                            d, d->id, unpickle_domptr(_nd), x,
   13.87 +                            d, d->domain_id, unpickle_domptr(_nd), x,
   13.88                              page->u.inuse.type_info);
   13.89                      okay = 0;
   13.90                      goto reassign_fail;
   13.91 @@ -1990,7 +1990,7 @@ int do_mmu_update(
   13.92              {
   13.93                  shadow_lock(FOREIGNDOM);
   13.94                  printk("privileged guest dom%d requests pfn=%lx to map mfn=%lx for dom%d\n",
   13.95 -                       d->id, gpfn, mfn, FOREIGNDOM->id);
   13.96 +                       d->domain_id, gpfn, mfn, FOREIGNDOM->domain_id);
   13.97                  set_machinetophys(mfn, gpfn);
   13.98                  set_p2m_entry(FOREIGNDOM, gpfn, mfn, &sh_mapcache, &mapcache);
   13.99                  okay = 1;
  13.100 @@ -2452,7 +2452,7 @@ int revalidate_l1(struct domain *d, l1_p
  13.101      int modified = 0, i;
  13.102  
  13.103  #if 0
  13.104 -    if ( d->id )
  13.105 +    if ( d->domain_id )
  13.106          printk("%s: l1page mfn=%lx snapshot mfn=%lx\n", __func__,
  13.107                 l1e_get_pfn(linear_pg_table[l1_linear_offset((unsigned long)l1page)]),
  13.108                 l1e_get_pfn(linear_pg_table[l1_linear_offset((unsigned long)snapshot)]));
  13.109 @@ -2909,7 +2909,7 @@ void ptwr_destroy(struct domain *d)
  13.110              {
  13.111                  MEM_LOG("Bad page values %p: ed=%p(%u), sd=%p,"
  13.112                          " caf=%08x, taf=%08x\n", page_to_pfn(page),
  13.113 -                        d, d->id, unpickle_domptr(_nd), x, 
  13.114 +                        d, d->domain_id, unpickle_domptr(_nd), x, 
  13.115                          page->u.inuse.type_info);
  13.116                  spin_unlock(&d->page_alloc_lock);
  13.117                  put_domain(e);
  13.118 @@ -2939,7 +2939,7 @@ void ptwr_destroy(struct domain *d)
  13.119           * Also, a domain mustn't have PGC_allocated pages when it is dying.
  13.120           */
  13.121          ASSERT(e->tot_pages <= e->max_pages);
  13.122 -        if ( unlikely(test_bit(DF_DYING, &e->flags)) ||
  13.123 +        if ( unlikely(test_bit(_DOMF_dying, &e->domain_flags)) ||
  13.124               unlikely(e->tot_pages == e->max_pages) ||
  13.125               unlikely(!gnttab_prepare_for_transfer(e, d, gntref)) )
  13.126          {
    14.1 --- a/xen/arch/x86/physdev.c	Thu May 12 13:28:39 2005 +0000
    14.2 +++ b/xen/arch/x86/physdev.c	Thu May 12 13:58:47 2005 +0000
    14.3 @@ -128,7 +128,7 @@ void physdev_init_dom0(struct domain *d)
    14.4      BUG_ON(d->arch.iobmp_mask == NULL);
    14.5      memset(d->arch.iobmp_mask, 0, IOBMP_BYTES);
    14.6  
    14.7 -    set_bit(DF_PHYSDEV, &d->flags);
    14.8 +    set_bit(_DOMF_physdev_access, &d->domain_flags);
    14.9  }
   14.10  
   14.11  
    15.1 --- a/xen/arch/x86/setup.c	Thu May 12 13:28:39 2005 +0000
    15.2 +++ b/xen/arch/x86/setup.c	Thu May 12 13:58:47 2005 +0000
    15.3 @@ -587,7 +587,7 @@ void __init __start_xen(multiboot_info_t
    15.4      if ( dom0 == NULL )
    15.5          panic("Error creating domain 0\n");
    15.6  
    15.7 -    set_bit(DF_PRIVILEGED, &dom0->flags);
    15.8 +    set_bit(_DOMF_privileged, &dom0->domain_flags);
    15.9  
   15.10      /* Grab the DOM0 command line. */
   15.11      cmdline = (char *)(mod[0].string ? __va(mod[0].string) : NULL);
    16.1 --- a/xen/arch/x86/shadow.c	Thu May 12 13:28:39 2005 +0000
    16.2 +++ b/xen/arch/x86/shadow.c	Thu May 12 13:58:47 2005 +0000
    16.3 @@ -117,7 +117,7 @@ shadow_promote(struct domain *d, unsigne
    16.4      {
    16.5          printk("shadow_promote: get_page_type failed "
    16.6                 "dom%d gpfn=%lx gmfn=%lx t=%08lx\n",
    16.7 -               d->id, gpfn, gmfn, new_type);
    16.8 +               d->domain_id, gpfn, gmfn, new_type);
    16.9          okay = 0;
   16.10      }
   16.11  
   16.12 @@ -233,7 +233,7 @@ alloc_shadow_page(struct domain *d,
   16.13      if ( unlikely(page == NULL) )
   16.14      {
   16.15          printk("Couldn't alloc shadow page! dom%d count=%d\n",
   16.16 -               d->id, d->arch.shadow_page_count);
   16.17 +               d->domain_id, d->arch.shadow_page_count);
   16.18          printk("Shadow table counts: l1=%d l2=%d hl2=%d snapshot=%d\n",
   16.19                 perfc_value(shadow_l1_pages), 
   16.20                 perfc_value(shadow_l2_pages),
   16.21 @@ -1179,7 +1179,8 @@ void __shadow_mode_disable(struct domain
   16.22       * Currently this does not fix up page ref counts, so it is valid to call
   16.23       * only when a domain is being destroyed.
   16.24       */
   16.25 -    BUG_ON(!test_bit(DF_DYING, &d->flags) && shadow_mode_refcounts(d));
   16.26 +    BUG_ON(!test_bit(_DOMF_dying, &d->domain_flags) &&
   16.27 +           shadow_mode_refcounts(d));
   16.28      d->arch.shadow_tainted_refcnts = shadow_mode_refcounts(d);
   16.29  
   16.30      free_shadow_pages(d);
   16.31 @@ -1409,7 +1410,7 @@ gpfn_to_mfn_foreign(struct domain *d, un
   16.32      if ( !(l2e_get_flags(l2e) & _PAGE_PRESENT) )
   16.33      {
   16.34          printk("gpfn_to_mfn_foreign(d->id=%d, gpfn=%lx) => 0 l2e=%lx\n",
   16.35 -               d->id, gpfn, l2e_get_value(l2e));
   16.36 +               d->domain_id, gpfn, l2e_get_value(l2e));
   16.37          return INVALID_MFN;
   16.38      }
   16.39      unsigned long l1tab = l2e_get_phys(l2e);
   16.40 @@ -1419,13 +1420,13 @@ gpfn_to_mfn_foreign(struct domain *d, un
   16.41  
   16.42  #if 0
   16.43      printk("gpfn_to_mfn_foreign(d->id=%d, gpfn=%lx) => %lx phystab=%lx l2e=%lx l1tab=%lx, l1e=%lx\n",
   16.44 -           d->id, gpfn, l1_pgentry_val(l1e) >> PAGE_SHIFT, phystab, l2e, l1tab, l1e);
   16.45 +           d->domain_id, gpfn, l1_pgentry_val(l1e) >> PAGE_SHIFT, phystab, l2e, l1tab, l1e);
   16.46  #endif
   16.47  
   16.48      if ( !(l1e_get_flags(l1e) & _PAGE_PRESENT) )
   16.49      {
   16.50          printk("gpfn_to_mfn_foreign(d->id=%d, gpfn=%lx) => 0 l1e=%lx\n",
   16.51 -               d->id, gpfn, l1e_get_value(l1e));
   16.52 +               d->domain_id, gpfn, l1e_get_value(l1e));
   16.53          return INVALID_MFN;
   16.54      }
   16.55  
   16.56 @@ -1754,7 +1755,7 @@ shadow_make_snapshot(
   16.57      {
   16.58          printk("Couldn't alloc fullshadow snapshot for pfn=%lx mfn=%lx!\n"
   16.59                 "Dom%d snapshot_count_count=%d\n",
   16.60 -               gpfn, gmfn, d->id, d->arch.snapshot_page_count);
   16.61 +               gpfn, gmfn, d->domain_id, d->arch.snapshot_page_count);
   16.62          BUG(); /* XXX FIXME: try a shadow flush to free up some memory. */
   16.63      }
   16.64  
   16.65 @@ -2645,7 +2646,7 @@ int shadow_fault(unsigned long va, struc
   16.66          {
   16.67              printk("%s() failed, crashing domain %d "
   16.68                     "due to a read-only L2 page table (gpde=%lx), va=%lx\n",
   16.69 -                   __func__, d->id, l2e_get_value(gpde), va);
   16.70 +                   __func__, d->domain_id, l2e_get_value(gpde), va);
   16.71              domain_crash_synchronous();
   16.72          }
   16.73  
   16.74 @@ -3146,7 +3147,7 @@ int check_l2_table(
   16.75          FAILPT("bogus owner for snapshot page");
   16.76      if ( page_get_owner(pfn_to_page(smfn)) != NULL )
   16.77          FAILPT("shadow page mfn=0x%lx is owned by someone, domid=%d",
   16.78 -               smfn, page_get_owner(pfn_to_page(smfn))->id);
   16.79 +               smfn, page_get_owner(pfn_to_page(smfn))->domain_id);
   16.80  
   16.81  #if 0
   16.82      if ( memcmp(&spl2e[DOMAIN_ENTRIES_PER_L2_PAGETABLE],
   16.83 @@ -3307,7 +3308,7 @@ int _check_all_pagetables(struct exec_do
   16.84      shadow_status_noswap = 1;
   16.85  
   16.86      sh_check_name = s;
   16.87 -    SH_VVLOG("%s-PT Audit domid=%d", s, d->id);
   16.88 +    SH_VVLOG("%s-PT Audit domid=%d", s, d->domain_id);
   16.89      sh_l2_present = sh_l1_present = 0;
   16.90      perfc_incrc(check_all_pagetables);
   16.91  
    17.1 --- a/xen/arch/x86/smpboot.c	Thu May 12 13:28:39 2005 +0000
    17.2 +++ b/xen/arch/x86/smpboot.c	Thu May 12 13:58:47 2005 +0000
    17.3 @@ -661,7 +661,7 @@ static void __init do_boot_cpu (int apic
    17.4  
    17.5      ed = idle->exec_domain[0];
    17.6  
    17.7 -    set_bit(DF_IDLETASK, &idle->flags);
    17.8 +    set_bit(_DOMF_idle_domain, &idle->domain_flags);
    17.9  
   17.10      ed->arch.monitor_table = mk_pagetable(__pa(idle_pg_table));
   17.11  
    18.1 --- a/xen/arch/x86/traps.c	Thu May 12 13:28:39 2005 +0000
    18.2 +++ b/xen/arch/x86/traps.c	Thu May 12 13:58:47 2005 +0000
    18.3 @@ -152,7 +152,7 @@ static inline int do_trap(int trapnr, ch
    18.4  
    18.5  #ifndef NDEBUG
    18.6      if ( (ed->arch.guest_context.trap_ctxt[trapnr].address == 0) &&
    18.7 -         (ed->domain->id == 0) )
    18.8 +         (ed->domain->domain_id == 0) )
    18.9          goto xen_fault;
   18.10  #endif
   18.11  
   18.12 @@ -326,7 +326,7 @@ asmlinkage int do_page_fault(struct cpu_
   18.13  
   18.14  #ifndef NDEBUG
   18.15      if ( (ed->arch.guest_context.trap_ctxt[TRAP_page_fault].address == 0) &&
   18.16 -         (d->id == 0) )
   18.17 +         (d->domain_id == 0) )
   18.18          goto xen_fault;
   18.19  #endif
   18.20  
   18.21 @@ -361,13 +361,13 @@ long do_fpu_taskswitch(int set)
   18.22  
   18.23      if ( set )
   18.24      {
   18.25 -        set_bit(EDF_GUEST_STTS, &ed->flags);
   18.26 +        set_bit(_VCPUF_guest_stts, &ed->vcpu_flags);
   18.27          stts();
   18.28      }
   18.29      else
   18.30      {
   18.31 -        clear_bit(EDF_GUEST_STTS, &ed->flags);
   18.32 -        if ( test_bit(EDF_USEDFPU, &ed->flags) )
   18.33 +        clear_bit(_VCPUF_guest_stts, &ed->vcpu_flags);
   18.34 +        if ( test_bit(_VCPUF_fpu_dirtied, &ed->vcpu_flags) )
   18.35              clts();
   18.36      }
   18.37  
   18.38 @@ -674,7 +674,7 @@ static int emulate_privileged_op(struct 
   18.39          case 0: /* Read CR0 */
   18.40              *reg = 
   18.41                  (read_cr0() & ~X86_CR0_TS) | 
   18.42 -                (test_bit(EDF_GUEST_STTS, &ed->flags) ? X86_CR0_TS : 0);
   18.43 +                (test_bit(_VCPUF_guest_stts, &ed->vcpu_flags) ? X86_CR0_TS:0);
   18.44              break;
   18.45  
   18.46          case 2: /* Read CR2 */
   18.47 @@ -808,7 +808,7 @@ asmlinkage int do_general_protection(str
   18.48  
   18.49  #ifndef NDEBUG
   18.50      if ( (ed->arch.guest_context.trap_ctxt[TRAP_gp_fault].address == 0) &&
   18.51 -         (ed->domain->id == 0) )
   18.52 +         (ed->domain->domain_id == 0) )
   18.53          goto gp_in_kernel;
   18.54  #endif
   18.55  
   18.56 @@ -922,7 +922,7 @@ asmlinkage int math_state_restore(struct
   18.57  
   18.58      setup_fpu(current);
   18.59  
   18.60 -    if ( test_and_clear_bit(EDF_GUEST_STTS, &current->flags) )
   18.61 +    if ( test_and_clear_bit(_VCPUF_guest_stts, &current->vcpu_flags) )
   18.62      {
   18.63          struct trap_bounce *tb = &current->arch.trap_bounce;
   18.64          tb->flags = TBF_EXCEPTION;
    19.1 --- a/xen/arch/x86/vmx.c	Thu May 12 13:28:39 2005 +0000
    19.2 +++ b/xen/arch/x86/vmx.c	Thu May 12 13:58:47 2005 +0000
    19.3 @@ -984,7 +984,7 @@ static void vmx_print_line(const char c,
    19.4              print_buf[index++] = c;
    19.5          }
    19.6          print_buf[index] = '\0';
    19.7 -        printk("(GUEST: %u) %s\n", d->domain->id, (char *) &print_buf);
    19.8 +        printk("(GUEST: %u) %s\n", d->domain->domain_id, (char *) &print_buf);
    19.9          index = 0;
   19.10      }
   19.11      else
   19.12 @@ -1072,7 +1072,7 @@ asmlinkage void vmx_vmexit_handler(struc
   19.13      }
   19.14  
   19.15      __vmread(GUEST_EIP, &eip);
   19.16 -    TRACE_3D(TRC_VMX_VMEXIT, ed->domain->id, eip, exit_reason);
   19.17 +    TRACE_3D(TRC_VMX_VMEXIT, ed->domain->domain_id, eip, exit_reason);
   19.18  
   19.19      switch (exit_reason) {
   19.20      case EXIT_REASON_EXCEPTION_NMI:
   19.21 @@ -1093,7 +1093,7 @@ asmlinkage void vmx_vmexit_handler(struc
   19.22  
   19.23          perfc_incra(cause_vector, vector);
   19.24  
   19.25 -        TRACE_3D(TRC_VMX_VECTOR, ed->domain->id, eip, vector);
   19.26 +        TRACE_3D(TRC_VMX_VECTOR, ed->domain->domain_id, eip, vector);
   19.27          switch (vector) {
   19.28  #ifdef XEN_DEBUGGER
   19.29          case TRAP_debug:
   19.30 @@ -1145,7 +1145,7 @@ asmlinkage void vmx_vmexit_handler(struc
   19.31                  __vmwrite(VM_ENTRY_INTR_INFO_FIELD, intr_fields);
   19.32                  __vmwrite(VM_ENTRY_EXCEPTION_ERROR_CODE, regs.error_code);
   19.33                  ed->arch.arch_vmx.cpu_cr2 = va;
   19.34 -                TRACE_3D(TRC_VMX_INT, ed->domain->id, TRAP_page_fault, va);
   19.35 +                TRACE_3D(TRC_VMX_INT, ed->domain->domain_id, TRAP_page_fault, va);
   19.36              }
   19.37              break;
   19.38          }
    20.1 --- a/xen/arch/x86/vmx_vmcs.c	Thu May 12 13:28:39 2005 +0000
    20.2 +++ b/xen/arch/x86/vmx_vmcs.c	Thu May 12 13:58:47 2005 +0000
    20.3 @@ -165,7 +165,7 @@ void vmx_do_launch(struct exec_domain *e
    20.4      struct cpu_user_regs *regs = get_cpu_user_regs();
    20.5  
    20.6      vmx_stts();
    20.7 -    set_bit(EDF_GUEST_STTS, &ed->flags);
    20.8 +    set_bit(_VCPUF_guest_stts, &ed->vcpu_flags);
    20.9  
   20.10      cpu = smp_processor_id();
   20.11  
    21.1 --- a/xen/common/dom0_ops.c	Thu May 12 13:28:39 2005 +0000
    21.2 +++ b/xen/common/dom0_ops.c	Thu May 12 13:58:47 2005 +0000
    21.3 @@ -139,7 +139,7 @@ long do_dom0_op(dom0_op_t *u_dom0_op)
    21.4          {
    21.5              ret = -EINVAL;
    21.6              if ( (d != current->domain) && 
    21.7 -                 test_bit(DF_CONSTRUCTED, &d->flags) )
    21.8 +                 test_bit(_DOMF_constructed, &d->domain_flags) )
    21.9              {
   21.10                  domain_unpause_by_systemcontroller(d);
   21.11                  ret = 0;
   21.12 @@ -194,7 +194,7 @@ long do_dom0_op(dom0_op_t *u_dom0_op)
   21.13  
   21.14          ret = 0;
   21.15          
   21.16 -        op->u.createdomain.domain = d->id;
   21.17 +        op->u.createdomain.domain = d->domain_id;
   21.18          copy_to_user(u_dom0_op, op, sizeof(*op));
   21.19      }
   21.20      break;
   21.21 @@ -265,7 +265,7 @@ long do_dom0_op(dom0_op_t *u_dom0_op)
   21.22          ed->cpumap = cpumap;
   21.23  
   21.24          if ( cpumap == CPUMAP_RUNANYWHERE )
   21.25 -            clear_bit(EDF_CPUPINNED, &ed->flags);
   21.26 +            clear_bit(_VCPUF_cpu_pinned, &ed->vcpu_flags);
   21.27          else
   21.28          {
   21.29              /* pick a new cpu from the usable map */
   21.30 @@ -273,8 +273,8 @@ long do_dom0_op(dom0_op_t *u_dom0_op)
   21.31  
   21.32              exec_domain_pause(ed);
   21.33              if ( ed->processor != new_cpu )
   21.34 -                set_bit(EDF_MIGRATED, &ed->flags);
   21.35 -            set_bit(EDF_CPUPINNED, &ed->flags);
   21.36 +                set_bit(_VCPUF_cpu_migrated, &ed->vcpu_flags);
   21.37 +            set_bit(_VCPUF_cpu_pinned, &ed->vcpu_flags);
   21.38              ed->processor = new_cpu;
   21.39              exec_domain_unpause(ed);
   21.40          }
   21.41 @@ -309,7 +309,7 @@ long do_dom0_op(dom0_op_t *u_dom0_op)
   21.42  
   21.43          for_each_domain ( d )
   21.44          {
   21.45 -            if ( d->id >= op->u.getdomaininfo.domain )
   21.46 +            if ( d->domain_id >= op->u.getdomaininfo.domain )
   21.47                  break;
   21.48          }
   21.49  
   21.50 @@ -322,7 +322,7 @@ long do_dom0_op(dom0_op_t *u_dom0_op)
   21.51  
   21.52          read_unlock(&domlist_lock);
   21.53  
   21.54 -        op->u.getdomaininfo.domain = d->id;
   21.55 +        op->u.getdomaininfo.domain = d->domain_id;
   21.56  
   21.57          memset(&op->u.getdomaininfo.vcpu_to_cpu, -1,
   21.58                 sizeof(op->u.getdomaininfo.vcpu_to_cpu));
   21.59 @@ -335,13 +335,13 @@ long do_dom0_op(dom0_op_t *u_dom0_op)
   21.60           * - domain is marked as running if any of its vcpus is running
   21.61           */
   21.62          for_each_exec_domain ( d, ed ) {
   21.63 -            op->u.getdomaininfo.vcpu_to_cpu[ed->id] = ed->processor;
   21.64 -            op->u.getdomaininfo.cpumap[ed->id]      = ed->cpumap;
   21.65 -            if (!test_bit(EDF_CTRLPAUSE, &ed->flags))
   21.66 +            op->u.getdomaininfo.vcpu_to_cpu[ed->vcpu_id] = ed->processor;
   21.67 +            op->u.getdomaininfo.cpumap[ed->vcpu_id]      = ed->cpumap;
   21.68 +            if ( !(ed->vcpu_flags & VCPUF_ctrl_pause) )
   21.69                  flags &= ~DOMFLAGS_PAUSED;
   21.70 -            if (!test_bit(EDF_BLOCKED, &ed->flags))
   21.71 +            if ( !(ed->vcpu_flags & VCPUF_blocked) )
   21.72                  flags &= ~DOMFLAGS_BLOCKED;
   21.73 -            if (test_bit(EDF_RUNNING, &ed->flags))
   21.74 +            if ( ed->vcpu_flags & VCPUF_running )
   21.75                  flags |= DOMFLAGS_RUNNING;
   21.76              if ( ed->cpu_time > cpu_time )
   21.77                  cpu_time += ed->cpu_time;
   21.78 @@ -352,9 +352,9 @@ long do_dom0_op(dom0_op_t *u_dom0_op)
   21.79          op->u.getdomaininfo.n_vcpu = vcpu_count;
   21.80  
   21.81          op->u.getdomaininfo.flags = flags |
   21.82 -            (test_bit( DF_DYING,      &d->flags)  ? DOMFLAGS_DYING    : 0) |
   21.83 -            (test_bit( DF_CRASHED,    &d->flags)  ? DOMFLAGS_CRASHED  : 0) |
   21.84 -            (test_bit( DF_SHUTDOWN,   &d->flags)  ? DOMFLAGS_SHUTDOWN : 0) |
   21.85 +            ((d->domain_flags & DOMF_dying)    ? DOMFLAGS_DYING    : 0) |
   21.86 +            ((d->domain_flags & DOMF_crashed)  ? DOMFLAGS_CRASHED  : 0) |
   21.87 +            ((d->domain_flags & DOMF_shutdown) ? DOMFLAGS_SHUTDOWN : 0) |
   21.88              d->shutdown_code << DOMFLAGS_SHUTDOWNSHIFT;
   21.89  
   21.90          op->u.getdomaininfo.tot_pages   = d->tot_pages;
    22.1 --- a/xen/common/dom_mem_ops.c	Thu May 12 13:28:39 2005 +0000
    22.2 +++ b/xen/common/dom_mem_ops.c	Thu May 12 13:58:47 2005 +0000
    22.3 @@ -29,7 +29,7 @@
    22.4              __HYPERVISOR_dom_mem_op,                \
    22.5              (_op) | (i << START_EXTENT_SHIFT),      \
    22.6              extent_list, nr_extents, extent_order,  \
    22.7 -            (d == current->domain) ? DOMID_SELF : d->id);
    22.8 +            (d == current->domain) ? DOMID_SELF : d->domain_id);
    22.9  
   22.10  static long
   22.11  alloc_dom_mem(struct domain *d, 
   22.12 @@ -95,14 +95,14 @@ free_dom_mem(struct domain *d,
   22.13              if ( unlikely((mpfn + j) >= max_page) )
   22.14              {
   22.15                  DPRINTK("Domain %u page number out of range (%lx >= %lx)\n", 
   22.16 -                        d->id, mpfn + j, max_page);
   22.17 +                        d->domain_id, mpfn + j, max_page);
   22.18                  return i;
   22.19              }
   22.20              
   22.21              page = &frame_table[mpfn + j];
   22.22              if ( unlikely(!get_page(page, d)) )
   22.23              {
   22.24 -                DPRINTK("Bad page free for domain %u\n", d->id);
   22.25 +                DPRINTK("Bad page free for domain %u\n", d->domain_id);
   22.26                  return i;
   22.27              }
   22.28  
    23.1 --- a/xen/common/domain.c	Thu May 12 13:28:39 2005 +0000
    23.2 +++ b/xen/common/domain.c	Thu May 12 13:58:47 2005 +0000
    23.3 @@ -39,7 +39,7 @@ struct domain *do_createdomain(domid_t d
    23.4      atomic_set(&d->refcnt, 1);
    23.5      atomic_set(&ed->pausecnt, 0);
    23.6  
    23.7 -    d->id          = dom_id;
    23.8 +    d->domain_id   = dom_id;
    23.9      ed->processor  = cpu;
   23.10   
   23.11      spin_lock_init(&d->time_lock);
   23.12 @@ -50,7 +50,7 @@ struct domain *do_createdomain(domid_t d
   23.13      INIT_LIST_HEAD(&d->page_list);
   23.14      INIT_LIST_HEAD(&d->xenpage_list);
   23.15  
   23.16 -    if ( (d->id != IDLE_DOMAIN_ID) &&
   23.17 +    if ( (d->domain_id != IDLE_DOMAIN_ID) &&
   23.18           ((init_event_channels(d) != 0) || (grant_table_create(d) != 0)) )
   23.19      {
   23.20          destroy_event_channels(d);
   23.21 @@ -62,12 +62,12 @@ struct domain *do_createdomain(domid_t d
   23.22      
   23.23      sched_add_domain(ed);
   23.24  
   23.25 -    if ( d->id != IDLE_DOMAIN_ID )
   23.26 +    if ( d->domain_id != IDLE_DOMAIN_ID )
   23.27      {
   23.28          write_lock(&domlist_lock);
   23.29          pd = &domain_list; /* NB. domain_list maintained in order of dom_id. */
   23.30          for ( pd = &domain_list; *pd != NULL; pd = &(*pd)->next_in_list )
   23.31 -            if ( (*pd)->id > d->id )
   23.32 +            if ( (*pd)->domain_id > d->domain_id )
   23.33                  break;
   23.34          d->next_in_list = *pd;
   23.35          *pd = d;
   23.36 @@ -88,7 +88,7 @@ struct domain *find_domain_by_id(domid_t
   23.37      d = domain_hash[DOMAIN_HASH(dom)];
   23.38      while ( d != NULL )
   23.39      {
   23.40 -        if ( d->id == dom )
   23.41 +        if ( d->domain_id == dom )
   23.42          {
   23.43              if ( unlikely(!get_domain(d)) )
   23.44                  d = NULL;
   23.45 @@ -107,7 +107,7 @@ void domain_kill(struct domain *d)
   23.46      struct exec_domain *ed;
   23.47  
   23.48      domain_pause(d);
   23.49 -    if ( !test_and_set_bit(DF_DYING, &d->flags) )
   23.50 +    if ( !test_and_set_bit(_DOMF_dying, &d->domain_flags) )
   23.51      {
   23.52          for_each_exec_domain(d, ed)
   23.53              sched_rem_domain(ed);
   23.54 @@ -121,10 +121,10 @@ void domain_crash(void)
   23.55  {
   23.56      struct domain *d = current->domain;
   23.57  
   23.58 -    if ( d->id == 0 )
   23.59 +    if ( d->domain_id == 0 )
   23.60          BUG();
   23.61  
   23.62 -    set_bit(DF_CRASHED, &d->flags);
   23.63 +    set_bit(_DOMF_crashed, &d->domain_flags);
   23.64  
   23.65      send_guest_virq(dom0->exec_domain[0], VIRQ_DOM_EXC);
   23.66  
   23.67 @@ -144,7 +144,7 @@ void domain_shutdown(u8 reason)
   23.68  {
   23.69      struct domain *d = current->domain;
   23.70  
   23.71 -    if ( d->id == 0 )
   23.72 +    if ( d->domain_id == 0 )
   23.73      {
   23.74          extern void machine_restart(char *);
   23.75          extern void machine_halt(void);
   23.76 @@ -164,9 +164,9 @@ void domain_shutdown(u8 reason)
   23.77      }
   23.78  
   23.79      if ( (d->shutdown_code = reason) == SHUTDOWN_crash )
   23.80 -        set_bit(DF_CRASHED, &d->flags);
   23.81 +        set_bit(_DOMF_crashed, &d->domain_flags);
   23.82      else
   23.83 -        set_bit(DF_SHUTDOWN, &d->flags);
   23.84 +        set_bit(_DOMF_shutdown, &d->domain_flags);
   23.85  
   23.86      send_guest_virq(dom0->exec_domain[0], VIRQ_DOM_EXC);
   23.87  
   23.88 @@ -180,7 +180,7 @@ void domain_destruct(struct domain *d)
   23.89      struct domain **pd;
   23.90      atomic_t      old, new;
   23.91  
   23.92 -    if ( !test_bit(DF_DYING, &d->flags) )
   23.93 +    if ( !test_bit(_DOMF_dying, &d->domain_flags) )
   23.94          BUG();
   23.95  
   23.96      /* May be already destructed, or get_domain() can race us. */
   23.97 @@ -196,7 +196,7 @@ void domain_destruct(struct domain *d)
   23.98      while ( *pd != d ) 
   23.99          pd = &(*pd)->next_in_list;
  23.100      *pd = d->next_in_list;
  23.101 -    pd = &domain_hash[DOMAIN_HASH(d->id)];
  23.102 +    pd = &domain_hash[DOMAIN_HASH(d->domain_id)];
  23.103      while ( *pd != d ) 
  23.104          pd = &(*pd)->next_in_hashbucket;
  23.105      *pd = d->next_in_hashbucket;
  23.106 @@ -217,18 +217,18 @@ void domain_destruct(struct domain *d)
  23.107   * of domains other than domain 0. ie. the domains that are being built by 
  23.108   * the userspace dom0 domain builder.
  23.109   */
  23.110 -int set_info_guest(struct domain *p, dom0_setdomaininfo_t *setdomaininfo)
  23.111 +int set_info_guest(struct domain *d, dom0_setdomaininfo_t *setdomaininfo)
  23.112  {
  23.113      int rc = 0;
  23.114      struct vcpu_guest_context *c = NULL;
  23.115      unsigned long vcpu = setdomaininfo->exec_domain;
  23.116      struct exec_domain *ed; 
  23.117  
  23.118 -    if ( (vcpu >= MAX_VIRT_CPUS) || ((ed = p->exec_domain[vcpu]) == NULL) )
  23.119 +    if ( (vcpu >= MAX_VIRT_CPUS) || ((ed = d->exec_domain[vcpu]) == NULL) )
  23.120          return -EINVAL;
  23.121      
  23.122 -    if (test_bit(DF_CONSTRUCTED, &p->flags) && 
  23.123 -        !test_bit(EDF_CTRLPAUSE, &ed->flags))
  23.124 +    if (test_bit(_DOMF_constructed, &d->domain_flags) && 
  23.125 +        !test_bit(_VCPUF_ctrl_pause, &ed->vcpu_flags))
  23.126          return -EINVAL;
  23.127  
  23.128      if ( (c = xmalloc(struct vcpu_guest_context)) == NULL )
  23.129 @@ -243,7 +243,7 @@ int set_info_guest(struct domain *p, dom
  23.130      if ( (rc = arch_set_info_guest(ed, c)) != 0 )
  23.131          goto out;
  23.132  
  23.133 -    set_bit(DF_CONSTRUCTED, &p->flags);
  23.134 +    set_bit(_DOMF_constructed, &d->domain_flags);
  23.135  
  23.136   out:    
  23.137      xfree(c);
  23.138 @@ -295,7 +295,7 @@ long do_boot_vcpu(unsigned long vcpu, st
  23.139      sched_add_domain(ed);
  23.140  
  23.141      /* domain_unpause_by_systemcontroller */
  23.142 -    if ( test_and_clear_bit(EDF_CTRLPAUSE, &ed->flags) )
  23.143 +    if ( test_and_clear_bit(_VCPUF_ctrl_pause, &ed->vcpu_flags) )
  23.144          domain_wake(ed);
  23.145  
  23.146      xfree(c);
    24.1 --- a/xen/common/event_channel.c	Thu May 12 13:28:39 2005 +0000
    24.2 +++ b/xen/common/event_channel.c	Thu May 12 13:58:47 2005 +0000
    24.3 @@ -40,7 +40,7 @@ static int get_free_port(struct exec_dom
    24.4      max = d->max_event_channel;
    24.5      chn = d->event_channel;
    24.6  
    24.7 -    for ( port = ed->id * EVENT_CHANNELS_SPREAD; port < max; port++ )
    24.8 +    for ( port = ed->vcpu_id * EVENT_CHANNELS_SPREAD; port < max; port++ )
    24.9          if ( chn[port].state == ECS_FREE )
   24.10              break;
   24.11  
   24.12 @@ -114,9 +114,9 @@ static long evtchn_bind_interdomain(evtc
   24.13          return -EINVAL;
   24.14  
   24.15      if ( dom1 == DOMID_SELF )
   24.16 -        dom1 = current->domain->id;
   24.17 +        dom1 = current->domain->domain_id;
   24.18      if ( dom2 == DOMID_SELF )
   24.19 -        dom2 = current->domain->id;
   24.20 +        dom2 = current->domain->domain_id;
   24.21  
   24.22      if ( ((d1 = find_domain_by_id(dom1)) == NULL) ||
   24.23           ((d2 = find_domain_by_id(dom2)) == NULL) )
   24.24 @@ -429,7 +429,7 @@ static long __evtchn_close(struct domain
   24.25              BUG();
   24.26  
   24.27          chn2[port2].state = ECS_UNBOUND;
   24.28 -        chn2[port2].u.unbound.remote_domid = d1->id;
   24.29 +        chn2[port2].u.unbound.remote_domid = d1->domain_id;
   24.30          break;
   24.31  
   24.32      default:
   24.33 @@ -459,7 +459,7 @@ static long evtchn_close(evtchn_close_t 
   24.34      domid_t        dom = close->dom;
   24.35  
   24.36      if ( dom == DOMID_SELF )
   24.37 -        dom = current->domain->id;
   24.38 +        dom = current->domain->domain_id;
   24.39      else if ( !IS_PRIV(current->domain) )
   24.40          return -EPERM;
   24.41  
   24.42 @@ -522,7 +522,7 @@ static long evtchn_status(evtchn_status_
   24.43      long             rc = 0;
   24.44  
   24.45      if ( dom == DOMID_SELF )
   24.46 -        dom = current->domain->id;
   24.47 +        dom = current->domain->domain_id;
   24.48      else if ( !IS_PRIV(current->domain) )
   24.49          return -EPERM;
   24.50  
   24.51 @@ -552,7 +552,7 @@ static long evtchn_status(evtchn_status_
   24.52      case ECS_INTERDOMAIN:
   24.53          status->status = EVTCHNSTAT_interdomain;
   24.54          status->u.interdomain.dom  =
   24.55 -            chn[port].u.interdomain.remote_dom->domain->id;
   24.56 +            chn[port].u.interdomain.remote_dom->domain->domain_id;
   24.57          status->u.interdomain.port = chn[port].u.interdomain.remote_port;
   24.58          break;
   24.59      case ECS_PIRQ:
    25.1 --- a/xen/common/grant_table.c	Thu May 12 13:28:39 2005 +0000
    25.2 +++ b/xen/common/grant_table.c	Thu May 12 13:58:47 2005 +0000
    25.3 @@ -118,10 +118,10 @@ static int
    25.4              u32 scombo, prev_scombo, new_scombo;
    25.5  
    25.6              if ( unlikely((sflags & GTF_type_mask) != GTF_permit_access) ||
    25.7 -                 unlikely(sdom != mapping_d->id) )
    25.8 +                 unlikely(sdom != mapping_d->domain_id) )
    25.9                  PIN_FAIL(unlock_out, GNTST_general_error,
   25.10                           "Bad flags (%x) or dom (%d). (NB. expected dom %d)\n",
   25.11 -                        sflags, sdom, mapping_d->id);
   25.12 +                        sflags, sdom, mapping_d->domain_id);
   25.13  
   25.14              /* Merge two 16-bit values into a 32-bit combined update. */
   25.15              /* NB. Endianness! */
   25.16 @@ -674,7 +674,7 @@ gnttab_setup_table(
   25.17  
   25.18      if ( op.dom == DOMID_SELF )
   25.19      {
   25.20 -        op.dom = current->domain->id;
   25.21 +        op.dom = current->domain->domain_id;
   25.22      }
   25.23      else if ( unlikely(!IS_PRIV(current->domain)) )
   25.24      {
   25.25 @@ -725,7 +725,7 @@ gnttab_dump_table(gnttab_dump_table_t *u
   25.26  
   25.27      if ( op.dom == DOMID_SELF )
   25.28      {
   25.29 -        op.dom = current->domain->id;
   25.30 +        op.dom = current->domain->domain_id;
   25.31      }
   25.32  
   25.33      if ( unlikely((d = find_domain_by_id(op.dom)) == NULL) )
   25.34 @@ -866,10 +866,10 @@ gnttab_check_unmap(
   25.35      lgt = ld->grant_table;
   25.36  
   25.37  #if GRANT_DEBUG_VERBOSE
   25.38 -    if ( ld->id != 0 )
   25.39 +    if ( ld->domain_id != 0 )
   25.40      {
   25.41          DPRINTK("Foreign unref rd(%d) ld(%d) frm(%x) flgs(%x).\n",
   25.42 -                rd->id, ld->id, frame, readonly);
   25.43 +                rd->domain_id, ld->domain_id, frame, readonly);
   25.44      }
   25.45  #endif
   25.46  
   25.47 @@ -879,7 +879,8 @@ gnttab_check_unmap(
   25.48  
   25.49      if ( get_domain(rd) == 0 )
   25.50      {
   25.51 -        DPRINTK("gnttab_check_unmap: couldn't get_domain rd(%d)\n", rd->id);
   25.52 +        DPRINTK("gnttab_check_unmap: couldn't get_domain rd(%d)\n",
   25.53 +                rd->domain_id);
   25.54          return 0;
   25.55      }
   25.56  
   25.57 @@ -913,7 +914,7 @@ gnttab_check_unmap(
   25.58  
   25.59              /* gotcha */
   25.60              DPRINTK("Grant unref rd(%d) ld(%d) frm(%lx) flgs(%x).\n",
   25.61 -                    rd->id, ld->id, frame, readonly);
   25.62 +                    rd->domain_id, ld->domain_id, frame, readonly);
   25.63  
   25.64              if ( readonly )
   25.65                  act->pin -= GNTPIN_hstr_inc;
   25.66 @@ -963,12 +964,13 @@ gnttab_prepare_for_transfer(
   25.67      unsigned long  target_pfn;
   25.68  
   25.69      DPRINTK("gnttab_prepare_for_transfer rd(%hu) ld(%hu) ref(%hu).\n",
   25.70 -            rd->id, ld->id, ref);
   25.71 +            rd->domain_id, ld->domain_id, ref);
   25.72  
   25.73      if ( unlikely((rgt = rd->grant_table) == NULL) ||
   25.74           unlikely(ref >= NR_GRANT_ENTRIES) )
   25.75      {
   25.76 -        DPRINTK("Dom %d has no g.t., or ref is bad (%d).\n", rd->id, ref);
   25.77 +        DPRINTK("Dom %d has no g.t., or ref is bad (%d).\n",
   25.78 +                rd->domain_id, ref);
   25.79          return 0;
   25.80      }
   25.81  
   25.82 @@ -990,10 +992,10 @@ gnttab_prepare_for_transfer(
   25.83          }
   25.84  
   25.85          if ( unlikely(sflags != GTF_accept_transfer) ||
   25.86 -             unlikely(sdom != ld->id) )
   25.87 +             unlikely(sdom != ld->domain_id) )
   25.88          {
   25.89              DPRINTK("Bad flags (%x) or dom (%d). (NB. expected dom %d)\n",
   25.90 -                    sflags, sdom, ld->id);
   25.91 +                    sflags, sdom, ld->domain_id);
   25.92              goto fail;
   25.93          }
   25.94  
   25.95 @@ -1041,7 +1043,7 @@ gnttab_notify_transfer(
   25.96      unsigned long   pfn;
   25.97  
   25.98      DPRINTK("gnttab_notify_transfer rd(%hu) ld(%hu) ref(%hu).\n",
   25.99 -            rd->id, ld->id, ref);
  25.100 +            rd->domain_id, ld->domain_id, ref);
  25.101  
  25.102      sha = &rd->grant_table->shared[ref];
  25.103  
  25.104 @@ -1062,7 +1064,7 @@ gnttab_notify_transfer(
  25.105              __phys_to_machine_mapping[pfn] = frame;
  25.106      }
  25.107      sha->frame = __mfn_to_gpfn(rd, frame);
  25.108 -    sha->domid = rd->id;
  25.109 +    sha->domid = rd->domain_id;
  25.110      wmb();
  25.111      sha->flags = ( GTF_accept_transfer | GTF_transfer_completed );
  25.112  
    26.1 --- a/xen/common/keyhandler.c	Thu May 12 13:28:39 2005 +0000
    26.2 +++ b/xen/common/keyhandler.c	Thu May 12 13:58:47 2005 +0000
    26.3 @@ -109,7 +109,7 @@ static void do_task_queues(unsigned char
    26.4      for_each_domain ( d )
    26.5      {
    26.6          printk("Xen: DOM %u, flags=%lx refcnt=%d nr_pages=%d "
    26.7 -               "xenheap_pages=%d\n", d->id, d->flags,
    26.8 +               "xenheap_pages=%d\n", d->domain_id, d->domain_flags,
    26.9                 atomic_read(&d->refcnt), d->tot_pages, d->xenheap_pages);
   26.10  
   26.11          dump_pageframe_info(d);
   26.12 @@ -118,11 +118,11 @@ static void do_task_queues(unsigned char
   26.13              printk("Guest: %p CPU %d [has=%c] flags=%lx "
   26.14                     "upcall_pend = %02x, upcall_mask = %02x\n", ed,
   26.15                     ed->processor,
   26.16 -                   test_bit(EDF_RUNNING, &ed->flags) ? 'T':'F',
   26.17 -                   ed->flags,
   26.18 +                   test_bit(_VCPUF_running, &ed->vcpu_flags) ? 'T':'F',
   26.19 +                   ed->vcpu_flags,
   26.20                     ed->vcpu_info->evtchn_upcall_pending, 
   26.21                     ed->vcpu_info->evtchn_upcall_mask);
   26.22 -            printk("Notifying guest... %d/%d\n", d->id, ed->id); 
   26.23 +            printk("Notifying guest... %d/%d\n", d->domain_id, ed->vcpu_id); 
   26.24              printk("port %d/%d stat %d %d %d\n",
   26.25                     VIRQ_DEBUG, ed->virq_to_evtchn[VIRQ_DEBUG],
   26.26                     test_bit(ed->virq_to_evtchn[VIRQ_DEBUG], 
    27.1 --- a/xen/common/page_alloc.c	Thu May 12 13:28:39 2005 +0000
    27.2 +++ b/xen/common/page_alloc.c	Thu May 12 13:58:47 2005 +0000
    27.3 @@ -504,13 +504,13 @@ struct pfn_info *alloc_domheap_pages(str
    27.4  
    27.5      spin_lock(&d->page_alloc_lock);
    27.6  
    27.7 -    if ( unlikely(test_bit(DF_DYING, &d->flags)) ||
    27.8 +    if ( unlikely(test_bit(_DOMF_dying, &d->domain_flags)) ||
    27.9           unlikely((d->tot_pages + (1 << order)) > d->max_pages) )
   27.10      {
   27.11          DPRINTK("Over-allocation for domain %u: %u > %u\n",
   27.12 -                d->id, d->tot_pages + (1 << order), d->max_pages);
   27.13 +                d->domain_id, d->tot_pages + (1 << order), d->max_pages);
   27.14          DPRINTK("...or the domain is dying (%d)\n", 
   27.15 -                !!test_bit(DF_DYING, &d->flags));
   27.16 +                !!test_bit(_DOMF_dying, &d->domain_flags));
   27.17          spin_unlock(&d->page_alloc_lock);
   27.18          free_heap_pages(MEMZONE_DOM, pg, order);
   27.19          return NULL;
   27.20 @@ -575,7 +575,7 @@ void free_domheap_pages(struct pfn_info 
   27.21  
   27.22          spin_unlock_recursive(&d->page_alloc_lock);
   27.23  
   27.24 -        if ( likely(!test_bit(DF_DYING, &d->flags)) )
   27.25 +        if ( likely(!test_bit(_DOMF_dying, &d->domain_flags)) )
   27.26          {
   27.27              free_heap_pages(MEMZONE_DOM, pg, order);
   27.28          }
    28.1 --- a/xen/common/sched_bvt.c	Thu May 12 13:28:39 2005 +0000
    28.2 +++ b/xen/common/sched_bvt.c	Thu May 12 13:58:47 2005 +0000
    28.3 @@ -174,9 +174,9 @@ static int bvt_alloc_task(struct exec_do
    28.4              return -1;
    28.5          memset(d->sched_priv, 0, sizeof(struct bvt_dom_info));
    28.6      }
    28.7 -    ed->sched_priv = &BVT_INFO(d)->ed_inf[ed->id];
    28.8 -    BVT_INFO(d)->ed_inf[ed->id].inf = BVT_INFO(d);
    28.9 -    BVT_INFO(d)->ed_inf[ed->id].exec_domain = ed;
   28.10 +    ed->sched_priv = &BVT_INFO(d)->ed_inf[ed->vcpu_id];
   28.11 +    BVT_INFO(d)->ed_inf[ed->vcpu_id].inf = BVT_INFO(d);
   28.12 +    BVT_INFO(d)->ed_inf[ed->vcpu_id].exec_domain = ed;
   28.13      return 0;
   28.14  }
   28.15  
   28.16 @@ -190,7 +190,8 @@ static void bvt_add_task(struct exec_dom
   28.17      ASSERT(inf != NULL);
   28.18      ASSERT(d   != NULL);
   28.19  
   28.20 -    if (d->id == 0) {
   28.21 +    if ( d->vcpu_id == 0 )
   28.22 +    {
   28.23          inf->mcu_advance = MCU_ADVANCE;
   28.24          inf->domain      = d->domain;
   28.25          inf->warpback    = 0;
   28.26 @@ -212,7 +213,7 @@ static void bvt_add_task(struct exec_dom
   28.27  
   28.28      einf->exec_domain = d;
   28.29  
   28.30 -    if ( d->domain->id == IDLE_DOMAIN_ID )
   28.31 +    if ( d->domain->domain_id == IDLE_DOMAIN_ID )
   28.32      {
   28.33          einf->avt = einf->evt = ~0U;
   28.34      } 
   28.35 @@ -231,7 +232,7 @@ static int bvt_init_idle_task(struct exe
   28.36  
   28.37      bvt_add_task(ed);
   28.38  
   28.39 -    set_bit(EDF_RUNNING, &ed->flags);
   28.40 +    set_bit(_VCPUF_running, &ed->vcpu_flags);
   28.41      if ( !__task_on_runqueue(ed) )
   28.42          __add_to_runqueue_head(ed);
   28.43  
   28.44 @@ -256,7 +257,7 @@ static void bvt_wake(struct exec_domain 
   28.45      /* Set the BVT parameters. AVT should always be updated 
   28.46         if CPU migration ocurred.*/
   28.47      if ( einf->avt < CPU_SVT(cpu) || 
   28.48 -         unlikely(test_bit(EDF_MIGRATED, &ed->flags)) )
   28.49 +         unlikely(test_bit(_VCPUF_cpu_migrated, &ed->vcpu_flags)) )
   28.50          einf->avt = CPU_SVT(cpu);
   28.51  
   28.52      /* Deal with warping here. */
   28.53 @@ -279,7 +280,7 @@ static void bvt_wake(struct exec_domain 
   28.54  
   28.55  static void bvt_sleep(struct exec_domain *ed)
   28.56  {
   28.57 -    if ( test_bit(EDF_RUNNING, &ed->flags) )
   28.58 +    if ( test_bit(_VCPUF_running, &ed->vcpu_flags) )
   28.59          cpu_raise_softirq(ed->processor, SCHEDULE_SOFTIRQ);
   28.60      else  if ( __task_on_runqueue(ed) )
   28.61          __del_from_runqueue(ed);
   28.62 @@ -538,8 +539,8 @@ static void bvt_dump_cpu_state(int i)
   28.63      list_for_each_entry ( ed_inf, queue, run_list )
   28.64      {
   28.65          ed = ed_inf->exec_domain;
   28.66 -        printk("%3d: %u has=%c ", loop++, ed->domain->id,
   28.67 -               test_bit(EDF_RUNNING, &ed->flags) ? 'T':'F');
   28.68 +        printk("%3d: %u has=%c ", loop++, ed->domain->domain_id,
   28.69 +               test_bit(_VCPUF_running, &ed->vcpu_flags) ? 'T':'F');
   28.70          bvt_dump_runq_el(ed);
   28.71          printk("c=0x%X%08X\n", (u32)(ed->cpu_time>>32), (u32)ed->cpu_time);
   28.72          printk("         l: %p n: %p  p: %p\n",
    29.1 --- a/xen/common/sched_sedf.c	Thu May 12 13:28:39 2005 +0000
    29.2 +++ b/xen/common/sched_sedf.c	Thu May 12 13:58:47 2005 +0000
    29.3 @@ -162,8 +162,8 @@ static inline void extraq_del(struct exe
    29.4  {
    29.5  	struct list_head *list = EXTRALIST(d,i);
    29.6  	ASSERT(extraq_on(d,i));
    29.7 -	PRINT(3, "Removing domain %i.%i from L%i extraq\n", d->domain->id,
    29.8 -	   d->id, i);	
    29.9 +	PRINT(3, "Removing domain %i.%i from L%i extraq\n", d->domain->domain_id,
   29.10 +	   d->vcpu_id, i);	
   29.11  	list_del(list);
   29.12  	list->next = NULL;
   29.13  	ASSERT(!extraq_on(d, i));
   29.14 @@ -182,7 +182,7 @@ static inline void extraq_add_sort_updat
   29.15  	ASSERT(!extraq_on(d,i));
   29.16  	PRINT(3, "Adding domain %i.%i (score= %i, short_pen= %"PRIi64")"
   29.17                " to L%i extraq\n",
   29.18 -              d->domain->id, d->id, EDOM_INFO(d)->score[i],
   29.19 +              d->domain->domain_id, d->vcpu_id, EDOM_INFO(d)->score[i],
   29.20                EDOM_INFO(d)->short_block_lost_tot, i);	
   29.21  	/*iterate through all elements to find our "hole" and on our way
   29.22  	  update all the other scores*/
   29.23 @@ -193,8 +193,8 @@ static inline void extraq_add_sort_updat
   29.24  	 		break;
   29.25  		else
   29.26  			PRINT(4,"\tbehind domain %i.%i (score= %i)\n",
   29.27 -			      curinf->exec_domain->domain->id,
   29.28 -			      curinf->exec_domain->id, curinf->score[i]);
   29.29 +			      curinf->exec_domain->domain->domain_id,
   29.30 +			      curinf->exec_domain->vcpu_id, curinf->score[i]);
   29.31  	}
   29.32  	/*cur now contains the element, before which we'll enqueue*/
   29.33  	PRINT(3, "\tlist_add to %p\n", cur->prev);
   29.34 @@ -208,23 +208,23 @@ static inline void extraq_add_sort_updat
   29.35  				extralist[i]);
   29.36  			curinf->score[i] -= sub;
   29.37  			PRINT(4, "\tupdating domain %i.%i (score= %u)\n",
   29.38 -			      curinf->exec_domain->domain->id, 
   29.39 -			      curinf->exec_domain->id, curinf->score[i]);
   29.40 +			      curinf->exec_domain->domain->domain_id, 
   29.41 +			      curinf->exec_domain->vcpu_id, curinf->score[i]);
   29.42  		}
   29.43  	ASSERT(extraq_on(d,i));
   29.44  }
   29.45  static inline void extraq_check(struct exec_domain *d) {
   29.46  	if (extraq_on(d, EXTRA_UTIL_Q)) {
   29.47 -		PRINT(2,"Dom %i.%i is on L1 extraQ\n",d->domain->id, d->id);
   29.48 +		PRINT(2,"Dom %i.%i is on L1 extraQ\n",d->domain->domain_id, d->vcpu_id);
   29.49  		if (!(EDOM_INFO(d)->status & EXTRA_AWARE) &&
   29.50  		    !extra_runs(EDOM_INFO(d))) {
   29.51  			extraq_del(d, EXTRA_UTIL_Q);
   29.52  			PRINT(2,"Removed dom %i.%i from L1 extraQ\n",
   29.53 -			      d->domain->id, d->id);
   29.54 +			      d->domain->domain_id, d->vcpu_id);
   29.55  		}
   29.56  	} else {
   29.57 -		PRINT(2,"Dom %i.%i is NOT on L1 extraQ\n",d->domain->id,
   29.58 -		      d->id);
   29.59 +		PRINT(2,"Dom %i.%i is NOT on L1 extraQ\n",d->domain->domain_id,
   29.60 +		      d->vcpu_id);
   29.61  		if ((EDOM_INFO(d)->status & EXTRA_AWARE) && sedf_runnable(d))
   29.62  		{
   29.63  			#if (EXTRA == EXTRA_ROUNDR)
   29.64 @@ -235,8 +235,8 @@ static inline void extraq_check(struct e
   29.65  			#elif
   29.66  			;
   29.67  			#endif
   29.68 -			PRINT(2,"Added dom %i.%i to L1 extraQ\n",d->domain->id,
   29.69 -			      d->id);
   29.70 +			PRINT(2,"Added dom %i.%i to L1 extraQ\n",d->domain->domain_id,
   29.71 +			      d->vcpu_id);
   29.72  		}
   29.73  	}
   29.74  }
   29.75 @@ -268,7 +268,7 @@ static inline void __del_from_queue(stru
   29.76      struct list_head *list = LIST(d);
   29.77      ASSERT(__task_on_queue(d));
   29.78      PRINT(3,"Removing domain %i.%i (bop= %"PRIu64") from runq/waitq\n",
   29.79 -          d->domain->id, d->id, PERIOD_BEGIN(EDOM_INFO(d)));
   29.80 +          d->domain->domain_id, d->vcpu_id, PERIOD_BEGIN(EDOM_INFO(d)));
   29.81      list_del(list);
   29.82      list->next = NULL;
   29.83      ASSERT(!__task_on_queue(d));
   29.84 @@ -309,7 +309,7 @@ DOMAIN_COMPARER(waitq, list, PERIOD_BEGI
   29.85  static inline void __add_to_waitqueue_sort(struct exec_domain *d) {
   29.86  	ASSERT(!__task_on_queue(d));
   29.87  	PRINT(3,"Adding domain %i.%i (bop= %"PRIu64") to waitq\n",
   29.88 -              d->domain->id, d->id, PERIOD_BEGIN(EDOM_INFO(d)));
   29.89 +              d->domain->domain_id, d->vcpu_id, PERIOD_BEGIN(EDOM_INFO(d)));
   29.90  	list_insert_sort(WAITQ(d->processor), LIST(d), waitq_comp);
   29.91  	ASSERT(__task_on_queue(d));
   29.92  }
   29.93 @@ -322,7 +322,7 @@ static inline void __add_to_waitqueue_so
   29.94  DOMAIN_COMPARER(runq, list, d1->deadl_abs, d2->deadl_abs)
   29.95  static inline void __add_to_runqueue_sort(struct exec_domain *d) {
   29.96  	PRINT(3,"Adding domain %i.%i (deadl= %"PRIu64") to runq\n",
   29.97 -              d->domain->id, d->id, EDOM_INFO(d)->deadl_abs);
   29.98 +              d->domain->domain_id, d->vcpu_id, EDOM_INFO(d)->deadl_abs);
   29.99  	list_insert_sort(RUNQ(d->processor), LIST(d), runq_comp);
  29.100  }
  29.101  
  29.102 @@ -346,8 +346,8 @@ static int sedf_init_scheduler() {
  29.103  
  29.104  /* Allocates memory for per domain private scheduling data*/
  29.105  static int sedf_alloc_task(struct exec_domain *d) {
  29.106 -	PRINT(2,"sedf_alloc_task was called, domain-id %i.%i\n",d->domain->id,
  29.107 -	      d->id);
  29.108 +	PRINT(2,"sedf_alloc_task was called, domain-id %i.%i\n",d->domain->domain_id,
  29.109 +	      d->vcpu_id);
  29.110  	if (d->domain->sched_priv == NULL) {
  29.111  		if ((d->domain->sched_priv = 
  29.112  		     xmalloc(struct sedf_dom_info)) == NULL )
  29.113 @@ -366,10 +366,10 @@ static void sedf_add_task(struct exec_do
  29.114  	struct sedf_edom_info *inf = EDOM_INFO(d);
  29.115  	inf->exec_domain = d;
  29.116  	
  29.117 -	PRINT(2,"sedf_add_task was called, domain-id %i.%i\n",d->domain->id,
  29.118 -	      d->id);
  29.119 +	PRINT(2,"sedf_add_task was called, domain-id %i.%i\n",d->domain->domain_id,
  29.120 +	      d->vcpu_id);
  29.121  	      
  29.122 -	if (d->domain->id==0) {
  29.123 +	if (d->domain->domain_id==0) {
  29.124  		/*set dom0 to something useful to boot the machine*/
  29.125  		inf->period    = MILLISECS(20);
  29.126  		inf->slice     = MILLISECS(15);
  29.127 @@ -391,7 +391,7 @@ static void sedf_add_task(struct exec_do
  29.128  	INIT_LIST_HEAD(&(inf->extralist[EXTRA_PEN_Q]));
  29.129  	INIT_LIST_HEAD(&(inf->extralist[EXTRA_UTIL_Q]));
  29.130  	
  29.131 -	if (d->domain->id != IDLE_DOMAIN_ID) {
  29.132 +	if (d->domain->domain_id != IDLE_DOMAIN_ID) {
  29.133  		extraq_check(d);
  29.134  	}
  29.135  }
  29.136 @@ -400,7 +400,7 @@ static void sedf_add_task(struct exec_do
  29.137  static void sedf_free_task(struct domain *d)
  29.138  {
  29.139  	int i;
  29.140 -	PRINT(2,"sedf_free_task was called, domain-id %i\n",d->id);
  29.141 +	PRINT(2,"sedf_free_task was called, domain-id %i\n",d->domain_id);
  29.142  	ASSERT(d->sched_priv != NULL);
  29.143  	xfree(d->sched_priv);
  29.144  	
  29.145 @@ -414,14 +414,14 @@ static void sedf_free_task(struct domain
  29.146  /* Initialises idle task */
  29.147  static int sedf_init_idle_task(struct exec_domain *d) {
  29.148  	PRINT(2,"sedf_init_idle_task was called, domain-id %i.%i\n",
  29.149 -	      d->domain->id, d->id);
  29.150 +	      d->domain->domain_id, d->vcpu_id);
  29.151  	if ( sedf_alloc_task(d) < 0 )
  29.152  		return -1;
  29.153  	
  29.154  	sedf_add_task(d);
  29.155  	EDOM_INFO(d)->deadl_abs = 0;
  29.156  	EDOM_INFO(d)->status &= ~SEDF_ASLEEP;
  29.157 -	set_bit(EDF_RUNNING, &d->flags);
  29.158 +	set_bit(_VCPUF_running, &d->vcpu_flags);
  29.159  	/*the idle task doesn't have to turn up on any list...*/
  29.160  	return 0;
  29.161  }
  29.162 @@ -497,7 +497,7 @@ struct list_head* waitq) {
  29.163  	list_for_each_safe(cur, tmp, waitq) {
  29.164  		curinf = list_entry(cur, struct sedf_edom_info, list);
  29.165  		PRINT(4,"\tLooking @ dom %i.%i\n",
  29.166 -		      curinf->exec_domain->domain->id, curinf->exec_domain->id);
  29.167 +		      curinf->exec_domain->domain->domain_id, curinf->exec_domain->vcpu_id);
  29.168  		if (PERIOD_BEGIN(curinf) <= now) {
  29.169  			__del_from_queue(curinf->exec_domain);
  29.170  			__add_to_runqueue_sort(curinf->exec_domain);
  29.171 @@ -512,12 +512,12 @@ struct list_head* waitq) {
  29.172  	list_for_each_safe(cur, tmp, runq) {
  29.173  		curinf = list_entry(cur,struct sedf_edom_info,list);
  29.174  		PRINT(4,"\tLooking @ dom %i.%i\n",
  29.175 -		      curinf->exec_domain->domain->id, curinf->exec_domain->id);
  29.176 +		      curinf->exec_domain->domain->domain_id, curinf->exec_domain->vcpu_id);
  29.177  		if (unlikely(curinf->slice == 0)) {
  29.178  			/*ignore domains with empty slice*/
  29.179  			PRINT(4,"\tUpdating zero-slice domain %i.%i\n",
  29.180 -			      curinf->exec_domain->domain->id,
  29.181 -			      curinf->exec_domain->id);
  29.182 +			      curinf->exec_domain->domain->domain_id,
  29.183 +			      curinf->exec_domain->vcpu_id);
  29.184  			__del_from_queue(curinf->exec_domain);
  29.185  			
  29.186  			/*move them to their next period*/
  29.187 @@ -534,8 +534,8 @@ struct list_head* waitq) {
  29.188  			PRINT(4,"\tDomain %i.%i exceeded it's deadline/"
  29.189  				"slice (%"PRIu64" / %"PRIu64") now: %"PRIu64
  29.190  				" cputime: %"PRIu64"\n",
  29.191 -				curinf->exec_domain->domain->id,
  29.192 -				curinf->exec_domain->id,
  29.193 +				curinf->exec_domain->domain->domain_id,
  29.194 +				curinf->exec_domain->vcpu_id,
  29.195  				curinf->deadl_abs, curinf->slice, now,
  29.196  				curinf->cputime);
  29.197  			__del_from_queue(curinf->exec_domain);
  29.198 @@ -601,11 +601,11 @@ static inline void desched_extra_dom(s_t
  29.199  		/*inf->short_block_lost_tot -= EXTRA_QUANTUM;*/
  29.200  		inf->short_block_lost_tot -= now - inf->sched_start_abs;
  29.201  		PRINT(3,"Domain %i.%i: Short_block_loss: %"PRIi64"\n", 
  29.202 -		      inf->exec_domain->domain->id, inf->exec_domain->id,
  29.203 +		      inf->exec_domain->domain->domain_id, inf->exec_domain->vcpu_id,
  29.204  		      inf->short_block_lost_tot);
  29.205  		if (inf->short_block_lost_tot <= 0) {
  29.206  			PRINT(4,"Domain %i.%i compensated short block loss!\n",
  29.207 -			  inf->exec_domain->domain->id, inf->exec_domain->id);
  29.208 +			  inf->exec_domain->domain->domain_id, inf->exec_domain->vcpu_id);
  29.209  			/*we have (over-)compensated our block penalty*/
  29.210  			inf->short_block_lost_tot = 0;
  29.211  			/*we don't want a place on the penalty queue anymore!*/
  29.212 @@ -808,14 +808,14 @@ sched_done:
  29.213  }
  29.214  
  29.215  static void sedf_sleep(struct exec_domain *d) {
  29.216 -	PRINT(2,"sedf_sleep was called, domain-id %i.%i\n",d->domain->id, d->id);
  29.217 +	PRINT(2,"sedf_sleep was called, domain-id %i.%i\n",d->domain->domain_id, d->vcpu_id);
  29.218  	
  29.219  	if (is_idle_task(d->domain))
  29.220  		return;
  29.221  
  29.222  	EDOM_INFO(d)->status |= SEDF_ASLEEP;
  29.223  	
  29.224 -	if ( test_bit(EDF_RUNNING, &d->flags) ) {
  29.225 +	if ( test_bit(_VCPUF_running, &d->vcpu_flags) ) {
  29.226  #ifdef ADV_SCHED_HISTO
  29.227  		adv_sched_hist_start(d->processor);
  29.228  #endif
  29.229 @@ -1140,14 +1140,14 @@ void sedf_wake(struct exec_domain *d) {
  29.230  	s_time_t              now = NOW();
  29.231  	struct sedf_edom_info* inf = EDOM_INFO(d);
  29.232  	
  29.233 -	PRINT(3, "sedf_wake was called, domain-id %i.%i\n",d->domain->id, d->id);
  29.234 +	PRINT(3, "sedf_wake was called, domain-id %i.%i\n",d->domain->domain_id, d->vcpu_id);
  29.235  	
  29.236  	if (unlikely(is_idle_task(d->domain)))
  29.237  		return;
  29.238  			
  29.239  	if ( unlikely(__task_on_queue(d)) ) {
  29.240  		PRINT(3,"\tdomain %i.%i is already in some queue\n",
  29.241 -		      d->domain->id, d->id);
  29.242 +		      d->domain->domain_id, d->vcpu_id);
  29.243  		return;
  29.244  	}
  29.245  	ASSERT(!sedf_runnable(d));
  29.246 @@ -1160,7 +1160,7 @@ void sedf_wake(struct exec_domain *d) {
  29.247  		inf->deadl_abs = now + inf->slice;
  29.248  		
  29.249  	PRINT(3,"waking up domain %i.%i (deadl= %"PRIu64" period= %"PRIu64" "\
  29.250 -	        "now= %"PRIu64")\n", d->domain->id, d->id, inf->deadl_abs,
  29.251 +	        "now= %"PRIu64")\n", d->domain->domain_id, d->vcpu_id, inf->deadl_abs,
  29.252  		 inf->period, now);
  29.253  #ifdef SEDF_STATS	
  29.254  	inf->block_tot++;
  29.255 @@ -1222,7 +1222,7 @@ void sedf_wake(struct exec_domain *d) {
  29.256  		}
  29.257  	}
  29.258  	PRINT(3,"woke up domain %i.%i (deadl= %"PRIu64" period= %"PRIu64" "\
  29.259 -	        "now= %"PRIu64")\n", d->domain->id, d->id, inf->deadl_abs,
  29.260 +	        "now= %"PRIu64")\n", d->domain->domain_id, d->vcpu_id, inf->deadl_abs,
  29.261  		inf->period, now);
  29.262  	if (PERIOD_BEGIN(inf) > now) {
  29.263  		__add_to_waitqueue_sort(d);
  29.264 @@ -1257,8 +1257,8 @@ void sedf_wake(struct exec_domain *d) {
  29.265  
  29.266  /*Print a lot of use-{full, less} information about a domains in the system*/
  29.267  static void sedf_dump_domain(struct exec_domain *d) {
  29.268 -	printk("%i.%i has=%c ", d->domain->id, d->id,
  29.269 -		test_bit(EDF_RUNNING, &d->flags) ? 'T':'F');
  29.270 +	printk("%i.%i has=%c ", d->domain->domain_id, d->vcpu_id,
  29.271 +		test_bit(_VCPUF_running, &d->vcpu_flags) ? 'T':'F');
  29.272  	printk("p=%"PRIu64" sl=%"PRIu64" ddl=%"PRIu64" w=%hu c=%"PRIu64" sc=%i xtr(%s)=%"PRIu64" ew=%hu",
  29.273  	  EDOM_INFO(d)->period, EDOM_INFO(d)->slice, EDOM_INFO(d)->deadl_abs,
  29.274  	  EDOM_INFO(d)->weight, d->cpu_time, EDOM_INFO(d)->score[EXTRA_UTIL_Q],
  29.275 @@ -1399,7 +1399,7 @@ static int sedf_adjdom(struct domain *p,
  29.276  
  29.277  	PRINT(2,"sedf_adjdom was called, domain-id %i new period %"PRIu64" "\
  29.278  	        "new slice %"PRIu64"\nlatency %"PRIu64" extra:%s\n",
  29.279 -		p->id, cmd->u.sedf.period, cmd->u.sedf.slice,
  29.280 +		p->domain_id, cmd->u.sedf.period, cmd->u.sedf.slice,
  29.281  		cmd->u.sedf.latency, (cmd->u.sedf.extratime)?"yes":"no");
  29.282  	if ( cmd->direction == SCHED_INFO_PUT )
  29.283  	{
    30.1 --- a/xen/common/schedule.c	Thu May 12 13:28:39 2005 +0000
    30.2 +++ b/xen/common/schedule.c	Thu May 12 13:58:47 2005 +0000
    30.3 @@ -107,27 +107,27 @@ struct exec_domain *alloc_exec_domain_st
    30.4  
    30.5      d->exec_domain[vcpu] = ed;
    30.6      ed->domain = d;
    30.7 -    ed->id = vcpu;
    30.8 +    ed->vcpu_id = vcpu;
    30.9  
   30.10      if ( SCHED_OP(alloc_task, ed) < 0 )
   30.11          goto out;
   30.12  
   30.13      if ( vcpu != 0 )
   30.14      {
   30.15 -        ed->vcpu_info = &d->shared_info->vcpu_data[ed->id];
   30.16 +        ed->vcpu_info = &d->shared_info->vcpu_data[ed->vcpu_id];
   30.17  
   30.18          for_each_exec_domain( d, edc )
   30.19          {
   30.20              if ( (edc->next_in_list == NULL) ||
   30.21 -                 (edc->next_in_list->id > vcpu) )
   30.22 +                 (edc->next_in_list->vcpu_id > vcpu) )
   30.23                  break;
   30.24          }
   30.25          ed->next_in_list  = edc->next_in_list;
   30.26          edc->next_in_list = ed;
   30.27  
   30.28 -        if (test_bit(EDF_CPUPINNED, &edc->flags)) {
   30.29 +        if (test_bit(_VCPUF_cpu_pinned, &edc->vcpu_flags)) {
   30.30              ed->processor = (edc->processor + 1) % smp_num_cpus;
   30.31 -            set_bit(EDF_CPUPINNED, &ed->flags);
   30.32 +            set_bit(_VCPUF_cpu_pinned, &ed->vcpu_flags);
   30.33          } else {
   30.34              ed->processor = (edc->processor + 1) % smp_num_cpus;  /* XXX */
   30.35          }
   30.36 @@ -169,9 +169,9 @@ void sched_add_domain(struct exec_domain
   30.37      struct domain *d = ed->domain;
   30.38  
   30.39      /* Must be unpaused by control software to start execution. */
   30.40 -    set_bit(EDF_CTRLPAUSE, &ed->flags);
   30.41 +    set_bit(_VCPUF_ctrl_pause, &ed->vcpu_flags);
   30.42  
   30.43 -    if ( d->id != IDLE_DOMAIN_ID )
   30.44 +    if ( d->domain_id != IDLE_DOMAIN_ID )
   30.45      {
   30.46          /* Initialise the per-domain timer. */
   30.47          init_ac_timer(&ed->timer);
   30.48 @@ -185,14 +185,14 @@ void sched_add_domain(struct exec_domain
   30.49      }
   30.50  
   30.51      SCHED_OP(add_task, ed);
   30.52 -    TRACE_2D(TRC_SCHED_DOM_ADD, d->id, ed->id);
   30.53 +    TRACE_2D(TRC_SCHED_DOM_ADD, d->domain_id, ed->vcpu_id);
   30.54  }
   30.55  
   30.56  void sched_rem_domain(struct exec_domain *ed) 
   30.57  {
   30.58      rem_ac_timer(&ed->timer);
   30.59      SCHED_OP(rem_task, ed);
   30.60 -    TRACE_2D(TRC_SCHED_DOM_REM, ed->domain->id, ed->id);
   30.61 +    TRACE_2D(TRC_SCHED_DOM_REM, ed->domain->domain_id, ed->vcpu_id);
   30.62  }
   30.63  
   30.64  void init_idle_task(void)
   30.65 @@ -210,10 +210,10 @@ void domain_sleep(struct exec_domain *ed
   30.66          SCHED_OP(sleep, ed);
   30.67      spin_unlock_irqrestore(&schedule_data[ed->processor].schedule_lock, flags);
   30.68  
   30.69 -    TRACE_2D(TRC_SCHED_SLEEP, ed->domain->id, ed->id);
   30.70 +    TRACE_2D(TRC_SCHED_SLEEP, ed->domain->domain_id, ed->vcpu_id);
   30.71   
   30.72      /* Synchronous. */
   30.73 -    while ( test_bit(EDF_RUNNING, &ed->flags) && !domain_runnable(ed) )
   30.74 +    while ( test_bit(_VCPUF_running, &ed->vcpu_flags) && !domain_runnable(ed) )
   30.75          cpu_relax();
   30.76  }
   30.77  
   30.78 @@ -229,10 +229,10 @@ void domain_wake(struct exec_domain *ed)
   30.79          ed->wokenup = NOW();
   30.80  #endif
   30.81      }
   30.82 -    clear_bit(EDF_MIGRATED, &ed->flags);
   30.83 +    clear_bit(_VCPUF_cpu_migrated, &ed->vcpu_flags);
   30.84      spin_unlock_irqrestore(&schedule_data[ed->processor].schedule_lock, flags);
   30.85  
   30.86 -    TRACE_2D(TRC_SCHED_WAKE, ed->domain->id, ed->id);
   30.87 +    TRACE_2D(TRC_SCHED_WAKE, ed->domain->domain_id, ed->vcpu_id);
   30.88  }
   30.89  
   30.90  /* Block the currently-executing domain until a pertinent event occurs. */
   30.91 @@ -245,16 +245,16 @@ long do_block(void)
   30.92  #endif
   30.93  
   30.94      ed->vcpu_info->evtchn_upcall_mask = 0;
   30.95 -    set_bit(EDF_BLOCKED, &ed->flags);
   30.96 +    set_bit(_VCPUF_blocked, &ed->vcpu_flags);
   30.97  
   30.98      /* Check for events /after/ blocking: avoids wakeup waiting race. */
   30.99      if ( event_pending(ed) )
  30.100      {
  30.101 -        clear_bit(EDF_BLOCKED, &ed->flags);
  30.102 +        clear_bit(_VCPUF_blocked, &ed->vcpu_flags);
  30.103      }
  30.104      else
  30.105      {
  30.106 -        TRACE_2D(TRC_SCHED_BLOCK, ed->domain->id, ed->id);
  30.107 +        TRACE_2D(TRC_SCHED_BLOCK, ed->domain->domain_id, ed->vcpu_id);
  30.108          __enter_scheduler();
  30.109      }
  30.110  
  30.111 @@ -268,7 +268,7 @@ static long do_yield(void)
  30.112      adv_sched_hist_start(current->processor);
  30.113  #endif
  30.114      
  30.115 -    TRACE_2D(TRC_SCHED_YIELD, current->domain->id, current->id);
  30.116 +    TRACE_2D(TRC_SCHED_YIELD, current->domain->domain_id, current->vcpu_id);
  30.117      __enter_scheduler();
  30.118      return 0;
  30.119  }
  30.120 @@ -297,7 +297,7 @@ long do_sched_op(unsigned long op)
  30.121  
  30.122      case SCHEDOP_shutdown:
  30.123      {
  30.124 -        TRACE_3D(TRC_SCHED_SHUTDOWN, current->domain->id, current->id,
  30.125 +        TRACE_3D(TRC_SCHED_SHUTDOWN, current->domain->domain_id, current->vcpu_id,
  30.126                   (op >> SCHEDOP_reasonshift));
  30.127          domain_shutdown((u8)(op >> SCHEDOP_reasonshift));
  30.128          break;
  30.129 @@ -400,7 +400,7 @@ long sched_adjdom(struct sched_adjdom_cm
  30.130              spin_unlock(&schedule_data[cpu].schedule_lock);
  30.131      __clear_cpu_bits(have_lock);
  30.132  
  30.133 -    TRACE_1D(TRC_SCHED_ADJDOM, d->id);
  30.134 +    TRACE_1D(TRC_SCHED_ADJDOM, d->domain_id);
  30.135      put_domain(d);
  30.136      return 0;
  30.137  }
  30.138 @@ -451,7 +451,7 @@ static void __enter_scheduler(void)
  30.139      add_ac_timer(&schedule_data[cpu].s_timer);
  30.140  
  30.141      /* Must be protected by the schedule_lock! */
  30.142 -    set_bit(EDF_RUNNING, &next->flags);
  30.143 +    set_bit(_VCPUF_running, &next->vcpu_flags);
  30.144  
  30.145      spin_unlock_irq(&schedule_data[cpu].schedule_lock);
  30.146  
  30.147 @@ -492,8 +492,8 @@ static void __enter_scheduler(void)
  30.148      }
  30.149  
  30.150      TRACE_4D(TRC_SCHED_SWITCH,
  30.151 -             prev->domain->id, prev->id,
  30.152 -             next->domain->id, next->id);
  30.153 +             prev->domain->domain_id, prev->vcpu_id,
  30.154 +             next->domain->domain_id, next->vcpu_id);
  30.155  
  30.156  #ifdef ADV_SCHED_HISTO
  30.157      adv_sched_hist_to_stop(cpu);
    31.1 --- a/xen/drivers/char/console.c	Thu May 12 13:28:39 2005 +0000
    31.2 +++ b/xen/drivers/char/console.c	Thu May 12 13:58:47 2005 +0000
    31.3 @@ -303,7 +303,7 @@ long do_console_io(int cmd, int count, c
    31.4  
    31.5  #ifndef VERBOSE
    31.6      /* Only domain-0 may access the emergency console. */
    31.7 -    if ( current->domain->id != 0 )
    31.8 +    if ( current->domain->domain_id != 0 )
    31.9          return -EPERM;
   31.10  #endif
   31.11  
    32.1 --- a/xen/include/asm-x86/config.h	Thu May 12 13:28:39 2005 +0000
    32.2 +++ b/xen/include/asm-x86/config.h	Thu May 12 13:58:47 2005 +0000
    32.3 @@ -275,9 +275,9 @@ extern unsigned long _end; /* standard E
    32.4  extern unsigned long xenheap_phys_end; /* user-configurable */
    32.5  #endif
    32.6  
    32.7 -#define GDT_VIRT_START(ed)    (PERDOMAIN_VIRT_START + ((ed)->id << PDPT_VCPU_VA_SHIFT))
    32.8 +#define GDT_VIRT_START(ed)    (PERDOMAIN_VIRT_START + ((ed)->vcpu_id << PDPT_VCPU_VA_SHIFT))
    32.9  #define GDT_VIRT_END(ed)      (GDT_VIRT_START(ed) + (64*1024))
   32.10 -#define LDT_VIRT_START(ed)    (PERDOMAIN_VIRT_START + (64*1024) + ((ed)->id << PDPT_VCPU_VA_SHIFT))
   32.11 +#define LDT_VIRT_START(ed)    (PERDOMAIN_VIRT_START + (64*1024) + ((ed)->vcpu_id << PDPT_VCPU_VA_SHIFT))
   32.12  #define LDT_VIRT_END(ed)      (LDT_VIRT_START(ed) + (64*1024))
   32.13  
   32.14  #define PDPT_VCPU_SHIFT       5
    33.1 --- a/xen/include/asm-x86/debugger.h	Thu May 12 13:28:39 2005 +0000
    33.2 +++ b/xen/include/asm-x86/debugger.h	Thu May 12 13:58:47 2005 +0000
    33.3 @@ -62,14 +62,14 @@ static inline int debugger_trap_entry(
    33.4  {
    33.5      struct exec_domain *ed = current;
    33.6  
    33.7 -    if ( !KERNEL_MODE(ed, regs) || (ed->domain->id == 0) )
    33.8 +    if ( !KERNEL_MODE(ed, regs) || (ed->domain->domain_id == 0) )
    33.9          return 0;
   33.10      
   33.11      switch ( vector )
   33.12      {
   33.13      case TRAP_int3:
   33.14      case TRAP_debug:
   33.15 -        set_bit(EDF_CTRLPAUSE, &ed->flags);
   33.16 +        set_bit(_VCPUF_ctrl_pause, &ed->vcpu_flags);
   33.17          raise_softirq(SCHEDULE_SOFTIRQ);
   33.18          return 1;
   33.19      }
    34.1 --- a/xen/include/asm-x86/i387.h	Thu May 12 13:28:39 2005 +0000
    34.2 +++ b/xen/include/asm-x86/i387.h	Thu May 12 13:58:47 2005 +0000
    34.3 @@ -19,7 +19,7 @@ extern void save_init_fpu(struct exec_do
    34.4  extern void restore_fpu(struct exec_domain *tsk);
    34.5  
    34.6  #define unlazy_fpu(_tsk) do { \
    34.7 -    if ( test_bit(EDF_USEDFPU, &(_tsk)->flags) ) \
    34.8 +    if ( test_bit(_VCPUF_fpu_dirtied, &(_tsk)->vcpu_flags) ) \
    34.9          save_init_fpu(_tsk); \
   34.10  } while ( 0 )
   34.11  
   34.12 @@ -31,9 +31,9 @@ extern void restore_fpu(struct exec_doma
   34.13  /* Make domain the FPU owner */
   34.14  static inline void setup_fpu(struct exec_domain *ed)
   34.15  {
   34.16 -    if ( !test_and_set_bit(EDF_USEDFPU, &ed->flags) )
   34.17 +    if ( !test_and_set_bit(_VCPUF_fpu_dirtied, &ed->vcpu_flags) )
   34.18      {
   34.19 -        if ( test_bit(EDF_DONEFPUINIT, &ed->flags) )
   34.20 +        if ( test_bit(_VCPUF_fpu_initialised, &ed->vcpu_flags) )
   34.21              restore_fpu(ed);
   34.22          else
   34.23              init_fpu();
    35.1 --- a/xen/include/asm-x86/shadow.h	Thu May 12 13:28:39 2005 +0000
    35.2 +++ b/xen/include/asm-x86/shadow.h	Thu May 12 13:58:47 2005 +0000
    35.3 @@ -317,7 +317,7 @@ extern int shadow_status_noswap;
    35.4  #ifdef VERBOSE
    35.5  #define SH_LOG(_f, _a...)                                               \
    35.6      printk("DOM%uP%u: SH_LOG(%d): " _f "\n",                            \
    35.7 -       current->domain->id , current->processor, __LINE__ , ## _a )
    35.8 +       current->domain->domain_id , current->processor, __LINE__ , ## _a )
    35.9  #else
   35.10  #define SH_LOG(_f, _a...) ((void)0)
   35.11  #endif
   35.12 @@ -325,7 +325,7 @@ extern int shadow_status_noswap;
   35.13  #if SHADOW_VERBOSE_DEBUG
   35.14  #define SH_VLOG(_f, _a...)                                              \
   35.15      printk("DOM%uP%u: SH_VLOG(%d): " _f "\n",                           \
   35.16 -           current->domain->id, current->processor, __LINE__ , ## _a )
   35.17 +           current->domain->domain_id, current->processor, __LINE__ , ## _a )
   35.18  #else
   35.19  #define SH_VLOG(_f, _a...) ((void)0)
   35.20  #endif
   35.21 @@ -333,7 +333,7 @@ extern int shadow_status_noswap;
   35.22  #if SHADOW_VVERBOSE_DEBUG
   35.23  #define SH_VVLOG(_f, _a...)                                             \
   35.24      printk("DOM%uP%u: SH_VVLOG(%d): " _f "\n",                          \
   35.25 -           current->domain->id, current->processor, __LINE__ , ## _a )
   35.26 +           current->domain->domain_id, current->processor, __LINE__ , ## _a )
   35.27  #else
   35.28  #define SH_VVLOG(_f, _a...) ((void)0)
   35.29  #endif
   35.30 @@ -341,7 +341,7 @@ extern int shadow_status_noswap;
   35.31  #if SHADOW_VVVERBOSE_DEBUG
   35.32  #define SH_VVVLOG(_f, _a...)                                            \
   35.33      printk("DOM%uP%u: SH_VVVLOG(%d): " _f "\n",                         \
   35.34 -           current->domain->id, current->processor, __LINE__ , ## _a )
   35.35 +           current->domain->domain_id, current->processor, __LINE__ , ## _a )
   35.36  #else
   35.37  #define SH_VVVLOG(_f, _a...) ((void)0)
   35.38  #endif
   35.39 @@ -349,7 +349,7 @@ extern int shadow_status_noswap;
   35.40  #if FULLSHADOW_DEBUG
   35.41  #define FSH_LOG(_f, _a...)                                              \
   35.42      printk("DOM%uP%u: FSH_LOG(%d): " _f "\n",                           \
   35.43 -           current->domain->id, current->processor, __LINE__ , ## _a )
   35.44 +           current->domain->domain_id, current->processor, __LINE__ , ## _a )
   35.45  #else
   35.46  #define FSH_LOG(_f, _a...) ((void)0)
   35.47  #endif
   35.48 @@ -384,7 +384,8 @@ shadow_get_page_from_l1e(l1_pgentry_t l1
   35.49          res = get_page_from_l1e(nl1e, owner);
   35.50          printk("tried to map mfn %lx from domain %d into shadow page tables "
   35.51                 "of domain %d; %s\n",
   35.52 -               mfn, owner->id, d->id, res ? "success" : "failed");
   35.53 +               mfn, owner->domain_id, d->domain_id,
   35.54 +               res ? "success" : "failed");
   35.55      }
   35.56  
   35.57      if ( unlikely(!res) )
   35.58 @@ -1189,7 +1190,7 @@ static inline unsigned long __shadow_sta
   35.59          {
   35.60              printk("d->id=%d gpfn=%lx gmfn=%lx stype=%lx c=%x t=%x "
   35.61                     "mfn_out_of_sync(gmfn)=%d mfn_is_page_table(gmfn)=%d\n",
   35.62 -                   d->id, gpfn, gmfn, stype,
   35.63 +                   d->domain_id, gpfn, gmfn, stype,
   35.64                     frame_table[gmfn].count_info,
   35.65                     frame_table[gmfn].u.inuse.type_info,
   35.66                     mfn_out_of_sync(gmfn), mfn_is_page_table(gmfn));
    36.1 --- a/xen/include/xen/event.h	Thu May 12 13:28:39 2005 +0000
    36.2 +++ b/xen/include/xen/event.h	Thu May 12 13:58:47 2005 +0000
    36.3 @@ -35,15 +35,15 @@ static inline void evtchn_set_pending(st
    36.4          set_bit(0, &ed->vcpu_info->evtchn_upcall_pending);
    36.5  
    36.6          /*
    36.7 -         * NB1. 'flags' and 'processor' must be checked /after/ update of
    36.8 +         * NB1. 'vcpu_flags' and 'processor' must be checked /after/ update of
    36.9           * pending flag. These values may fluctuate (after all, we hold no
   36.10           * locks) but the key insight is that each change will cause
   36.11           * evtchn_upcall_pending to be polled.
   36.12           * 
   36.13 -         * NB2. We save DF_RUNNING across the unblock to avoid a needless
   36.14 +         * NB2. We save VCPUF_running across the unblock to avoid a needless
   36.15           * IPI for domains that we IPI'd to unblock.
   36.16           */
   36.17 -        running = test_bit(EDF_RUNNING, &ed->flags);
   36.18 +        running = test_bit(_VCPUF_running, &ed->vcpu_flags);
   36.19          exec_domain_unblock(ed);
   36.20          if ( running )
   36.21              smp_send_event_check_cpu(ed->processor);
    37.1 --- a/xen/include/xen/sched.h	Thu May 12 13:28:39 2005 +0000
    37.2 +++ b/xen/include/xen/sched.h	Thu May 12 13:58:47 2005 +0000
    37.3 @@ -62,7 +62,7 @@ int  init_exec_domain_event_channels(str
    37.4  
    37.5  struct exec_domain 
    37.6  {
    37.7 -    int              id;
    37.8 +    int              vcpu_id;
    37.9  
   37.10      int              processor;
   37.11  
   37.12 @@ -80,7 +80,7 @@ struct exec_domain
   37.13      s_time_t         wokenup;       /* time domain got woken up */
   37.14      void            *sched_priv;    /* scheduler-specific data */
   37.15  
   37.16 -    unsigned long    flags;
   37.17 +    unsigned long    vcpu_flags;
   37.18  
   37.19      u16              virq_to_evtchn[NR_VIRQS];
   37.20  
   37.21 @@ -97,7 +97,7 @@ struct exec_domain
   37.22  
   37.23  struct domain
   37.24  {
   37.25 -    domid_t          id;
   37.26 +    domid_t          domain_id;
   37.27  
   37.28      shared_info_t   *shared_info;     /* shared data area */
   37.29      spinlock_t       time_lock;
   37.30 @@ -113,7 +113,7 @@ struct domain
   37.31      unsigned int     xenheap_pages;   /* # pages allocated from Xen heap    */
   37.32  
   37.33      /* Scheduling. */
   37.34 -    int              shutdown_code; /* code value from OS (if DF_SHUTDOWN). */
   37.35 +    int              shutdown_code; /* code value from OS (if DOMF_shutdown) */
   37.36      void            *sched_priv;    /* scheduler-specific data */
   37.37  
   37.38      struct domain   *next_in_list;
   37.39 @@ -135,7 +135,7 @@ struct domain
   37.40      u16              pirq_to_evtchn[NR_PIRQS];
   37.41      u32              pirq_mask[NR_PIRQS/32];
   37.42  
   37.43 -    unsigned long    flags;
   37.44 +    unsigned long    domain_flags;
   37.45      unsigned long    vm_assist;
   37.46  
   37.47      atomic_t         refcnt;
   37.48 @@ -172,7 +172,7 @@ extern struct exec_domain idle0_exec_dom
   37.49  
   37.50  extern struct exec_domain *idle_task[NR_CPUS];
   37.51  #define IDLE_DOMAIN_ID   (0x7FFFU)
   37.52 -#define is_idle_task(_p) (test_bit(DF_IDLETASK, &(_p)->flags))
   37.53 +#define is_idle_task(_d) (test_bit(_DOMF_idle_domain, &(_d)->domain_flags))
   37.54  
   37.55  struct exec_domain *alloc_exec_domain_struct(struct domain *d,
   37.56                                               unsigned long vcpu);
   37.57 @@ -328,29 +328,67 @@ extern struct domain *domain_list;
   37.58         (_ed) != NULL;                \
   37.59         (_ed) = (_ed)->next_in_list )
   37.60  
   37.61 -#define EDF_DONEFPUINIT  0 /* Has the FPU been initialised for this task?    */
   37.62 -#define EDF_USEDFPU      1 /* Has this task used the FPU since last save?    */
   37.63 -#define EDF_GUEST_STTS   2 /* Has the guest OS requested 'stts'?             */
   37.64 -#define EDF_BLOCKED      3 /* Domain is blocked waiting for an event.        */
   37.65 -#define EDF_CTRLPAUSE    4 /* Domain is paused by controller software.       */
   37.66 -#define EDF_RUNNING      5 /* Currently running on a CPU.                    */
   37.67 -#define EDF_CPUPINNED    6 /* Disables auto-migration.                       */
   37.68 -#define EDF_MIGRATED     7 /* Domain migrated between CPUs.                  */
   37.69 -#define EDF_DONEINIT     8 /* Initialization completed    .                  */
   37.70 +/*
   37.71 + * Per-VCPU flags (vcpu_flags).
   37.72 + */
   37.73 + /* Has the FPU been initialised? */
   37.74 +#define _VCPUF_fpu_initialised 0
   37.75 +#define VCPUF_fpu_initialised  (1UL<<_VCPUF_fpu_initialised)
   37.76 + /* Has the FPU been used since it was last saved? */
   37.77 +#define _VCPUF_fpu_dirtied     1
   37.78 +#define VCPUF_fpu_dirtied      (1UL<<_VCPUF_fpu_dirtied)
   37.79 + /* Has the guest OS requested 'stts'? */
   37.80 +#define _VCPUF_guest_stts      2
   37.81 +#define VCPUF_guest_stts       (1UL<<_VCPUF_guest_stts)
   37.82 + /* Domain is blocked waiting for an event. */
   37.83 +#define _VCPUF_blocked         3
   37.84 +#define VCPUF_blocked          (1UL<<_VCPUF_blocked)
   37.85 + /* Domain is paused by controller software. */
   37.86 +#define _VCPUF_ctrl_pause      4
   37.87 +#define VCPUF_ctrl_pause       (1UL<<_VCPUF_ctrl_pause)
   37.88 + /* Currently running on a CPU? */
   37.89 +#define _VCPUF_running         5
   37.90 +#define VCPUF_running          (1UL<<_VCPUF_running)
   37.91 + /* Disables auto-migration between CPUs. */
   37.92 +#define _VCPUF_cpu_pinned      6
   37.93 +#define VCPUF_cpu_pinned       (1UL<<_VCPUF_cpu_pinned)
   37.94 + /* Domain migrated between CPUs. */
   37.95 +#define _VCPUF_cpu_migrated    7
   37.96 +#define VCPUF_cpu_migrated     (1UL<<_VCPUF_cpu_migrated)
   37.97 + /* Initialization completed. */
   37.98 +#define _VCPUF_initialised     8
   37.99 +#define VCPUF_initialised      (1UL<<_VCPUF_initialised)
  37.100  
  37.101 -#define DF_CONSTRUCTED   0 /* Has the guest OS been fully built yet?         */
  37.102 -#define DF_IDLETASK      1 /* Is this one of the per-CPU idle domains?       */
  37.103 -#define DF_PRIVILEGED    2 /* Is this domain privileged?                     */
  37.104 -#define DF_PHYSDEV       3 /* May this domain do IO to physical devices?     */
  37.105 -#define DF_SHUTDOWN      4 /* Guest shut itself down for some reason.        */
  37.106 -#define DF_CRASHED       5 /* Domain crashed inside Xen, cannot continue.    */
  37.107 -#define DF_DYING         6 /* Death rattle.                                  */
  37.108 +/*
  37.109 + * Per-domain flags (domain_flags).
  37.110 + */
  37.111 + /* Has the guest OS been fully built yet? */
  37.112 +#define _DOMF_constructed      0
  37.113 +#define DOMF_constructed       (1UL<<_DOMF_constructed)
  37.114 + /* Is this one of the per-CPU idle domains? */
  37.115 +#define _DOMF_idle_domain      1
  37.116 +#define DOMF_idle_domain       (1UL<<_DOMF_idle_domain)
  37.117 + /* Is this domain privileged? */
  37.118 +#define _DOMF_privileged       2
  37.119 +#define DOMF_privileged        (1UL<<_DOMF_privileged)
  37.120 + /* May this domain do IO to physical devices? */
  37.121 +#define _DOMF_physdev_access   3
  37.122 +#define DOMF_physdev_access    (1UL<<_DOMF_physdev_access)
  37.123 + /* Guest shut itself down for some reason. */
  37.124 +#define _DOMF_shutdown         4
  37.125 +#define DOMF_shutdown          (1UL<<_DOMF_shutdown)
  37.126 + /* Domain has crashed and cannot continue to execute. */
  37.127 +#define _DOMF_crashed          5
  37.128 +#define DOMF_crashed           (1UL<<_DOMF_crashed)
  37.129 + /* Death rattle. */
  37.130 +#define _DOMF_dying            6
  37.131 +#define DOMF_dying             (1UL<<_DOMF_dying)
  37.132  
  37.133  static inline int domain_runnable(struct exec_domain *ed)
  37.134  {
  37.135      return ( (atomic_read(&ed->pausecnt) == 0) &&
  37.136 -             !(ed->flags & ((1<<EDF_BLOCKED)|(1<<EDF_CTRLPAUSE))) &&
  37.137 -             !(ed->domain->flags & ((1<<DF_SHUTDOWN)|(1<<DF_CRASHED))) );
  37.138 +             !(ed->vcpu_flags & (VCPUF_blocked|VCPUF_ctrl_pause)) &&
  37.139 +             !(ed->domain->domain_flags & (DOMF_shutdown|DOMF_crashed)) );
  37.140  }
  37.141  
  37.142  static inline void exec_domain_pause(struct exec_domain *ed)
  37.143 @@ -392,7 +430,7 @@ static inline void domain_unpause(struct
  37.144  
  37.145  static inline void exec_domain_unblock(struct exec_domain *ed)
  37.146  {
  37.147 -    if ( test_and_clear_bit(EDF_BLOCKED, &ed->flags) )
  37.148 +    if ( test_and_clear_bit(_VCPUF_blocked, &ed->vcpu_flags) )
  37.149          domain_wake(ed);
  37.150  }
  37.151  
  37.152 @@ -403,7 +441,7 @@ static inline void domain_pause_by_syste
  37.153      for_each_exec_domain ( d, ed )
  37.154      {
  37.155          ASSERT(ed != current);
  37.156 -        if ( !test_and_set_bit(EDF_CTRLPAUSE, &ed->flags) )
  37.157 +        if ( !test_and_set_bit(_VCPUF_ctrl_pause, &ed->vcpu_flags) )
  37.158              domain_sleep(ed);
  37.159      }
  37.160  
  37.161 @@ -416,14 +454,15 @@ static inline void domain_unpause_by_sys
  37.162  
  37.163      for_each_exec_domain ( d, ed )
  37.164      {
  37.165 -        if ( test_and_clear_bit(EDF_CTRLPAUSE, &ed->flags) )
  37.166 +        if ( test_and_clear_bit(_VCPUF_ctrl_pause, &ed->vcpu_flags) )
  37.167              domain_wake(ed);
  37.168      }
  37.169  }
  37.170  
  37.171 -
  37.172 -#define IS_PRIV(_d) (test_bit(DF_PRIVILEGED, &(_d)->flags))
  37.173 -#define IS_CAPABLE_PHYSDEV(_d) (test_bit(DF_PHYSDEV, &(_d)->flags))
  37.174 +#define IS_PRIV(_d)                                         \
  37.175 +    (test_bit(_DOMF_privileged, &(_d)->domain_flags))
  37.176 +#define IS_CAPABLE_PHYSDEV(_d)                              \
  37.177 +    (test_bit(_DOMF_physdev_access, &(_d)->domain_flags))
  37.178  
  37.179  #define VM_ASSIST(_d,_t) (test_bit((_t), &(_d)->vm_assist))
  37.180