08 Apr, 2014

1 commit

  • This patch is a continuation of efforts trying to optimize find_vma(),
    avoiding potentially expensive rbtree walks to locate a vma upon faults.
    The original approach (https://lkml.org/lkml/2013/11/1/410), where the
    largest vma was also cached, ended up being too specific and random,
    thus further comparison with other approaches were needed. There are
    two things to consider when dealing with this, the cache hit rate and
    the latency of find_vma(). Improving the hit-rate does not necessarily
    translate in finding the vma any faster, as the overhead of any fancy
    caching schemes can be too high to consider.

    We currently cache the last used vma for the whole address space, which
    provides a nice optimization, reducing the total cycles in find_vma() by
    up to 250%, for workloads with good locality. On the other hand, this
    simple scheme is pretty much useless for workloads with poor locality.
    Analyzing ebizzy runs shows that, no matter how many threads are
    running, the mmap_cache hit rate is less than 2%, and in many situations
    below 1%.

    The proposed approach is to replace this scheme with a small per-thread
    cache, maximizing hit rates at a very low maintenance cost.
    Invalidations are performed by simply bumping up a 32-bit sequence
    number. The only expensive operation is in the rare case of a seq
    number overflow, where all caches that share the same address space are
    flushed. Upon a miss, the proposed replacement policy is based on the
    page number that contains the virtual address in question. Concretely,
    the following results are seen on an 80 core, 8 socket x86-64 box:

    1) System bootup: Most programs are single threaded, so the per-thread
    scheme does improve ~50% hit rate by just adding a few more slots to
    the cache.

    +----------------+----------+------------------+
    | caching scheme | hit-rate | cycles (billion) |
    +----------------+----------+------------------+
    | baseline | 50.61% | 19.90 |
    | patched | 73.45% | 13.58 |
    +----------------+----------+------------------+

    2) Kernel build: This one is already pretty good with the current
    approach as we're dealing with good locality.

    +----------------+----------+------------------+
    | caching scheme | hit-rate | cycles (billion) |
    +----------------+----------+------------------+
    | baseline | 75.28% | 11.03 |
    | patched | 88.09% | 9.31 |
    +----------------+----------+------------------+

    3) Oracle 11g Data Mining (4k pages): Similar to the kernel build workload.

    +----------------+----------+------------------+
    | caching scheme | hit-rate | cycles (billion) |
    +----------------+----------+------------------+
    | baseline | 70.66% | 17.14 |
    | patched | 91.15% | 12.57 |
    +----------------+----------+------------------+

    4) Ebizzy: There's a fair amount of variation from run to run, but this
    approach always shows nearly perfect hit rates, while baseline is just
    about non-existent. The amounts of cycles can fluctuate between
    anywhere from ~60 to ~116 for the baseline scheme, but this approach
    reduces it considerably. For instance, with 80 threads:

    +----------------+----------+------------------+
    | caching scheme | hit-rate | cycles (billion) |
    +----------------+----------+------------------+
    | baseline | 1.06% | 91.54 |
    | patched | 99.97% | 14.18 |
    +----------------+----------+------------------+

    [akpm@linux-foundation.org: fix nommu build, per Davidlohr]
    [akpm@linux-foundation.org: document vmacache_valid() logic]
    [akpm@linux-foundation.org: attempt to untangle header files]
    [akpm@linux-foundation.org: add vmacache_find() BUG_ON]
    [hughd@google.com: add vmacache_valid_mm() (from Oleg)]
    [akpm@linux-foundation.org: coding-style fixes]
    [akpm@linux-foundation.org: adjust and enhance comments]
    Signed-off-by: Davidlohr Bueso
    Reviewed-by: Rik van Riel
    Acked-by: Linus Torvalds
    Reviewed-by: Michel Lespinasse
    Cc: Oleg Nesterov
    Tested-by: Hugh Dickins
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Davidlohr Bueso
     

26 Feb, 2014

1 commit

  • The function kgdb_breakpoint() sets up break point at
    compile time by calling arch_kgdb_breakpoint();
    Though this call is surrounded by wmb() barrier,
    the compile can still re-order the break point,
    because this scheduling barrier is not a code motion
    barrier in gcc.

    Making kgdb_breakpoint() as noinline solves this problem
    of code reording around break point instruction and also
    avoids problem of being called as inline function from
    other places

    More details about discussion on this can be found here
    http://comments.gmane.org/gmane.linux.ports.arm.kernel/269732

    Signed-off-by: Vijaya Kumar K
    Acked-by: Will Deacon
    Acked-by: Jason Wessel
    Signed-off-by: Catalin Marinas

    Vijaya Kumar K
     

