* [PATCH RT] enable interrupts in do_page_fault for users.
@ 2007-06-01 23:21 Steven Rostedt
2007-06-07 1:42 ` [PATCH RT] enable interrupts in do_page_fault for users (take 2 - add i386 fix too) Steven Rostedt
0 siblings, 1 reply; 2+ messages in thread
From: Steven Rostedt @ 2007-06-01 23:21 UTC (permalink / raw)
To: Ingo Molnar; +Cc: LKML, Thomas Gleixner, Arnaldo Carvalho de Melo
Ingo,
To prevent scheduling while irqs disabled, I added a force to the
do_page_fault to enable interrupts.
The thing is, if the user faults at an address above PAGE_OFFSET. My
stupid program that I attached to my last email did just that:
unsigned long *p = (void*)-1;
*p = 0xbed;
where (void*)-1 is an address greater than PAGE_OFFSET. If I changed
that address to (void*)1, the program still segfaulted, but I didn't get
the warning about scheduling while interrupts disabled. I even put in a
print to show if interrupts are disabled in do_page_fault before calling
force_sig_info, and with (void*)-1 they were, and with (void*)1 they
were not disabled.
This patch forces interrupts to always be enabled when entering the user
fault code. Maybe this should also be applied to mainline?
This solves the one issue with scheduling while irqs disabled.
-- Steve
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
Index: linux-2.6.21-rt9/arch/x86_64/mm/fault.c
===================================================================
--- linux-2.6.21-rt9.orig/arch/x86_64/mm/fault.c
+++ linux-2.6.21-rt9/arch/x86_64/mm/fault.c
@@ -476,6 +476,10 @@ bad_area:
bad_area_nosemaphore:
/* User mode accesses just cause a SIGSEGV */
if (error_code & PF_USER) {
+
+ /* it's possible to have interrupts off here */
+ local_irq_enable();
+
if (is_prefetch(regs, address, error_code))
return;
^ permalink raw reply [flat|nested] 2+ messages in thread
* [PATCH RT] enable interrupts in do_page_fault for users (take 2 - add i386 fix too)
2007-06-01 23:21 [PATCH RT] enable interrupts in do_page_fault for users Steven Rostedt
@ 2007-06-07 1:42 ` Steven Rostedt
0 siblings, 0 replies; 2+ messages in thread
From: Steven Rostedt @ 2007-06-07 1:42 UTC (permalink / raw)
To: Ingo Molnar; +Cc: LKML, Thomas Gleixner, Arnaldo Carvalho de Melo
Thomas,
Can you replace my previous patch with this one. This one includes the
fix for i386.
-- Steve
Index: linux-2.6.21-rt9/arch/x86_64/mm/fault.c
===================================================================
--- linux-2.6.21-rt9.orig/arch/x86_64/mm/fault.c
+++ linux-2.6.21-rt9/arch/x86_64/mm/fault.c
@@ -476,6 +476,10 @@ bad_area:
bad_area_nosemaphore:
/* User mode accesses just cause a SIGSEGV */
if (error_code & PF_USER) {
+
+ /* it's possible to have interrupts off here */
+ local_irq_enable();
+
if (is_prefetch(regs, address, error_code))
return;
Index: linux-2.6.21-rt9/arch/i386/mm/fault.c
===================================================================
--- linux-2.6.21-rt9.orig/arch/i386/mm/fault.c
+++ linux-2.6.21-rt9/arch/i386/mm/fault.c
@@ -459,6 +459,10 @@ bad_area:
bad_area_nosemaphore:
/* User mode accesses just cause a SIGSEGV */
if (error_code & 4) {
+
+ /* it's possible to have interrupts off here */
+ local_irq_enable();
+
/*
* Valid to do another page fault here because this one came
* from user space.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2007-06-07 1:43 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-06-01 23:21 [PATCH RT] enable interrupts in do_page_fault for users Steven Rostedt
2007-06-07 1:42 ` [PATCH RT] enable interrupts in do_page_fault for users (take 2 - add i386 fix too) Steven Rostedt
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®