]> xenbits.xensource.com Git - xen.git/commitdiff
Rename 'big lock' to 'domain lock'.
authorKeir Fraser <keir.fraser@citrix.com>
Mon, 14 Apr 2008 15:07:54 +0000 (16:07 +0100)
committerKeir Fraser <keir.fraser@citrix.com>
Mon, 14 Apr 2008 15:07:54 +0000 (16:07 +0100)
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
xen/arch/ia64/xen/mm.c
xen/arch/x86/domain.c
xen/arch/x86/hvm/hvm.c
xen/arch/x86/mm.c
xen/arch/x86/traps.c
xen/arch/x86/x86_64/compat/mm.c
xen/common/compat/domain.c
xen/common/domain.c
xen/common/grant_table.c
xen/include/xen/sched.h

index 15057ba2ebce74dc553ff8c416c041f31a24320b..5c8c6dd8de046b987ac269268035efa96dc1aece 100644 (file)
@@ -2827,7 +2827,7 @@ arch_memory_op(int op, XEN_GUEST_HANDLE(void) arg)
             return -EINVAL;
         }
 
-        LOCK_BIGLOCK(d);
+        domain_lock(d);
 
         /* Check remapping necessity */
         prev_mfn = gmfn_to_mfn(d, xatp.gpfn);
@@ -2853,7 +2853,7 @@ arch_memory_op(int op, XEN_GUEST_HANDLE(void) arg)
         guest_physmap_add_page(d, xatp.gpfn, mfn);
 
     out:
-        UNLOCK_BIGLOCK(d);
+        domain_unlock(d);
         
         rcu_unlock_domain(d);
 
index ae1097416cd157ce23c875250e072c5fbd4bd1ea..4418c51ff980f4122af95bca7d678eb8cd7f4d9b 100644 (file)
@@ -951,9 +951,9 @@ arch_do_vcpu_op(
         if ( copy_from_guest(&info, arg, 1) )
             break;
 
-        LOCK_BIGLOCK(d);
+        domain_lock(d);
         rc = map_vcpu_info(v, info.mfn, info.offset);
-        UNLOCK_BIGLOCK(d);
+        domain_unlock(d);
 
         break;
     }
index 10f9f9e71e36a0f856ebf63333aa554274496306..37307103469b740fcfc19743efc22208967d092c 100644 (file)
@@ -479,11 +479,11 @@ static int hvm_load_cpu_ctxt(struct domain *d, hvm_domain_context_t *h)
     vc = &v->arch.guest_context;
 
     /* Need to init this vcpu before loading its contents */
-    LOCK_BIGLOCK(d);
+    domain_lock(d);
     if ( !v->is_initialised )
         if ( (rc = boot_vcpu(d, vcpuid, vc)) != 0 )
             return rc;
-    UNLOCK_BIGLOCK(d);
+    domain_unlock(d);
 
     if ( hvm_load_entry(CPU, h, &ctxt) != 0 ) 
         return -EINVAL;
@@ -719,11 +719,11 @@ static void hvm_vcpu_down(void)
     vcpu_sleep_nosync(v);
 
     /* Any other VCPUs online? ... */
-    LOCK_BIGLOCK(d);
+    domain_lock(d);
     for_each_vcpu ( d, v )
         if ( !test_bit(_VPF_down, &v->pause_flags) )
             online_count++;
-    UNLOCK_BIGLOCK(d);
+    domain_unlock(d);
 
     /* ... Shut down the domain if not. */
     if ( online_count == 0 )
index 2376e941de5755ef18b9ad62a449871219e2966a..15f2cf57ebc833cbd47b8cd75dcc4b533c2451f2 100644 (file)
@@ -2188,7 +2188,7 @@ int do_mmuext_op(
         goto out;
     }
 
