All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] x86/mm: Remove in_nmi() warning from 64bit implementation of vmalloc_fault()
@ 2019-04-24  7:04 Jiri Kosina
  2019-04-24  7:26 ` Peter Zijlstra
  2019-04-24 11:11 ` [tip:x86/mm] x86/mm: Remove in_nmi() warning from 64-bit " tip-bot for Jiri Kosina
  0 siblings, 2 replies; 4+ messages in thread
From: Jiri Kosina @ 2019-04-24  7:04 UTC (permalink / raw)
  To: Dave Hansen, Andy Lutomirski, Peter Zijlstra, Thomas Gleixner,
	Ingo Molnar, Borislav Petkov, H. Peter Anvin
  Cc: Joerg Roedel, Frederic Weisbecker, Nicolai Stange, x86, linux-kernel

From: Jiri Kosina <jkosina@suse.cz>

In-NMI warnings have been added to vmalloc_fault() via ebc8827f75 ("x86: 
Barf when vmalloc and kmemcheck faults happen in NMI") back in the time 
when our NMI entry code could not cope with nested NMIs.

These days, it's perfectly fine to take a fault in NMI context and we 
don't have to care about the fact that IRET from the fault handler might 
cause NMI nesting.

This warning has already been removed from 32bit implementation of 
vmalloc_fault() in 6863ea0cda8 ("x86/mm: Remove in_nmi() warning from 
vmalloc_fault()"), but 64bit version was omitted.

Remove the bogus warning also from 64bit implementation of vmalloc_fault().

Fixes: 6863ea0cda8 ("x86/mm: Remove in_nmi() warning from vmalloc_fault()")
Reported-by: Nicolai Stange <nstange@suse.de>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
---
 arch/x86/mm/fault.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/arch/x86/mm/fault.c b/arch/x86/mm/fault.c
index 667f1da36208..5eaf67e8314f 100644
--- a/arch/x86/mm/fault.c
+++ b/arch/x86/mm/fault.c
@@ -359,8 +359,6 @@ static noinline int vmalloc_fault(unsigned long address)
 	if (!(address >= VMALLOC_START && address < VMALLOC_END))
 		return -1;
 
-	WARN_ON_ONCE(in_nmi());
-
 	/*
 	 * Copy kernel mappings over when needed. This can also
 	 * happen within a race in page table update. In the later

-- 
Jiri Kosina
SUSE Labs


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] x86/mm: Remove in_nmi() warning from 64bit implementation of vmalloc_fault()
  2019-04-24  7:04 [PATCH] x86/mm: Remove in_nmi() warning from 64bit implementation of vmalloc_fault() Jiri Kosina
@ 2019-04-24  7:26 ` Peter Zijlstra
  2019-04-24  7:31   ` Jiri Kosina
  2019-04-24 11:11 ` [tip:x86/mm] x86/mm: Remove in_nmi() warning from 64-bit " tip-bot for Jiri Kosina
  1 sibling, 1 reply; 4+ messages in thread
From: Peter Zijlstra @ 2019-04-24  7:26 UTC (permalink / raw)
  To: Jiri Kosina
  Cc: Dave Hansen, Andy Lutomirski, Thomas Gleixner, Ingo Molnar,
	Borislav Petkov, H. Peter Anvin, Joerg Roedel,
	Frederic Weisbecker, Nicolai Stange, x86, linux-kernel

On Wed, Apr 24, 2019 at 09:04:57AM +0200, Jiri Kosina wrote:
> From: Jiri Kosina <jkosina@suse.cz>
> 
> In-NMI warnings have been added to vmalloc_fault() via ebc8827f75 ("x86: 
> Barf when vmalloc and kmemcheck faults happen in NMI") back in the time 
> when our NMI entry code could not cope with nested NMIs.
> 
> These days, it's perfectly fine to take a fault in NMI context and we 
> don't have to care about the fact that IRET from the fault handler might 
> cause NMI nesting.
> 
> This warning has already been removed from 32bit implementation of 
> vmalloc_fault() in 6863ea0cda8 ("x86/mm: Remove in_nmi() warning from 
> vmalloc_fault()"), but 64bit version was omitted.
> 
> Remove the bogus warning also from 64bit implementation of vmalloc_fault().

Cute; did you actually trigger this?

> Fixes: 6863ea0cda8 ("x86/mm: Remove in_nmi() warning from vmalloc_fault()")
> Reported-by: Nicolai Stange <nstange@suse.de>
> Signed-off-by: Jiri Kosina <jkosina@suse.cz>

Acked-by: Peter Zijlstra (Intel) <peterz@infradead.org>

> ---
>  arch/x86/mm/fault.c | 2 --
>  1 file changed, 2 deletions(-)
> 
> diff --git a/arch/x86/mm/fault.c b/arch/x86/mm/fault.c
> index 667f1da36208..5eaf67e8314f 100644
> --- a/arch/x86/mm/fault.c
> +++ b/arch/x86/mm/fault.c
> @@ -359,8 +359,6 @@ static noinline int vmalloc_fault(unsigned long address)
>  	if (!(address >= VMALLOC_START && address < VMALLOC_END))
>  		return -1;
>  
> -	WARN_ON_ONCE(in_nmi());
> -
>  	/*
>  	 * Copy kernel mappings over when needed. This can also
>  	 * happen within a race in page table update. In the later
> 
> -- 
> Jiri Kosina
> SUSE Labs
> 

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] x86/mm: Remove in_nmi() warning from 64bit implementation of vmalloc_fault()
  2019-04-24  7:26 ` Peter Zijlstra
@ 2019-04-24  7:31   ` Jiri Kosina
  0 siblings, 0 replies; 4+ messages in thread
From: Jiri Kosina @ 2019-04-24  7:31 UTC (permalink / raw)
  To: Peter Zijlstra
  Cc: Dave Hansen, Andy Lutomirski, Thomas Gleixner, Ingo Molnar,
	Borislav Petkov, H. Peter Anvin, Joerg Roedel,
	Frederic Weisbecker, Nicolai Stange, x86, linux-kernel

On Wed, 24 Apr 2019, Peter Zijlstra wrote:

> > In-NMI warnings have been added to vmalloc_fault() via ebc8827f75 ("x86: 
> > Barf when vmalloc and kmemcheck faults happen in NMI") back in the time 
> > when our NMI entry code could not cope with nested NMIs.
> > 
> > These days, it's perfectly fine to take a fault in NMI context and we 
> > don't have to care about the fact that IRET from the fault handler might 
> > cause NMI nesting.
> > 
> > This warning has already been removed from 32bit implementation of 
> > vmalloc_fault() in 6863ea0cda8 ("x86/mm: Remove in_nmi() warning from 
> > vmalloc_fault()"), but 64bit version was omitted.
> > 
> > Remove the bogus warning also from 64bit implementation of vmalloc_fault().
> 
> Cute; did you actually trigger this?

Nope; Nicolai tripped over it while he was looking into interactions 
between ftrace and pagefaults.

> > Fixes: 6863ea0cda8 ("x86/mm: Remove in_nmi() warning from vmalloc_fault()")
> > Reported-by: Nicolai Stange <nstange@suse.de>
> > Signed-off-by: Jiri Kosina <jkosina@suse.cz>
> 
> Acked-by: Peter Zijlstra (Intel) <peterz@infradead.org>

Thanks,

-- 
Jiri Kosina
SUSE Labs


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [tip:x86/mm] x86/mm: Remove in_nmi() warning from 64-bit implementation of vmalloc_fault()
  2019-04-24  7:04 [PATCH] x86/mm: Remove in_nmi() warning from 64bit implementation of vmalloc_fault() Jiri Kosina
  2019-04-24  7:26 ` Peter Zijlstra
@ 2019-04-24 11:11 ` tip-bot for Jiri Kosina
  1 sibling, 0 replies; 4+ messages in thread
From: tip-bot for Jiri Kosina @ 2019-04-24 11:11 UTC (permalink / raw)
  To: linux-tip-commits
  Cc: dave.hansen, peterz, torvalds, luto, jkosina, linux-kernel,
	mingo, tglx, jroedel, nstange, bp, fweisbec, hpa

Commit-ID:  a65c88e16f32aa9ef2e8caa68ea5c29bd5eb0ff0
Gitweb:     https://git.kernel.org/tip/a65c88e16f32aa9ef2e8caa68ea5c29bd5eb0ff0
Author:     Jiri Kosina <jkosina@suse.cz>
AuthorDate: Wed, 24 Apr 2019 09:04:57 +0200
Committer:  Ingo Molnar <mingo@kernel.org>
CommitDate: Wed, 24 Apr 2019 12:21:35 +0200

x86/mm: Remove in_nmi() warning from 64-bit implementation of vmalloc_fault()

In-NMI warnings have been added to vmalloc_fault() via:

  ebc8827f75 ("x86: Barf when vmalloc and kmemcheck faults happen in NMI")

back in the time when our NMI entry code could not cope with nested NMIs.

These days, it's perfectly fine to take a fault in NMI context and we
don't have to care about the fact that IRET from the fault handler might
cause NMI nesting.

This warning has already been removed from 32-bit implementation of
vmalloc_fault() in:

  6863ea0cda8 ("x86/mm: Remove in_nmi() warning from vmalloc_fault()")

but the 64-bit version was omitted.

Remove the bogus warning also from 64-bit implementation of vmalloc_fault().

Reported-by: Nicolai Stange <nstange@suse.de>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Acked-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Cc: Andy Lutomirski <luto@kernel.org>
Cc: Borislav Petkov <bp@alien8.de>
Cc: Dave Hansen <dave.hansen@linux.intel.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Joerg Roedel <jroedel@suse.de>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Fixes: 6863ea0cda8 ("x86/mm: Remove in_nmi() warning from vmalloc_fault()")
Link: http://lkml.kernel.org/r/nycvar.YFH.7.76.1904240902280.9803@cbobk.fhfr.pm
Signed-off-by: Ingo Molnar <mingo@kernel.org>
---
 arch/x86/mm/fault.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/arch/x86/mm/fault.c b/arch/x86/mm/fault.c
index a0df19b0897d..bd20de9db1a8 100644
--- a/arch/x86/mm/fault.c
+++ b/arch/x86/mm/fault.c
@@ -359,8 +359,6 @@ static noinline int vmalloc_fault(unsigned long address)
 	if (!(address >= VMALLOC_START && address < VMALLOC_END))
 		return -1;
 
-	WARN_ON_ONCE(in_nmi());
-
 	/*
 	 * Copy kernel mappings over when needed. This can also
 	 * happen within a race in page table update. In the later

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2019-04-24 11:11 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-04-24  7:04 [PATCH] x86/mm: Remove in_nmi() warning from 64bit implementation of vmalloc_fault() Jiri Kosina
2019-04-24  7:26 ` Peter Zijlstra
2019-04-24  7:31   ` Jiri Kosina
2019-04-24 11:11 ` [tip:x86/mm] x86/mm: Remove in_nmi() warning from 64-bit " tip-bot for Jiri Kosina

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.