public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/3] x86: signal: cosmetic unification of do_signal()
@ 2008-09-24  0:19 Hiroshi Shimamoto
  2008-09-24  0:21 ` [PATCH 2/3] x86: signal: cosmetic unification of do_notify_resume() Hiroshi Shimamoto
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Hiroshi Shimamoto @ 2008-09-24  0:19 UTC (permalink / raw)
  To: Ingo Molnar, Thomas Gleixner, H. Peter Anvin; +Cc: linux-kernel

From: Hiroshi Shimamoto <h-shimamoto@ct.jp.nec.com>

Make do_signal() same.
Thia patch modifies only comments in signal_64.c.

Signed-off-by: Hiroshi Shimamoto <h-shimamoto@ct.jp.nec.com>
---
 arch/x86/kernel/signal_64.c |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/arch/x86/kernel/signal_64.c b/arch/x86/kernel/signal_64.c
index bf77d47..5a5fbc3 100644
--- a/arch/x86/kernel/signal_64.c
+++ b/arch/x86/kernel/signal_64.c
@@ -410,7 +410,8 @@ static void do_signal(struct pt_regs *regs)
 
 	signr = get_signal_to_deliver(&info, &ka, regs, NULL);
 	if (signr > 0) {
-		/* Re-enable any watchpoints before delivering the
+		/*
+		 * Re-enable any watchpoints before delivering the
 		 * signal to user space. The processor register will
 		 * have been cleared if the watchpoint triggered
 		 * inside the kernel.
@@ -418,7 +419,7 @@ static void do_signal(struct pt_regs *regs)
 		if (current->thread.debugreg7)
 			set_debugreg(current->thread.debugreg7, 7);
 
-		/* Whee!  Actually deliver the signal.  */
+		/* Whee! Actually deliver the signal.  */
 		if (handle_signal(signr, &info, &ka, oldset, regs) == 0) {
 			/*
 			 * A signal was successfully delivered; the saved
@@ -441,6 +442,7 @@ static void do_signal(struct pt_regs *regs)
 			regs->ax = regs->orig_ax;
 			regs->ip -= 2;
 			break;
+
 		case -ERESTART_RESTARTBLOCK:
 			regs->ax = NR_restart_syscall;
 			regs->ip -= 2;
-- 
1.5.6


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

* [PATCH 2/3] x86: signal: cosmetic unification of do_notify_resume()
  2008-09-24  0:19 [PATCH 1/3] x86: signal: cosmetic unification of do_signal() Hiroshi Shimamoto
@ 2008-09-24  0:21 ` Hiroshi Shimamoto
  2008-09-24  0:22 ` [PATCH 3/3] x86: signal: cosmetic unification of handle_signal() Hiroshi Shimamoto
  2008-09-24  7:39 ` [PATCH 1/3] x86: signal: cosmetic unification of do_signal() Ingo Molnar
  2 siblings, 0 replies; 4+ messages in thread
From: Hiroshi Shimamoto @ 2008-09-24  0:21 UTC (permalink / raw)
  To: Ingo Molnar, Thomas Gleixner, H. Peter Anvin; +Cc: linux-kernel

From: Hiroshi Shimamoto <h-shimamoto@ct.jp.nec.com>

Make do_notify_resume() same.

Signed-off-by: Hiroshi Shimamoto <h-shimamoto@ct.jp.nec.com>
---
 arch/x86/kernel/signal_32.c |    8 ++++++++
 arch/x86/kernel/signal_64.c |   16 ++++++++++++----
 2 files changed, 20 insertions(+), 4 deletions(-)

diff --git a/arch/x86/kernel/signal_32.c b/arch/x86/kernel/signal_32.c
index da3cf32..b94463f 100644
--- a/arch/x86/kernel/signal_32.c
+++ b/arch/x86/kernel/signal_32.c
@@ -663,6 +663,12 @@ static void do_signal(struct pt_regs *regs)
 void
 do_notify_resume(struct pt_regs *regs, void *unused, __u32 thread_info_flags)
 {
+#if defined(CONFIG_X86_64) && defined(CONFIG_X86_MCE)
+	/* notify userspace of pending MCEs */
+	if (thread_info_flags & _TIF_MCE_NOTIFY)
+		mce_notify_user();
+#endif /* CONFIG_X86_64 && CONFIG_X86_MCE */
+
 	/* deal with pending signal delivery */
 	if (thread_info_flags & _TIF_SIGPENDING)
 		do_signal(regs);
@@ -672,7 +678,9 @@ do_notify_resume(struct pt_regs *regs, void *unused, __u32 thread_info_flags)
 		tracehook_notify_resume(regs);
 	}
 
+#ifdef CONFIG_X86_32
 	clear_thread_flag(TIF_IRET);
+#endif /* CONFIG_X86_32 */
 }
 
 void signal_fault(struct pt_regs *regs, void __user *frame, char *where)
diff --git a/arch/x86/kernel/signal_64.c b/arch/x86/kernel/signal_64.c
index 5a5fbc3..9087752 100644
--- a/arch/x86/kernel/signal_64.c
+++ b/arch/x86/kernel/signal_64.c
@@ -460,14 +460,18 @@ static void do_signal(struct pt_regs *regs)
 	}
 }
 
