[PATCH v3 12/13] scripts/gdb: Add internal helper and convenience function for per-cpu lookup

2012-11-27 Thread Jan Kiszka
This function allows to obtain a per-cpu variable, either of the current or an explicitly specified CPU. Note: sparc64 version is untested. CC: "David S. Miller" CC: sparcli...@vger.kernel.org Signed-off-by: Jan Kiszka --- scripts/gdb/percpu.py

[PATCH v3 02/13] scripts/gdb: Add container_of helper and convenience function

2012-11-27 Thread Jan Kiszka
Provide an internal helper with container_of semantics. As type lookups are very slow in gdb-python and we need a type "long" for this, cache the reference to this type object. Then export the helper also as a convenience function form use at the gdb command line. Signed-off-by:

[PATCH v3 01/13] scripts/gdb: Add infrastructure

2012-11-27 Thread Jan Kiszka
ess the version string returned by gdb as some distros tend to prefix it with their name. This feature depends on CONFIG_DEBUG_INFO. CC: Michal Marek CC: linux-kbu...@vger.kernel.org Signed-off-by: Jan Kiszka --- Makefile |5 - scripts/Makefile |3 ++- scri

[PATCH v3 00/13] Add gdb python scripts as kernel debugging helpers

2012-11-27 Thread Jan Kiszka
Kay Sievers CC: linux-i...@vger.kernel.org CC: linux-kbu...@vger.kernel.org CC: Michal Marek CC: sparcli...@vger.kernel.org CC: Tony Luck Jan Kiszka (13): scripts/gdb: Add infrastructure scripts/gdb: Add container_of helper and convenience function scripts/gdb: Add lx-symbols command scripts/gdb: Add get

[PATCH v3 13/13] scripts/gdb: Add lx_current convenience function

2012-11-27 Thread Jan Kiszka
This is a shorthand for *$lx_per_cpu("current_task"), i.e. a convenience function to retrieve the currently running task of the active context. Signed-off-by: Jan Kiszka --- scripts/gdb/percpu.py | 15 +++ 1 files changed, 15 insertions(+), 0 deletions(-) diff --git a/s

[PATCH v3 11/13] scripts/gdb: Add get_gdbserver_type helper

2012-11-27 Thread Jan Kiszka
This helper probes the type of the gdb server. Supported are QEMU and KGDB so far. Knowledge about the gdb server is required e.g. to retrieve the current CPU or current task. Signed-off-by: Jan Kiszka --- scripts/gdb/utils.py | 35 +++ 1 files changed, 35

[PATCH v3 10/13] scripts/gdb: Add internal helper and convenience function to retrieve thread_info

2012-11-27 Thread Jan Kiszka
Add the internal helper get_thread_info that calculated the thread_info from a given task variable. Also export this service as a convenience function. Note: ia64 version is untested. CC: Tony Luck CC: Fenghua Yu CC: linux-i...@vger.kernel.org Signed-off-by: Jan Kiszka --- scripts/gdb

[PATCH v3 04/13] scripts/gdb: Add get_target_endianness helper

2012-11-27 Thread Jan Kiszka
Parse the target endianness from the output of "show endian" and cache the result to return it via the new helper get_target_endiannes. We will need it for reading integers from buffers that contain target memory. Signed-off-by: Jan Kiszka --- scripts/gdb/utils.py | 17 ++

[PATCH v3 07/13] scripts/gdb: Add task iteration helper

2012-11-27 Thread Jan Kiszka
The internal helper for_each_task iterates over all tasks of the target, calling the provided function on each. For performance reasons, we cache a reference to the gdb type object of a task. Signed-off-by: Jan Kiszka --- scripts/gdb/task.py | 40 1

[PATCH v3 08/13] scripts/gdb: Add helper and convenience function to look up tasks

2012-11-27 Thread Jan Kiszka
Add the helper task_by_pid that can look up a task by its PID. Also export it as a convenience function. Signed-off-by: Jan Kiszka --- scripts/gdb/task.py| 29 + scripts/gdb/vmlinux-gdb.py |1 + 2 files changed, 30 insertions(+), 0 deletions(-) diff

[PATCH v3 03/13] scripts/gdb: Add lx-symbols command

2012-11-27 Thread Jan Kiszka
odule files found during lx-symbols execution. This way, breakpoints can be set to module initialization functions, and there is usually no need to explicitly call lx-symbols after (re-)loading a module. Signed-off-by: Jan Kiszka --- scripts/gdb/symbols.py |

[PATCH v3 06/13] scripts/gdb: Add lx-dmesg command

2012-11-27 Thread Jan Kiszka
This pokes into the log buffer of the debugged kernel, dumping it to the gdb console. Helping in case the target should or can no longer execute dmesg itself. CC: Kay Sievers Signed-off-by: Jan Kiszka --- scripts/gdb/dmesg.py | 63 scripts

[PATCH v3 05/13] scripts/gdb: Add read_u16/32/64 helpers

2012-11-27 Thread Jan Kiszka
Add helpers for reading integers from target memory buffers. Required when caching the memory access is more efficient than reading individual values via gdb. Signed-off-by: Jan Kiszka --- scripts/gdb/utils.py | 18 ++ 1 files changed, 18 insertions(+), 0 deletions(-) diff

[PATCH v3 09/13] scripts/gdb: Add is_target_arch helper

