diff --git a/xen/arch/x86/acpi/power.c b/xen/arch/x86/acpi/power.c index e3d6eefe65..3ad7dfc9a3 100644 --- a/xen/arch/x86/acpi/power.c +++ b/xen/arch/x86/acpi/power.c @@ -306,7 +306,6 @@ static int enter_state(u32 state) cpufreq_add_cpu(0); enable_cpu: - rcu_barrier(); mtrr_aps_sync_begin(); enable_nonboot_cpus(); mtrr_aps_sync_end(); diff --git a/xen/arch/x86/sysctl.c b/xen/arch/x86/sysctl.c index a95923e591..b0cb1b57e7 100644 --- a/xen/arch/x86/sysctl.c +++ b/xen/arch/x86/sysctl.c @@ -84,12 +84,9 @@ long cpu_up_helper(void *data) unsigned int cpu = (unsigned long)data; int ret = cpu_up(cpu); + /* Have one more go on EBUSY. */ if ( ret == -EBUSY ) - { - /* On EBUSY, flush RCU work and have one more go. */ - rcu_barrier(); ret = cpu_up(cpu); - } if ( !ret && !opt_smt && cpu_data[cpu].compute_unit_id == INVALID_CUID && @@ -109,12 +106,9 @@ long cpu_down_helper(void *data) { int cpu = (unsigned long)data; int ret = cpu_down(cpu); + /* Have one more go on EBUSY. */ if ( ret == -EBUSY ) - { - /* On EBUSY, flush RCU work and have one more go. */ - rcu_barrier(); ret = cpu_down(cpu); - } return ret; } diff --git a/xen/common/cpu.c b/xen/common/cpu.c index 31953f32e4..1f976db0a5 100644 --- a/xen/common/cpu.c +++ b/xen/common/cpu.c @@ -4,6 +4,7 @@ #include #include #include +#include unsigned int __read_mostly nr_cpu_ids = NR_CPUS; #ifndef nr_cpumask_bits @@ -53,6 +54,7 @@ void put_cpu_maps(void) void cpu_hotplug_begin(void) { + rcu_barrier(); write_lock(&cpu_add_remove_lock); }