Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/1107/?format=api
{ "id": 1107, "url": "http://patchwork.ozlabs.org/api/patches/1107/?format=api", "web_url": "http://patchwork.ozlabs.org/project/linuxppc-dev/patch/200809231955.01564.srinivasa@in.ibm.com/", "project": { "id": 2, "url": "http://patchwork.ozlabs.org/api/projects/2/?format=api", "name": "Linux PPC development", "link_name": "linuxppc-dev", "list_id": "linuxppc-dev.lists.ozlabs.org", "list_email": "linuxppc-dev@lists.ozlabs.org", "web_url": "https://github.com/linuxppc/wiki/wiki", "scm_url": "https://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux.git", "webscm_url": "https://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux.git/", "list_archive_url": "https://lore.kernel.org/linuxppc-dev/", "list_archive_url_format": "https://lore.kernel.org/linuxppc-dev/{}/", "commit_url_format": "https://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux.git/commit/?id={}" }, "msgid": "<200809231955.01564.srinivasa@in.ibm.com>", "list_archive_url": "https://lore.kernel.org/linuxppc-dev/200809231955.01564.srinivasa@in.ibm.com/", "date": "2008-09-23T14:25:01", "name": "[RFC] Demultiplexing SIGTRAP signal -v2", "commit_ref": null, "pull_url": null, "state": "rfc", "archived": true, "hash": "bdfbd4db8c3b9385a3a9e8dd661b0d1f4e38e749", "submitter": { "id": 390, "url": "http://patchwork.ozlabs.org/api/people/390/?format=api", "name": "Srinivasa Ds", "email": "srinivasa@in.ibm.com" }, "delegate": null, "mbox": "http://patchwork.ozlabs.org/project/linuxppc-dev/patch/200809231955.01564.srinivasa@in.ibm.com/mbox/", "series": [], "comments": "http://patchwork.ozlabs.org/api/patches/1107/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/1107/checks/", "tags": {}, "related": [], "headers": { "Return-Path": "<linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@ozlabs.org>", "X-Original-To": [ "patchwork-incoming@ozlabs.org", "linuxppc-dev@ozlabs.org" ], "Delivered-To": [ "patchwork-incoming@ozlabs.org", "linuxppc-dev@ozlabs.org" ], "Received": [ "from ozlabs.org (localhost [127.0.0.1])\n\tby ozlabs.org (Postfix) with ESMTP id E3AD7DE19A\n\tfor <patchwork-incoming@ozlabs.org>;\n\tWed, 24 Sep 2008 00:25:40 +1000 (EST)", "from e28esmtp03.in.ibm.com (e28smtp03.in.ibm.com [59.145.155.3])\n\t(using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))\n\t(Client CN \"e28smtp03.in.ibm.com\", Issuer \"Equifax\" (verified OK))\n\tby ozlabs.org (Postfix) with ESMTPS id 42895DDEF4\n\tfor <linuxppc-dev@ozlabs.org>; Wed, 24 Sep 2008 00:25:21 +1000 (EST)", "from d28relay04.in.ibm.com (d28relay04.in.ibm.com [9.184.220.61])\n\tby e28esmtp03.in.ibm.com (8.13.1/8.13.1) with ESMTP id\n\tm8NEOn4p012855\n\tfor <linuxppc-dev@ozlabs.org>; Tue, 23 Sep 2008 19:54:49 +0530", "from d28av05.in.ibm.com (d28av05.in.ibm.com [9.184.220.67])\n\tby d28relay04.in.ibm.com (8.13.8/8.13.8/NCO v9.1) with ESMTP id\n\tm8NEOnGI1708236\n\tfor <linuxppc-dev@ozlabs.org>; Tue, 23 Sep 2008 19:54:49 +0530", "from d28av05.in.ibm.com (loopback [127.0.0.1])\n\tby d28av05.in.ibm.com (8.13.1/8.13.3) with ESMTP id m8NEOmow014898\n\tfor <linuxppc-dev@ozlabs.org>; Wed, 24 Sep 2008 00:24:49 +1000", "from srinivasa-009124031087.in.ibm.com\n\t(Srinivasa-009124031087.in.ibm.com [9.124.31.87] (may be forged))\n\tby d28av05.in.ibm.com (8.13.1/8.12.11) with ESMTP id m8NEOml5013950; \n\tWed, 24 Sep 2008 00:24:48 +1000" ], "From": "Srinivasa Ds <srinivasa@in.ibm.com>", "Organization": "IBM", "To": "Ingo Molnar <mingo@elte.hu>", "Subject": "Re: [RFC][PATCH] Demultiplexing SIGTRAP signal -v2", "Date": "Tue, 23 Sep 2008 19:55:01 +0530", "User-Agent": "KMail/1.9.9", "References": "<200809221602.32616.srinivasa@in.ibm.com>\n\t<20080923112812.GL29021@elte.hu> <20080923113001.GA12531@elte.hu>", "In-Reply-To": "<20080923113001.GA12531@elte.hu>", "MIME-Version": "1.0", "Content-Disposition": "inline", "Message-Id": "<200809231955.01564.srinivasa@in.ibm.com>", "Cc": "linux-parisc@vger.kernel.org, linux-kernel@vger.kernel.org,\n\tlinuxppc-dev@ozlabs.org, paulus@samba.org,\n\t\"H. Peter Anvin\" <hpa@zytor.com>, akpm@linux-foundation.org,\n\tThomas Gleixner <tglx@linutronix.de>, Roland McGrath <roland@redhat.com>", "X-BeenThere": "linuxppc-dev@ozlabs.org", "X-Mailman-Version": "2.1.11", "Precedence": "list", "List-Id": "Linux on PowerPC Developers Mail List <linuxppc-dev.ozlabs.org>", "List-Unsubscribe": "<https://ozlabs.org/mailman/options/linuxppc-dev>,\n\t<mailto:linuxppc-dev-request@ozlabs.org?subject=unsubscribe>", "List-Archive": "<http://ozlabs.org/pipermail/linuxppc-dev>", "List-Post": "<mailto:linuxppc-dev@ozlabs.org>", "List-Help": "<mailto:linuxppc-dev-request@ozlabs.org?subject=help>", "List-Subscribe": "<https://ozlabs.org/mailman/listinfo/linuxppc-dev>,\n\t<mailto:linuxppc-dev-request@ozlabs.org?subject=subscribe>", "Content-Type": "text/plain; charset=\"us-ascii\"", "Content-Transfer-Encoding": "7bit", "Sender": "linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@ozlabs.org", "Errors-To": "linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@ozlabs.org" }, "content": "On Tuesday 23 September 2008 17:00:01 Ingo Molnar wrote:\n\n> > applied to [the new topic] tip/core/signal, thanks Srinivasa! There\n> > are some other pending x86 signal changes already, so i based\n> > tip/core/signal on tip/x86/signal.\n>\n> -tip testing found the following build error with the attached config:\n>\n\nIngo, Reproduced build break issue with your config on tip tree. It was a costly overlook \nto miss one header file. I included it in this patch and tested it out.\n\n\nCurrently a SIGTRAP can denote any one of below reasons.\n\t- Breakpoint hit\n\t- H/W debug register hit\n\t- Single step\n\t- Signal sent through kill() or rasie()\n\nArchitectures like powerpc/parisc provides infrastructure to demultiplex\nSIGTRAP signal by passing down the information for receiving SIGTRAP through\nsi_code of siginfot_t structure. Here is an attempt is generalise this \ninfrastructure by extending it to x86 and x86_64 archs. \n\nSigned-off-by: Srinivasa DS <srinivasa@in.ibm.com>\n\n\n---\n arch/ia64/include/asm/siginfo.h | 5 -----\n arch/powerpc/include/asm/siginfo.h | 5 -----\n arch/x86/kernel/ptrace.c | 7 ++++---\n arch/x86/kernel/traps_32.c | 4 +++-\n arch/x86/kernel/traps_64.c | 2 +-\n include/asm-generic/siginfo.h | 2 ++\n include/asm-parisc/siginfo.h | 5 -----\n include/asm-x86/ptrace.h | 2 +-\n include/asm-x86/traps.h | 12 ++++++++++++\n 9 files changed, 23 insertions(+), 21 deletions(-)", "diff": "Index: linux-2.6.27-rc7/arch/ia64/include/asm/siginfo.h\n===================================================================\n--- linux-2.6.27-rc7.orig/arch/ia64/include/asm/siginfo.h\n+++ linux-2.6.27-rc7/arch/ia64/include/asm/siginfo.h\n@@ -113,11 +113,6 @@ typedef struct siginfo {\n #undef NSIGSEGV\n #define NSIGSEGV\t3\n \n-/*\n- * SIGTRAP si_codes\n- */\n-#define TRAP_BRANCH\t(__SI_FAULT|3)\t/* process taken branch trap */\n-#define TRAP_HWBKPT\t(__SI_FAULT|4)\t/* hardware breakpoint or watchpoint */\n #undef NSIGTRAP\n #define NSIGTRAP\t4\n \nIndex: linux-2.6.27-rc7/arch/powerpc/include/asm/siginfo.h\n===================================================================\n--- linux-2.6.27-rc7.orig/arch/powerpc/include/asm/siginfo.h\n+++ linux-2.6.27-rc7/arch/powerpc/include/asm/siginfo.h\n@@ -15,11 +15,6 @@\n \n #include <asm-generic/siginfo.h>\n \n-/*\n- * SIGTRAP si_codes\n- */\n-#define TRAP_BRANCH\t(__SI_FAULT|3)\t/* process taken branch trap */\n-#define TRAP_HWBKPT\t(__SI_FAULT|4)\t/* hardware breakpoint or watchpoint */\n #undef NSIGTRAP\n #define NSIGTRAP\t4\n \nIndex: linux-2.6.27-rc7/arch/x86/kernel/traps_32.c\n===================================================================\n--- linux-2.6.27-rc7.orig/arch/x86/kernel/traps_32.c\n+++ linux-2.6.27-rc7/arch/x86/kernel/traps_32.c\n@@ -891,6 +891,7 @@ void __kprobes do_debug(struct pt_regs *\n {\n \tstruct task_struct *tsk = current;\n \tunsigned int condition;\n+\tint si_code;\n \n \ttrace_hardirqs_fixup();\n \n@@ -935,8 +936,9 @@ void __kprobes do_debug(struct pt_regs *\n \t\t\tgoto clear_TF_reenable;\n \t}\n \n+\tsi_code = get_si_code((unsigned long)condition);\n \t/* Ok, finally something we can handle */\n-\tsend_sigtrap(tsk, regs, error_code);\n+\tsend_sigtrap(tsk, regs, error_code, si_code);\n \n \t/*\n \t * Disable additional traps. They'll be re-enabled when\nIndex: linux-2.6.27-rc7/arch/x86/kernel/traps_64.c\n===================================================================\n--- linux-2.6.27-rc7.orig/arch/x86/kernel/traps_64.c\n+++ linux-2.6.27-rc7/arch/x86/kernel/traps_64.c\n@@ -936,7 +936,7 @@ asmlinkage void __kprobes do_debug(struc\n \ttsk->thread.error_code = error_code;\n \tinfo.si_signo = SIGTRAP;\n \tinfo.si_errno = 0;\n-\tinfo.si_code = TRAP_BRKPT;\n+\tinfo.si_code = get_si_code(condition);\n \tinfo.si_addr = user_mode(regs) ? (void __user *)regs->ip : NULL;\n \tforce_sig_info(SIGTRAP, &info, tsk);\n \nIndex: linux-2.6.27-rc7/include/asm-generic/siginfo.h\n===================================================================\n--- linux-2.6.27-rc7.orig/include/asm-generic/siginfo.h\n+++ linux-2.6.27-rc7/include/asm-generic/siginfo.h\n@@ -199,6 +199,8 @@ typedef struct siginfo {\n */\n #define TRAP_BRKPT\t(__SI_FAULT|1)\t/* process breakpoint */\n #define TRAP_TRACE\t(__SI_FAULT|2)\t/* process trace trap */\n+#define TRAP_BRANCH (__SI_FAULT|3) /* process taken branch trap */\n+#define TRAP_HWBKPT (__SI_FAULT|4) /* hardware breakpoint/watchpoint */\n #define NSIGTRAP\t2\n \n /*\nIndex: linux-2.6.27-rc7/include/asm-parisc/siginfo.h\n===================================================================\n--- linux-2.6.27-rc7.orig/include/asm-parisc/siginfo.h\n+++ linux-2.6.27-rc7/include/asm-parisc/siginfo.h\n@@ -3,11 +3,6 @@\n \n #include <asm-generic/siginfo.h>\n \n-/*\n- * SIGTRAP si_codes\n- */\n-#define TRAP_BRANCH\t(__SI_FAULT|3)\t/* process taken branch trap */\n-#define TRAP_HWBKPT\t(__SI_FAULT|4)\t/* hardware breakpoint or watchpoint */\n #undef NSIGTRAP\n #define NSIGTRAP\t4\n \nIndex: linux-2.6.27-rc7/arch/x86/kernel/ptrace.c\n===================================================================\n--- linux-2.6.27-rc7.orig/arch/x86/kernel/ptrace.c\n+++ linux-2.6.27-rc7/arch/x86/kernel/ptrace.c\n@@ -1357,7 +1357,8 @@ const struct user_regset_view *task_user\n #endif\n }\n \n-void send_sigtrap(struct task_struct *tsk, struct pt_regs *regs, int error_code)\n+void send_sigtrap(struct task_struct *tsk, struct pt_regs *regs,\n+\t\t\t\t\t int error_code, int si_code)\n {\n \tstruct siginfo info;\n \n@@ -1366,7 +1367,7 @@ void send_sigtrap(struct task_struct *ts\n \n \tmemset(&info, 0, sizeof(info));\n \tinfo.si_signo = SIGTRAP;\n-\tinfo.si_code = TRAP_BRKPT;\n+\tinfo.si_code = si_code;\n \n \t/* User-mode ip? */\n \tinfo.si_addr = user_mode_vm(regs) ? (void __user *) regs->ip : NULL;\n@@ -1476,5 +1477,5 @@ asmregparm void syscall_trace_leave(stru\n \t */\n \tif (test_thread_flag(TIF_SINGLESTEP) &&\n \t (current->ptrace & PT_PTRACED))\n-\t\tsend_sigtrap(current, regs, 0);\n+\t\tsend_sigtrap(current, regs, 0, TRAP_BRKPT);\n }\nIndex: linux-2.6.27-rc7/include/asm-x86/traps.h\n===================================================================\n--- linux-2.6.27-rc7.orig/include/asm-x86/traps.h\n+++ linux-2.6.27-rc7/include/asm-x86/traps.h\n@@ -1,6 +1,8 @@\n #ifndef _ASM_X86_TRAPS_H\n #define _ASM_X86_TRAPS_H\n \n+#include <asm/debugreg.h>\n+\n /* Common in X86_32 and X86_64 */\n asmlinkage void divide_error(void);\n asmlinkage void debug(void);\n@@ -36,6 +38,16 @@ void do_invalid_op(struct pt_regs *, lon\n void do_general_protection(struct pt_regs *, long);\n void do_nmi(struct pt_regs *, long);\n \n+static inline int get_si_code(unsigned long condition)\n+{\n+\tif (condition & DR_STEP)\n+\t\treturn TRAP_TRACE;\n+\telse if (condition & (DR_TRAP0|DR_TRAP1|DR_TRAP2|DR_TRAP3))\n+\t\treturn TRAP_HWBKPT;\n+\telse\n+\t\treturn TRAP_BRKPT;\n+}\n+\n extern int panic_on_unrecovered_nmi;\n extern int kstack_depth_to_print;\n \nIndex: linux-2.6.27-rc7/include/asm-x86/ptrace.h\n===================================================================\n--- linux-2.6.27-rc7.orig/include/asm-x86/ptrace.h\n+++ linux-2.6.27-rc7/include/asm-x86/ptrace.h\n@@ -143,7 +143,7 @@ convert_ip_to_linear(struct task_struct \n \n #ifdef CONFIG_X86_32\n extern void send_sigtrap(struct task_struct *tsk, struct pt_regs *regs,\n-\t\t\t int error_code);\n+\t\t\t int error_code, int si_code);\n #else\n void signal_fault(struct pt_regs *regs, void __user *frame, char *where);\n #endif\n", "prefixes": [ "RFC" ] }