25 Jan, 2014

1 commit

  • Some code added to the debug_core module had KDB dependencies
    that it shouldn't have. Move the KDB dependent REASON back to
    the caller to remove the dependency in the debug core code.

    Update the call from the UV NMI handler to conform to the new
    interface.

    Signed-off-by: Mike Travis
    Reviewed-by: Hedi Berriche
    Cc: Russ Anderson
    Cc: Jason Wessel
    Cc: Peter Zijlstra
    Cc: Paul Mackerras
    Cc: Arnaldo Carvalho de Melo
    Link: http://lkml.kernel.org/r/20140114162551.318251993@asylum.americas.sgi.com
    Signed-off-by: Ingo Molnar

    Mike Travis
     

04 Oct, 2013

1 commit

  • This patch adds a kgdb_nmicallin() interface that can be used by
    external NMI handlers to call the KGDB/KDB handler. The primary
    need for this is for those types of NMI interrupts where all the
    CPUs have already received the NMI signal. Therefore no
    send_IPI(NMI) is required, and in fact it will cause a 2nd
    unhandled NMI to occur. This generates the "Dazed and Confuzed"
    messages.

    Since all the CPUs are getting the NMI at roughly the same time,
    it's not guaranteed that the first CPU that hits the NMI handler
    will manage to enter KGDB and set the dbg_master_lock before the
    slaves start entering. The new argument "send_ready" was added
    for KGDB to signal the NMI handler to release the slave CPUs for
    entry into KGDB.

    Signed-off-by: Mike Travis
    Acked-by: Jason Wessel
    Reviewed-by: Dimitri Sivanich
    Reviewed-by: Hedi Berriche
    Cc: Peter Zijlstra
    Cc: Paul Mackerras
    Cc: Arnaldo Carvalho de Melo
    Link: http://lkml.kernel.org/r/20131002151417.928886849@asylum.americas.sgi.com
    Signed-off-by: Ingo Molnar

    Mike Travis
     

01 May, 2013

1 commit

  • Currently help message of /proc/sysrq-trigger highlight its upper-case
    characters, like below:

    SysRq : HELP : loglevel(0-9) reBoot Crash terminate-all-tasks(E)
    memory-full-oom-kill(F) kill-all-tasks(I) ...

    this would confuse user trigger sysrq by upper-case character, which is
    inconsistent with the real lower-case character registed key.

    This inconsistent help message will also lead more confused when
    26 upper-case letters put into use in future.

    This patch fix kgdb sysrq key: "debug(g)"

    Signed-off-by: zhangwei(Jovi)
    Cc: Jason Wessel
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    zhangwei(Jovi)
     

03 Mar, 2013

1 commit

  • Pull KGDB/KDB fixes and cleanups from Jason Wessel:
    "For a change we removed more code than we added. If people aren't
    using it we shouldn't be carrying it. :-)

    Cleanups:
    - Remove kdb ssb command - there is no in kernel disassembler to
    support it

    - Remove kdb ll command - Always caused a kernel oops and there were
    no bug reports so no one was using this command

    - Use kernel ARRAY_SIZE macro instead of array computations

    Fixes:
    - Stop oops in kdb if user executes kdb_defcmd with args

    - kdb help command truncated text

    - ppc64 support for kgdbts

    - Add missing kconfig option from original kdb port for dealing with
    catastrophic kernel crashes such that you can reboot automatically
    on continue from kdb"

    * tag 'for_linux-3.9' of git://git.kernel.org/pub/scm/linux/kernel/git/jwessel/kgdb:
    kdb: Remove unhandled ssb command
    kdb: Prevent kernel oops with kdb_defcmd
    kdb: Remove the ll command
    kdb_main: fix help print
    kdb: Fix overlap in buffers with strcpy
    Fixed dead ifdef block by adding missing Kconfig option.
    kdb: Setup basic kdb state before invoking commands via kgdb
    kdb: use ARRAY_SIZE where possible
    kgdb/kgdbts: support ppc64
    kdb: A fix for kdb command table expansion

    Linus Torvalds
     

