[Kgdb-bugreport] [RESEND PATCH v5 3.19-rc2 6/8] kdb: Categorize kdb commands (similar to SysRq categorization)

2015-01-12 Thread Daniel Thompson
This patch introduces several new flags to collect kdb commands into groups (later allowing them to be optionally disabled). This follows similar prior art to enable/disable magic sysrq commands. The commands have been categorized as follows: Always on: go (w/o args), env, set, help, ?, cpu (w/

[Kgdb-bugreport] [RESEND PATCH v3 3.19-rc2] kdb: Avoid printing KERN_ levels to consoles

2015-01-12 Thread Daniel Thompson
Currently when kdb traps printk messages then the raw log level prefix (consisting of '\001' followed by a numeral) does not get stripped off before the message is issued to the various I/O handlers supported by kdb. This causes annoying visual noise as well as causing problems grepping for ^. It i

[Kgdb-bugreport] [RESEND PATCH 3.19-rc2 0/3] kdb: Improve command output searching

2015-01-12 Thread Daniel Thompson
This patchset improves kdb's capabilities to search the output of commands. Specifically it fixes a bug in the prompt management when '| grep' is used and adds a new feature to search command output interactively from the more prompt. Finally there is a trivial bit of const clean up that I spotted

[Kgdb-bugreport] [RESEND PATCH 3.19-rc2 2/3] kdb: Provide forward search at more prompt

2015-01-12 Thread Daniel Thompson
Currently kdb allows the output of comamnds to be filtered using the | grep feature. This is useful but does not permit the output emitted shortly after a string match to be examined without wading through the entire unfiltered output of the command. Such a feature is particularly useful to navigat

[Kgdb-bugreport] [RESEND PATCH 3.19-rc2 1/3] kdb: Fix a prompt management bug when using | grep

2015-01-12 Thread Daniel Thompson
Currently when the "| grep" feature is used to filter the output of a command then the prompt is not displayed for the subsequent command. Likewise any characters typed by the user are also not echoed to the display. This rather disconcerting problem eventually corrects itself when the user presses

[Kgdb-bugreport] [RESEND PATCH v3 3.19-rc2] kgdb: Timeout if secondary CPUs ignore the roundup

2015-01-12 Thread Daniel Thompson
Currently if an active CPU fails to respond to a roundup request the CPU that requested the roundup will become stuck. This needlessly reduces the robustness of the debugger. This patch introduces a timeout allowing the system state to be examined even when the system contains unresponsive process

Re: [Kgdb-bugreport] [RFC v4] debug: prevent entering debug mode on panic/exception.

2015-01-12 Thread Kiran Raparthy
On 7 January 2015 at 02:47, Andrew Morton wrote: > On Tue, 06 Jan 2015 15:25:51 + Daniel Thompson > wrote: > >> >> To avoid entering the debugger on panic/exception without any extra >> >> configuration, panic_timeout is being used which can be set via >> >> /proc/sys/kernel/panic at run tim

[Kgdb-bugreport] [RESEND PATCH v5 3.19-rc2 0/8] kdb: Allow selective reduction in capabilities

2015-01-12 Thread Daniel Thompson
Jason: This patchset is already integrated into kgdb-next and I'm only really posted it for completeness. The rebase from v3.18-rc3 to v3.19-rc2 was trivial (no conflicts at all) so you can probably just stick with what you already have in kgdb-next. This patchset implements restricted mod

Re: [Kgdb-bugreport] [RFC v4] debug: prevent entering debug mode on panic/exception.

2015-01-12 Thread Andrew Morton
On Tue, 06 Jan 2015 15:31:31 + Daniel Thompson wrote: > On 06/01/15 00:14, Andrew Morton wrote: > > We appear to have forgotten to document panic_timeout. Sigh. > > I knew I'd seen it somewhere... > > Once its been sysctlised it ends up called "panic": > https://www.kernel.org/doc/Docum

[Kgdb-bugreport] [PATCH] kgdb: fix potential out-of-bounds access

2015-01-12 Thread Brian Norris
CPU arrays (e.g., kgdb_info[]) are indexed from 0 (inclusive) to NR_CPUS (exclusive). Pointed out by Coverity, CID 1262269 Signed-off-by: Brian Norris Cc: Jason Wessel --- Untested kernel/debug/kdb/kdb_main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel/debug/kdb

[Kgdb-bugreport] [RESEND PATCH v5 3.19-rc2 5/8] kdb: Remove KDB_REPEAT_NONE flag

2015-01-12 Thread Daniel Thompson
From: Anton Vorontsov Since we now treat KDB_REPEAT_* as flags, there is no need to pass KDB_REPEAT_NONE. It's just the default behaviour when no flags are specified. Signed-off-by: Anton Vorontsov Signed-off-by: John Stultz Signed-off-by: Daniel Thompson Cc: Jason Wessel --- include/linux/

[Kgdb-bugreport] [RESEND PATCH v5 3.19-rc2 7/8] kdb: Add enable mask for groups of commands

2015-01-12 Thread Daniel Thompson
From: Anton Vorontsov Currently all kdb commands are enabled whenever kdb is deployed. This makes it difficult to deploy kdb to help debug certain types of systems. Android phones provide one example; the FIQ debugger found on some Android devices has a deliberately weak set of commands to allow

[Kgdb-bugreport] [PATCH 1/1] x86, kgdb: correct kgdb_arch_remove_breakpoint

2015-01-12 Thread zhe.he
From: He Zhe On 3.19-rc2, kgdbts boot time test fails with default parameter V1F100 "KGDB: BP remove failed: 81049070" Then system is hanged. When CONFIG_DEBUG_RODATA is on, kgdb_arch_set_breakpoint firstly tries probe_kernel_write to set breakpoints and mark their type as BP_BREAKPOINT.

[Kgdb-bugreport] [PATCH] kgdb, docs: Fix pdfdocs build errors

2015-01-12 Thread Graham Whaley
From: Rajaneesh Acharya kgdb.pdf failed to build from 'make pdfdocs' giving errors such as: jade:... Documentation/DocBook/kgdb.xml:200:8:E: document type does not allow element "para" here; missing one of "footnote", "caution", "important", "note", "tip", "warning", "blockquote", "informalexamp

[Kgdb-bugreport] [RESEND PATCH v5 3.19-rc2 8/8] kdb: Allow access to sensitive commands to be restricted by default

2015-01-12 Thread Daniel Thompson
Currently kiosk mode must be explicitly requested by the bootloader or userspace. It is convenient to be able to change the default value in a similar manner to CONFIG_MAGIC_SYSRQ_DEFAULT_MASK. Signed-off-by: Daniel Thompson Cc: Jason Wessel --- kernel/debug/kdb/kdb_main.c | 2 +- lib/Kconfig.

Re: [Kgdb-bugreport] [RFC v4] debug: prevent entering debug mode on panic/exception.

2015-01-12 Thread Andrew Morton
On Tue, 06 Jan 2015 15:25:51 + Daniel Thompson wrote: > >> To avoid entering the debugger on panic/exception without any extra > >> configuration, panic_timeout is being used which can be set via > >> /proc/sys/kernel/panic at run time and CONFIG_PANIC_TIMEOUT sets the > >> default > >> val

Re: [Kgdb-bugreport] [PATCH] kgdb: fix potential out-of-bounds access

2015-01-12 Thread Brian Norris
On Mon, Jan 12, 2015 at 11:54 AM, Jason Wessel wrote: > This is actually already fixed a different way in the kgdb-next: > > https://git.kernel.org/cgit/linux/kernel/git/jwessel/kgdb.git/commit/?h=kgdb-next&id=c7d9ebf81c456dc185c8eae9e293bfdccf2a65f5 Great. Thanks for the quick response. Brian

[Kgdb-bugreport] [RFC v4] debug: prevent entering debug mode on panic/exception.

2015-01-12 Thread Kiran Raparthy
From: Colin Cross debug: prevent entering debug mode on panic/exception. On non-developer devices, kgdb prevents the device from rebooting after a panic. Incase of panics and exceptions, to allow the device to reboot, prevent entering debug mode to avoid getting stuck waiting for the user to in

[Kgdb-bugreport] [RESEND PATCH v5 3.19-rc2 2/8] kdb: Rename kdb_repeat_t to kdb_cmdflags_t, cmd_repeat to cmd_flags

2015-01-12 Thread Daniel Thompson
From: Anton Vorontsov We're about to add more options for command behaviour, so let's expand the meaning of kdb_repeat_t. So far we just do various renames, there should be no functional changes. Signed-off-by: Anton Vorontsov Signed-off-by: John Stultz Signed-off-by: Daniel Thompson Cc: Jas

Re: [Kgdb-bugreport] kgdb-next not pushed to Linus for 3.19

2015-01-12 Thread Joe Perches
On Tue, 2015-01-06 at 18:54 +, Daniel Thompson wrote: > Hi Jason > > I'm trying to figure out what to do with my long-outstanding kgdb/kdb > patches in preparation for the 3.20 merge window. > > As of now I have five pending patch sets some of which are well over six > months old (and none ha

[Kgdb-bugreport] [PATCH] kgdb, docs: Fix typo and minor style issues

2015-01-12 Thread Graham Whaley
Fix up a number of small typos, duplications and formatting issues. Signed-off-by: Graham Whaley --- Generated atop of patch: ("kgdb,docs: Fix pdfdocs build errors") Documentation/DocBook/kgdb.tmpl | 45 + 1 file changed, 23 insertions(+), 22 deletion

Re: [Kgdb-bugreport] [RFC v4] debug: prevent entering debug mode on panic/exception.

2015-01-12 Thread Kiran Raparthy
Hi Andrew, On 6 January 2015 at 05:44, Andrew Morton wrote: > On Tue, 23 Dec 2014 18:08:29 +0530 Kiran Raparthy > wrote: > >> From: Colin Cross >> >> debug: prevent entering debug mode on panic/exception. >> >> On non-developer devices, kgdb prevents the device from rebooting >> after a panic.

[Kgdb-bugreport] [RESEND PATCH v3.19-rc2] kdb: Remove stack dump when entering kgdb due to NMI

2015-01-12 Thread Daniel Thompson
Issuing a stack dump feels ergonomically wrong when entering due to NMI. Entering due to NMI is normally a reaction to a user request, either the NMI button on a server or a "magic knock" on a UART. Therefore the backtrace behaviour on entry due to NMI should be like SysRq-g (no stack dump) rather

[Kgdb-bugreport] [RESEND PATCH v5 3.19-rc2 4/8] kdb: Use KDB_REPEAT_* values as flags

2015-01-12 Thread Daniel Thompson
From: Anton Vorontsov The actual values of KDB_REPEAT_* enum values and overall logic stayed the same, but we now treat the values as flags. This makes it possible to add other flags and combine them, plus makes the code a lot simpler and shorter. But functionality-wise, there should be no chang

[Kgdb-bugreport] [RESEND PATCH 3.19-rc2 3/3] kdb: Const qualifier for kdb_getstr's prompt argument

2015-01-12 Thread Daniel Thompson
All current callers of kdb_getstr() can pass constant pointers via the prompt argument. This patch adds a const qualification to make explicit the fact that this is safe. Signed-off-by: Daniel Thompson --- kernel/debug/kdb/kdb_io.c | 2 +- kernel/debug/kdb/kdb_private.h | 2 +- 2 files chan

[Kgdb-bugreport] [RESEND PATCH v5 3.19-rc2 1/8] kdb: Remove currently unused kdbtab_t->cmd_flags

2015-01-12 Thread Daniel Thompson
From: Anton Vorontsov The struct member is never used in the code, so we can remove it. We will introduce real flags soon by renaming cmd_repeat to cmd_flags. Signed-off-by: Anton Vorontsov Signed-off-by: John Stultz Signed-off-by: Daniel Thompson Cc: Jason Wessel --- kernel/debug/kdb/kdb_

Re: [Kgdb-bugreport] kgdb-next not pushed to Linus for 3.19

2015-01-12 Thread Jason Wessel
On 01/06/2015 03:21 PM, Andrew Morton wrote: > On Tue, 06 Jan 2015 10:57:42 -0800 Joe Perches wrote: > >> On Tue, 2015-01-06 at 18:54 +, Daniel Thompson wrote: >>> Hi Jason >>> >>> I'm trying to figure out what to do with my long-outstanding kgdb/kdb >>> patches in preparation for the 3.20 mer

[Kgdb-bugreport] [RESEND PATCH v5 3.19-rc2 3/8] kdb: Rename kdb_register_repeat() to kdb_register_flags()

2015-01-12 Thread Daniel Thompson
From: Anton Vorontsov We're about to add more options for commands behaviour, so let's give a more generic name to the low-level kdb command registration function. There are just various renames, no functional changes. Signed-off-by: Anton Vorontsov Signed-off-by: John Stultz Signed-off-by: D

Re: [Kgdb-bugreport] [PATCH] kgdb: fix potential out-of-bounds access

2015-01-12 Thread Jason Wessel
On 01/12/2015 01:45 PM, Brian Norris wrote: > CPU arrays (e.g., kgdb_info[]) are indexed from 0 (inclusive) to NR_CPUS > (exclusive). > > Pointed out by Coverity, CID 1262269 > > Signed-off-by: Brian Norris > Cc: Jason Wessel > --- > Untested > > kernel/debug/kdb/kdb_main.c | 2 +- > 1 file chan