lkml.org 
[lkml]   [2020]   [Aug]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH] x86/nmi: Fix nmi_handle duration miscalculation
    Date
    In nmi_check_duration(), the 'whole_msecs' value should
    get from 'duration' to reflect actual time duration,
    but not 'action->max_duration'.

    Signed-off-by: Libing Zhou <libing.zhou@nokia-sbell.com>
    ---
    arch/x86/kernel/nmi.c | 2 +-
    1 file changed, 1 insertion(+), 1 deletion(-)

    diff --git a/arch/x86/kernel/nmi.c b/arch/x86/kernel/nmi.c
    index 4fc9954a9560..c51ee659e520 100644
    --- a/arch/x86/kernel/nmi.c
    +++ b/arch/x86/kernel/nmi.c
    @@ -102,7 +102,7 @@ fs_initcall(nmi_warning_debugfs);

    static void nmi_check_duration(struct nmiaction *action, u64 duration)
    {
    - u64 whole_msecs = READ_ONCE(action->max_duration);
    + u64 whole_msecs = duration;
    int remainder_ns, decimal_msecs;

    if (duration < nmi_longest_ns || duration < action->max_duration)
    --
    2.22.0
    \
     
     \ /
      Last update: 2020-08-17 11:06    [W:4.322 / U:0.756 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site