x86/mce/AMD: Read MSRs on the CPU allocating the threshold blocks
authorYazen Ghannam <Yazen.Ghannam@amd.com>
Mon, 12 Sep 2016 07:59:31 +0000 (09:59 +0200)
committerThomas Gleixner <tglx@linutronix.de>
Tue, 13 Sep 2016 13:23:08 +0000 (15:23 +0200)
commitcfee4f6f0b2026380c6bc6913dbd27943df17371
tree835891bc3c6371bd62617c198d3c5b547bf33222
parentbad744b7f29d264c2c2ad8fb723dd480e6c9b007
x86/mce/AMD: Read MSRs on the CPU allocating the threshold blocks

Scalable MCA systems allow non-core MCA banks to only be accessible by
certain CPUs. The MSRs for these banks are Read-as-Zero on other CPUs.

During allocate_threshold_blocks(), get_block_address() can be scheduled
on CPUs other than the one allocating the block. This causes the MSRs to
be read on the wrong CPU and results in incorrect behavior.

Add a @cpu parameter to get_block_address() and pass this in to ensure
that the MSRs are only read on the CPU that is allocating the block.

Signed-off-by: Yazen Ghannam <Yazen.Ghannam@amd.com>
Signed-off-by: Borislav Petkov <bp@suse.de>
Link: http://lkml.kernel.org/r/1472673994-12235-2-git-send-email-Yazen.Ghannam@amd.com
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
arch/x86/kernel/cpu/mcheck/mce_amd.c