]> git.ipfire.org Git - thirdparty/kernel/stable.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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 29 Oct 2020 09:07:16 +0000 (10:07 +0100)
commit5fd2c1240d756a08ef387e42a2572c81557592a0
tree68bb611ffa3518da680a1a4776287ae345cce8cd
parent6f9bc7071b5334fbe43a2582b8a12d5bdc9dbff3
x86/nmi: Fix nmi_handle() duration miscalculation

[ Upstream commit f94c91f7ba3ba7de2bc8aa31be28e1abb22f849e ]

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: 248ed51048c4 ("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
Signed-off-by: Sasha Levin <sashal@kernel.org>
arch/x86/kernel/nmi.c