LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
* [PATCH] x86 handle_vm86_trap cleanup
@ 2008-03-17  9:21 Roland McGrath
  2008-03-21 10:39 ` Ingo Molnar
  0 siblings, 1 reply; 4+ messages in thread
From: Roland McGrath @ 2008-03-17  9:21 UTC (permalink / raw)
  To: Ingo Molnar, Thomas Gleixner; +Cc: Andrew Morton, linux-kernel

Use force_sig in handle_vm86_trap like other machine traps do.

Signed-off-by: Roland McGrath <roland@redhat.com>
---
 arch/x86/kernel/vm86_32.c |    9 +--------
 1 files changed, 1 insertions(+), 8 deletions(-)

diff --git a/arch/x86/kernel/vm86_32.c b/arch/x86/kernel/vm86_32.c
index 738c210..fddb998 100644
--- a/arch/x86/kernel/vm86_32.c
+++ b/arch/x86/kernel/vm86_32.c
@@ -553,16 +553,9 @@ int handle_vm86_trap(struct kernel_vm86_regs * regs, long error_code, int trapno
 	}
 	if (trapno !=1)
 		return 1; /* we let this handle by the calling routine */
-	if (current->ptrace & PT_PTRACED) {
-		unsigned long flags;
-		spin_lock_irqsave(&current->sighand->siglock, flags);
-		sigdelset(&current->blocked, SIGTRAP);
-		recalc_sigpending();
-		spin_unlock_irqrestore(&current->sighand->siglock, flags);
-	}
-	send_sig(SIGTRAP, current, 1);
 	current->thread.trap_no = trapno;
 	current->thread.error_code = error_code;
+	force_sig(SIGTRAP, current);
 	return 0;
 }
 

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

* Re: [PATCH] x86 handle_vm86_trap cleanup
  2008-03-17  9:21 [PATCH] x86 handle_vm86_trap cleanup Roland McGrath
@ 2008-03-21 10:39 ` Ingo Molnar
  2008-03-22  3:53   ` Roland McGrath
  0 siblings, 1 reply; 4+ messages in thread
From: Ingo Molnar @ 2008-03-21 10:39 UTC (permalink / raw)
  To: Roland McGrath; +Cc: Thomas Gleixner, Andrew Morton, linux-kernel


* Roland McGrath <roland@redhat.com> wrote:

> Use force_sig in handle_vm86_trap like other machine traps do.

thanks, applied.

> -	if (current->ptrace & PT_PTRACED) {
> -		unsigned long flags;
> -		spin_lock_irqsave(&current->sighand->siglock, flags);
> -		sigdelset(&current->blocked, SIGTRAP);
> -		recalc_sigpending();
> -		spin_unlock_irqrestore(&current->sighand->siglock, flags);
> -	}
> -	send_sig(SIGTRAP, current, 1);
>  	current->thread.trap_no = trapno;
>  	current->thread.error_code = error_code;
> +	force_sig(SIGTRAP, current);
>  	return 0;
>  }

for the record, this also changes semantics, because previously we'd 
permanently unblock SIGTRAP (most certainly as a hack, to be able to do 
the send_sig()), while now we use force_sig() which just ignores the 
blocked mask. (and i agree with your fix of course)

	Ingo

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

* Re: [PATCH] x86 handle_vm86_trap cleanup
  2008-03-21 10:39 ` Ingo Molnar
@ 2008-03-22  3:53   ` Roland McGrath
  2008-03-22 11:17     ` Ingo Molnar
  0 siblings, 1 reply; 4+ messages in thread
From: Roland McGrath @ 2008-03-22  3:53 UTC (permalink / raw)
  To: Ingo Molnar; +Cc: Thomas Gleixner, Andrew Morton, linux-kernel

> for the record, this also changes semantics, because previously we'd 
> permanently unblock SIGTRAP (most certainly as a hack, to be able to do 
> the send_sig()), while now we use force_sig() which just ignores the 
> blocked mask. (and i agree with your fix of course)

That's not so.  force_sig_info (called by force_sig) removes the signal
from the blocked set too.  That is the only way to get the signal ever to
be dequeued.


Thanks,
Roland

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

* Re: [PATCH] x86 handle_vm86_trap cleanup
  2008-03-22  3:53   ` Roland McGrath
@ 2008-03-22 11:17     ` Ingo Molnar
  0 siblings, 0 replies; 4+ messages in thread
From: Ingo Molnar @ 2008-03-22 11:17 UTC (permalink / raw)
  To: Roland McGrath; +Cc: Thomas Gleixner, Andrew Morton, linux-kernel


* Roland McGrath <roland@redhat.com> wrote:

> > for the record, this also changes semantics, because previously we'd 
> > permanently unblock SIGTRAP (most certainly as a hack, to be able to 
> > do the send_sig()), while now we use force_sig() which just ignores 
> > the blocked mask. (and i agree with your fix of course)
> 
> That's not so.  force_sig_info (called by force_sig) removes the 
> signal from the blocked set too.  That is the only way to get the 
> signal ever to be dequeued.

ah, indeed, i missed that :)

	Ingo

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

end of thread, other threads:[~2008-03-22 11:17 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-03-17  9:21 [PATCH] x86 handle_vm86_trap cleanup Roland McGrath
2008-03-21 10:39 ` Ingo Molnar
2008-03-22  3:53   ` Roland McGrath
2008-03-22 11:17     ` Ingo Molnar

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).