aboutsummaryrefslogtreecommitdiffstats
path: root/scripts (follow)
AgeCommit message (Collapse)AuthorFilesLines
2015-04-15Merge branch 'kconfig' of git://git.kernel.org/pub/scm/linux/kernel/git/mmarek/kbuildLinus Torvalds15-198/+174
Pull kconfig updates from Michal Marek: "Here is the kconfig stuff for v4.1-rc1: - fixes for mergeconfig (used by make kvmconfig/tinyconfig) - header cleanup - make -s *config is silent now" * 'kconfig' of git://git.kernel.org/pub/scm/linux/kernel/git/mmarek/kbuild: kconfig: Do not print status messages in make -s mode kconfig: Simplify Makefile kbuild: add generic mergeconfig target, %.config merge_config.sh: rename MAKE to RUNMAKE merge_config.sh: improve indentation kbuild: mergeconfig: remove redundant $(objtree) kbuild: mergeconfig: move an error check to merge_config.sh kbuild: mergeconfig: fix "jobserver unavailable" warning kconfig: Remove unnecessary prototypes from headers kconfig: Remove dead code kconfig: Get rid of the P() macro in headers kconfig: fix a misspelling in scripts/kconfig/merge_config.sh
2015-04-15Merge branch 'kbuild' of git://git.kernel.org/pub/scm/linux/kernel/git/mmarek/kbuildLinus Torvalds3-11/+22
Pull kbuild updates from Michal Marek: "Here is the first round of kbuild changes for v4.1-rc1: - kallsyms fix for ARM and cleanup - make dep(end) removed (developers have no sense of nostalgia these days...) - include Makefiles by relative path - stop useless rebuilds of asm-offsets.h and bounds.h" * 'kbuild' of git://git.kernel.org/pub/scm/linux/kernel/git/mmarek/kbuild: Kbuild: kallsyms: drop special handling of pre-3.0 GCC symbols Kbuild: kallsyms: ignore veneers emitted by the ARM linker kbuild: ia64: use $(src)/Makefile.gate rather than particular path kbuild: include $(src)/Makefile rather than $(obj)/Makefile kbuild: use relative path more to include Makefile kbuild: use relative path to include Makefile kbuild: do not add $(bounds-file) and $(offsets-file) to targets kbuild: remove warning about "make depend" kbuild: Don't reset timestamps in include/generated if not needed
2015-04-14scripts/coccinelle/misc/bugon.cocci: update bug_on conversion warningFabian Frederick1-1/+1
if()/BUG conversion to BUG_ON must be avoided when there's side effect in condition. The reason being BUG_ON won't execute the condition when CONFIG_BUG is not defined. With inspiration from Bruce Fields. Signed-off-by: Fabian Frederick <fabf@skynet.be> Suggested-by: Julia Lawall <Julia.Lawall@lip6.fr> Acked-by: Julia Lawall <Julia.Lawall@lip6.fr> Cc: J. Bruce Fields <bfields@fieldses.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2015-04-09kconfig: Do not print status messages in make -s modeMichal Marek6-32/+62
Add an -s option to the various frontends and pass it when make -s is used. Also, use $(kecho) instead of @echo in the Makefile. Signed-off-by: Michal Marek <mmarek@suse.cz>
2015-04-08kconfig: Simplify MakefileMichal Marek1-12/+8
Use a single rule for targets handled directly by the conf program. Signed-off-by: Michal Marek <mmarek@suse.cz>
2015-04-07Kbuild: kallsyms: drop special handling of pre-3.0 GCC symbolsArd Biesheuvel1-1/+0
Since we have required at least GCC v3.2 for some time now, we can drop the special handling of the 'gcc[0-9]_compiled.' label which is not emitted anymore since GCC v3.0. Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Signed-off-by: Michal Marek <mmarek@suse.cz>
2015-04-07Kbuild: kallsyms: ignore veneers emitted by the ARM linkerArd Biesheuvel1-9/+21
When linking large kernels on ARM, the linker will insert veneers (i.e., PLT like stubs) when function symbols are out of reach for the ordinary relative branch/branch-and-link instructions. However, due to the fact that the kallsyms region sits in .rodata, which is between .text and .init.text, additional veneers may be emitted in the second pass due to the fact that the size of the kallsyms region itself has pushed the .init.text section further apart, requiring even more veneers. So ignore the veneers when generating the symbol table. Veneers have no corresponding source code, and they will not turn up in backtraces anyway. This patch also lightly refactors the symbol_valid() function to use a local 'sym_name' rather than the obfuscated 'sym + 1' and 'sym + offset' Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Signed-off-by: Michal Marek <mmarek@suse.cz>
2015-04-02kbuild: include $(src)/Makefile rather than $(obj)/MakefileMasahiro Yamada2-2/+2
This commit actually has no impact because $(src) and $(obj) point to the same path, but $(src)/Makefile looks better when we include source files. Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com> Signed-off-by: Michal Marek <mmarek@suse.cz>
2015-04-02kbuild: use relative path to include MakefileMasahiro Yamada2-2/+2
The "MAKEFLAGS += --include-dir=$(srctree)" line in the top Makefile allows us to do this. Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com> Signed-off-by: Michal Marek <mmarek@suse.cz>
2015-03-24kbuild: add generic mergeconfig target, %.configMasahiro Yamada1-10/+9
"scripts/kconfig/merge_config.sh && make oldconfig" works well enough for merging local config fragments, but Kbuild currently has the entry points only for "kvmconfig" and "tinyconfig". This commit provides the generic target for mergeconfig, so we can manage our own config fragments easily: put "foo.config" in arch/$(SRCARCH)/configs/ or kernel/configs/, and then run "make foo.config". Now "make kvmconfig" is just a shorthand of "make kvm_guest.config". Likewise, "make tinyconfig" is equivalent to "make allnoconfig tiny.config". Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com> Reviewed-by: Josh Triplett <josh@joshtriplett.org> Reviewed-by: Darren Hart <dvhart@linux.intel.com> Signed-off-by: Michal Marek <mmarek@suse.cz>
2015-03-24merge_config.sh: rename MAKE to RUNMAKEMasahiro Yamada1-3/+3
The variable "MAKE" is used to store the command name that has invoked the Makefile. (Actually, it is already set to "make" if you run this script from a Makefile.) In this script, however, it is used to determine if Make should be run or not. It is not what we usually expect. Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com> Reviewed-by: Josh Triplett <josh@joshtriplett.org> Reviewed-by: Darren Hart <dvhart@linux.intel.com> Signed-off-by: Michal Marek <mmarek@suse.cz>
2015-03-24merge_config.sh: improve indentationMasahiro Yamada1-8/+6
It is true that we do not want to move the code too far to the right, but something like below is not preferred: if [ "x$PREV_VAL" != "x$NEW_VAL" ] ; then echo Value of $CFG is redefined by fragment $MERGE_FILE: echo Previous value: $PREV_VAL echo New value: $NEW_VAL echo elif [ "$WARNREDUN" = "true" ]; then echo Value of $CFG is redundant by fragment $MERGE_FILE: fi To fix this, call "continue" if the "grep" command fails to find the given CONFIG. Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com> Reviewed-by: Josh Triplett <josh@joshtriplett.org> Reviewed-by: Darren Hart <dvhart@linux.intel.com> Signed-off-by: Michal Marek <mmarek@suse.cz>
2015-03-24kbuild: mergeconfig: remove redundant $(objtree)Masahiro Yamada1-1/+1
Kbuild always runs in $(objtree). Actually, $(objtree) is always set to "." by the top-level Makefile. We can omit "-O $(objtree)" and "$(objtree)/". Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com> Reviewed-by: Josh Triplett <josh@joshtriplett.org> Reviewed-by: Darren Hart <dvhart@linux.intel.com> Signed-off-by: Michal Marek <mmarek@suse.cz>
2015-03-24kbuild: mergeconfig: move an error check to merge_config.shMasahiro Yamada2-1/+5
Currently, "make tinyconfig" does not work with "-j" option. $ make mrproper $ make -j8 tinyconfig HOSTCC scripts/basic/fixdep HOSTCC scripts/kconfig/conf.o SHIPPED scripts/kconfig/zconf.tab.c SHIPPED scripts/kconfig/zconf.lex.c SHIPPED scripts/kconfig/zconf.hash.c HOSTCC scripts/kconfig/zconf.tab.o HOSTLD scripts/kconfig/conf scripts/kconfig/conf --allnoconfig Kconfig # # configuration written to .config # scripts/kconfig/Makefile:122: *** You need an existing .config for this target. Stop. make: *** [tinyconfig] Error 2 As shown above, "allnoconfig" has created the .config file before mergeconfig is called, but Make still raises a false alarm because of some sort of race condition. We can fix this issue by moving the error check to the shell script. Anyway, scripts/kconfig/merge_config.sh always requires an existing .config as a base file. It is reasonable to check its existence in the shell script. Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com> Reviewed-by: Josh Triplett <josh@joshtriplett.org> Reviewed-by: Darren Hart <dvhart@linux.intel.com> Signed-off-by: Michal Marek <mmarek@suse.cz>
2015-03-24kbuild: mergeconfig: fix "jobserver unavailable" warningMasahiro Yamada1-1/+1
If "make kvmconfig" is run with "-j" option, a warning message, "jobserver unavailable: using -j1. Add `+' to parent make rule.", is displayed. $ make -s defconfig *** Default configuration is based on 'x86_64_defconfig' # # configuration written to .config # $ make -j8 kvmconfig Using ./.config as base Merging ./arch/x86/configs/kvm_guest.config [ snip ] # # merged configuration written to ./.config (needs make) # make[2]: warning: jobserver unavailable: using -j1. Add `+' to parent make rule. scripts/kconfig/conf --oldconfig Kconfig [ snip ] # # configuration written to .config # Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com> Reviewed-by: Josh Triplett <josh@joshtriplett.org> Reviewed-by: Darren Hart <dvhart@linux.intel.com> Signed-off-by: Michal Marek <mmarek@suse.cz>
2015-02-28scripts/gdb: add empty package initialization scriptJan Kiszka1-0/+1
This got lost during the initial merge process: Python requires an __init__.py script, even if empty, in order to accept a directory as package. Add it, this time as a non-empty file. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2015-02-25kconfig: Remove unnecessary prototypes from headersMichal Marek7-48/+40
Signed-off-by: Michal Marek <mmarek@suse.cz>
2015-02-25kconfig: Remove dead codeMichal Marek4-39/+0
Signed-off-by: Michal Marek <mmarek@suse.cz>
2015-02-25kconfig: Get rid of the P() macro in headersMichal Marek2-47/+43
This was originally meant for dlopen()ing a potential kconfig shared library. The unused dlopen code has already been removed in commit 5a6f8d2b (kconfig: nuke LKC_DIRECT_LINK cruft), so let's remove the rest. The lkc_proto.h change was made with the following sed script: sed -r 's/^P\(([^,]*), *([^,]*), *(.*)\);/\2 \1\3;/' Plus some manual adjustments. Signed-off-by: Michal Marek <mmarek@suse.cz>
2015-02-25kconfig: fix a misspelling in scripts/kconfig/merge_config.shMasahiro Yamada1-1/+1
Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com> Signed-off-by: Michal Marek <mmarek@suse.cz>
2015-02-19Merge branch 'kconfig' of git://git.kernel.org/pub/scm/linux/kernel/git/mmarek/kbuildLinus Torvalds2-0/+6
Pull kconfig updates from Michal Marek: "Yann E Morin was supposed to take over kconfig maintainership, but this hasn't happened. So I'm sending a few kconfig patches that I collected: - Fix for missing va_end in kconfig - merge_config.sh displays used if given too few arguments - s/boolean/bool/ in Kconfig files for consistency, with the plan to only support bool in the future" * 'kconfig' of git://git.kernel.org/pub/scm/linux/kernel/git/mmarek/kbuild: kconfig: use va_end to match corresponding va_start merge_config.sh: Display usage if given too few arguments kconfig: use bool instead of boolean for type definition attributes
2015-02-19Merge branch 'misc' of git://git.kernel.org/pub/scm/linux/kernel/git/mmarek/kbuildLinus Torvalds1-3/+14
Pull misc kbuild changes from Michal Marek: "Just a few non-critical kbuild changes: - builddeb adds the actual distribution name in the changelog - documentation fixes" * 'misc' of git://git.kernel.org/pub/scm/linux/kernel/git/mmarek/kbuild: kbuild: trivial - fix the help doc of CONFIG_CC_OPTIMIZE_FOR_SIZE kbuild: Update documentation of clean-files and clean-dirs builddeb: Try to determine distribution builddeb: Update year and git repository URL in debian/copyright
2015-02-19Merge branch 'kbuild' of git://git.kernel.org/pub/scm/linux/kernel/git/mmarek/kbuildLinus Torvalds2-8/+2
Pull kbuild updates from Michal Marek: - several cleanups in kbuild - serialize multiple *config targets so that 'make defconfig kvmconfig' works - The cc-ifversion macro got support for an else-branch * 'kbuild' of git://git.kernel.org/pub/scm/linux/kernel/git/mmarek/kbuild: kbuild,gcov: simplify kernel/gcov/Makefile more kbuild: allow cc-ifversion to have the argument for false condition kbuild,gcov: simplify kernel/gcov/Makefile kbuild,gcov: remove unnecessary workaround kbuild: do not add $(call ...) to invoke cc-version or cc-fullversion kbuild: fix cc-ifversion macro kbuild: drop $(version_h) from MRPROPER_FILES kbuild: use mixed-targets when two or more config targets are given kbuild: remove redundant line from bounds.h/asm-offsets.h kbuild: merge bounds.h and asm-offsets.h rules kbuild: Drop support for clean-rule
2015-02-17scripts/gdb: disable pagination while printing from breakpoint handlerJan Kiszka1-0/+11
While reporting the (refreshed) list of modules on automatic updates we may hit the page boundary of the output console and cause a stop if pagination is enabled. However, gdb does not accept user input while running over the breakpoint handler. So we get stuck, and the user is forced to interrupt gdb. Resolve this by disabling pagination during automatic symbol updates. We restore the user's configuration once done. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Cc: Thomas Gleixner <tglx@linutronix.de> Cc: Jason Wessel <jason.wessel@windriver.com> Cc: Andi Kleen <andi@firstfloor.org> Cc: Ben Widawsky <ben@bwidawsk.net> Cc: Borislav Petkov <bp@suse.de> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2015-02-17scripts/gdb: convert CpuList to generator functionJan Kiszka2-40/+33
Yet another code simplification. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Cc: Thomas Gleixner <tglx@linutronix.de> Cc: Jason Wessel <jason.wessel@windriver.com> Cc: Andi Kleen <andi@firstfloor.org> Cc: Ben Widawsky <ben@bwidawsk.net> Cc: Borislav Petkov <bp@suse.de> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2015-02-17scripts/gdb: convert ModuleList to generator functionJan Kiszka2-23/+12
Analogously to the task list, convert the module list to a generator function. It noticeably simplifies the code. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Cc: Thomas Gleixner <tglx@linutronix.de> Cc: Jason Wessel <jason.wessel@windriver.com> Cc: Andi Kleen <andi@firstfloor.org> Cc: Ben Widawsky <ben@bwidawsk.net> Cc: Borislav Petkov <bp@suse.de> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2015-02-17scripts/gdb: use a generator instead of iterator for task listDaniel Wagner1-30/+20
The iterator does not return any task_struct from the thread_group list because the first condition in the 'if not t or ...' will only be the first time None. Instead of keeping track of the state ourself in the next() function, we fall back using Python's generator. Signed-off-by: Daniel Wagner <daniel.wagner@bmw-carit.de> Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Cc: Thomas Gleixner <tglx@linutronix.de> Cc: Jason Wessel <jason.wessel@windriver.com> Cc: Andi Kleen <andi@firstfloor.org> Cc: Ben Widawsky <ben@bwidawsk.net> Cc: Borislav Petkov <bp@suse.de> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2015-02-17scripts/gdb: ignore byte-compiled python filesDaniel Thompson1-0/+2
Using the gdb scripts leaves byte-compiled python files in the scripts/ directory. These should be ignored by git. [jan.kiszka@siemens.com: drop redundant mrproper rule as suggested by Michal] Signed-off-by: Daniel Thompson <daniel.thompson@linaro.org> Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Cc: Michal Marek <mmarek@suse.cz> Cc: Thomas Gleixner <tglx@linutronix.de> Cc: Jason Wessel <jason.wessel@windriver.com> Cc: Andi Kleen <andi@firstfloor.org> Cc: Ben Widawsky <ben@bwidawsk.net> Cc: Borislav Petkov <bp@suse.de> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2015-02-17scripts/gdb: port to python3 / gdb7.7Pantelis Koukousoulas6-9/+18
I tried to use these scripts in an ubuntu 14.04 host (gdb 7.7 compiled against python 3.3) but there were several errors. I believe this patch fixes these issues so that the commands now work (I tested lx-symbols, lx-dmesg, lx-lsmod). Main issues that needed to be resolved: * In python 2 iterators have a "next()" method. In python 3 it is __next__() instead (so let's just add both). * In older python versions there was an implicit conversion in object.__format__() (used when an object is in string.format()) where it was converting the object to str first and then calling str's __format__(). This has now been removed so we must explicitly convert to str the objects for which we need to keep this behavior. * In dmesg.py: in python 3 log_buf is now a "memoryview" object which needs to be converted to a string in order to use string methods like "splitlines()". Luckily memoryview exists in python 2.7.6 as well, so we can convert log_buf to memoryview and use the same code in both python 2 and python 3. This version of the patch has now been tested with gdb 7.7 and both python 3.4 and python 2.7.6 (I think asking for at least python 2.7.6 is a reasonable requirement instead of complicating the code with version checks etc). Signed-off-by: Pantelis Koukousoulas <pktoss@gmail.com> Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Cc: Thomas Gleixner <tglx@linutronix.de> Cc: Jason Wessel <jason.wessel@windriver.com> Cc: Andi Kleen <andi@firstfloor.org> Cc: Ben Widawsky <ben@bwidawsk.net> Cc: Borislav Petkov <bp@suse.de> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2015-02-17scripts/gdb: add lx-lsmod commandJan Kiszka1-1/+45
This adds a lsmod-like command to list all currently loaded modules of the target. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Cc: Thomas Gleixner <tglx@linutronix.de> Cc: Jason Wessel <jason.wessel@windriver.com> Cc: Andi Kleen <andi@firstfloor.org> Cc: Ben Widawsky <ben@bwidawsk.net> Cc: Borislav Petkov <bp@suse.de> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2015-02-17scripts/gdb: add class to iterate over CPU masksJan Kiszka1-0/+54
Will be used first to count module references. It is optimized to read the mask only once per stop. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Cc: Thomas Gleixner <tglx@linutronix.de> Cc: Jason Wessel <jason.wessel@windriver.com> Cc: Andi Kleen <andi@firstfloor.org> Cc: Ben Widawsky <ben@bwidawsk.net> Cc: Borislav Petkov <bp@suse.de> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2015-02-17scripts/gdb: add lx_current convenience functionJan Kiszka1-0/+17
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 <jan.kiszka@siemens.com> Cc: Thomas Gleixner <tglx@linutronix.de> Cc: Jason Wessel <jason.wessel@windriver.com> Cc: Andi Kleen <andi@firstfloor.org> Cc: Ben Widawsky <ben@bwidawsk.net> Cc: Borislav Petkov <bp@suse.de> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2015-02-17scripts/gdb: add internal helper and convenience function for per-cpu lookupJan Kiszka2-0/+69
This function allows to obtain a per-cpu variable, either of the current or an explicitly specified CPU. Note: sparc64 version is untested. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Cc: "David S. Miller" <davem@davemloft.net> Cc: Thomas Gleixner <tglx@linutronix.de> Cc: Jason Wessel <jason.wessel@windriver.com> Cc: Andi Kleen <andi@firstfloor.org> Cc: Ben Widawsky <ben@bwidawsk.net> Cc: Borislav Petkov <bp@suse.de> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2015-02-17scripts/gdb: add get_gdbserver_type helperJan Kiszka1-0/+35
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 <jan.kiszka@siemens.com> Cc: Thomas Gleixner <tglx@linutronix.de> Cc: Jason Wessel <jason.wessel@windriver.com> Cc: Andi Kleen <andi@firstfloor.org> Cc: Ben Widawsky <ben@bwidawsk.net> Cc: Borislav Petkov <bp@suse.de> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2015-02-17scripts/gdb: add internal helper and convenience function to retrieve thread_infoJan Kiszka1-0/+35
Add the internal helper get_thread_info that calculates the thread_info from a given task variable. Also export this service as a convenience function. Note: ia64 version is untested. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Cc: Tony Luck <tony.luck@intel.com> Cc: Fenghua Yu <fenghua.yu@intel.com> Cc: Thomas Gleixner <tglx@linutronix.de> Cc: Jason Wessel <jason.wessel@windriver.com> Cc: Andi Kleen <andi@firstfloor.org> Cc: Ben Widawsky <ben@bwidawsk.net> Cc: Borislav Petkov <bp@suse.de> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2015-02-17scripts/gdb: add is_target_arch helperJan Kiszka1-0/+13
This helper caches to result of "show architecture" and matches the provided arch (sub-)string against that output. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Cc: Thomas Gleixner <tglx@linutronix.de> Cc: Jason Wessel <jason.wessel@windriver.com> Cc: Andi Kleen <andi@firstfloor.org> Cc: Ben Widawsky <ben@bwidawsk.net> Cc: Borislav Petkov <bp@suse.de> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2015-02-17scripts/gdb: add helper and convenience function to look up tasksJan Kiszka2-0/+28
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 <jan.kiszka@siemens.com> Cc: Thomas Gleixner <tglx@linutronix.de> Cc: Jason Wessel <jason.wessel@windriver.com> Cc: Andi Kleen <andi@firstfloor.org> Cc: Ben Widawsky <ben@bwidawsk.net> Cc: Borislav Petkov <bp@suse.de> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2015-02-17scripts/gdb: add task iteration classJan Kiszka1-0/+46
This class allows to iterate over all tasks of the target. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Cc: Thomas Gleixner <tglx@linutronix.de> Cc: Jason Wessel <jason.wessel@windriver.com> Cc: Andi Kleen <andi@firstfloor.org> Cc: Ben Widawsky <ben@bwidawsk.net> Cc: Borislav Petkov <bp@suse.de> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2015-02-17scripts/gdb: add lx-dmesg commandJan Kiszka2-0/+65
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. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Cc: Kay Sievers <kay@vrfy.org> Cc: Thomas Gleixner <tglx@linutronix.de> Cc: Jason Wessel <jason.wessel@windriver.com> Cc: Andi Kleen <andi@firstfloor.org> Cc: Ben Widawsky <ben@bwidawsk.net> Cc: Borislav Petkov <bp@suse.de> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2015-02-17scripts/gdb: add read_u16/32/64 helpersJan Kiszka1-0/+21
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 <jan.kiszka@siemens.com> Cc: Thomas Gleixner <tglx@linutronix.de> Cc: Jason Wessel <jason.wessel@windriver.com> Cc: Andi Kleen <andi@firstfloor.org> Cc: Ben Widawsky <ben@bwidawsk.net> Cc: Borislav Petkov <bp@suse.de> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2015-02-17scripts/gdb: add get_target_endianness helperJan Kiszka1-0/+18
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 <jan.kiszka@siemens.com> Cc: Thomas Gleixner <tglx@linutronix.de> Cc: Jason Wessel <jason.wessel@windriver.com> Cc: Andi Kleen <andi@firstfloor.org> Cc: Ben Widawsky <ben@bwidawsk.net> Cc: Borislav Petkov <bp@suse.de> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2015-02-17scripts/gdb: add internal helper and convenience function to look up a moduleJan Kiszka2-0/+29
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 <jan.kiszka@siemens.com> Cc: Thomas Gleixner <tglx@linutronix.de> Cc: Jason Wessel <jason.wessel@windriver.com> Cc: Andi Kleen <andi@firstfloor.org> Cc: Ben Widawsky <ben@bwidawsk.net> Cc: Borislav Petkov <bp@suse.de> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2015-02-17scripts/gdb: add automatic symbol reloading on module insertionJan Kiszka1-0/+39
This installs a silent breakpoint on the do_init_module function. The breakpoint handler will try to load symbols from the module files found during lx-symbols execution. This way, breakpoints can be set to module initialization functions, and there is no need to explicitly call lx-symbols after (re-)loading a module. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Cc: Thomas Gleixner <tglx@linutronix.de> Cc: Jason Wessel <jason.wessel@windriver.com> Cc: Andi Kleen <andi@firstfloor.org> Cc: Ben Widawsky <ben@bwidawsk.net> Cc: Borislav Petkov <bp@suse.de> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2015-02-17scripts/gdb: add lx-symbols commandJan Kiszka2-0/+128
This is probably the most useful helper when debugging kernel modules: lx-symbols first reloads 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-symbol-file command for each loaded module so that gdb knows which module symbol corresponds to which address. It also looks up variable sections (bss, data, rodata) and appends their address to the add-symbole-file command line. This allows to access global module variables just like any other variable. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Cc: Thomas Gleixner <tglx@linutronix.de> Cc: Jason Wessel <jason.wessel@windriver.com> Cc: Andi Kleen <andi@firstfloor.org> Cc: Ben Widawsky <ben@bwidawsk.net> Cc: Borislav Petkov <bp@suse.de> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2015-02-17scripts/gdb: add module iteration classJan Kiszka1-0/+39
Will soon be used for loading symbols, printing global variables or listing modules. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Cc: Thomas Gleixner <tglx@linutronix.de> Cc: Jason Wessel <jason.wessel@windriver.com> Cc: Andi Kleen <andi@firstfloor.org> Cc: Ben Widawsky <ben@bwidawsk.net> Cc: Borislav Petkov <bp@suse.de> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2015-02-17scripts/gdb: add container_of helper and convenience functionJan Kiszka2-0/+37
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: Jan Kiszka <jan.kiszka@siemens.com> Cc: Thomas Gleixner <tglx@linutronix.de> Cc: Jason Wessel <jason.wessel@windriver.com> Cc: Andi Kleen <andi@firstfloor.org> Cc: Ben Widawsky <ben@bwidawsk.net> Cc: Borislav Petkov <bp@suse.de> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2015-02-17scripts/gdb: add cache for type objectsJan Kiszka1-0/+34
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 <jan.kiszka@siemens.com> Cc: Thomas Gleixner <tglx@linutronix.de> Cc: Jason Wessel <jason.wessel@windriver.com> Cc: Andi Kleen <andi@firstfloor.org> Cc: Ben Widawsky <ben@bwidawsk.net> Cc: Borislav Petkov <bp@suse.de> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2015-02-17scripts/gdb: add infrastructureJan Kiszka4-0/+36
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 <objfile>-gdb.py when opening <objfile>. Therefore, this places a corresponding link to the main helper script into the output directory that contains vmlinux. The main scripts will pull in submodules containing Linux specific gdb commands and functions. To avoid polluting the source directory with compiled python modules, we link to them from the object directory. Due to gdb.parse_and_eval and string redirection for gdb.execute, we depend on gdb >= 7.2. This feature is enabled via CONFIG_GDB_SCRIPTS. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Acked-by: Michal Marek <mmarek@suse.cz> [kbuild stuff] Cc: Thomas Gleixner <tglx@linutronix.de> Cc: Jason Wessel <jason.wessel@windriver.com> Cc: Andi Kleen <andi@firstfloor.org> Cc: Ben Widawsky <ben@bwidawsk.net> Cc: Borislav Petkov <bp@suse.de> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2015-02-16vfs,ext2: remove CONFIG_EXT2_FS_XIP and rename CONFIG_FS_XIP to CONFIG_FS_DAXMatthew Wilcox1-1/+0
The fewer Kconfig options we have the better. Use the generic CONFIG_FS_DAX to enable XIP support in ext2 as well as in the core. Signed-off-by: Matthew Wilcox <matthew.r.wilcox@intel.com> Cc: Andreas Dilger <andreas.dilger@intel.com> Cc: Boaz Harrosh <boaz@plexistor.com> Cc: Christoph Hellwig <hch@lst.de> Cc: Dave Chinner <david@fromorbit.com> Cc: Jan Kara <jack@suse.cz> Cc: Jens Axboe <axboe@kernel.dk> Cc: Kirill A. Shutemov <kirill.shutemov@linux.intel.com> Cc: Mathieu Desnoyers <mathieu.desnoyers@efficios.com> Cc: Randy Dunlap <rdunlap@infradead.org> Cc: Ross Zwisler <ross.zwisler@linux.intel.com> Cc: Theodore Ts'o <tytso@mit.edu> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2015-02-13kasan: enable instrumentation of global variablesAndrey Ryabinin1-1/+1
This feature let us to detect accesses out of bounds of global variables. This will work as for globals in kernel image, so for globals in modules. Currently this won't work for symbols in user-specified sections (e.g. __init, __read_mostly, ...) The idea of this is simple. Compiler increases each global variable by redzone size and add constructors invoking __asan_register_globals() function. Information about global variable (address, size, size with redzone ...) passed to __asan_register_globals() so we could poison variable's redzone. This patch also forces module_alloc() to return 8*PAGE_SIZE aligned address making shadow memory handling ( kasan_module_alloc()/kasan_module_free() ) more simple. Such alignment guarantees that each shadow page backing modules address space correspond to only one module_alloc() allocation. Signed-off-by: Andrey Ryabinin <a.ryabinin@samsung.com> Cc: Dmitry Vyukov <dvyukov@google.com> Cc: Konstantin Serebryany <kcc@google.com> Cc: Dmitry Chernenkov <dmitryc@google.com> Signed-off-by: Andrey Konovalov <adech.fo@gmail.com> Cc: Yuri Gribov <tetra2005@gmail.com> Cc: Konstantin Khlebnikov <koct9i@gmail.com> Cc: Sasha Levin <sasha.levin@oracle.com> Cc: Christoph Lameter <cl@linux.com> Cc: Joonsoo Kim <iamjoonsoo.kim@lge.com> Cc: Dave Hansen <dave.hansen@intel.com> Cc: Andi Kleen <andi@firstfloor.org> Cc: Ingo Molnar <mingo@elte.hu> Cc: Thomas Gleixner <tglx@linutronix.de> Cc: "H. Peter Anvin" <hpa@zytor.com> Cc: Christoph Lameter <cl@linux.com> Cc: Pekka Enberg <penberg@kernel.org> Cc: David Rientjes <rientjes@google.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>