13 Jan, 2012

1 commit

  • module_ref contains two "unsigned int" fields.

    Thats now too small, since some machines can open more than 2^32 files.

    Check commit 518de9b39e8 (fs: allow for more than 2^31 files) for
    reference.

    We can add an aligned(2 * sizeof(unsigned long)) attribute to force
    alloc_percpu() allocating module_ref areas in single cache lines.

    Signed-off-by: Eric Dumazet
    CC: Rusty Russell
    CC: Tejun Heo
    CC: Robin Holt
    CC: David Miller
    Signed-off-by: Rusty Russell

    Eric Dumazet
     

12 Dec, 2011

1 commit


01 Nov, 2011

1 commit


02 Aug, 2011

4 commits

  • The first packet that gdb sends when the kernel is in kdb mode seems
    to change with every release of gdb. Instead of continuing to add
    many different gdb packets, change kdb to automatically look for any
    thing that looks like a gdb packet.

    Example 1 cold start test:
    echo g > /proc/sysrq-trigger
    $D#44+

    Example 2 cold start test:
    echo g > /proc/sysrq-trigger
    $3#33

    The second one should re-enter kdb's shell right away and is purely a
    test.

    Signed-off-by: Jason Wessel

    Jason Wessel
     
  • The DOING_KGDB2 was originally a state variable for one of the two
    ways to automatically transition from kdb to kgdb. Purge all these
    variables and just use one single state for the transition.

    Signed-off-by: Jason Wessel

    Jason Wessel
     
  • When switching from kdb mode to kgdb mode packets were getting lost
    depending on the size of the fifo queue of the serial chip. When gdb
    initially connects if it is in kdb mode it should entirely send any
    character buffer over to the gdbstub when switching connections.

    Previously kdb was zero'ing out the character buffer and this could
    lead to gdb failing to connect at all, or a lengthy pause could occur
    on the initial connect.

    Signed-off-by: Jason Wessel

    Jason Wessel
     
  • The BTARGS and BTSYMARG variables do not have any function in the
    mainline version of kdb.

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

    Jason Wessel
     

31 Mar, 2011

1 commit


26 Mar, 2011

2 commits


23 Dec, 2010

1 commit


18 Nov, 2010

2 commits


02 Nov, 2010

1 commit

  • "gadget", "through", "command", "maintain", "maintain", "controller", "address",
    "between", "initiali[zs]e", "instead", "function", "select", "already",
    "equal", "access", "management", "hierarchy", "registration", "interest",
    "relative", "memory", "offset", "already",

    Signed-off-by: Uwe Kleine-König
    Signed-off-by: Jiri Kosina

    Uwe Kleine-König
     

30 Oct, 2010

2 commits

  • The kdb_current legally be equal to NULL in the early boot of the x86
    arch. The problem pcan be observed by booting with the kernel arguments:

    earlyprintk=vga ekgdboc=kbd kgdbwait

    The kdb shell will oops on entry and recursively fault because it
    cannot get past the final stage of shell initialization.

    Signed-off-by: Jason Wessel

    Jason Wessel
     
  • Rusty pointed out that the per_cpu command uses up lots of space on
    the stack and the cpu supress mask is probably not needed.

    This patch removes the need for the supress mask as well as fixing up
    the following problems with the kdb per_cpu command:
    * The per_cpu command should allow an address as an argument
    * When you have more data than can be displayed on one screen allow
    the user to break out of the print loop.

    Reported-by: Rusty Russell
    Signed-off-by: Jason Wessel

    Jason Wessel
     

23 Oct, 2010

4 commits

  • The kdb shell needs to enforce switching back to the original CPU that
    took the exception before restoring normal kernel execution. Resuming
    from a different CPU than what took the original exception will cause
    problems with spin locks that are freed from the a different processor
    than had taken the lock.

    The special logic in dbg_cpu_switch() can go away entirely with
    because the state of what cpus want to be masters or slaves will
    remain unchanged between entry and exit of the debug_core exception
    context.

    Signed-off-by: Jason Wessel

    Jason Wessel
     
  • Fix the following sparse warnings:

    kdb_main.c:328:5: warning: symbol 'kdbgetu64arg' was not declared. Should it be static?
    kgdboc.c:246:12: warning: symbol 'kgdboc_early_init' was not declared. Should it be static?
    kgdb.c:652:26: warning: incorrect type in argument 1 (different address spaces)
    kgdb.c:652:26: expected void const *ptr
    kgdb.c:652:26: got struct perf_event *[noderef] *pev

    The one in kgdb.c required the (void * __force) because of the return
    code from register_wide_hw_breakpoint looking like:

    return (void __percpu __force *)ERR_PTR(err);

    Signed-off-by: Jason Wessel

    Jason Wessel
     
  • Nothing should try to use kdb_commands directly as sometimes it is
    null. Instead, use the for_each_kdbcmd() iterator.

    This particular problem dates back to the initial kdb merge (2.6.35),
    but at that point nothing was dynamically unregistering commands from
    the kdb shell.

    Signed-off-by: Jason Wessel

    Jason Wessel
     
  • In order to allow kernel modules to dynamically add a command to the
    kdb shell the kdb_register, kdb_register_repeat, kdb_unregister, and
    kdb_printf need to be exported as GPL symbols.

    Any kernel module that adds a dynamic kdb shell function should only
    need to include linux/kdb.h.

    Signed-off-by: Jason Wessel

    Jason Wessel
     

