aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChen Yucong <slaoub@gmail.com>2014-11-01 06:23:32 -0400
committerBorislav Petkov <bp@suse.de>2014-11-01 06:28:23 -0400
commit8dcf32ea220d87ca517e164de85d336480c9d172 (patch)
tree4d74594c26f1a6145197ca196142f563a735a0b7
parenta3a529d104ec5149fb9a667dce988635941be1ed (diff)
x86, MCE, AMD: Assign interrupt handler only when bank supports it
There are some AMD CPU models which have thresholding banks but which cannot generate a thresholding interrupt. This is denoted by the bit MCi_MISC[IntP]. Make sure to check that bit before assigning the thresholding interrupt handler. Signed-off-by: Chen Yucong <slaoub@gmail.com> [ Boris: save an indentation level and rewrite commit message. ] Link: http://lkml.kernel.org/r/1412662128.28440.18.camel@debian Signed-off-by: Borislav Petkov <bp@suse.de>
-rw-r--r--arch/x86/kernel/cpu/mcheck/mce_amd.c17
1 files changed, 10 insertions, 7 deletions
diff --git a/arch/x86/kernel/cpu/mcheck/mce_amd.c b/arch/x86/kernel/cpu/mcheck/mce_amd.c
index 6606523ff1c1..f1c3769bbd64 100644
--- a/arch/x86/kernel/cpu/mcheck/mce_amd.c
+++ b/arch/x86/kernel/cpu/mcheck/mce_amd.c
@@ -212,7 +212,7 @@ void mce_amd_feature_init(struct cpuinfo_x86 *c)
212 unsigned int cpu = smp_processor_id(); 212 unsigned int cpu = smp_processor_id();
213 u32 low = 0, high = 0, address = 0; 213 u32 low = 0, high = 0, address = 0;
214 unsigned int bank, block; 214 unsigned int bank, block;
215 int offset = -1; 215 int offset = -1, new;
216 216
217 for (bank = 0; bank < mca_cfg.banks; ++bank) { 217 for (bank = 0; bank < mca_cfg.banks; ++bank) {
218 for (block = 0; block < NR_BLOCKS; ++block) { 218 for (block = 0; block < NR_BLOCKS; ++block) {
@@ -247,15 +247,18 @@ void mce_amd_feature_init(struct cpuinfo_x86 *c)
247 b.address = address; 247 b.address = address;
248 b.interrupt_capable = lvt_interrupt_supported(bank, high); 248 b.interrupt_capable = lvt_interrupt_supported(bank, high);
249 249
250 if (b.interrupt_capable) { 250 if (!b.interrupt_capable)
251 int new = (high & MASK_LVTOFF_HI) >> 20; 251 goto init;
252 offset = setup_APIC_mce(offset, new);
253 }
254 252
255 mce_threshold_block_init(&b, offset); 253 new = (high & MASK_LVTOFF_HI) >> 20;
254 offset = setup_APIC_mce(offset, new);
256 255
257 if (mce_threshold_vector != amd_threshold_interrupt) 256 if ((offset == new) &&
257 (mce_threshold_vector != amd_threshold_interrupt))
258 mce_threshold_vector = amd_threshold_interrupt; 258 mce_threshold_vector = amd_threshold_interrupt;
259
260init:
261 mce_threshold_block_init(&b, offset);
259 } 262 }
260 } 263 }
261} 264}