2012-11-27 Thread Jan Kiszka
This helper caches to result of "show architecture" and matches the provided arch (sub-)string against that output. Signed-off-by: Jan Kiszka --- scripts/gdb/utils.py |9 + 1 files changed, 9 insertions(+), 0 deletions(-) diff --git a/scripts/gdb/utils.py b/scripts/gd

Re: [PATCH] x86: correctly initialize the CS base on reset

2013-03-19 Thread Jan Kiszka
On 2013-03-19 16:43, Gleb Natapov wrote: > On Tue, Mar 19, 2013 at 04:30:26PM +0100, Paolo Bonzini wrote: >> The CS base was initialized to 0 on VMX (wrong, but usually overridden >> by userspace before starting) or 0xf on SVM. The correct value is >> 0x, and VMX is able to emulate it

[PATCH v6 20/20] scripts/gdb: Add basic documentation

2013-02-06 Thread Jan Kiszka
CC: Rob Landley CC: linux-...@vger.kernel.org Signed-off-by: Jan Kiszka --- Just to close the request Boris had regarding help on the commands. Changes in v6: - explain how to obtain help on commands and functions - minor wording fixes Documentation/gdb-kernel-debugging.txt | 158

[PATCH v5 02/20] scripts/gdb: Add cache for type objects

2013-01-29 Thread Jan Kiszka
Type lookups are very slow in gdb-python which is often noticeable when iterating over a number of objects. Introduce the helper class CachedType that keeps a reference to a gdb.Type object but also refreshes it after an object file has been loaded. Signed-off-by: Jan Kiszka --- scripts/gdb

[PATCH v5 06/20] scripts/gdb: Add internal helper and convenience function to look up a module

2013-01-29 Thread Jan Kiszka
Add the internal helper get_module_by_name to obtain the module structure corresponding to the given name. Also export this service as a convenience function. Signed-off-by: Jan Kiszka --- scripts/gdb/module.py | 30 ++ scripts/gdb/vmlinux-gdb.py |1 + 2

[PATCH v5 11/20] scripts/gdb: Add task iteration helper

2013-01-29 Thread Jan Kiszka
The internal helper for_each_task iterates over all tasks of the target, calling the provided function on each. Signed-off-by: Jan Kiszka --- scripts/gdb/task.py | 35 +++ 1 files changed, 35 insertions(+), 0 deletions(-) create mode 100644 scripts/gdb/task.py

[PATCH v5 13/20] scripts/gdb: Add is_target_arch helper

2013-01-29 Thread Jan Kiszka
This helper caches to result of "show architecture" and matches the provided arch (sub-)string against that output. Signed-off-by: Jan Kiszka --- scripts/gdb/utils.py |9 + 1 files changed, 9 insertions(+), 0 deletions(-) diff --git a/scripts/gdb/utils.py b/scripts/gd

[PATCH v5 19/20] scripts/gdb: Add lx-lsmod command

2013-01-29 Thread Jan Kiszka
This adds a lsmod-like command to list all currently loaded modules of the target. Signed-off-by: Jan Kiszka --- scripts/gdb/module.py | 43 +++ 1 files changed, 43 insertions(+), 0 deletions(-) diff --git a/scripts/gdb/module.py b/scripts/gdb

[PATCH v5 20/20] scripts/gdb: Add basic documentation

2013-01-29 Thread Jan Kiszka
CC: Rob Landley CC: linux-...@vger.kernel.org Signed-off-by: Jan Kiszka --- Documentation/gdb-kernel-debugging.txt | 155 1 files changed, 155 insertions(+), 0 deletions(-) create mode 100644 Documentation/gdb-kernel-debugging.txt diff --git a/Documentation

[PATCH v5 18/20] scripts/gdb: Add helper to iterate over CPU masks

2013-01-29 Thread Jan Kiszka
Will be used first to count module references. It is optimized to read the mask only once per stop and to minimize the loop lengths. Signed-off-by: Jan Kiszka --- scripts/gdb/percpu.py | 33 + 1 files changed, 33 insertions(+), 0 deletions(-) diff --git a

[PATCH v5 10/20] scripts/gdb: Add lx-dmesg command

2013-01-29 Thread Jan Kiszka
This pokes into the log buffer of the debugged kernel, dumping it to the gdb console. Helping in case the target should or can no longer execute dmesg itself. CC: Kay Sievers Signed-off-by: Jan Kiszka --- scripts/gdb/dmesg.py | 63 scripts

[PATCH v5 15/20] scripts/gdb: Add get_gdbserver_type helper

2013-01-29 Thread Jan Kiszka
This helper probes the type of the gdb server. Supported are QEMU and KGDB so far. Knowledge about the gdb server is required e.g. to retrieve the current CPU or current task. Signed-off-by: Jan Kiszka --- scripts/gdb/utils.py | 35 +++ 1 files changed, 35

[PATCH v5 14/20] scripts/gdb: Add internal helper and convenience function to retrieve thread_info

2013-01-29 Thread Jan Kiszka
Add the internal helper get_thread_info that calculated the thread_info from a given task variable. Also export this service as a convenience function. Note: ia64 version is untested. CC: Tony Luck CC: Fenghua Yu CC: linux-i...@vger.kernel.org Signed-off-by: Jan Kiszka --- scripts/gdb

