diff options
author | Yazen Ghannam <yazen.ghannam@amd.com> | 2017-07-24 12:12:28 +0200 |
---|---|---|
committer | Ingo Molnar <mingo@kernel.org> | 2017-07-25 15:50:53 +0200 |
commit | 9662d43f523dfc0dc242ec29c2921c43898d6ae5 (patch) | |
tree | e181d63765fac66fb247081fdcbd2b464fb4d2e2 /kernel | |
parent | 520eccdfe187591a51ea9ab4c1a024ae4d0f68d9 (diff) | |
download | linux-stable-9662d43f523dfc0dc242ec29c2921c43898d6ae5.tar.gz linux-stable-9662d43f523dfc0dc242ec29c2921c43898d6ae5.tar.bz2 linux-stable-9662d43f523dfc0dc242ec29c2921c43898d6ae5.zip |
x86/mce/AMD: Allow any CPU to initialize the smca_banks array
Current SMCA implementations have the same banks on each CPU with the
non-core banks only visible to a "master thread" on each die. Practically,
this means the smca_banks array, which describes the banks, only needs to
be populated once by a single master thread.
CPU 0 seemed like a good candidate to do the populating. However, it's
possible that CPU 0 is not enabled in which case the smca_banks array won't
be populated.
Rather than try to figure out another master thread to do the populating,
we should just allow any CPU to populate the array.
Drop the CPU 0 check and return early if the bank was already initialized.
Also, drop the WARNing about an already initialized bank, since this will
be a common, expected occurrence.
The smca_banks array is only populated at boot time and CPUs are brought
online sequentially. So there's no need for locking around the array.
If the first CPU up is a master thread, then it will populate the array
with all banks, core and non-core. Every CPU afterwards will return
early. If the first CPU up is not a master thread, then it will populate
the array with all core banks. The first CPU afterwards that is a master
thread will skip populating the core banks and continue populating the
non-core banks.
Signed-off-by: Yazen Ghannam <yazen.ghannam@amd.com>
Signed-off-by: Borislav Petkov <bp@suse.de>
Acked-by: Jack Miller <jack@codezen.org>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Tony Luck <tony.luck@intel.com>
Cc: linux-edac <linux-edac@vger.kernel.org>
Link: http://lkml.kernel.org/r/20170724101228.17326-4-bp@alien8.de
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'kernel')
0 files changed, 0 insertions, 0 deletions