login
Header Space

 
 

Re: [git pull] x86 fixes

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: Harvey Harrison <harvey.harrison@...>
Cc: Linus Torvalds <torvalds@...>, <linux-kernel@...>, Thomas Gleixner <tglx@...>, H. Peter Anvin <hpa@...>, Andrew Morton <akpm@...>
Date: Thursday, March 27, 2008 - 5:01 pm

* Ingo Molnar <mingo@elte.hu> wrote:


i.e. the patch below, which is even simpler. The comments were a bit 
confusing as well - in this function we decide whether to ignore a 
fault, so returning 0 means we do _not_ ignore a fault (but process it 
to the bitter end most likely).

	Ingo

-------------->
Subject: x86: prefetch fix #2
From: Ingo Molnar <mingo@elte.hu>
Date: Thu Mar 27 21:29:09 CET 2008

Linus noticed a second bug and an uncleanliness:

 - we'd return on any instruction fetch fault

 - we'd use both the value of 16 and the PF_INSTR symbol which are
   the same and make no sense

the cleanup nicely unifies this piece of logic.

Signed-off-by: Ingo Molnar <mingo@elte.hu>
---
 arch/x86/mm/fault.c |   11 ++++-------
 1 file changed, 4 insertions(+), 7 deletions(-)

Index: linux-x86.q/arch/x86/mm/fault.c
===================================================================
--- linux-x86.q.orig/arch/x86/mm/fault.c
+++ linux-x86.q/arch/x86/mm/fault.c
@@ -103,13 +103,10 @@ static int is_prefetch(struct pt_regs *r
 	int prefetch = 0;
 	unsigned char *max_instr;
 
-#ifdef CONFIG_X86_32
-	/* Catch an obscure case of prefetch inside an NX page: */
-	if ((__supported_pte_mask & _PAGE_NX) && (error_code & 16))
-		return 0;
-#endif
-
-	/* If it was a exec fault on NX page, ignore */
+	/*
+	 * If it was a exec (instruction fetch) fault on NX page, then
+	 * do not ignore the fault:
+	 */
 	if (error_code & PF_INSTR)
 		return 0;
 

--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[git pull] x86 fixes, Ingo Molnar, (Thu Mar 27, 4:03 pm)
Re: [git pull] x86 fixes, Linus Torvalds, (Thu Mar 27, 4:31 pm)
Re: [git pull] x86 fixes, Ingo Molnar, (Thu Mar 27, 4:50 pm)
Re: [git pull] x86 fixes, Ingo Molnar, (Thu Mar 27, 5:24 pm)
Re: [git pull] x86 fixes, Harvey Harrison, (Thu Mar 27, 4:48 pm)
Re: [git pull] x86 fixes, Ingo Molnar, (Thu Mar 27, 4:55 pm)
Re: [git pull] x86 fixes, Ingo Molnar, (Thu Mar 27, 5:01 pm)
Re: [git pull] x86 fixes, Harvey Harrison, (Thu Mar 27, 5:08 pm)
speck-geostationary