[PATCH v5 00/20] Add gdb python scripts as kernel debugging helpers

2013-01-29 Thread Jan Kiszka
. Jan CC: "David S. Miller" CC: Fenghua Yu CC: Kay Sievers CC: linux-...@vger.kernel.org CC: linux-i...@vger.kernel.org CC: linux-kbu...@vger.kernel.org CC: Michal Marek CC: Rob Landley CC: sparcli...@vger.kernel.org CC: Tony Luck Jan Kiszka (20): scripts/gdb: Add infrastructure s

[PATCH v5 01/20] scripts/gdb: Add infrastructure

2013-01-29 Thread Jan Kiszka
ess the version string returned by gdb as some distros tend to prefix it with their name. This feature depends on CONFIG_DEBUG_INFO. CC: Michal Marek CC: linux-kbu...@vger.kernel.org Signed-off-by: Jan Kiszka --- Makefile |5 - scripts/Makefile |3 ++- scri

[PATCH v5 17/20] scripts/gdb: Add lx_current convenience function

2013-01-29 Thread Jan Kiszka
This is a shorthand for *$lx_per_cpu("current_task"), i.e. a convenience function to retrieve the currently running task of the active context. Signed-off-by: Jan Kiszka --- scripts/gdb/percpu.py | 16 1 files changed, 16 insertions(+), 0 deletions(-) diff --git

[PATCH v5 07/20] scripts/gdb: Add lx_modvar convenience function

2013-01-29 Thread Jan Kiszka
-by: Jan Kiszka --- scripts/gdb/module.py | 48 scripts/gdb/utils.py |7 +++ 2 files changed, 55 insertions(+), 0 deletions(-) diff --git a/scripts/gdb/module.py b/scripts/gdb/module.py index e309c0a..333729a 100644 --- a/scripts/gdb

[PATCH v5 08/20] scripts/gdb: Add get_target_endianness helper

2013-01-29 Thread Jan Kiszka
Parse the target endianness from the output of "show endian" and cache the result to return it via the new helper get_target_endiannes. We will need it for reading integers from buffers that contain target memory. Signed-off-by: Jan Kiszka --- scripts/gdb/utils.py | 17 ++

[PATCH v5 04/20] scripts/gdb: Add module iteration helper

2013-01-29 Thread Jan Kiszka
Will soon be used for loading symbols, printing global variables or listing modules. Signed-off-by: Jan Kiszka --- scripts/gdb/module.py | 28 1 files changed, 28 insertions(+), 0 deletions(-) create mode 100644 scripts/gdb/module.py diff --git a/scripts/gdb

[PATCH v5 09/20] scripts/gdb: Add read_u16/32/64 helpers

2013-01-29 Thread Jan Kiszka
Add helpers for reading integers from target memory buffers. Required when caching the memory access is more efficient than reading individual values via gdb. Signed-off-by: Jan Kiszka --- scripts/gdb/utils.py | 18 ++ 1 files changed, 18 insertions(+), 0 deletions(-) diff

[PATCH v5 12/20] scripts/gdb: Add helper and convenience function to look up tasks

2013-01-29 Thread Jan Kiszka
Add the helper task_by_pid that can look up a task by its PID. Also export it as a convenience function. Signed-off-by: Jan Kiszka --- scripts/gdb/task.py| 29 + scripts/gdb/vmlinux-gdb.py |1 + 2 files changed, 30 insertions(+), 0 deletions(-) diff

[PATCH v5 03/20] scripts/gdb: Add container_of helper and convenience function

2013-01-29 Thread Jan Kiszka
Provide an internal helper with container_of semantics. As type lookups are very slow in gdb-python and we need a type "long" for this, cache the reference to this type object. Then export the helper also as a convenience function form use at the gdb command line. Signed-off-by:

[PATCH v5 16/20] scripts/gdb: Add internal helper and convenience function for per-cpu lookup

2013-01-29 Thread Jan Kiszka
This function allows to obtain a per-cpu variable, either of the current or an explicitly specified CPU. Note: sparc64 version is untested. CC: "David S. Miller" CC: sparcli...@vger.kernel.org Signed-off-by: Jan Kiszka --- scripts/gdb/percpu.py

[PATCH v5 05/20] scripts/gdb: Add lx-symbols command

2013-01-29 Thread Jan Kiszka
odule files found during lx-symbols execution. This way, breakpoints can be set to module initialization functions, and there is usually no need to explicitly call lx-symbols after (re-)loading a module. Signed-off-by: Jan Kiszka --- scripts/gdb/symbols.py |

Re: [PATCH v5 16/20] scripts/gdb: Add internal helper and convenience function for per-cpu lookup

2013-01-29 Thread Jan Kiszka
On 2013-01-29 14:51, Borislav Petkov wrote: > On Tue, Jan 29, 2013 at 01:37:59PM +0100, Jan Kiszka wrote: >> This function allows to obtain a per-cpu variable, either of the current >> or an explicitly specified CPU. >> >> Note: sparc64 version is untested. >>

Re: [PATCH v5 16/20] scripts/gdb: Add internal helper and convenience function for per-cpu lookup

2013-01-29 Thread Jan Kiszka
On 2013-01-29 15:12, Borislav Petkov wrote: > On Tue, Jan 29, 2013 at 02:56:56PM +0100, Jan Kiszka wrote: >> Let me guess: You are dumping a weird QEMU/KVM CPU, right? > > Nah, I actually have the silicon! :-) > > Joking, of course. I wish. I'm booting the guest with

