x86/microcode: remove microcode_update_lock
authorChao Gao <chao.gao@intel.com>
Fri, 27 Sep 2019 12:19:38 +0000 (14:19 +0200)
committerJan Beulich <jbeulich@suse.com>
Fri, 27 Sep 2019 12:19:38 +0000 (14:19 +0200)
commit487b49e08ab103353ad57cdca004999383552738
treeb29729a597138e2ccac723845ec800adcb6347ac
parent8dd4dfa92d62fece75eae32ef2c2031caff19e34
x86/microcode: remove microcode_update_lock

microcode_update_lock is to prevent logic threads of a same core from
updating microcode at the same time. But due to using a global lock, it
also prevented parallel microcode updating on different cores.

Remove this lock in order to update microcode in parallel. It is safe
because we have already ensured serialization of sibling threads at the
caller side.
1.For late microcode update, do_microcode_update() ensures that only one
  sibiling thread of a core can update microcode.
2.For microcode update during system startup or CPU-hotplug,
  microcode_mutex() guarantees update serialization of logical threads.
3.get/put_cpu_bitmaps() prevents the concurrency of CPU-hotplug and
  late microcode update.

Note that printk in apply_microcode() and svm_host_osvm_init() (for AMD
only) are still processed sequentially.

Signed-off-by: Chao Gao <chao.gao@intel.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
xen/arch/x86/microcode_amd.c
xen/arch/x86/microcode_intel.c