[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] [xen-unstable] x86: avoid LOCK prefix in some cases where it's not necessary.



# HG changeset patch
# User Keir Fraser <keir.fraser@xxxxxxxxxx>
# Date 1197287755 0
# Node ID 40812c9d96e73f0b630384117b4a983affd2cff9
# Parent  d4d3b2f1714d16daef45f6ad23dfbfe4e4abb925
x86: avoid LOCK prefix in some cases where it's not necessary.
Signed-off-by: Jan Beulich <jbeulich@xxxxxxxxxx>
---
 xen/arch/x86/hvm/hvm.c    |    2 +-
 xen/arch/x86/hvm/vlapic.c |    2 +-
 xen/arch/x86/traps.c      |   18 +++++++++---------
 xen/common/page_alloc.c   |    5 +++--
 4 files changed, 14 insertions(+), 13 deletions(-)

diff -r d4d3b2f1714d -r 40812c9d96e7 xen/arch/x86/hvm/hvm.c
--- a/xen/arch/x86/hvm/hvm.c    Mon Dec 10 11:49:12 2007 +0000
+++ b/xen/arch/x86/hvm/hvm.c    Mon Dec 10 11:55:55 2007 +0000
@@ -81,7 +81,7 @@ void hvm_enable(struct hvm_function_tabl
      * delays, but the vmexits simply slow things down).
      */
     memset(hvm_io_bitmap, ~0, sizeof(hvm_io_bitmap));
-    clear_bit(0x80, hvm_io_bitmap);
+    __clear_bit(0x80, hvm_io_bitmap);
 
     hvm_funcs   = *fns;
     hvm_enabled = 1;
diff -r d4d3b2f1714d -r 40812c9d96e7 xen/arch/x86/hvm/vlapic.c
--- a/xen/arch/x86/hvm/vlapic.c Mon Dec 10 11:49:12 2007 +0000
+++ b/xen/arch/x86/hvm/vlapic.c Mon Dec 10 11:55:55 2007 +0000
@@ -408,7 +408,7 @@ static void vlapic_ipi(struct vlapic *vl
         if ( vlapic_match_dest(v, vlapic, short_hand, dest, dest_mode) )
         {
             if ( delivery_mode == APIC_DM_LOWEST )
-                set_bit(v->vcpu_id, &lpr_map);
+                __set_bit(v->vcpu_id, &lpr_map);
             else
                 vlapic_accept_irq(v, delivery_mode,
                                   vector, level, trig_mode);
diff -r d4d3b2f1714d -r 40812c9d96e7 xen/arch/x86/traps.c
--- a/xen/arch/x86/traps.c      Mon Dec 10 11:49:12 2007 +0000
+++ b/xen/arch/x86/traps.c      Mon Dec 10 11:55:55 2007 +0000
@@ -677,25 +677,25 @@ static int emulate_forced_invalid_op(str
     if ( regs->eax == 1 )
     {
         /* Modify Feature Information. */
-        clear_bit(X86_FEATURE_VME, &d);
-        clear_bit(X86_FEATURE_PSE, &d);
-        clear_bit(X86_FEATURE_PGE, &d);
+        __clear_bit(X86_FEATURE_VME, &d);
+        __clear_bit(X86_FEATURE_PSE, &d);
+        __clear_bit(X86_FEATURE_PGE, &d);
         if ( !cpu_has_sep )
-            clear_bit(X86_FEATURE_SEP, &d);
+            __clear_bit(X86_FEATURE_SEP, &d);
 #ifdef __i386__
         if ( !supervisor_mode_kernel )
-            clear_bit(X86_FEATURE_SEP, &d);
+            __clear_bit(X86_FEATURE_SEP, &d);
 #endif
         if ( !IS_PRIV(current->domain) )
-            clear_bit(X86_FEATURE_MTRR, &d);
+            __clear_bit(X86_FEATURE_MTRR, &d);
     }
     else if ( regs->eax == 0x80000001 )
     {
         /* Modify Feature Information. */
 #ifdef __i386__
-        clear_bit(X86_FEATURE_SYSCALL % 32, &d);
-#endif
-        clear_bit(X86_FEATURE_RDTSCP % 32, &d);
+        __clear_bit(X86_FEATURE_SYSCALL % 32, &d);
+#endif
+        __clear_bit(X86_FEATURE_RDTSCP % 32, &d);
     }
     else
     {
diff -r d4d3b2f1714d -r 40812c9d96e7 xen/common/page_alloc.c
--- a/xen/common/page_alloc.c   Mon Dec 10 11:49:12 2007 +0000
+++ b/xen/common/page_alloc.c   Mon Dec 10 11:55:55 2007 +0000
@@ -301,14 +301,15 @@ static void init_node_heap(int node)
     /* First node to be discovered has its heap metadata statically alloced. */
     static heap_by_zone_and_order_t _heap_static;
     static unsigned long avail_static[NR_ZONES];
-    static unsigned long first_node_initialised;
+    static int first_node_initialised;
 
     int i, j;
 
-    if ( !test_and_set_bit(0, &first_node_initialised) )
+    if ( !first_node_initialised )
     {
         _heap[node] = &_heap_static;
         avail[node] = avail_static;
+        first_node_initialised = 1;
     }
     else
     {

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.