02 Mar, 2013

8 commits

  • The 'ssb' command can only be handled when we have a disassembler, to check for
    branches, so remove the 'ssb' command for now.

    Signed-off-by: Vincent Stehlé
    Signed-off-by: Jason Wessel

    Vincent
     
  • The kdb_defcmd can only be used to display the available command aliases
    while using the kernel debug shell. If you try to define a new macro
    while the kernel debugger is active it will oops. The debug shell
    macros must use pre-allocated memory set aside at the time kdb_init()
    is run, and the kdb_defcmd is restricted to only working at the time
    that the kdb_init sequence is being run, which only occurs if you
    actually activate the kernel debugger.

    Signed-off-by: Jason Wessel

    Jason Wessel
     
  • Recently some code inspection was done after fixing a problem with
    kmalloc used while in the kernel debugger context (which is not
    legal), and it turned up the fact that kdb ll command will oops the
    kernel.

    Given that there have been zero bug reports on the command combined
    with the fact it will oops the kernel it is clearly not being used.
    Instead of fixing it, it will be removed.

    Signed-off-by: Jason Wessel

    Jason Wessel
     
  • The help command was chopping all the usage instructions such that
    they were not readable.

    Example:

    bta [D|R|S|T|C|Z|E|U|I| Backtrace all processes matching state flag
    per_cpu [] [ [] []
    Display per_cpu variables

    All that is needed is to check the how long the cmd_usage is and jump
    to the next line when appropriate.

    Signed-off-by: Jason Wessel

    Jason Wessel
     
  • Maxime reported that strcpy(s->usage, s->usage+1) has no definitive
    guarantee that it will work on all archs the same way when you have
    overlapping memory. The fix is simple for the kdb code because we
    still have the original string memory in the function scope, so we
    just have to use that as the argument instead.

    Reported-by: Maxime Villard
    Signed-off-by: Jason Wessel

    Jason Wessel
     
  • Although invasive kdb commands are not supported via kgdb, some useful
    non-invasive commands like bt* require basic kdb state to be setup before
    calling into the kdb code. Factor out some of this code and call it before
    and after executing kdb commands via kgdb.

    Signed-off-by: Matt Klein
    Signed-off-by: Jason Wessel

    Matt Klein
     
  • Signed-off-by: Sasha Levin
    Signed-off-by: Jason Wessel

    Sasha Levin
     
  • When locally adding in some additional kdb commands, I stumbled
    across an issue with the dynamic expansion of the kdb command table.
    When the number of kdb commands exceeds the size of the statically
    allocated kdb_base_commands[] array, additional space is allocated in
    the kdb_register_repeat() routine.

    The unused portion of the newly allocated array was not being initialized
    to zero properly and this would result in segfaults when help '?' was
    executed or when a search for a non-existing command would traverse the
    command table beyond the end of valid command entries and then attempt
    to use the non-zeroed area as actual command entries.

    Signed-off-by: John Blackwood
    Signed-off-by: Jason Wessel

    John Blackwood
     

05 Feb, 2013

1 commit


12 Jan, 2013

1 commit


13 Oct, 2012

1 commit

  • Pull KGDB/KDB fixes and cleanups from Jason Wessel:
    "Cleanups
    - Clean up compile warnings in kgdboc.c and x86/kernel/kgdb.c
    - Add module event hooks for simplified debugging with gdb
    Fixes
    - Fix kdb to stop paging with 'q' on bta and dmesg
    - Fix for data that scrolls off the vga console due to line wrapping
    when using the kdb pager
    New
    - The debug core registers for kernel module events which allows a
    kernel aware gdb to automatically load symbols and break on entry
    to a kernel module
    - Allow kgdboc=kdb to setup kdb on the vga console"

    * tag 'for_linus-3.7' of git://git.kernel.org/pub/scm/linux/kernel/git/jwessel/kgdb:
    tty/console: fix warnings in drivers/tty/serial/kgdboc.c
    kdb,vt_console: Fix missed data due to pager overruns
    kdb: Fix dmesg/bta scroll to quit with 'q'
    kgdboc: Accept either kbd or kdb to activate the vga + keyboard kdb shell
    kgdb,x86: fix warning about unused variable
    mips,kgdb: fix recursive page fault with CONFIG_KPROBES
    kgdb: Add module event hooks

    Linus Torvalds
     

12 Oct, 2012

3 commits

  • It is possible to miss data when using the kdb pager. The kdb pager
    does not pay attention to the maximum column constraint of the screen
    or serial terminal. This result is not incrementing the shown lines
    correctly and the pager will print more lines that fit on the screen.
    Obviously that is less than useful when using a VGA console where you
    cannot scroll back.

    The pager will now look at the kdb_buffer string to see how many
    characters are printed. It might not be perfect considering you can
    output ASCII that might move the cursor position, but it is a
    substantially better approximation for viewing dmesg and trace logs.

    This also means that the vt screen needs to set the kdb COLUMNS
    variable.

    Cc:
    Signed-off-by: Jason Wessel

    Jason Wessel
     
  • If you press 'q' the pager should exit instead of printing everything
    from dmesg which can really bog down a 9600 baud serial link.

    The same is true for the bta command.

    Signed-off-by: Jason Wessel

    Jason Wessel
     
  • Allow gdb to auto load kernel modules when it is attached,
    which makes it trivially easy to debug module init functions
    or pre-set breakpoints in a kernel module that has not loaded yet.

    Signed-off-by: Jason Wessel

    Jason Wessel
     

27 Sep, 2012

2 commits

  • This command disables NMI-entry. If NMI source has been previously shared
    with a serial console ("debug port"), this effectively releases the port
    from KDB exclusive use, and makes the console available for normal use.

    Of course, NMI can be reenabled, enable_nmi modparam is used for that:

    echo 1 > /sys/module/kdb/parameters/enable_nmi

    Signed-off-by: Anton Vorontsov
    Acked-by: Jason Wessel
    Signed-off-by: Greg Kroah-Hartman

    Anton Vorontsov
     
  • The new arch callback should manage NMIs that usually cause KGDB to
    enter. That is, not all NMIs should be enabled/disabled, but only
    those that issue kgdb_handle_exception().

    We must mask it as serial-line interrupt can be used as an NMI, so
    if the original KGDB-entry cause was say a breakpoint, then every
    input to KDB console will cause KGDB to reenter, which we don't want.

    Signed-off-by: Anton Vorontsov
    Acked-by: Jason Wessel
    Signed-off-by: Greg Kroah-Hartman

    Anton Vorontsov
     

31 Jul, 2012

3 commits


22 Jul, 2012

3 commits


05 Apr, 2012

1 commit

  • Pull KGDB/KDB regression fixes from Jason Wessel:
    - Fix a Smatch warning that appeared in the 3.4 merge window
    - Fix kgdb test suite with SMP for all archs without HW single stepping
    - Fix kgdb sw breakpoints with CONFIG_DEBUG_RODATA=y limitations on x86
    - Fix oops on kgdb test suite with CONFIG_DEBUG_RODATA
    - Fix kgdb test suite with SMP for all archs with HW single stepping

    * tag 'for_linus-3.4-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/jwessel/kgdb:
    x86,kgdb: Fix DEBUG_RODATA limitation using text_poke()
    kgdb,debug_core: pass the breakpoint struct instead of address and memory
    kgdbts: (2 of 2) fix single step awareness to work correctly with SMP
    kgdbts: (1 of 2) fix single step awareness to work correctly with SMP
    kgdbts: Fix kernel oops with CONFIG_DEBUG_RODATA
    kdb: Fix smatch warning on dbg_io_ops->is_console

    Linus Torvalds
     

30 Mar, 2012

2 commits

  • There is extra state information that needs to be exposed in the
    kgdb_bpt structure for tracking how a breakpoint was installed. The
    debug_core only uses the the probe_kernel_write() to install
    breakpoints, but this is not enough for all the archs. Some arch such
    as x86 need to use text_poke() in order to install a breakpoint into a
    read only page.

    Passing the kgdb_bpt structure to kgdb_arch_set_breakpoint() and
    kgdb_arch_remove_breakpoint() allows other archs to set the type
    variable which indicates how the breakpoint was installed.

    Cc: stable@vger.kernel.org # >= 2.6.36
    Signed-off-by: Jason Wessel

    Jason Wessel
     
  • The Smatch tool warned that the change from commit b8adde8dd
    (kdb: Avoid using dbg_io_ops until it is initialized) should
    add another null check later in the kdb_printf().

    It is worth noting that the second use of dbg_io_ops->is_console
    is protected by the KDB_PAGER state variable which would only
    get set when kdb is fully active and initialized. If we
    ever encounter changes or defects in the KDB_PAGER state
    we do not want to crash the kernel in a kdb_printf/printk.

    CC: Tim Bird
    Reported-by: Dan Carpenter
    Signed-off-by: Jason Wessel

    Jason Wessel
     

29 Mar, 2012

2 commits

  • …m/linux/kernel/git/dhowells/linux-asm_system

    Pull "Disintegrate and delete asm/system.h" from David Howells:
    "Here are a bunch of patches to disintegrate asm/system.h into a set of
    separate bits to relieve the problem of circular inclusion
    dependencies.

    I've built all the working defconfigs from all the arches that I can
    and made sure that they don't break.

    The reason for these patches is that I recently encountered a circular
    dependency problem that came about when I produced some patches to
    optimise get_order() by rewriting it to use ilog2().

    This uses bitops - and on the SH arch asm/bitops.h drags in
    asm-generic/get_order.h by a circuituous route involving asm/system.h.

    The main difficulty seems to be asm/system.h. It holds a number of
    low level bits with no/few dependencies that are commonly used (eg.
    memory barriers) and a number of bits with more dependencies that
    aren't used in many places (eg. switch_to()).

    These patches break asm/system.h up into the following core pieces:

    (1) asm/barrier.h

    Move memory barriers here. This already done for MIPS and Alpha.

    (2) asm/switch_to.h

    Move switch_to() and related stuff here.

    (3) asm/exec.h

    Move arch_align_stack() here. Other process execution related bits
    could perhaps go here from asm/processor.h.

    (4) asm/cmpxchg.h

    Move xchg() and cmpxchg() here as they're full word atomic ops and
    frequently used by atomic_xchg() and atomic_cmpxchg().

    (5) asm/bug.h

    Move die() and related bits.

    (6) asm/auxvec.h

    Move AT_VECTOR_SIZE_ARCH here.

    Other arch headers are created as needed on a per-arch basis."

    Fixed up some conflicts from other header file cleanups and moving code
    around that has happened in the meantime, so David's testing is somewhat
    weakened by that. We'll find out anything that got broken and fix it..

    * tag 'split-asm_system_h-for-linus-20120328' of git://git.kernel.org/pub/scm/linux/kernel/git/dhowells/linux-asm_system: (38 commits)
    Delete all instances of asm/system.h
    Remove all #inclusions of asm/system.h
    Add #includes needed to permit the removal of asm/system.h
    Move all declarations of free_initmem() to linux/mm.h
    Disintegrate asm/system.h for OpenRISC
    Split arch_align_stack() out from asm-generic/system.h
    Split the switch_to() wrapper out of asm-generic/system.h
    Move the asm-generic/system.h xchg() implementation to asm-generic/cmpxchg.h
    Create asm-generic/barrier.h
    Make asm-generic/cmpxchg.h #include asm-generic/cmpxchg-local.h
    Disintegrate asm/system.h for Xtensa
    Disintegrate asm/system.h for Unicore32 [based on ver #3, changed by gxt]
    Disintegrate asm/system.h for Tile
    Disintegrate asm/system.h for Sparc
    Disintegrate asm/system.h for SH
    Disintegrate asm/system.h for Score
    Disintegrate asm/system.h for S390
    Disintegrate asm/system.h for PowerPC
    Disintegrate asm/system.h for PA-RISC
    Disintegrate asm/system.h for MN10300
    ...

    Linus Torvalds
     
  • Remove all #inclusions of asm/system.h preparatory to splitting and killing
    it. Performed with the following command:

    perl -p -i -e 's!^#\s*include\s*.*\n!!' `grep -Irl '^#\s*include\s*' *`

    Signed-off-by: David Howells

    David Howells
     

24 Mar, 2012

1 commit

  • Pull KGDB/KDB updates from Jason Wessel:
    "Fixes:
    - Fix KDB keyboard repeat scan codes and leaked keyboard events
    - Fix kernel crash with kdb_printf() for users who compile new
    kdb_printf()'s in early code
    - Return all segment registers to gdb on x86_64

    Features:
    - KDB/KGDB hook the reboot notifier and end user can control if it
    stops, detaches or does nothing (updated docs as well)
    - Notify users who use CONFIG_DEBUG_RODATA to use hw breakpoints"

    * tag 'for_linus-3.4-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/jwessel/kgdb:
    kdb: Add message about CONFIG_DEBUG_RODATA on failure to install breakpoint
    kdb: Avoid using dbg_io_ops until it is initialized
    kgdb,debug_core: add the ability to control the reboot notifier
    KDB: Fix usability issues relating to the 'enter' key.
    kgdb,debug-core,gdbstub: Hook the reboot notifier for debugger detach
    kgdb: Respect that flush op is optional
    kgdb: x86: Return all segment registers also in 64-bit mode

    Linus Torvalds
     

23 Mar, 2012

6 commits

  • On x86, if CONFIG_DEBUG_RODATA is set, one cannot set breakpoints
    via KDB. Apparently this is a well-known problem, as at least one distribution
    now ships with both KDB enabled and CONFIG_DEBUG_RODATA=y for security reasons.

    This patch adds an printk message to the breakpoint failure case,
    in order to provide suggestions about how to use the debugger.

    Reported-by: Tim Bird
    Signed-off-by: Jason Wessel
    Acked-by: Tim Bird

    Jason Wessel
     
  • This fixes a bug with setting a breakpoint during kdb initialization
    (from kdb_cmds). Any call to kdb_printf() before the initialization
    of the kgdboc serial console driver (which happens much later during
    bootup than kdb_init), results in kernel panic due to the use of
    dbg_io_ops before it is initialized.

    Signed-off-by: Tim Bird
    Signed-off-by: Jason Wessel

    Tim Bird
     
  • Sometimes it is desirable to stop the kernel debugger before allowing
    a system to reboot either with kdb or kgdb. This patch adds the
    ability to turn the reboot notifier on and off or enter the debugger
    and stop kernel execution before rebooting.

    It is possible to change the setting after booting the kernel with the
    following:

    echo 1 > /sys/module/debug_core/parameters/kgdbreboot

    It is also possible to change this setting using kdb / kgdb to
    manipulate the variable directly.

    Using KDB:
    mm kgdbreboot 1

    Using gdb:
    set kgdbreboot=1

    Reported-by: Jan Kiszka
    Signed-off-by: Jason Wessel

    Jason Wessel
     
  • This fixes the following problems:
    1) Typematic-repeat of 'enter' gives warning message
    and leaks make/break if KDB exits. Repeats
    look something like 0x1c 0x1c .... 0x9c
    2) Use of 'keypad enter' gives warning message and
    leaks the ENTER break/make code out if KDB exits.
    KP ENTER repeats look someting like 0xe0 0x1c
    0xe0 0x1c ... 0xe0 0x9c.
    3) Lag on the order of seconds between "break" and "make" when
    expecting the enter "break" code. Seen under virtualized
    environments such as VMware ESX.

    The existing special enter handler tries to glob the enter break code,
    but this fails if the other (KP) enter was used, or if there was a key
    repeat. It also fails if you mashed some keys along with enter, and
    you ended up with a non-enter make or non-enter break code coming
    after the enter make code. So first, we modify the handler to handle
    these cases. But performing these actions on every enter is annoying
    since now you can't hold ENTER down to scroll d messages in
    KDB. Since this special behaviour is only necessary to handle the
    exiting KDB ('g' + ENTER) without leaking scancodes to the OS. This
    cleanup needs to get executed anytime the kdb_main loop exits.

    Tested on QEMU. Set a bp on atkbd.c to verify no scan code was leaked.

    Cc: Andrei Warkentin
    [jason.wessel@windriver.com: move cleanup calls to kdb_main.c]
    Signed-off-by: Andrei Warkentin
    Signed-off-by: Jason Wessel

    Andrei Warkentin
     
  • The gdbstub and kdb should get detached if the system is rebooting.
    Calling gdbstub_exit() will set the proper debug core state and send a
    message to any debugger that is connected to correctly detach.

    An attached debugger will receive the exit code from
    include/linux/reboot.h based on SYS_HALT, SYS_REBOOT, etc...

    Reported-by: Jan Kiszka
    Signed-off-by: Jason Wessel

    Jason Wessel
     
  • Not all kgdb I/O drivers implement a flush operation. Adjust
    gdbstub_exit accordingly.

    Signed-off-by: Jan Kiszka
    Signed-off-by: Jason Wessel

    Jan Kiszka