]> xenbits.xensource.com Git - xen.git/commitdiff
xen/x86: Drop unnecessary barriers
authorAndrew Cooper <andrew.cooper3@citrix.com>
Fri, 2 Dec 2016 15:00:41 +0000 (15:00 +0000)
committerAndrew Cooper <andrew.cooper3@citrix.com>
Wed, 3 Jan 2018 13:02:54 +0000 (13:02 +0000)
x86's current implementation of wmb() is a compiler barrier.  As a result, the
only change in this patch is to remove an mfence instruction from
cpuidle_disable_deep_cstate().

None of these barriers serve any purpose.  They are not synchronising with
remote cpus, and their compiler-barrier properties are not needed for
correctness purposes.

Furthermore, these wmb()'s specifically do not want to turn into sfence
instructions in future changes where wmb()'s implementation is corrected.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Acked-by: Jan Beulich <jbeulich@suse.com>
xen/arch/x86/acpi/cpu_idle.c
xen/arch/x86/cpu/mcheck/mce.c
xen/arch/x86/crash.c
xen/arch/x86/smpboot.c

index 884ee32c56b84273f6aafe4a1c923f0c57fbda8f..cb1c5da36c9883ab719bb01533f7335eb6c1e56f 100644 (file)
@@ -1341,8 +1341,6 @@ void cpuidle_disable_deep_cstate(void)
             max_cstate = 1;
     }
 
-    mb();
-
     hpet_disable_legacy_broadcast();
 }
 
index df0106ec3ce40d4b1042ce2fa4e036cf3714eee1..a8c287d12430db23f495a68ef1148b7473e6e0af 100644 (file)
@@ -86,7 +86,6 @@ static x86_mce_vector_t _machine_check_vector = unexpected_machine_check;
 void x86_mce_vector_register(x86_mce_vector_t hdlr)
 {
     _machine_check_vector = hdlr;
-    wmb();
 }
 
 /* Call the installed machine check handler for this CPU setup. */
@@ -385,8 +384,6 @@ mcheck_mca_logout(enum mca_source who, struct mca_banks *bankmask,
             mcabank_clear(i);
         else if ( who == MCA_MCE_SCAN && need_clear )
             mcabanks_set(i, clear_bank);
-
-        wmb();
     }
 
     if ( mig && errcnt > 0 )
index 82535c4df03dfb0940f59bb81849ece4bcd9d4d6..8d742582affce05629fc2501f53aac8caa2bd6cc 100644 (file)
@@ -146,9 +146,6 @@ static void nmi_shootdown_cpus(void)
     write_atomic((unsigned long *)__va(__pa(&exception_table[TRAP_nmi])),
                  (unsigned long)&do_nmi_crash);
 
-    /* Ensure the new callback function is set before sending out the NMI. */
-    wmb();
-
     smp_send_nmi_allbutself();
 
     msecs = 1000; /* Wait at most a second for the other cpus to stop */
index 0e585b34bd7d68d30e69c3b6fc5b677d0ebb4a20..7b97ff86cb1ee7a94bda1af981515f3434b80c81 100644 (file)
@@ -361,7 +361,6 @@ void start_secondary(void *unused)
     spin_debug_enable();
     set_cpu_sibling_map(cpu);
     notify_cpu_starting(cpu);
-    wmb();
 
     /*
      * We need to hold vector_lock so there the set of online cpus
@@ -377,7 +376,6 @@ void start_secondary(void *unused)
     local_irq_enable();
     mtrr_ap_init();
 
-    wmb();
     startup_cpu_idle_loop();
 }