-void do_notify_resume(struct pt_regs *regs, void *unused,
-		      __u32 thread_info_flags)
+/*
+ * notification of userspace execution resumption
+ * - triggered by the TIF_WORK_MASK flags
+ */
+void
+do_notify_resume(struct pt_regs *regs, void *unused, __u32 thread_info_flags)
 {
-#ifdef CONFIG_X86_MCE
+#if defined(CONFIG_X86_64) && defined(CONFIG_X86_MCE)
 	/* notify userspace of pending MCEs */
 	if (thread_info_flags & _TIF_MCE_NOTIFY)
 		mce_notify_user();
-#endif /* CONFIG_X86_MCE */
+#endif /* CONFIG_X86_64 && CONFIG_X86_MCE */
 
 	/* deal with pending signal delivery */
 	if (thread_info_flags & _TIF_SIGPENDING)
@@ -477,6 +481,10 @@ void do_notify_resume(struct pt_regs *regs, void *unused,
 		clear_thread_flag(TIF_NOTIFY_RESUME);
 		tracehook_notify_resume(regs);
 	}
+
+#ifdef CONFIG_X86_32
+	clear_thread_flag(TIF_IRET);
+#endif /* CONFIG_X86_32 */
 }
 
 void signal_fault(struct pt_regs *regs, void __user *frame, char *where)
-- 
1.5.6


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

* [PATCH 3/3] x86: signal: cosmetic unification of handle_signal()
  2008-09-24  0:19 [PATCH 1/3] x86: signal: cosmetic unification of do_signal() Hiroshi Shimamoto
  2008-09-24  0:21 ` [PATCH 2/3] x86: signal: cosmetic unification of do_notify_resume() Hiroshi Shimamoto
@ 2008-09-24  0:22 ` Hiroshi Shimamoto
  2008-09-24  7:39 ` [PATCH 1/3] x86: signal: cosmetic unification of do_signal() Ingo Molnar
  2 siblings, 0 replies; 4+ messages in thread
From: Hiroshi Shimamoto @ 2008-09-24  0:22 UTC (permalink / raw)
  To: Ingo Molnar, Thomas Gleixner, H. Peter Anvin; +Cc: linux-kernel

From: Hiroshi Shimamoto <h-shimamoto@ct.jp.nec.com>

Make handle_signal() same.

Signed-off-by: Hiroshi Shimamoto <h-shimamoto@ct.jp.nec.com>
---
 arch/x86/kernel/signal_32.c |    9 +++++++++
 arch/x86/kernel/signal_64.c |    2 ++
 2 files changed, 11 insertions(+), 0 deletions(-)

diff --git a/arch/x86/kernel/signal_32.c b/arch/x86/kernel/signal_32.c
index b94463f..bb05917 100644
--- a/arch/x86/kernel/signal_32.c
+++ b/arch/x86/kernel/signal_32.c
@@ -550,6 +550,15 @@ handle_signal(unsigned long sig, siginfo_t *info, struct k_sigaction *ka,
 	if (ret)
 		return ret;
 
+#ifdef CONFIG_X86_64
+	/*
+	 * This has nothing to do with segment registers,
+	 * despite the name.  This magic affects uaccess.h
+	 * macros' behavior.  Reset it to the normal setting.
+	 */
+	set_fs(USER_DS);
+#endif
+
 	/*
 	 * Clear the direction flag as per the ABI for function entry.
 	 */
diff --git a/arch/x86/kernel/signal_64.c b/arch/x86/kernel/signal_64.c
index 9087752..963236f 100644
--- a/arch/x86/kernel/signal_64.c
+++ b/arch/x86/kernel/signal_64.c
@@ -346,12 +346,14 @@ handle_signal(unsigned long sig, siginfo_t *info, struct k_sigaction *ka,
 	if (ret)
 		return ret;
 
+#ifdef CONFIG_X86_64
 	/*
 	 * This has nothing to do with segment registers,
 	 * despite the name.  This magic affects uaccess.h
 	 * macros' behavior.  Reset it to the normal setting.
 	 */
 	set_fs(USER_DS);
+#endif
 
 	/*
 	 * Clear the direction flag as per the ABI for function entry.
-- 
1.5.6


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

* Re: [PATCH 1/3] x86: signal: cosmetic unification of do_signal()
  2008-09-24  0:19 [PATCH 1/3] x86: signal: cosmetic unification of do_signal() Hiroshi Shimamoto
  2008-09-24  0:21 ` [PATCH 2/3] x86: signal: cosmetic unification of do_notify_resume() Hiroshi Shimamoto
  2008-09-24  0:22 ` [PATCH 3/3] x86: signal: cosmetic unification of handle_signal() Hiroshi Shimamoto
@ 2008-09-24  7:39 ` Ingo Molnar
  2 siblings, 0 replies; 4+ messages in thread
From: Ingo Molnar @ 2008-09-24  7:39 UTC (permalink / raw)
  To: Hiroshi Shimamoto; +Cc: Thomas Gleixner, H. Peter Anvin, linux-kernel


* Hiroshi Shimamoto <h-shimamoto@ct.jp.nec.com> wrote:

> From: Hiroshi Shimamoto <h-shimamoto@ct.jp.nec.com>
> 
> Make do_signal() same.
> Thia patch modifies only comments in signal_64.c.
> 
> Signed-off-by: Hiroshi Shimamoto <h-shimamoto@ct.jp.nec.com>

applied your patches to tip/x86/signal:

 86d3237: x86: signal: cosmetic unification of handle_signal()
 ee847c5: x86: signal: cosmetic unification of do_notify_resume()
 5fd9333: x86: signal: cosmetic unification of do_signal()

thanks!

	Ingo

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

end of thread, other threads:[~2008-09-24  7:39 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-09-24  0:19 [PATCH 1/3] x86: signal: cosmetic unification of do_signal() Hiroshi Shimamoto
2008-09-24  0:21 ` [PATCH 2/3] x86: signal: cosmetic unification of do_notify_resume() Hiroshi Shimamoto
2008-09-24  0:22 ` [PATCH 3/3] x86: signal: cosmetic unification of handle_signal() Hiroshi Shimamoto
2008-09-24  7:39 ` [PATCH 1/3] x86: signal: cosmetic unification of do_signal() Ingo Molnar

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox