Skip to contentSkip to conversation

x86: Allow vmalloc faults from NMI context

PATCH Peter Zijlstra 2 participants 2 messages Apr 10, 2014

Subsystems (2)
lore
Share & tools
lore

Peter Zijlstra

author maintainer
#0 lore raw

Jiri reported he hit vmalloc_faults()'s:

  WARN_ON_ONCE(in_nmi());

The patch that added this ebc8827f75954 ("x86: Barf when vmalloc and kmemcheck faults happen in NMI") explains that this was done in order to avoid faults from NMI to cause nested NMIs.

We have, however, completely fixed this issue and can now safely take faults from NMI context.

Therefore remove this warning. We must still leave the kmemcheck warn in place since kmemcheck itself can't deal with NMI context yet.

---
 arch/x86/mm/fault.c | 4 ----
 1 file changed, 4 deletions(-)
arch/x86/mm/fault.c +0 -4
index 8e5722992677..d0234cdf70f1 100644
@@ -271,8 +271,6 @@ static noinline __kprobes int vmalloc_fault(unsigned long address)
 	if (!(address >= VMALLOC_START && address < VMALLOC_END))
 		return -1;
 
-	WARN_ON_ONCE(in_nmi());
-
 	/*
 	 * Synchronize this task's top level page-table
 	 * with the 'reference' page table.
@@ -369,8 +367,6 @@ static noinline __kprobes 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
#1 lore raw
Quoted 8 lines · On Thu, 10 Apr 2014 16:40:03 +0200 Peter Zijlstra <[email protected]> wrote:

Jiri reported he hit vmalloc_faults()'s:

  WARN_ON_ONCE(in_nmi());

The patch that added this ebc8827f75954 ("x86: Barf when vmalloc and kmemcheck faults happen in NMI") explains that this was done in order to avoid faults from NMI to cause nested NMIs.

Quoted 6 lines

We have, however, completely fixed this issue and can now safely take faults from NMI context.

Therefore remove this warning. We must still leave the kmemcheck warn in place since kmemcheck itself can't deal with NMI context yet.

Yay, finally....

-- Steve

Quoted 27 lines
---
 arch/x86/mm/fault.c | 4 ----
 1 file changed, 4 deletions(-)
arch/x86/mm/fault.c +0 -4
index 8e5722992677..d0234cdf70f1 100644
@@ -271,8 +271,6 @@ static noinline __kprobes int vmalloc_fault(unsigned long address)
 	if (!(address >= VMALLOC_START && address < VMALLOC_END))
 		return -1;
 
-	WARN_ON_ONCE(in_nmi());
-
 	/*
 	 * Synchronize this task's top level page-table
 	 * with the 'reference' page table.
@@ -369,8 +367,6 @@ static noinline __kprobes 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