ia64/xen-unstable

changeset 2944:1f88cb43f263

bitkeeper revision 1.1159.1.412 (4193a1919CNLBKTNSj3aLn7Jd6TpGA)

Synchronize domain time updates between CPUs.
author cl349@freefall.cl.cam.ac.uk
date Thu Nov 11 17:29:53 2004 +0000 (2004-11-11)
parents 94930ba41a23
children 48a6e020fddb
files xen/arch/x86/time.c xen/common/domain.c xen/include/xen/sched.h
line diff
     1.1 --- a/xen/arch/x86/time.c	Thu Nov 11 16:12:10 2004 +0000
     1.2 +++ b/xen/arch/x86/time.c	Thu Nov 11 17:29:53 2004 +0000
     1.3 @@ -281,6 +281,8 @@ void update_dom_time(struct domain *d)
     1.4  
     1.5      read_lock_irqsave(&time_lock, flags);
     1.6  
     1.7 +    spin_lock(&d->time_lock);
     1.8 +
     1.9      si->time_version1++;
    1.10      wmb();
    1.11  
    1.12 @@ -293,6 +295,8 @@ void update_dom_time(struct domain *d)
    1.13      wmb();
    1.14      si->time_version2++;
    1.15  
    1.16 +    spin_unlock(&d->time_lock);
    1.17 +
    1.18      read_unlock_irqrestore(&time_lock, flags);
    1.19  }
    1.20  
     2.1 --- a/xen/common/domain.c	Thu Nov 11 16:12:10 2004 +0000
     2.2 +++ b/xen/common/domain.c	Thu Nov 11 17:29:53 2004 +0000
     2.3 @@ -44,6 +44,8 @@ struct domain *do_createdomain(domid_t d
     2.4   
     2.5      memcpy(&ed->thread, &idle0_exec_domain.thread, sizeof(ed->thread));
     2.6  
     2.7 +    spin_lock_init(&d->time_lock);
     2.8 +
     2.9      spin_lock_init(&d->page_alloc_lock);
    2.10      INIT_LIST_HEAD(&d->page_list);
    2.11      INIT_LIST_HEAD(&d->xenpage_list);
     3.1 --- a/xen/include/xen/sched.h	Thu Nov 11 16:12:10 2004 +0000
     3.2 +++ b/xen/include/xen/sched.h	Thu Nov 11 17:29:53 2004 +0000
     3.3 @@ -109,10 +109,11 @@ struct exec_domain
     3.4  };
     3.5  
     3.6  struct domain {
     3.7 -    domid_t  id;
     3.8 -    s_time_t create_time;
     3.9 +    domid_t          id;
    3.10 +    s_time_t         create_time;
    3.11  
    3.12 -    shared_info_t *shared_info;       /* shared data area */
    3.13 +    shared_info_t   *shared_info;     /* shared data area */
    3.14 +    spinlock_t       time_lock;
    3.15  
    3.16      spinlock_t       page_alloc_lock; /* protects all the following fields  */
    3.17      struct list_head page_list;       /* linked list, of size tot_pages     */