[PATCH v4 14/13] scripts/gdb: Add basic documentation

2013-01-24 Thread Jan Kiszka
Signed-off-by: Jan Kiszka --- Add-on patch to this series as requested during review. Documentation/gdb-kernel-debugging.txt | 145 1 files changed, 145 insertions(+), 0 deletions(-) create mode 100644 Documentation/gdb-kernel-debugging.txt diff --git a

Re: [PATCH v13 2/8] start vm after resetting it

2013-02-28 Thread Jan Kiszka
On 2013-02-28 13:13, Hu Tao wrote: > From: Wen Congyang > > The guest should run after resetting it, but it does not run if its > old state is RUN_STATE_INTERNAL_ERROR or RUN_STATE_PAUSED. > > We don't set runstate to RUN_STATE_PAUSED when resetting the guest, > so the runstate will be changed f

Re: [PATCH 1/5] KGDB: improve early init

2008-01-30 Thread Jan Kiszka
king of pending kgdbwait requests. Signed-off-by: Jan Kiszka <[EMAIL PROTECTED]> --- arch/x86/kernel/traps_32.c |4 +++ arch/x86/kernel/traps_64.c |4 +++ include/linux/kgdb.h |7 +- kernel/kgdb.c | 52 + 4 files c

Re: [Kgdb-bugreport] [PATCH 1/5] KGDB: improve early init

2008-01-31 Thread Jan Kiszka
George Anzinger wrote: > On 01/31/2008 01:36 AM, Jan Kiszka was caught saying: >> Jan Kiszka wrote: >>> George Anzinger wrote: >>>> On 01/30/2008 04:08 PM, Jan Kiszka was caught saying: >>>>> [Here comes a rebased version against latest x86/mm] >&

Re: [Kgdb-bugreport] [PATCH 1/5] KGDB: improve early init

2008-01-31 Thread Jan Kiszka
Jan Kiszka wrote: > George Anzinger wrote: >> On 01/31/2008 01:36 AM, Jan Kiszka was caught saying: >>> BTW, do you know if EXCEPTION_STACK_READY fails for other archs in >>> parse_early_param as well? It should, because my under standing of >>> trap_init is t

Re: [Kgdb-bugreport] [PATCH 4/5] KGDB-8250: refactor configuration

2008-02-01 Thread Jan Kiszka
Sergei Shtylyov wrote: > Hello. > > Jan Kiszka wrote: > >> Sorry, previous version was missing some __init[data] attributes which >> were dropped in an intermediate stage. Here comes an updated patch: > >> <---snip---> > >> This major refacto

[PATCH 02/13] scripts/gdb: Add container_of helper and convenience function

2012-10-03 Thread Jan Kiszka
From: Jan Kiszka Provide an internal helper with container_of semantics. As type lookups are very slow in gdb-python and we need a type "long" for this, cache the reference to this type object. Then export the helper also as a convenience function form use at the gdb command line. Sig

[PATCH 13/13] scripts/gdb: Add lx_current convenience function

2012-10-03 Thread Jan Kiszka
From: Jan Kiszka This is a shorthand for *$lx_per_cpu("current_task"), i.e. a convenience function to retrieve the currently running task of the active context. Signed-off-by: Jan Kiszka --- scripts/gdb/percpu.py | 15 +++ 1 files changed, 15 insertions(+), 0 deletion

[PATCH 04/13] scripts/gdb: Add get_target_endianness helper

2012-10-03 Thread Jan Kiszka
From: Jan Kiszka Parse the target endianness from the output of "show endian" and cache the result to return it via the new helper get_target_endiannes. We will need it for reading integers from buffers that contain target memory. Signed-off-by: Jan Kiszka --- scripts/gdb/utils

[PATCH 00/13] Add gdb python scripts as kernel debugging helpers

2012-10-03 Thread Jan Kiszka
@vger.kernel.org CC: linux-kbu...@vger.kernel.org CC: Michal Marek CC: sparcli...@vger.kernel.org CC: Tony Luck Jan Kiszka (13): scripts/gdb: Add infrastructure scripts/gdb: Add container_of helper and convenience function scripts/gdb: Add lx-symbols command scripts/gdb: Add get_target_endian

[PATCH 10/13] scripts/gdb: Add internal helper and convenience function to retrieve thread_info

2012-10-03 Thread Jan Kiszka
From: Jan Kiszka Add the internal helper get_thread_info that calculated the thread_info from a given task variable. Also export this service as a convenience function. Note: ia64 version is untested. CC: Tony Luck CC: Fenghua Yu CC: linux-i...@vger.kernel.org Signed-off-by: Jan Kiszka

[PATCH 01/13] scripts/gdb: Add infrastructure

2012-10-03 Thread Jan Kiszka
From: Jan Kiszka This provides the basic infrastructure to load kernel-specific python helper scripts when debugging the kernel in gdb. The loading mechanism is based on gdb loading for -gdb.py when opening . Therefore, this places a corresponding link to the main helper script into the output

[PATCH 08/13] scripts/gdb: Add helper and convenience function to look up tasks