09 Sep, 2010

1 commit


05 Sep, 2010

1 commit


29 Aug, 2010

1 commit

  • * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input:
    Input: pxa27x_keypad - remove input_free_device() in pxa27x_keypad_remove()
    Input: mousedev - fix regression of inverting axes
    Input: uinput - add devname alias to allow module on-demand load
    Input: hil_kbd - fix compile error
    USB: drop tty argument from usb_serial_handle_sysrq_char()
    Input: sysrq - drop tty argument form handle_sysrq()
    Input: sysrq - drop tty argument from sysrq ops handlers

    Linus Torvalds
     

21 Aug, 2010

1 commit

  • Sysrq operations do not accept tty argument anymore so no need to pass
    it to us.

    [Stephen Rothwell : fix build breakage in drm code
    caused by sysrq using bool but not including linux/types.h]

    [Sachin Sant : fix build breakage in s390 keyboadr
    driver]

    Acked-by: Alan Cox
    Acked-by: Jason Wessel
    Acked-by: Greg Kroah-Hartman
    Signed-off-by: Dmitry Torokhov

    Dmitry Torokhov
     

17 Aug, 2010

1 commit

  • If CONFIG_KGDB_KDB is set and CONFIG_KALLSYMS is not set the kernel
    will fail to build with the error:

    kernel/built-in.o: In function `kallsyms_symbol_next':
    kernel/debug/kdb/kdb_support.c:237: undefined reference to `kdb_walk_kallsyms'
    kernel/built-in.o: In function `kallsyms_symbol_complete':
    kernel/debug/kdb/kdb_support.c:193: undefined reference to `kdb_walk_kallsyms'

    The kdb_walk_kallsyms needs a #ifdef proper header to match the C
    implementation. This patch also fixes the compiler warnings in
    kdb_support.c when compiling without CONFIG_KALLSYMS set. The
    compiler warnings are a result of the kallsyms_lookup() macro not
    initializing the two of the pass by reference variables.

    Signed-off-by: Jason Wessel
    Reported-by: Michal Simek

    Jason Wessel
     

07 Aug, 2010

1 commit

  • …x/kernel/git/tip/linux-2.6-tip

    * 'timers-timekeeping-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip:
    um: Fix read_persistent_clock fallout
    kgdb: Do not access xtime directly
    powerpc: Clean up obsolete code relating to decrementer and timebase
    powerpc: Rework VDSO gettimeofday to prevent time going backwards
    clocksource: Add __clocksource_updatefreq_hz/khz methods
    x86: Convert common clocksources to use clocksource_register_hz/khz
    timekeeping: Make xtime and wall_to_monotonic static
    hrtimer: Cleanup direct access to wall_to_monotonic
    um: Convert to use read_persistent_clock
    timkeeping: Fix update_vsyscall to provide wall_to_monotonic offset
    powerpc: Cleanup xtime usage
    powerpc: Simplify update_vsyscall
    time: Kill off CONFIG_GENERIC_TIME
    time: Implement timespec_add
    x86: Fix vtime/file timestamp inconsistencies

    Trivial conflicts in Documentation/feature-removal-schedule.txt

    Much less trivial conflicts in arch/powerpc/kernel/time.c resolved as
    per Thomas' earlier merge commit 47916be4e28c ("Merge branch
    'powerpc.cherry-picks' into timers/clocksource")

    Linus Torvalds
     

05 Aug, 2010

2 commits

  • The kernel console interface stores the number of lines it is
    configured to use. The kdb debugger can greatly benefit by knowing how
    many lines there are on the console for the pager functionality
    without having the end user compile in the setting or have to
    repeatedly change it at run time.

    Signed-off-by: Jason Wessel
    Signed-off-by: Jesse Barnes
    CC: David Airlie
    CC: Andrew Morton

    Jason Wessel
     
  • The kdb shell specification includes the ability to get and set
    architecture specific registers by name.

    For the time being individual register get and set will be implemented
    on a per architecture basis. If an architecture defines
    DBG_MAX_REG_NUM > 0 then kdb and the gdbstub will use the capability
    for individually getting and setting architecture specific registers.

    Signed-off-by: Jason Wessel

    Jason Wessel
     

