lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:	Tue, 19 May 2015 16:56:03 +0800
From:	"long.wanglong" <long.wanglong@...wei.com>
To:	Petr Mladek <pmladek@...e.cz>
CC:	<rostedt@...dmis.org>, <jkosina@...e.cz>,
	<gregkh@...uxfoundation.org>, <stable@...r.kernel.org>,
	<wanglong@...qinren.net>, <peifeiyue@...wei.com>,
	<linux-kernel@...r.kernel.org>, <morgan.wang@...wei.com>,
	<paulmck@...ux.vnet.ibm.com>, <dzickus@...hat.com>,
	<x86@...nel.org>, <sasha.levin@...cle.com>
Subject: Re: [RFC PATCH 16/17] x86/nmi: Perform a safe NMI stack trace on
 all CPUs

On 2015/5/18 22:17, Petr Mladek wrote:
> On Thu 2015-05-14 11:35:03, Wang Long wrote:
>> From: "Steven Rostedt (Red Hat)" <rostedt@...dmis.org>
>>
>> commit a9edc88093287183ac934be44f295f183b2c62dd upstream.
>>
>> When trigger_all_cpu_backtrace() is called on x86, it will trigger an
>> NMI on each CPU and call show_regs(). But this can lead to a hard lock
>> up if the NMI comes in on another printk().
>>
>> In order to avoid this, when the NMI triggers, it switches the printk
>> routine for that CPU to call a NMI safe printk function that records the
>> printk in a per_cpu seq_buf descriptor. After all NMIs have finished
>> recording its data, the seq_bufs are printed in a safe context.
>>
>> Link: http://lkml.kernel.org/p/20140619213952.360076309@goodmis.org
>> Link: http://lkml.kernel.org/r/20141115050605.055232587@goodmis.org
>>
>> Tested-by: Jiri Kosina <jkosina@...e.cz>
>> Acked-by: Jiri Kosina <jkosina@...e.cz>
>> Acked-by: Paul E. McKenney <paulmck@...ux.vnet.ibm.com>
>> Reviewed-by: Petr Mladek <pmladek@...e.cz>
>> [wanglong: backport to 3.10 stable
>> - adjust context
>> ]
>> Signed-off-by: Wang Long <long.wanglong@...wei.com>
>> Signed-off-by: Steven Rostedt <rostedt@...dmis.org>
>> ---
>>  arch/x86/kernel/apic/hw_nmi.c | 86 +++++++++++++++++++++++++++++++++++++++++--
>>  1 file changed, 83 insertions(+), 3 deletions(-)
>>
>> diff --git a/arch/x86/kernel/apic/hw_nmi.c b/arch/x86/kernel/apic/hw_nmi.c
>> index a698d71..1eb5f90 100644
>> --- a/arch/x86/kernel/apic/hw_nmi.c
>> +++ b/arch/x86/kernel/apic/hw_nmi.c
>> @@ -18,6 +18,7 @@
>>  #include <linux/nmi.h>
>>  #include <linux/module.h>
>>  #include <linux/delay.h>
>> +#include <linux/seq_buf.h>
>>  
>>  #ifdef CONFIG_HARDLOCKUP_DETECTOR
>>  u64 hw_nmi_get_sample_period(int watchdog_thresh)
>> @@ -29,12 +30,33 @@ u64 hw_nmi_get_sample_period(int watchdog_thresh)
>>  #ifdef arch_trigger_all_cpu_backtrace
>>  /* For reliability, we're prepared to waste bits here. */
>>  static DECLARE_BITMAP(backtrace_mask, NR_CPUS) __read_mostly;
>> +static cpumask_var_t printtrace_mask;
>> +
>> +#define NMI_BUF_SIZE           4096
> 
> Please, replace spaces with tabs.
> 
> In fact, the indentation is broken in this whole patch.
> 
> The content looks fine, though.
> 
> Best Regards,
> Petr
> 
Hi Petr,

Thank you for your review. Sorry for the indentation broken.

I will send the patch v2.

Best Regards
Wang Long


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