Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1256573 > unrolled thread

Re: [V4 PATCH 4/4] x86/apic: Introduce noextnmi boot option

Started byBaoquan He <bhe@redhat.com>
First post2015-10-27 09:50 +0100
Last post2015-10-27 10:10 +0100
Articles 3 — 3 participants

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: [V4 PATCH 4/4] x86/apic: Introduce noextnmi boot option Baoquan He <bhe@redhat.com> - 2015-10-27 09:50 +0100
    Re: [V4 PATCH 4/4] x86/apic: Introduce noextnmi boot option "'Baoquan He'" <bhe@redhat.com> - 2015-10-27 10:10 +0100
    RE: Re: [V4 PATCH 4/4] x86/apic: Introduce noextnmi boot option 河合英宏 / KAWAI,HIDEHIRO   <hidehiro.kawai.ez@hitachi.com> - 2015-10-27 10:10 +0100

#1256573 — Re: [V4 PATCH 4/4] x86/apic: Introduce noextnmi boot option

FromBaoquan He <bhe@redhat.com>
Date2015-10-27 09:50 +0100
SubjectRe: [V4 PATCH 4/4] x86/apic: Introduce noextnmi boot option
Message-ID<qo878-30x-1@gated-at.bofh.it>
Hi,

I just have a look at this thread. I am wondering why we don't use
existing is_kdump_kernel() directly to disable external NMI if it's
in kdump kernel. Then no need to introduce another boot option "noextnmi"
which is used only for kdump kernel.

Thanks
Baoquan

On 09/25/15 at 08:28pm, Hidehiro Kawai wrote:
> This patch introduces new boot option "noextnmi" which disables
> external NMI.  This option is useful for the dump capture kernel
> so that an HA application or administrator wouldn't mistakenly
> shoot down the kernel by NMI.
> 
> Currently, only x86 supports this option.
> 
> Signed-off-by: Hidehiro Kawai <hidehiro.kawai.ez@hitachi.com>
> Cc: Thomas Gleixner <tglx@linutronix.de>
> Cc: Ingo Molnar <mingo@redhat.com>
> Cc: "H. Peter Anvin" <hpa@zytor.com>
> Cc: Jonathan Corbet <corbet@lwn.net>
> ---
>  Documentation/kernel-parameters.txt |    4 ++++
>  arch/x86/kernel/apic/apic.c         |   17 ++++++++++++++++-
>  2 files changed, 20 insertions(+), 1 deletion(-)
> 
> diff --git a/Documentation/kernel-parameters.txt b/Documentation/kernel-parameters.txt
> index 22a4b68..8bcaccd 100644
> --- a/Documentation/kernel-parameters.txt
> +++ b/Documentation/kernel-parameters.txt
> @@ -2379,6 +2379,10 @@ bytes respectively. Such letter suffixes can also be entirely omitted.
>  			noexec=on: enable non-executable mappings (default)
>  			noexec=off: disable non-executable mappings
>  
> +	noextnmi	[X86]
> +			Mask external NMI.  This option is useful for a
> +			dump capture kernel to be shot down by NMI.
> +
>  	nosmap		[X86]
>  			Disable SMAP (Supervisor Mode Access Prevention)
>  			even if it is supported by processor.
> diff --git a/arch/x86/kernel/apic/apic.c b/arch/x86/kernel/apic/apic.c
> index 24e94ce..fd47128 100644
> --- a/arch/x86/kernel/apic/apic.c
> +++ b/arch/x86/kernel/apic/apic.c
> @@ -82,6 +82,12 @@
>  static unsigned int disabled_cpu_apicid __read_mostly = BAD_APICID;
>  
>  /*
> + * Don't enable external NMI via LINT1 on BSP.  This is useful for
> + * the dump capture kernel.
> + */
> +static bool apic_noextnmi;
> +
> +/*
>   * Map cpu index to physical APIC ID
>   */
>  DEFINE_EARLY_PER_CPU_READ_MOSTLY(u16, x86_cpu_to_apicid, BAD_APICID);
> @@ -1161,6 +1167,8 @@ void __init init_bsp_APIC(void)
>  	value = APIC_DM_NMI;
>  	if (!lapic_is_integrated())		/* 82489DX */
>  		value |= APIC_LVT_LEVEL_TRIGGER;
> +	if (apic_noextnmi)
> +		value |= APIC_LVT_MASKED;
>  	apic_write(APIC_LVT1, value);
>  }
>  
> @@ -1380,7 +1388,7 @@ void setup_local_APIC(void)
>  	/*
>  	 * only the BP should see the LINT1 NMI signal, obviously.
>  	 */
> -	if (!cpu)
> +	if (!cpu && !apic_noextnmi)
>  		value = APIC_DM_NMI;
>  	else
>  		value = APIC_DM_NMI | APIC_LVT_MASKED;
> @@ -2548,3 +2556,10 @@ static int __init apic_set_disabled_cpu_apicid(char *arg)
>  	return 0;
>  }
>  early_param("disable_cpu_apicid", apic_set_disabled_cpu_apicid);
> +
> +static int __init apic_set_noextnmi(char *arg)
> +{
> +	apic_noextnmi = true;
> +	return 0;
> +}
> +early_param("noextnmi", apic_set_noextnmi);
> 
> 
> 
> _______________________________________________
> kexec mailing list
> kexec@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/kexec
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [next] | [standalone]


