]> git.baikalelectronics.ru Git - kernel.git/commit
x86/nmi: Fix nmi_handle() duration miscalculation
authorLibing Zhou <libing.zhou@nokia-sbell.com>
Thu, 20 Aug 2020 02:56:41 +0000 (10:56 +0800)
committerBorislav Petkov <bp@suse.de>
Thu, 1 Oct 2020 12:42:08 +0000 (14:42 +0200)
commit3a57b6b435d843b350cc4445eb601e05b6b788d4
treeaa1048ce5484a96d123b071ae55113055381f98a
parentc1f13badc6cbfe8ec4f723ee1826a8b4ad41d6e3
x86/nmi: Fix nmi_handle() duration miscalculation

When nmi_check_duration() is checking the time an NMI handler took to
execute, the whole_msecs value used should be read from the @duration
argument, not from the ->max_duration, the latter being used to store
the current maximal duration.

 [ bp: Rewrite commit message. ]

Fixes: bb3155a33155 ("x86/nmi: Remove irq_work from the long duration NMI handler")
Suggested-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Signed-off-by: Libing Zhou <libing.zhou@nokia-sbell.com>
Signed-off-by: Borislav Petkov <bp@suse.de>
Cc: Changbin Du <changbin.du@gmail.com>
Link: https://lkml.kernel.org/r/20200820025641.44075-1-libing.zhou@nokia-sbell.com
arch/x86/kernel/nmi.c