2012-10-03 Thread Jan Kiszka
From: Jan Kiszka Add the helper task_by_pid that can look up a task by its PID. Also export it as a convenience function. Signed-off-by: Jan Kiszka --- scripts/gdb/task.py| 29 + scripts/gdb/vmlinux-gdb.py |1 + 2 files changed, 30 insertions(+), 0

[PATCH 07/13] scripts/gdb: Add task iteration helper

2012-10-03 Thread Jan Kiszka
From: Jan Kiszka The internal helper for_each_task iterates over all tasks of the target, calling the provided function on each. For performance reasons, we cache a reference to the gdb type object of a task. Signed-off-by: Jan Kiszka --- scripts/gdb/task.py | 40

[PATCH 09/13] scripts/gdb: Add is_target_arch helper

2012-10-03 Thread Jan Kiszka
From: Jan Kiszka This helper caches to result of "show architecture" and matches the provided arch (sub-)string against that output. Signed-off-by: Jan Kiszka --- scripts/gdb/utils.py |9 + 1 files changed, 9 insertions(+), 0 deletions(-) diff --git a/scripts/gdb/

[PATCH 12/13] scripts/gdb: Add internal helper and convenience function for per-cpu lookup

2012-10-03 Thread Jan Kiszka
From: Jan Kiszka This function allows to obtain a per-cpu variable, either of the current or an explicitly specified CPU. Note: sparc64 version is untested. CC: "David S. Miller" CC: sparcli...@vger.kernel.org Signed-off-by: Jan Kiszka --- scripts/gdb/percpu.py

[PATCH 11/13] scripts/gdb: Add get_gdbserver_type helper

2012-10-03 Thread Jan Kiszka
From: Jan Kiszka This helper probes the type of the gdb server. Supported are QEMU and KGDB so far. Knowledge about the gdb server is required e.g. to retrieve the current CPU or current task. Signed-off-by: Jan Kiszka --- scripts/gdb/utils.py | 35 +++ 1

[PATCH 05/13] scripts/gdb: Add read_u16/32/64 helpers

2012-10-03 Thread Jan Kiszka
From: Jan Kiszka Add helpers for reading integers from target memory buffers. Required when caching the memory access is more efficient than reading individual values via gdb. Signed-off-by: Jan Kiszka --- scripts/gdb/utils.py | 18 ++ 1 files changed, 18 insertions(+), 0

[PATCH 03/13] scripts/gdb: Add lx-symbols command

2012-10-03 Thread Jan Kiszka
From: Jan Kiszka This is probably the most useful helper when debugging kernel modules: lx-symbols will first reload vmlinux. Then it searches recursively for *.ko files in the specified paths and the current directory. Finally it walks the kernel's module list, issuing the necessary add-s

[PATCH 06/13] scripts/gdb: Add lx-dmesg command

2012-10-03 Thread Jan Kiszka
From: Jan Kiszka This pokes into the log buffer of the debugged kernel, dumping it to the gdb console. Helping in case the target should or can no longer execute dmesg itself. CC: Kay Sievers Signed-off-by: Jan Kiszka --- scripts/gdb/dmesg.py | 63

Re: [PATCH 06/13] scripts/gdb: Add lx-dmesg command

2012-10-03 Thread Jan Kiszka
On 2012-10-03 14:16, Andi Kleen wrote: > Jan Kiszka writes: > >> From: Jan Kiszka >> >> This pokes into the log buffer of the debugged kernel, dumping it to the >> gdb console. Helping in case the target should or can no longer execute >> dmesg itself

Re: [git pull] kgdb light, v7

2008-02-11 Thread Jan Kiszka
Domenico Andreoli wrote: > On Sun, Feb 10, 2008 at 11:20:26PM +0100, Ingo Molnar wrote: >> this is -v7 of the KGDB-light tree, which can be pulled from: >> >> git://git.kernel.org/pub/scm/linux/kernel/git/mingo/linux-2.6-kgdb.git > > my git hangs on this.. Just booting? Or using the debugger? I

[RFC][PATCH] modular kgdb-light (was: Re: [git pull] kgdb-light -v10)

2008-02-15 Thread Jan Kiszka
cy_restart - for implementing "R0" gdb packet o idle_task - kgdb tells the per-cpu idle tasks apart o clocksource_touch_watchdog - obvious For simplicity reasons I just gpl-exported all of them. The result is a fully modular kgdb that may help to reduce concerns regarding its in

[PATCH 12/13] scripts/gdb: Add internal helper and convenience function for per-cpu lookup

2012-11-05 Thread Jan Kiszka
This function allows to obtain a per-cpu variable, either of the current or an explicitly specified CPU. Note: sparc64 version is untested. CC: "David S. Miller" CC: sparcli...@vger.kernel.org Signed-off-by: Jan Kiszka --- scripts/gdb/percpu.py

[PATCH 03/13] scripts/gdb: Add lx-symbols command

2012-11-05 Thread Jan Kiszka
odule files found during lx-symbols execution. This way, breakpoints can be set to module initialization functions, and there is usually no need to explicitly call lx-symbols after (re-)loading a module. Signed-off-by: Jan Kiszka --- scripts/gdb/symbols.py |

[PATCH 13/13] scripts/gdb: Add lx_current convenience function

2012-11-05 Thread Jan Kiszka
This is a shorthand for *$lx_per_cpu("current_task"), i.e. a convenience function to retrieve the currently running task of the active context. Signed-off-by: Jan Kiszka --- scripts/gdb/percpu.py | 15 +++ 1 files changed, 15 insertions(+), 0 deletions(-) diff --git a/s