#1256589

From"'Baoquan He'" <bhe@redhat.com>
Date2015-10-27 10:10 +0100
Message-ID<qo8qu-3ms-1@gated-at.bofh.it>
In reply to#1256573
On 10/27/15 at 09:01am, 河合英宏 / KAWAI,HIDEHIRO wrote:
> Hi,
> 
> > I just have a look at this thread. I am wondering why we don't use
> > existing is_kdump_kernel() directly to disable external NMI if it's
> > in kdump kernel. Then no need to introduce another boot option "noextnmi"
> > which is used only for kdump kernel.
> 
> As I stated in another mail, there is a case where we don't want to
> mask external NMIs in the second kernel.  So, we need some
> configurable way.  Please see the following quotation.

Got it. Thanks for telling.

> 
> > We souldn't enable this feature silently.  Some users wouldn't like
> > to enable this feature.  For example, a user enables a watchdog timer
> > which raises an external NMI when the counter is not reset for a
> > specific duration.  Then, the second kernel hangs up while saving
> > crash dump, and NMI is delivered to the CPU.  The kernel gets panic
> > due to the NMI, prints some information to the display and serial
> > console, and then automatically reboot.  In this case, users don't
> > want to block external NMIs.
> 
> Regards,
> 
> Hidehiro Kawai
> Hitachi, Ltd. Research & Development Group
> 
> 
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [next] | [standalone]


#1256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ZWNvbmQga2VybmVsIGhhbmdzIHVwIHdoaWxlIHNhdmluZw0KPiBjcmFz
aCBkdW1wLCBhbmQgTk1JIGlzIGRlbGl2ZXJlZCB0byB0aGUgQ1BVLiAgVGhlIGtlcm5lbCBnZXRz
IHBhbmljDQo+IGR1ZSB0byB0aGUgTk1JLCBwcmludHMgc29tZSBpbmZvcm1hdGlvbiB0byB0aGUg
ZGlzcGxheSBhbmQgc2VyaWFsDQo+IGNvbnNvbGUsIGFuZCB0aGVuIGF1dG9tYXRpY2FsbHkgcmVi
b290LiAgSW4gdGhpcyBjYXNlLCB1c2VycyBkb24ndA0KPiB3YW50IHRvIGJsb2NrIGV4dGVybmFs
IE5NSXMuDQoNClJlZ2FyZHMsDQoNCkhpZGVoaXJvIEthd2FpDQpIaXRhY2hpLCBMdGQuIFJlc2Vh
cmNoICYgRGV2ZWxvcG1lbnQgR3JvdXANCg0KDQo=
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web