x86/mce/amd: Straighten CPU hotplug path
authorThomas Gleixner <tglx@linutronix.de>
Mon, 30 Mar 2020 18:30:45 +0000 (20:30 +0200)
committerBorislav Petkov <bp@suse.de>
Tue, 14 Apr 2020 13:49:10 +0000 (15:49 +0200)
commit6458de97fc15530b54477c4e2b70af653e8ac3d9
tree5d52abf29479cdcbcb2b649d35712124292d130b
parent6e7a41c63abcfee28734c4c8872dae8d642329b6
x86/mce/amd: Straighten CPU hotplug path

mce_threshold_create_device() hotplug callback runs on the plugged in
CPU so:

 - use this_cpu_read() which is faster
 - pass in struct threshold_bank **bp to threshold_create_bank() and
   instead of doing per-CPU accesses
 - Use rdmsr_safe() instead of rdmsr_safe_on_cpu() which avoids an IPI.

No functional changes.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Borislav Petkov <bp@suse.de>
Link: https://lkml.kernel.org/r/20200403161943.1458-6-bp@alien8.de
arch/x86/kernel/cpu/mce/amd.c