Received: by 2002:ac0:aa62:0:0:0:0:0 with SMTP id w31-v6csp2038919ima; Mon, 22 Oct 2018 03:11:51 -0700 (PDT) X-Google-Smtp-Source: AJdET5dH1URykQZHCdsia9Wb1FkZ5ZOb5FA6s4rTRhL54+OuTM+wVjdNcPFxhR3tywyen1aHI5JL X-Received: by 2002:a17:902:aa45:: with SMTP id c5-v6mr5235335plr.100.1540203111383; Mon, 22 Oct 2018 03:11:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1540203111; cv=none; d=google.com; s=arc-20160816; b=bBVmo0XtGZzEhGiQj5CBQTbnBJIm53DevtGti0N1TMyk4DlOk/ahCPoyMoUlXiLCmP JFoBmGLYXWkb7LVAubGQ8lVnOoMs31aKo884y6Qwn/syaoDhOZJdHG5aLQM2Wxo/zKh8 GbBCuLmJI7akTGHtdGs1g16GzaDwFBsBuTlsC+mTwZSOOh5wxo/EIr3If9P/nIuTZCc4 gSa3BpAxvl8eviL0zAUMSHB0MovLOWC+57TRZSY8t/+YQ5iXE3wL1mU2PFRMAeBbCorX n7+1NH9BiNh5DwSS9P9X5Bz0hgucgND2ht6m4WCm+fPHFAdqVf/G690Bwk+Biihecw2F SMWQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:date:message-id:subject:cc:from:to :in-reply-to; bh=GgeaHDcLpLOobEnYLzbF33fVKWN0mIYTi/ssIwijA4M=; b=L7Ztjce6Z5Rbjr4lvxhTkEqLV0+RcvzQ7nPTfUw1bydQYgFz/7e5VxK2l5a/U46HMW OK4A5y+5NNiwnSxby0RtcJuTSETSaKh9EII3scAMMHyF3IGoto1nK1gqeBDOydZYwbNu /xSt5txMh1zNZewC0QLNhaD2D/o0MHmX9Sc3zKz9Tcl//4xUL8H6wljjOxXhizCiaSSn NpsMEGIvril3lWWJ6SxbsyEAenC9Jgl1ZtmuTY87I28A9S1jR9FWqcm6Bgg8tXGA/MdU JCLP+fC8YRLnEuQDqWmgLg3V5ipVVEnXkmneLW9GbGjJvJykvlsTS5H2TjjO7I6LnPU9 syRw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id s13-v6si4604437pgp.382.2018.10.22.03.11.35; Mon, 22 Oct 2018 03:11:51 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728306AbeJVRy4 (ORCPT + 99 others); Mon, 22 Oct 2018 13:54:56 -0400 Received: from ozlabs.org ([203.11.71.1]:35841 "EHLO ozlabs.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727519AbeJVRy4 (ORCPT ); Mon, 22 Oct 2018 13:54:56 -0400 Received: by ozlabs.org (Postfix, from userid 1034) id 42dryZ1yBNz9sDC; Mon, 22 Oct 2018 20:37:10 +1100 (AEDT) X-powerpc-patch-notification: thanks X-powerpc-patch-commit: fb978ca207743badfe7efd9eebe68bcbb4969f79 In-Reply-To: <872199441fd43b05fc1c7d049098ef7c0e83f4c5.1537262646.git.christophe.leroy@c-s.fr> To: Christophe Leroy , Benjamin Herrenschmidt , Paul Mackerras From: Michael Ellerman Cc: linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org Subject: Re: powerpc/kgdb: add kgdb_arch_set/remove_breakpoint() Message-Id: <42dryZ1yBNz9sDC@ozlabs.org> Date: Mon, 22 Oct 2018 20:37:09 +1100 (AEDT) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 2018-09-18 at 09:26:03 UTC, Christophe Leroy wrote: > Generic implementation fails to remove breakpoints after init > when CONFIG_STRICT_KERNEL_RWX is selected: > > [ 13.251285] KGDB: BP remove failed: c001c338 > [ 13.259587] kgdbts: ERROR PUT: end of test buffer on 'do_fork_test' line 8 expected OK got $E14#aa > [ 13.268969] KGDB: re-enter exception: ALL breakpoints killed > [ 13.275099] CPU: 0 PID: 1 Comm: init Not tainted 4.18.0-g82bbb913ffd8 #860 > [ 13.282836] Call Trace: > [ 13.285313] [c60e1ba0] [c0080ef0] kgdb_handle_exception+0x6f4/0x720 (unreliable) > [ 13.292618] [c60e1c30] [c000e97c] kgdb_handle_breakpoint+0x3c/0x98 > [ 13.298709] [c60e1c40] [c000af54] program_check_exception+0x104/0x700 > [ 13.305083] [c60e1c60] [c000e45c] ret_from_except_full+0x0/0x4 > [ 13.310845] [c60e1d20] [c02a22ac] run_simple_test+0x2b4/0x2d4 > [ 13.316532] [c60e1d30] [c0081698] put_packet+0xb8/0x158 > [ 13.321694] [c60e1d60] [c00820b4] gdb_serial_stub+0x230/0xc4c > [ 13.327374] [c60e1dc0] [c0080af8] kgdb_handle_exception+0x2fc/0x720 > [ 13.333573] [c60e1e50] [c000e928] kgdb_singlestep+0xb4/0xcc > [ 13.339068] [c60e1e70] [c000ae1c] single_step_exception+0x90/0xac > [ 13.345100] [c60e1e80] [c000e45c] ret_from_except_full+0x0/0x4 > [ 13.350865] [c60e1f40] [c000e11c] ret_from_syscall+0x0/0x38 > [ 13.356346] Kernel panic - not syncing: Recursive entry to debugger > > This patch creates powerpc specific version of > kgdb_arch_set_breakpoint() and kgdb_arch_remove_breakpoint() > using patch_instruction() > > Fixes: 1e0fc9d1eb2b ("powerpc/Kconfig: Enable STRICT_KERNEL_RWX for some configs") > Signed-off-by: Christophe Leroy Applied to powerpc next, thanks. https://git.kernel.org/powerpc/c/fb978ca207743badfe7efd9eebe68b cheers