-    LOCK_BIGLOCK(d);
+    domain_lock(d);
 
     for ( i = 0; i < count; i++ )
     {
@@ -2437,7 +2437,7 @@ int do_mmuext_op(
 
     process_deferred_ops();
 
-    UNLOCK_BIGLOCK(d);
+    domain_unlock(d);
 
     perfc_add(num_mmuext_ops, i);
 
@@ -2492,7 +2492,7 @@ int do_mmu_update(
 
     domain_mmap_cache_init(&mapcache);
 
-    LOCK_BIGLOCK(d);
+    domain_lock(d);
 
     for ( i = 0; i < count; i++ )
     {
@@ -2664,7 +2664,7 @@ int do_mmu_update(
 
     process_deferred_ops();
 
-    UNLOCK_BIGLOCK(d);
+    domain_unlock(d);
 
     domain_mmap_cache_destroy(&mapcache);
 
@@ -2693,7 +2693,7 @@ static int create_grant_pte_mapping(
     l1_pgentry_t ol1e;
     struct domain *d = v->domain;
 
-    ASSERT(spin_is_locked(&d->big_lock));
+    ASSERT(domain_is_locked(d));
 
     adjust_guest_l1e(nl1e, d);
 
@@ -2816,7 +2816,7 @@ static int create_grant_va_mapping(
     unsigned long gl1mfn;
     int okay;
     
-    ASSERT(spin_is_locked(&d->big_lock));
+    ASSERT(domain_is_locked(d));
 
     adjust_guest_l1e(nl1e, d);
 
@@ -3014,7 +3014,7 @@ int do_update_va_mapping(unsigned long va, u64 val64,
     if ( rc )
         return rc;
 
-    LOCK_BIGLOCK(d);
+    domain_lock(d);
 
     pl1e = guest_map_l1e(v, va, &gl1mfn);
 
@@ -3027,7 +3027,7 @@ int do_update_va_mapping(unsigned long va, u64 val64,
 
     process_deferred_ops();
 
-    UNLOCK_BIGLOCK(d);
+    domain_unlock(d);
 
     switch ( flags & UVMF_FLUSHTYPE_MASK )
     {
@@ -3172,12 +3172,12 @@ long do_set_gdt(XEN_GUEST_HANDLE(ulong) frame_list, unsigned int entries)
     if ( copy_from_guest(frames, frame_list, nr_pages) )
         return -EFAULT;
 
-    LOCK_BIGLOCK(curr->domain);
+    domain_lock(curr->domain);
 
     if ( (ret = set_gdt(curr, frames, entries)) == 0 )
         flush_tlb_local();
 
-    UNLOCK_BIGLOCK(curr->domain);
+    domain_unlock(curr->domain);
 
     return ret;
 }
@@ -3311,7 +3311,7 @@ long arch_memory_op(int op, XEN_GUEST_HANDLE(void) arg)
             return -EINVAL;
         }
 
-        LOCK_BIGLOCK(d);
+        domain_lock(d);
 
         /* Remove previously mapped page if it was present. */
         prev_mfn = gmfn_to_mfn(d, xatp.gpfn);
@@ -3333,7 +3333,7 @@ long arch_memory_op(int op, XEN_GUEST_HANDLE(void) arg)
         /* Map at new location. */
         guest_physmap_add_page(d, xatp.gpfn, mfn);
 
-        UNLOCK_BIGLOCK(d);
+        domain_unlock(d);
 
         rcu_unlock_domain(d);
 
@@ -3669,7 +3669,7 @@ int ptwr_do_page_fault(struct vcpu *v, unsigned long addr,
     struct ptwr_emulate_ctxt ptwr_ctxt;
     int rc;
 
-    LOCK_BIGLOCK(d);
+    domain_lock(d);
 
     /* Attempt to read the PTE that maps the VA being accessed. */
     guest_get_eff_l1e(v, addr, &pte);
@@ -3694,12 +3694,12 @@ int ptwr_do_page_fault(struct vcpu *v, unsigned long addr,
     if ( rc == X86EMUL_UNHANDLEABLE )
         goto bail;
 
-    UNLOCK_BIGLOCK(d);
+    domain_unlock(d);
     perfc_incr(ptwr_emulations);
     return EXCRET_fault_fixed;
 
  bail:
-    UNLOCK_BIGLOCK(d);
+    domain_unlock(d);
     return 0;
 }
 
index c9f879b351add05e2448377c27be35f36e3cdef5..5e39c9b4174c29f01f077e672cca43bebebf5d8c 100644 (file)
@@ -1979,14 +1979,14 @@ static int emulate_privileged_op(struct cpu_user_regs *regs)
             break;
 
         case 3: /* Write CR3 */
-            LOCK_BIGLOCK(v->domain);
+            domain_lock(v->domain);
             if ( !is_pv_32on64_vcpu(v) )
                 rc = new_guest_cr3(gmfn_to_mfn(v->domain, xen_cr3_to_pfn(*reg)));
 #ifdef CONFIG_COMPAT
             else
                 rc = new_guest_cr3(gmfn_to_mfn(v->domain, compat_cr3_to_pfn(*reg)));
 #endif
-            UNLOCK_BIGLOCK(v->domain);
+            domain_unlock(v->domain);
             if ( rc == 0 ) /* not okay */
                 goto fail;
             break;
index 256f7a5ac87158bfc7a8816d8ab286145cda45d2..a1de1bab27fdaf2056228b3e3638d631f02e9426 100644 (file)
@@ -28,12 +28,12 @@ int compat_set_gdt(XEN_GUEST_HANDLE(uint) frame_list, unsigned int entries)
         guest_handle_add_offset(frame_list, 1);
     }
 
-    LOCK_BIGLOCK(current->domain);
+    domain_lock(current->domain);
 
     if ( (ret = set_gdt(current, frames, entries)) == 0 )
         flush_tlb_local();
 
-    UNLOCK_BIGLOCK(current->domain);
+    domain_unlock(current->domain);
 
     return ret;
 }
index 002a8a8362229da656a1d8f54ed4492b95ff0b8f..9e58cb145c49e4bd647663de9417c75982beb9c2 100644 (file)
@@ -42,11 +42,11 @@ int compat_vcpu_op(int cmd, int vcpuid, XEN_GUEST_HANDLE(void) arg)
             break;
         }
 
-        LOCK_BIGLOCK(d);
+        domain_lock(d);
         rc = -EEXIST;
         if ( !v->is_initialised )
             rc = boot_vcpu(d, vcpuid, cmp_ctxt);
-        UNLOCK_BIGLOCK(d);
+        domain_unlock(d);
 
         xfree(cmp_ctxt);
         break;
index 76b48f42960226c0a7b885dfbc3f9539ec8c01ce..c74fb07c0e924cd902490bcbcf4ef247b21dbca0 100644 (file)
@@ -80,7 +80,7 @@ struct domain *alloc_domain(domid_t domid)
     }
 
     atomic_set(&d->refcnt, 1);
-    spin_lock_init(&d->big_lock);
+    spin_lock_init(&d->domain_lock);
     spin_lock_init(&d->page_alloc_lock);
     spin_lock_init(&d->shutdown_lock);
     spin_lock_init(&d->hypercall_deadlock_mutex);
@@ -629,7 +629,7 @@ int vcpu_reset(struct vcpu *v)
     int rc;
 
     domain_pause(d);
-    LOCK_BIGLOCK(d);
+    domain_lock(d);
 
     rc = arch_vcpu_reset(v);
     if ( rc != 0 )
@@ -646,7 +646,7 @@ int vcpu_reset(struct vcpu *v)
     clear_bit(_VPF_blocked, &v->pause_flags);
 
  out:
-    UNLOCK_BIGLOCK(v->domain);
+    domain_unlock(v->domain);
     domain_unpause(d);
 
     return rc;
@@ -678,11 +678,11 @@ long do_vcpu_op(int cmd, int vcpuid, XEN_GUEST_HANDLE(void) arg)
             return -EFAULT;
         }
 
-        LOCK_BIGLOCK(d);
+        domain_lock(d);
         rc = -EEXIST;
         if ( !v->is_initialised )
             rc = boot_vcpu(d, vcpuid, ctxt);
-        UNLOCK_BIGLOCK(d);
+        domain_unlock(d);
 
         xfree(ctxt);
         break;
index d582713c7ee66ec22df4eb086fbcd2e833406e66..53662df865bda49766e223f9792baa9ba8fb9dc6 100644 (file)
@@ -1445,7 +1445,7 @@ do_grant_table_op(
     if ( count > 512 )
         return -EINVAL;
     
-    LOCK_BIGLOCK(d);
+    domain_lock(d);
     
     rc = -EFAULT;
     switch ( cmd )
@@ -1516,7 +1516,7 @@ do_grant_table_op(
     }
     
   out:
-    UNLOCK_BIGLOCK(d);
+    domain_unlock(d);
     
     return rc;
 }
index de036ceaf8c0061c6c717baa6aa363318785d3b4..ff5241a5325e928473ebc09913f75048acc557ae 100644 (file)
@@ -138,8 +138,9 @@ struct vcpu
 };
 
 /* Per-domain lock can be recursively acquired in fault handlers. */
-#define LOCK_BIGLOCK(_d) spin_lock_recursive(&(_d)->big_lock)
-#define UNLOCK_BIGLOCK(_d) spin_unlock_recursive(&(_d)->big_lock)
+#define domain_lock(d) spin_lock_recursive(&(d)->domain_lock)
+#define domain_unlock(d) spin_unlock_recursive(&(d)->domain_lock)
+#define domain_is_locked(d) spin_is_locked(&(d)->domain_lock)
 
 struct domain
 {
@@ -147,7 +148,7 @@ struct domain
 
     shared_info_t   *shared_info;     /* shared data area */
 
-    spinlock_t       big_lock;
+    spinlock_t       domain_lock;
 
     spinlock_t       page_alloc_lock; /* protects all the following fields  */
     struct list_head page_list;       /* linked list, of size tot_pages     */