1
0
Fork 0
alistair23-linux/arch/x86
Yazen Ghannam 17ef4af0ec x86/mce/AMD: Use saved threshold block info in interrupt handler
In the amd_threshold_interrupt() handler, we loop through every possible
block in each bank and rediscover the block's address and if it's valid,
e.g. valid, counter present and not locked.

However, we already have the address saved in the threshold blocks list
for each CPU and bank. The list only contains blocks that have passed
all the valid checks.

Besides the redundancy, there's also a smp_call_function* in
get_block_address() which causes a warning when servicing the interrupt:

 WARNING: CPU: 0 PID: 0 at kernel/smp.c:281 smp_call_function_single+0xdd/0xf0
 ...
 Call Trace:
  <IRQ>
  rdmsr_safe_on_cpu()
  get_block_address.isra.2()
  amd_threshold_interrupt()
  smp_threshold_interrupt()
  threshold_interrupt()

because we do get called in an interrupt handler *with* interrupts
disabled, which can result in a deadlock.

Drop the redundant valid checks and move the overflow check, logging and
block reset into a separate function.

Check the first block then iterate over the rest. This procedure is
needed since the first block is used as the head of the list.

Signed-off-by: Yazen Ghannam <yazen.ghannam@amd.com>
Signed-off-by: Borislav Petkov <bp@suse.de>
Cc: Borislav Petkov <bp@alien8.de>
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/20170613162835.30750-3-bp@alien8.de
Signed-off-by: Ingo Molnar <mingo@kernel.org>
2017-06-14 07:32:06 +02:00
..
boot x86/boot: Use CROSS_COMPILE prefix for readelf 2017-05-21 13:04:27 +02:00
configs Merge branch 'x86-boot-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip 2017-05-01 20:51:12 -07:00
crypto crypto: glue_helper - remove the le128_gf128mul_x_ble function 2017-04-05 21:58:37 +08:00
entry Revert "x86/entry: Fix the end of the stack for newly forked tasks" 2017-05-24 09:05:16 +02:00
events perf/core improvements and fixes: 2017-05-03 19:28:27 +02:00
hyperv char/misc patches for 4.12-rc1 2017-05-04 19:15:35 -07:00
ia32 sched/headers: Prepare for new header dependencies before moving code to <linux/sched/task_stack.h> 2017-03-02 08:42:36 +01:00
include Linux 4.12-rc5 2017-06-14 07:31:46 +02:00
kernel x86/mce/AMD: Use saved threshold block info in interrupt handler 2017-06-14 07:32:06 +02:00
kvm KVM: async_pf: avoid async pf injection when in guest mode 2017-06-11 08:39:24 +02:00
lguest Merge branch 'x86-boot-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip 2017-05-01 20:51:12 -07:00
lib x86/mm/kaslr: Use the _ASM_MUL macro for multiplication to work around Clang incompatibility 2017-05-05 08:31:05 +02:00
math-emu Replace <asm/uaccess.h> with <linux/uaccess.h> globally 2016-12-24 11:46:01 -08:00
mm Revert "x86/PAT: Fix Xorg regression on CPUs that don't support PAT" 2017-06-01 15:52:23 +02:00
net x86: use set_memory.h header 2017-05-08 17:15:13 -07:00
oprofile x86/oprofile/nmi: Convert to hotplug state machine 2016-11-22 23:34:43 +01:00
pci pci-v4.12-changes 2017-05-08 19:03:25 -07:00
platform x86/efi: Correct EFI identity mapping under 'efi=old_map' when KASLR is enabled 2017-05-28 11:06:16 +02:00
power x86/mm: Add support for gbpages to kernel_ident_mapping_init() 2017-05-08 08:28:40 +02:00
purgatory kasan: do not sanitize kexec purgatory 2017-03-31 17:13:30 -07:00
ras RAS: Add a Corrected Errors Collector 2017-03-28 08:54:48 +02:00
realmode x86: use set_memory.h header 2017-05-08 17:15:13 -07:00
tools x86/tools: Fix gcc-7 warning in relocs.c 2016-12-19 11:50:24 +01:00
um Merge branch 'for-linus-4.12-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rw/uml 2017-05-13 10:20:02 -07:00
video x86/video: Don't assume all FB devices are PCI devices 2016-03-15 11:08:26 +01:00
xen xen: make xen_flush_tlb_all() static 2017-05-19 08:04:25 +02:00
.gitignore
Kbuild Drivers: hv vmbus: Move Hypercall page setup out of common code 2017-01-19 11:42:07 +01:00
Kconfig security/keys: add CONFIG_KEYS_COMPAT to Kconfig 2017-06-09 13:29:45 +10:00
Kconfig.cpu
Kconfig.debug usb/early: Add driver for xhci debug capability 2017-03-21 12:30:05 +01:00
Makefile x86/build: Permit building with old make versions 2017-05-24 09:05:17 +02:00
Makefile.um
Makefile_32.cpu x86/build: Mostly disable '-maccumulate-outgoing-args' 2017-03-30 11:53:04 +02:00