[{"id":1772361,"web_url":"http://patchwork.ozlabs.org/comment/1772361/","msgid":"<3xyKGW4mR8z9sNr@ozlabs.org>","date":"2017-09-21T01:46:43","subject":"Re: powerpc/kprobes: Update optprobes to use emulate_update_regs()","submitter":{"id":69509,"url":"http://patchwork.ozlabs.org/api/people/69509/","name":"Michael Ellerman","email":"patch-notifications@ellerman.id.au"},"content":"On Fri, 2017-09-15 at 10:08:21 UTC, \"Naveen N. Rao\" wrote:\n> Optprobes depended on an updated regs->nip from analyse_instr() to\n> identify the location to branch back from the optprobes trampoline.\n> However, since commit 3cdfcbfd32b9d (\"powerpc: Change analyse_instr so\n> it doesn't modify *regs\"), analyse_instr() doesn't update the registers\n> anymore.  Due to this, we end up branching back from the optprobes\n> trampoline to the same branch into the trampoline resulting in a loop.\n> \n> Fix this by calling out to emulate_update_regs() before using the nip.\n> Additionally, explicitly compare the return value from analyse_instr()\n> to 1, rather than just checking for !0 so as to guard against any\n> future changes to analyse_instr() that may result in -1 being returned\n> in more scenarios.\n> \n> Fixes: 3cdfcbfd32b9d (\"powerpc: Change analyse_instr so it doesn't modify *regs\")\n> Signed-off-by: Naveen N. Rao <naveen.n.rao@linux.vnet.ibm.com>\n\nApplied to powerpc fixes, thanks.\n\nhttps://git.kernel.org/powerpc/c/8afafa6fba7809c0785018b77c95b1\n\ncheers","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 3xyKM44G2jz9s78\n\tfor <patchwork-incoming@ozlabs.org>;\n\tThu, 21 Sep 2017 11:50:40 +1000 (AEST)","from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3])\n\tby lists.ozlabs.org (Postfix) with ESMTP id 3xyKM42vCTzDrSs\n\tfor <patchwork-incoming@ozlabs.org>;\n\tThu, 21 Sep 2017 11:50:40 +1000 (AEST)","from ozlabs.org (bilbo.ozlabs.org [103.22.144.67])\n\t(using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits))\n\t(No client certificate requested)\n\tby lists.ozlabs.org (Postfix) with ESMTPS id 3xyKGW6TQ3zDqXn\n\tfor <linuxppc-dev@lists.ozlabs.org>;\n\tThu, 21 Sep 2017 11:46:43 +1000 (AEST)","by ozlabs.org (Postfix, from userid 1034)\n\tid 3xyKGW4mR8z9sNr; Thu, 21 Sep 2017 11:46:43 +1000 (AEST)"],"X-powerpc-patch-notification":"thanks","X-powerpc-patch-commit":"8afafa6fba7809c0785018b77c95b19e58b35b94","In-Reply-To":"<20170915100821.7254-1-naveen.n.rao@linux.vnet.ibm.com>","To":"\"Naveen N. Rao\" <naveen.n.rao@linux.vnet.ibm.com>","From":"Michael Ellerman <patch-notifications@ellerman.id.au>","Subject":"Re: powerpc/kprobes: Update optprobes to use emulate_update_regs()","Message-Id":"<3xyKGW4mR8z9sNr@ozlabs.org>","Date":"Thu, 21 Sep 2017 11:46:43 +1000 (AEST)","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":"Anju T Sudhakar <anju@linux.vnet.ibm.com>, linuxppc-dev@lists.ozlabs.org","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>"}}]