29 Jul, 2010

1 commit


22 Jul, 2010

3 commits


05 Jun, 2010

1 commit


21 May, 2010

6 commits

  • Certain calls from the kdb shell will call out to printk(), and any of
    these calls should get vectored back to the kdb_printf() so that the
    kdb pager and processing can be used, as well as to properly channel
    I/O to the polled I/O devices.

    CC: Randy Dunlap
    Signed-off-by: Jason Wessel
    Acked-by: Andrew Morton

    Jason Wessel
     
  • If kdb is open on a serial port that is not actually a console make
    sure to call the poll routines to emit and receive characters.

    Signed-off-by: Jason Wessel
    Acked-by: Martin Hicks

    Jason Wessel
     
  • This patch adds in the kdb PS/2 keyboard driver. This was mostly a
    direct port from the original kdb where I cleaned up the code against
    checkpatch.pl and added the glue to stitch it into kgdb.

    This patch also enables early kdb debug via kgdbwait and the keyboard.

    All the access to configure kdb using either a serial console or the
    keyboard is done via kgdboc.

    If you want to use only the keyboard and want to break in early you
    would add to your kernel command arguments:

    kgdboc=kbd kgdbwait

    If you wanted serial and or the keyboard access you could use:

    kgdboc=kbd,ttyS0

    You can also configure kgdboc as a kernel module or at run time with
    the sysfs where you can activate and deactivate kgdb.

    Turn it on:
    echo kbd,ttyS0 > /sys/module/kgdboc/parameters/kgdboc

    Turn it off:
    echo "" > /sys/module/kgdboc/parameters/kgdboc

    Signed-off-by: Jason Wessel
    Reviewed-by: Dmitry Torokhov

    Jason Wessel
     
  • One of the driving forces behind integrating another front end (kdb)
    to the debug core is to allow front end commands to be accessible via
    gdb's monitor command. It is true that you could write gdb macros to
    get certain data, but you may want to just use gdb to access the
    commands that are available in the kdb front end.

    This patch implements the Rcmd gdb stub packet. In gdb you access
    this with the "monitor" command. For instance you could type "monitor
    help", "monitor lsmod" or "monitor ps A" etc...

    There is no error checking or command restrictions on what you can and
    cannot access at this point. Doing something like trying to set
    breakpoints with the monitor command is going to cause nothing but
    problems. Perhaps in the future only the commands that are actually
    known to work with the gdb monitor command will be available.

    Signed-off-by: Jason Wessel

    Jason Wessel
     
  • The design of the kdb shell requires that every device that can
    provide input to kdb have a polling routine that exits immediately if
    there is no character available. This is required in order to get the
    page scrolling mechanism working.

    Changing the kernel debugger I/O API to require all polling character
    routines to exit immediately if there is no data allows the kernel
    debugger to process multiple input channels.

    NO_POLL_CHAR will be the return code to the polling routine when ever
    there is no character available.

    CC: linux-serial@vger.kernel.org
    Signed-off-by: Jason Wessel

    Jason Wessel
     
  • This patch contains only the kdb core. Because the change set was
    large, it was split. The next patch in the series includes the
    instrumentation into the core kernel which are mainly helper functions
    for kdb.

    This work is directly derived from kdb v4.4 found at:

    ftp://oss.sgi.com/projects/kdb/download/v4.4/

    The kdb internals have been re-organized to make them mostly platform
    independent and to connect everything to the debug core which is used by
    gdbstub (which has long been known as kgdb).

    The original version of kdb was 58,000 lines worth of changes to
    support x86. From that implementation only the kdb shell, and basic
    commands for memory access, runcontrol, lsmod, and dmesg where carried
    forward.

    This is a generic implementation which aims to cover all the current
    architectures using the kgdb core: ppc, arm, x86, mips, sparc, sh and
    blackfin. More archictectures can be added by implementing the
    architecture specific kgdb functions.

    [mort@sgi.com: Compile fix with hugepages enabled]
    [mort@sgi.com: Clean breakpoint code renaming kdba_ -> kdb_]
    [mort@sgi.com: fix new line after printing registers]
    [mort@sgi.com: Remove the concept of global vs. local breakpoints]
    [mort@sgi.com: Rework kdb_si_swapinfo to use more generic name]
    [mort@sgi.com: fix the information dump macros, remove 'arch' from the names]
    [sfr@canb.auug.org.au: include fixup to include linux/slab.h]

    CC: linux-arch@vger.kernel.org
    Signed-off-by: Jason Wessel
    Signed-off-by: Martin Hicks

    Jason Wessel