[PATCH 04/13] scripts/gdb: Add get_target_endianness helper

2012-11-05 Thread Jan Kiszka
Parse the target endianness from the output of "show endian" and cache the result to return it via the new helper get_target_endiannes. We will need it for reading integers from buffers that contain target memory. Signed-off-by: Jan Kiszka --- scripts/gdb/utils.py | 17 ++

[PATCH 11/13] scripts/gdb: Add get_gdbserver_type helper

2012-11-05 Thread Jan Kiszka
This helper probes the type of the gdb server. Supported are QEMU and KGDB so far. Knowledge about the gdb server is required e.g. to retrieve the current CPU or current task. Signed-off-by: Jan Kiszka --- scripts/gdb/utils.py | 35 +++ 1 files changed, 35

[PATCH 07/13] scripts/gdb: Add task iteration helper

2012-11-05 Thread Jan Kiszka
The internal helper for_each_task iterates over all tasks of the target, calling the provided function on each. For performance reasons, we cache a reference to the gdb type object of a task. Signed-off-by: Jan Kiszka --- scripts/gdb/task.py | 40 1

[PATCH 01/13] scripts/gdb: Add infrastructure

2012-11-05 Thread Jan Kiszka
on CONFIG_DEBUG_INFO. CC: Michal Marek CC: linux-kbu...@vger.kernel.org Signed-off-by: Jan Kiszka --- Makefile |5 - scripts/Makefile |3 ++- scripts/gdb/Makefile |9 + scripts/gdb/vmlinux-gdb.py | 20 4 files chan

[PATCH 02/13] scripts/gdb: Add container_of helper and convenience function

2012-11-05 Thread Jan Kiszka
Provide an internal helper with container_of semantics. As type lookups are very slow in gdb-python and we need a type "long" for this, cache the reference to this type object. Then export the helper also as a convenience function form use at the gdb command line. Signed-off-by:

[PATCH 08/13] scripts/gdb: Add helper and convenience function to look up tasks

2012-11-05 Thread Jan Kiszka
Add the helper task_by_pid that can look up a task by its PID. Also export it as a convenience function. Signed-off-by: Jan Kiszka --- scripts/gdb/task.py| 29 + scripts/gdb/vmlinux-gdb.py |1 + 2 files changed, 30 insertions(+), 0 deletions(-) diff

[PATCH 00/13] Add gdb python scripts as kernel debugging helpers

2012-11-05 Thread Jan Kiszka
enghua Yu CC: Kay Sievers CC: linux-i...@vger.kernel.org CC: linux-kbu...@vger.kernel.org CC: Michal Marek CC: sparcli...@vger.kernel.org CC: Tony Luck Jan Kiszka (13): scripts/gdb: Add infrastructure scripts/gdb: Add container_of helper and convenience function scripts/gdb: Add lx-symb

[PATCH 09/13] scripts/gdb: Add is_target_arch helper

2012-11-05 Thread Jan Kiszka
This helper caches to result of "show architecture" and matches the provided arch (sub-)string against that output. Signed-off-by: Jan Kiszka --- scripts/gdb/utils.py |9 + 1 files changed, 9 insertions(+), 0 deletions(-) diff --git a/scripts/gdb/utils.py b/scripts/gd

[PATCH 06/13] scripts/gdb: Add lx-dmesg command

2012-11-05 Thread Jan Kiszka
This pokes into the log buffer of the debugged kernel, dumping it to the gdb console. Helping in case the target should or can no longer execute dmesg itself. CC: Kay Sievers Signed-off-by: Jan Kiszka --- scripts/gdb/dmesg.py | 63 scripts

[PATCH 05/13] scripts/gdb: Add read_u16/32/64 helpers

2012-11-05 Thread Jan Kiszka
Add helpers for reading integers from target memory buffers. Required when caching the memory access is more efficient than reading individual values via gdb. Signed-off-by: Jan Kiszka --- scripts/gdb/utils.py | 18 ++ 1 files changed, 18 insertions(+), 0 deletions(-) diff

[PATCH 10/13] scripts/gdb: Add internal helper and convenience function to retrieve thread_info

2012-11-05 Thread Jan Kiszka
Add the internal helper get_thread_info that calculated the thread_info from a given task variable. Also export this service as a convenience function. Note: ia64 version is untested. CC: Tony Luck CC: Fenghua Yu CC: linux-i...@vger.kernel.org Signed-off-by: Jan Kiszka --- scripts/gdb

Re: x86-32: Early microcode loading stumbles over disabled DYNAMIC_FTRACE

2013-08-26 Thread Jan Kiszka
On 2013-08-23 22:17, Borislav Petkov wrote: > On Fri, Aug 23, 2013 at 06:40:46PM +0200, Jan Kiszka wrote: >> Below some hunks to get it working again - at least in the absence of >> any microcode in the initrd. Marking all involved functions as __init >> is another opti

Re: [PATCH] trace-cmd: Report unknown VMX exit reasons with code

