Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/817410/?format=api
{ "id": 817410, "url": "http://patchwork.ozlabs.org/api/patches/817410/?format=api", "web_url": "http://patchwork.ozlabs.org/project/linuxppc-dev/patch/481ef9b0b83116b1ca72ec6c95266c5454073387.1505934128.git.naveen.n.rao@linux.vnet.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": "<481ef9b0b83116b1ca72ec6c95266c5454073387.1505934128.git.naveen.n.rao@linux.vnet.ibm.com>", "list_archive_url": "https://lore.kernel.org/linuxppc-dev/481ef9b0b83116b1ca72ec6c95266c5454073387.1505934128.git.naveen.n.rao@linux.vnet.ibm.com/", "date": "2017-09-22T09:10:47", "name": "[v2,5/6] powerpc/jprobes: Disable preemption when triggered through ftrace", "commit_ref": "6baea433bc84cd148af1c524389a8d756f67412e", "pull_url": null, "state": "accepted", "archived": false, "hash": "787666122a4a5af949d0d4686762d05bf168b298", "submitter": { "id": 15185, "url": "http://patchwork.ozlabs.org/api/people/15185/?format=api", "name": "Naveen N. Rao", "email": "naveen.n.rao@linux.vnet.ibm.com" }, "delegate": null, "mbox": "http://patchwork.ozlabs.org/project/linuxppc-dev/patch/481ef9b0b83116b1ca72ec6c95266c5454073387.1505934128.git.naveen.n.rao@linux.vnet.ibm.com/mbox/", "series": [ { "id": 4580, "url": "http://patchwork.ozlabs.org/api/series/4580/?format=api", "web_url": "http://patchwork.ozlabs.org/project/linuxppc-dev/list/?series=4580", "date": "2017-09-22T09:10:23", "name": "powerpc/kprobes: More fixes", "version": 2, "mbox": "http://patchwork.ozlabs.org/series/4580/mbox/" } ], "comments": "http://patchwork.ozlabs.org/api/patches/817410/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/817410/checks/", "tags": {}, "related": [], "headers": { "Return-Path": "<linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org>", "X-Original-To": [ "patchwork-incoming@ozlabs.org", "linuxppc-dev@lists.ozlabs.org" ], "Delivered-To": [ "patchwork-incoming@ozlabs.org", "linuxppc-dev@lists.ozlabs.org" ], "Received": [ "from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3])\n\t(using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits))\n\t(No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 3xz7HP3WgHz9s82\n\tfor <patchwork-incoming@ozlabs.org>;\n\tFri, 22 Sep 2017 19:20:17 +1000 (AEST)", "from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3])\n\tby lists.ozlabs.org (Postfix) with ESMTP id 3xz7HP2gCQzDsQm\n\tfor <patchwork-incoming@ozlabs.org>;\n\tFri, 22 Sep 2017 19:20:17 +1000 (AEST)", "from mx0a-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com\n\t[148.163.158.5])\n\t(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256\n\tbits)) (No client certificate requested)\n\tby lists.ozlabs.org (Postfix) with ESMTPS id 3xz7553WsczDrFM\n\tfor <linuxppc-dev@lists.ozlabs.org>;\n\tFri, 22 Sep 2017 19:11:21 +1000 (AEST)", "from pps.filterd (m0098420.ppops.net [127.0.0.1])\n\tby mx0b-001b2d01.pphosted.com (8.16.0.21/8.16.0.21) with SMTP id\n\tv8M996wG129290\n\tfor <linuxppc-dev@lists.ozlabs.org>; Fri, 22 Sep 2017 05:11:18 -0400", "from e23smtp08.au.ibm.com (e23smtp08.au.ibm.com [202.81.31.141])\n\tby mx0b-001b2d01.pphosted.com with ESMTP id 2d4y6vsfvj-1\n\t(version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT)\n\tfor <linuxppc-dev@lists.ozlabs.org>; Fri, 22 Sep 2017 05:11:18 -0400", "from localhost\n\tby e23smtp08.au.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use\n\tOnly! Violators will be prosecuted\n\tfor <linuxppc-dev@lists.ozlabs.org> from\n\t<naveen.n.rao@linux.vnet.ibm.com>; Fri, 22 Sep 2017 19:11:15 +1000", "from d23relay06.au.ibm.com (202.81.31.225)\n\tby e23smtp08.au.ibm.com (202.81.31.205) with IBM ESMTP SMTP Gateway:\n\tAuthorized Use Only! Violators will be prosecuted; \n\tFri, 22 Sep 2017 19:11:14 +1000", "from d23av02.au.ibm.com (d23av02.au.ibm.com [9.190.235.138])\n\tby d23relay06.au.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id\n\tv8M9BERU41681036\n\tfor <linuxppc-dev@lists.ozlabs.org>; Fri, 22 Sep 2017 19:11:14 +1000", "from d23av02.au.ibm.com (localhost [127.0.0.1])\n\tby d23av02.au.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id\n\tv8M9B4n8020753\n\tfor <linuxppc-dev@lists.ozlabs.org>; Fri, 22 Sep 2017 19:11:05 +1000", "from naverao1-tp.ibm.com ([9.77.124.51])\n\tby d23av02.au.ibm.com (8.14.4/8.14.4/NCO v10.0 AVin) with ESMTP id\n\tv8M9AoTZ020313; Fri, 22 Sep 2017 19:11:02 +1000" ], "Authentication-Results": "ozlabs.org;\n\tspf=none (mailfrom) smtp.mailfrom=linux.vnet.ibm.com\n\t(client-ip=148.163.158.5; helo=mx0a-001b2d01.pphosted.com;\n\tenvelope-from=naveen.n.rao@linux.vnet.ibm.com; receiver=<UNKNOWN>)", "From": "\"Naveen N. Rao\" <naveen.n.rao@linux.vnet.ibm.com>", "To": "Michael Ellerman <mpe@ellerman.id.au>", "Subject": "[PATCH v2 5/6] powerpc/jprobes: Disable preemption when triggered\n\tthrough ftrace", "Date": "Fri, 22 Sep 2017 14:40:47 +0530", "X-Mailer": "git-send-email 2.14.1", "In-Reply-To": [ "<9e98f74834af349564b71bc8443bdad55d6e37c6.1505934128.git.naveen.n.rao@linux.vnet.ibm.com>", "<cover.1505934128.git.naveen.n.rao@linux.vnet.ibm.com>" ], "References": [ "<9e98f74834af349564b71bc8443bdad55d6e37c6.1505934128.git.naveen.n.rao@linux.vnet.ibm.com>", "<cover.1505934128.git.naveen.n.rao@linux.vnet.ibm.com>" ], "X-TM-AS-MML": "disable", "x-cbid": "17092209-0048-0000-0000-0000025D9FF6", "X-IBM-AV-DETECTION": "SAVI=unused REMOTE=unused XFE=unused", "x-cbparentid": "17092209-0049-0000-0000-000048147E2E", "Message-Id": "<481ef9b0b83116b1ca72ec6c95266c5454073387.1505934128.git.naveen.n.rao@linux.vnet.ibm.com>", "X-Proofpoint-Virus-Version": "vendor=fsecure engine=2.50.10432:, ,\n\tdefinitions=2017-09-22_02:, , signatures=0", "X-Proofpoint-Spam-Details": "rule=outbound_notspam policy=outbound score=0\n\tspamscore=0 suspectscore=0\n\tmalwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam\n\tadjust=0 reason=mlx scancount=1 engine=8.0.1-1707230000\n\tdefinitions=main-1709220128", "X-BeenThere": "linuxppc-dev@lists.ozlabs.org", "X-Mailman-Version": "2.1.24", "Precedence": "list", "List-Id": "Linux on PowerPC Developers Mail List\n\t<linuxppc-dev.lists.ozlabs.org>", "List-Unsubscribe": "<https://lists.ozlabs.org/options/linuxppc-dev>,\n\t<mailto:linuxppc-dev-request@lists.ozlabs.org?subject=unsubscribe>", "List-Archive": "<http://lists.ozlabs.org/pipermail/linuxppc-dev/>", "List-Post": "<mailto:linuxppc-dev@lists.ozlabs.org>", "List-Help": "<mailto:linuxppc-dev-request@lists.ozlabs.org?subject=help>", "List-Subscribe": "<https://lists.ozlabs.org/listinfo/linuxppc-dev>,\n\t<mailto:linuxppc-dev-request@lists.ozlabs.org?subject=subscribe>", "Cc": "linuxppc-dev@lists.ozlabs.org, Masami Hiramatsu <mhiramat@kernel.org>,\n\tKamalesh Babulal <kamalesh@linux.vnet.ibm.com>", "Errors-To": "linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org", "Sender": "\"Linuxppc-dev\"\n\t<linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org>" }, "content": "KPROBES_SANITY_TEST throws the below splat when CONFIG_PREEMPT is\nenabled:\n\n[ 3.140410] Kprobe smoke test: started\n[ 3.149680] DEBUG_LOCKS_WARN_ON(val > preempt_count())\n[ 3.149684] ------------[ cut here ]------------\n[ 3.149695] WARNING: CPU: 19 PID: 1 at kernel/sched/core.c:3094 preempt_count_sub+0xcc/0x140\n[ 3.149699] Modules linked in:\n[ 3.149705] CPU: 19 PID: 1 Comm: swapper/0 Not tainted 4.13.0-rc7-nnr+ #97\n[ 3.149709] task: c0000000fea80000 task.stack: c0000000feb00000\n[ 3.149713] NIP: c00000000011d3dc LR: c00000000011d3d8 CTR: c000000000a090d0\n[ 3.149718] REGS: c0000000feb03400 TRAP: 0700 Not tainted (4.13.0-rc7-nnr+)\n[ 3.149722] MSR: 8000000000021033 <SF,ME,IR,DR,RI,LE> CR: 28000282 XER: 00000000\n[ 3.149732] CFAR: c00000000015aa18 SOFTE: 0\n<snip>\n[ 3.149786] NIP [c00000000011d3dc] preempt_count_sub+0xcc/0x140\n[ 3.149790] LR [c00000000011d3d8] preempt_count_sub+0xc8/0x140\n[ 3.149794] Call Trace:\n[ 3.149798] [c0000000feb03680] [c00000000011d3d8] preempt_count_sub+0xc8/0x140 (unreliable)\n[ 3.149804] [c0000000feb036e0] [c000000000046198] kprobe_handler+0x228/0x4b0\n[ 3.149810] [c0000000feb03750] [c0000000000269c8] program_check_exception+0x58/0x3b0\n[ 3.149816] [c0000000feb037c0] [c00000000000903c] program_check_common+0x16c/0x170\n[ 3.149822] --- interrupt: 0 at kprobe_target+0x8/0x20\n LR = init_test_probes+0x248/0x7d0\n[ 3.149829] [c0000000feb03ab0] [c000000000e4f048] kp+0x0/0x80 (unreliable)\n[ 3.149835] [c0000000feb03b10] [c00000000004ea60] livepatch_handler+0x38/0x74\n[ 3.149841] [c0000000feb03ba0] [c000000000d0de54] init_kprobes+0x1d8/0x208\n[ 3.149846] [c0000000feb03c40] [c00000000000daa8] do_one_initcall+0x68/0x1d0\n[ 3.149852] [c0000000feb03d00] [c000000000ce44f0] kernel_init_freeable+0x298/0x374\n[ 3.149857] [c0000000feb03dc0] [c00000000000dd84] kernel_init+0x24/0x160\n[ 3.149863] [c0000000feb03e30] [c00000000000bfec] ret_from_kernel_thread+0x5c/0x70\n[ 3.149867] Instruction dump:\n[ 3.149871] 419effdc 3d22001b 39299240 81290000 2f890000 409effc8 3c82ffcb 3c62ffcb\n[ 3.149879] 3884bc68 3863bc18 4803d5fd 60000000 <0fe00000> 4bffffa8 60000000 60000000\n[ 3.149890] ---[ end trace 432dd46b4ce3d29f ]---\n[ 3.166003] Kprobe smoke test: passed successfully\n\nThe issue is that we aren't disabling preemption in\nkprobe_ftrace_handler(). Disable it.\n\nFixes: ead514d5fb30a0 (\"powerpc/kprobes: Add support for KPROBES_ON_FTRACE\")\nAcked-by: Masami Hiramatsu <mhiramat@kernel.org>\nSigned-off-by: Naveen N. Rao <naveen.n.rao@linux.vnet.ibm.com>\n---\n arch/powerpc/kernel/kprobes-ftrace.c | 15 +++++++++++----\n 1 file changed, 11 insertions(+), 4 deletions(-)", "diff": "diff --git a/arch/powerpc/kernel/kprobes-ftrace.c b/arch/powerpc/kernel/kprobes-ftrace.c\nindex 1e54ec8ad85f..4b1f34f685b1 100644\n--- a/arch/powerpc/kernel/kprobes-ftrace.c\n+++ b/arch/powerpc/kernel/kprobes-ftrace.c\n@@ -80,6 +80,7 @@ void kprobe_ftrace_handler(unsigned long nip, unsigned long parent_nip,\n \t/* Disable irq for emulating a breakpoint and avoiding preempt */\n \tlocal_irq_save(flags);\n \thard_irq_disable();\n+\tpreempt_disable();\n \n \tp = get_kprobe((kprobe_opcode_t *)nip);\n \tif (unlikely(!p) || kprobe_disabled(p))\n@@ -101,12 +102,18 @@ void kprobe_ftrace_handler(unsigned long nip, unsigned long parent_nip,\n \t\tkcb->kprobe_status = KPROBE_HIT_ACTIVE;\n \t\tif (!p->pre_handler || !p->pre_handler(p, regs))\n \t\t\t__skip_singlestep(p, regs, kcb, orig_nip);\n-\t\t/*\n-\t\t * If pre_handler returns !0, it sets regs->nip and\n-\t\t * resets current kprobe.\n-\t\t */\n+\t\telse {\n+\t\t\t/*\n+\t\t\t * If pre_handler returns !0, it sets regs->nip and\n+\t\t\t * resets current kprobe. In this case, we still need\n+\t\t\t * to restore irq, but not preemption.\n+\t\t\t */\n+\t\t\tlocal_irq_restore(flags);\n+\t\t\treturn;\n+\t\t}\n \t}\n end:\n+\tpreempt_enable_no_resched();\n \tlocal_irq_restore(flags);\n }\n NOKPROBE_SYMBOL(kprobe_ftrace_handler);\n", "prefixes": [ "v2", "5/6" ] }