2013-10-04 Thread Jan Kiszka
On 2013-08-11 09:59, Jan Kiszka wrote: > From: Jan Kiszka > > Allows to parse the result even if the KVM plugin does not yet > understand a specific exit code. > > Signed-off-by: Jan Kiszka > --- > plugin_kvm.c | 12 > 1 files changed, 8 insertions(+

Re: [PATCH 1/3] KVM: cleanup (physical) CPU hotplug

2013-09-17 Thread Jan Kiszka
On 2013-09-16 16:06, Paolo Bonzini wrote: > Remove the useless argument, and do not do anything if there are no > VMs running at the time of the hotplug. kvm_cpu_hotplug already filters !kvm_usage_count. If we need the check to be under kvm_lock, drop that line as well. If that is not required (ma

Re: [PATCH 0/3] KVM: Make kvm_lock non-raw

2013-09-20 Thread Jan Kiszka
On 2013-09-20 20:18, Paul Gortmaker wrote: > On 13-09-20 02:04 PM, Jan Kiszka wrote: >> On 2013-09-20 19:51, Paul Gortmaker wrote: >>> [Re: [PATCH 0/3] KVM: Make kvm_lock non-raw] On 16/09/2013 (Mon 18:12) Paul >>> Gortmaker wrote: >>> >>>> On 13

Re: [PATCH 0/3] KVM: Make kvm_lock non-raw

2013-09-20 Thread Jan Kiszka
On 2013-09-20 19:51, Paul Gortmaker wrote: > [Re: [PATCH 0/3] KVM: Make kvm_lock non-raw] On 16/09/2013 (Mon 18:12) Paul > Gortmaker wrote: > >> On 13-09-16 10:06 AM, Paolo Bonzini wrote: >>> Paul Gortmaker reported a BUG on preempt-rt kernels, due to taking the >>> mmu_lock within the raw kvm_lo

Re: x86-32: Early microcode loading stumbles over disabled DYNAMIC_FTRACE

2013-08-30 Thread Jan Kiszka
On 2013-08-30 19:25, Steven Rostedt wrote: > On Fri, 30 Aug 2013 10:16:00 -0700 > "H. Peter Anvin" wrote: > >>> Who uses static tracing? I only use it to test that it still works ;-) >> >> Can we get rid of it? >> > > I've though about it. But as some archs only have static tracing > available

Re: [PATCH 0/3] KVM: Make kvm_lock non-raw

2013-09-22 Thread Jan Kiszka
On 2013-09-22 11:53, Gleb Natapov wrote: > On Sun, Sep 22, 2013 at 10:53:14AM +0200, Paolo Bonzini wrote: >> Il 22/09/2013 09:42, Gleb Natapov ha scritto: >>> On Mon, Sep 16, 2013 at 04:06:10PM +0200, Paolo Bonzini wrote: Paul Gortmaker reported a BUG on preempt-rt kernels, due to taking the >

Re: [RFC v2 PATCH 00/21] KVM: x86: CPU isolation and direct interrupts delivery to guests

2012-09-07 Thread Jan Kiszka
On 2012-09-06 13:27, Tomoki Sekiyama wrote: > This RFC patch series provides facility to dedicate CPUs to KVM guests > and enable the guests to handle interrupts from passed-through PCI devices > directly (without VM exit and relay by the host). > > With this feature, we can improve throughput and

Re: [PATCH v6 11/12] KVM: introduce readonly memslot

2012-09-07 Thread Jan Kiszka
On 2012-08-21 05:02, Xiao Guangrong wrote: > In current code, if we map a readonly memory space from host to guest > and the page is not currently mapped in the host, we will get a fault > pfn and async is not allowed, then the vm will crash > > We introduce readonly memory region to map ROM/ROMD

Re: [PATCH v6 11/12] KVM: introduce readonly memslot

2012-09-07 Thread Jan Kiszka
On 2012-09-07 12:47, Xiao Guangrong wrote: > On 09/07/2012 06:23 PM, Jan Kiszka wrote: >> On 2012-08-21 05:02, Xiao Guangrong wrote: >>> In current code, if we map a readonly memory space from host to guest >>> and the page is not currently mapped in the host, we will ge

Re: [PATCH v6 11/12] KVM: introduce readonly memslot

2012-09-09 Thread Jan Kiszka
On 2012-09-09 15:42, Avi Kivity wrote: > On 09/07/2012 02:14 PM, Jan Kiszka wrote: >>> >>> $ grep __KVM_HAVE include/linux/kvm.h | wc -l >>> 20 >> >> Yes, mistakes of the past. >> >>> >>> As your suggestion, userspace will always

Re: [PATCH] KVM: x86: fix vcpu->mmio_fragments overflow

2012-10-22 Thread Jan Kiszka
On 2012-10-22 13:43, Gleb Natapov wrote: > On Mon, Oct 22, 2012 at 01:35:56PM +0200, Jan Kiszka wrote: >> On 2012-10-22 13:23, Gleb Natapov wrote: >>> On Mon, Oct 22, 2012 at 07:09:38PM +0800, Xiao Guangrong wrote: >>>> On 10/22/2012 05:16 PM, Gleb Natapov wrote: &g

Re: [PATCH] KVM: x86: fix vcpu->mmio_fragments overflow

2012-10-22 Thread Jan Kiszka
On 2012-10-22 13:23, Gleb Natapov wrote: > On Mon, Oct 22, 2012 at 07:09:38PM +0800, Xiao Guangrong wrote: >> On 10/22/2012 05:16 PM, Gleb Natapov wrote: >>> On Fri, Oct 19, 2012 at 03:37:32PM +0800, Xiao Guangrong wrote: After commit b3356bf0dbb349 (KVM: emulator: optimize "rep ins" handling)

Re: [PATCH] KVM: x86: fix vcpu->mmio_fragments overflow

2012-10-22 Thread Jan Kiszka
On 2012-10-22 14:18, Avi Kivity wrote: > On 10/22/2012 01:45 PM, Jan Kiszka wrote: > >>> Indeed. git pull, recheck and call for kvm_flush_coalesced_mmio_buffer() >>> is gone. So this will break new userspace, not old. By global you mean >>> shared between devic

Re: [PATCH] KVM: x86: fix vcpu->mmio_fragments overflow

2012-10-22 Thread Jan Kiszka
On 2012-10-22 14:53, Gleb Natapov wrote: > On Mon, Oct 22, 2012 at 02:45:37PM +0200, Jan Kiszka wrote: >> On 2012-10-22 14:18, Avi Kivity wrote: >>> On 10/22/2012 01:45 PM, Jan Kiszka wrote: >>> >>>>> Indeed. git pull, recheck and call for kvm_flush_coal

Re: [PATCH] KVM: x86: fix vcpu->mmio_fragments overflow

2012-10-22 Thread Jan Kiszka
On 2012-10-22 14:58, Avi Kivity wrote: > On 10/22/2012 02:55 PM, Jan Kiszka wrote: >>> Since the userspace change is needed the idea is dead, but if we could >>> implement it I do not see how it can hurt the latency if it would be the >>> only mechanism to use coales

Re: [PATCH] KVM: x86: fix vcpu->mmio_fragments overflow

2012-10-22 Thread Jan Kiszka
On 2012-10-22 15:08, Gleb Natapov wrote: > On Mon, Oct 22, 2012 at 03:05:58PM +0200, Jan Kiszka wrote: >> On 2012-10-22 14:58, Avi Kivity wrote: >>> On 10/22/2012 02:55 PM, Jan Kiszka wrote: >>>>> Since the userspace change is needed the idea is dead, but if we

Re: [PATCH] KVM: x86: fix vcpu->mmio_fragments overflow

2012-10-22 Thread Jan Kiszka
On 2012-10-22 16:00, Gleb Natapov wrote: > On Mon, Oct 22, 2012 at 03:25:49PM +0200, Jan Kiszka wrote: >> On 2012-10-22 15:08, Gleb Natapov wrote: >>> On Mon, Oct 22, 2012 at 03:05:58PM +0200, Jan Kiszka wrote: >>>> On 2012-10-22 14:58, Avi Kivity wrote: >>&g

[PATCH] ftrace: Consistently restore trace function on sysctl enabling

2013-03-26 Thread Jan Kiszka
If we reenable ftrace via syctl, we currently set ftrace_trace_function based on the previous simplistic algorithm. This is inconsistent with what update_ftrace_function does. So better call that helper instead. Signed-off-by: Jan Kiszka --- kernel/trace/ftrace.c |8 ++-- 1 files

x86-32: Early microcode loading stumbles over disabled DYNAMIC_FTRACE

2013-08-23 Thread Jan Kiszka
Hi all, 32-bit kernels currently crash/reboot in early microcode loading when non-dynamic function tracing is enabled. Several functions in that path get instrumented with mcount, but its non-dynamic implementation does not work before paging is enabled (it accesses global variables at wrong addre

[PATCH] trace-cmd: Update VMX exit reasons in KVM plugin

2013-08-11 Thread Jan Kiszka
From: Jan Kiszka Aligns us with latest arch/x86/include/uapi/asm/vmx.h. Signed-off-by: Jan Kiszka --- plugin_kvm.c |9 - 1 files changed, 8 insertions(+), 1 deletions(-) diff --git a/plugin_kvm.c b/plugin_kvm.c index 9b376d8..8a25cf1 100644 --- a/plugin_kvm.c +++ b/plugin_kvm.c

[PATCH] trace-cmd: Report unknown VMX exit reasons with code

2013-08-11 Thread Jan Kiszka
From: Jan Kiszka Allows to parse the result even if the KVM plugin does not yet understand a specific exit code. Signed-off-by: Jan Kiszka --- plugin_kvm.c | 12 1 files changed, 8 insertions(+), 4 deletions(-) diff --git a/plugin_kvm.c b/plugin_kvm.c index 8a25cf1..59443e5

Re: [PATCH] tile: support KVM for tilegx

2013-08-12 Thread Jan Kiszka
On 2013-08-12 17:24, Chris Metcalf wrote: > This change provides the initial framework support for KVM on tilegx. > Basic virtual disk and networking is supported. > > Signed-off-by: Chris Metcalf > --- ... > diff --git a/include/uapi/linux/kvm.h b/include/uapi/linux/kvm.h > index acccd08..d387

Re: [PATCH] kvm: nVMX: check vmcs12 for valid activity state

2013-04-15 Thread Jan Kiszka
On 2013-04-15 14:46, Paolo Bonzini wrote: > KVM does not use the activity state VMCS field, and does not support > it in nested VMX either (the corresponding bits in the misc VMX feature > MSR are zero). Fail entry if the activity state is set to anything but > "active". Ah, that indeed simplifie

  1   2   3   4   5   6   7   8   9   10   >