10 Nov, 2014

1 commit


03 Nov, 2014

1 commit


27 Oct, 2014

1 commit


20 Oct, 2014

1 commit


14 Oct, 2014

1 commit

  • Pull kbuild changes from Michal Marek:
    - fix for handling dependencies of *-objs targets by Masahiro Yamada
    - lots of cleanups in the kbuild machinery, also by Masahiro
    - fixes for the kconfig build to use an UTF-8 capable ncurses library
    if possible and to build on not-so-standard installs
    - some more minor fixes

    * 'kbuild' of git://git.kernel.org/pub/scm/linux/kernel/git/mmarek/kbuild:
    kbuild: Do not reference *-n variables in the Makefile
    kbuild: simplify build, clean, modbuiltin shorthands
    kbuild: arm: Do not define "comma" twice
    kbuild: remove obj-n and lib-n handling
    kbuild: remove unnecessary variable initializaions
    kbuild: remove unnecessary "obj- := dummy.o" trick
    kbuild: handle C=... and M=... after entering into build directory
    kbuild: use $(Q) for sub-make target
    kbuild: fake the "Entering directory ..." message more simply
    kconfig/lxdialog: get ncurses CFLAGS with pkg-config
    kconfig: nconfig: fix multi-byte UTF handling
    kconfig: lxdialog: fix spelling
    kbuild: Make scripts executable
    kbuild: remove redundant clean-files from scripts/kconfig/Makefile
    kbuild: refactor script/kconfig/Makefile
    kbuild: handle the dependency of multi-objs hostprogs appropriately
    kbuild: handle multi-objs dependency appropriately

    Linus Torvalds
     

08 Oct, 2014

2 commits

  • Pull documentation updates from Jiri Kosina:
    "Updates to kernel documentation.

    I took this over (hopefully temporarily) from Randy who was not
    willing to maintain it any longer. This pile mostly is a relay of
    queue that Randy already had in his tree"

    * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/doc:
    Documentation: fix broken v4l-utils URL
    Documentation: update include path for mpssd
    Documentation: correct parameter error for dma_mapping_error
    MAINTAINERS: update location of linux-doc tree
    Documentation: remove networking/.gitignore
    tools: add more endian.h macros
    Make Documenation depend on headers_install
    Docs: this_cpu_ops: remove redundant add forms
    Documentation: disable vdso_test to avoid breakage with old glibc
    Documentation: update vDSO makefile to build portable examples
    Documentation: update .gitignore files
    Documentation: support glibc versions without htole macros
    v4l2-pci-skeleton: Only build if PCI is available
    Documentation: fix misc. warnings
    Documentation: make functions static to avoid prototype warnings
    Documentation: add makefiles for more targets
    Documentation: use subdir-y to avoid unnecessary built-in.o files

    Linus Torvalds
     
  • Pull module update from Rusty Russell:
    "Nothing major: support for compressing modules, and auto-tainting
    params.

    PS. My virtio-next tree is empty: DaveM took the patches I had. There
    might be a virtio-rng starvation fix, but so far it's a bit voodoo
    so I will get to that in the next two days or it will wait"

    * tag 'modules-next-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rusty/linux:
    moduleparam: Resolve missing-field-initializer warning
    kbuild: handle module compression while running 'make modules_install'.
    modinst: wrap long lines in order to enhance cmd_modules_install
    modsign: lookup lines ending in .ko in .mod files
    modpost: simplify file name generation of *.mod.c files
    modpost: reduce visibility of symbols and constify r/o arrays
    param: check for tainting before calling set op.
    drm/i915: taint the kernel if unsafe module parameters are set
    module: add module_param_unsafe and module_param_named_unsafe
    module: make it possible to have unsafe, tainting module params
    module: rename KERNEL_PARAM_FL_NOARG to avoid confusion

    Linus Torvalds
     

06 Oct, 2014

1 commit


02 Oct, 2014

5 commits


29 Sep, 2014

1 commit


26 Sep, 2014

1 commit

  • Cc: rdunlap@infradead.org
    Cc: linux-doc@vger.kernel.org
    Cc: sudeep.dutt@intel.com
    Cc: nikhil.rao@intel.com
    Cc: ashutosh.dixit@intel.com
    Cc: akpm@linux-foundation.org
    Cc: gregkh@linuxfoundation.org
    Signed-off-by: Peter Foley
    Signed-off-by: Jiri Kosina

    Peter Foley
     

22 Sep, 2014

1 commit


15 Sep, 2014

1 commit


08 Sep, 2014

1 commit


01 Sep, 2014

1 commit


27 Aug, 2014

1 commit

  • Since module-init-tools (gzip) and kmod (gzip and xz) support compressed
    modules, it could be useful to include a support for compressing modules
    right after having them installed. Doing this in kbuild instead of per
    distro can permit to make this kind of usage more generic.

    This patch add a Kconfig entry to "Enable loadable module support" menu
    and let you choose to compress using gzip (default) or xz.

    Both gzip and xz does not used any extra -[1-9] option since Andi Kleen
    and Rusty Russell prove no gain is made using them. gzip is called with -n
    argument to avoid storing original filename inside compressed file, that
    way we can save some more bytes.

    On a v3.16 kernel, 'make allmodconfig' generated 4680 modules for a
    total of 378MB (no strip, no sign, no compress), the following table
    shows observed disk space gain based on the allmodconfig .config :

    | time |
    +-------------+-----------------+
    | manual .ko | make | size | percent
    | compression | modules_install | | gain
    +-------------+-----------------+------+--------
    - | | 18.61s | 378M |
    GZIP | 3m16s | 3m37s | 102M | 73.41%
    XZ | 5m22s | 5m39s | 77M | 79.83%

    The gain for restricted environnement seems to be interesting while
    uncompress can be time consuming but happens only while loading a module,
    that is generally done only once.

    This is fully compatible with signed modules while the signed module is
    compressed. module-init-tools or kmod handles decompression
    and provide to other layer the uncompressed but signed payload.

    Reviewed-by: Willy Tarreau
    Signed-off-by: Bertrand Jacquin
    Signed-off-by: Rusty Russell

    Bertrand Jacquin
     

26 Aug, 2014

1 commit


17 Aug, 2014

1 commit


15 Aug, 2014

2 commits

  • Pull misc kbuild updates from Michal Marek:
    "This is the non-critical part of kbuild for 3.17-rc1:

    - make help hint to use make -s with make kernelrelease et al.
    - moved a kbuild document to Documentation/kbuild where it belongs
    - four new Coccinelle scripts, one dropped and one fixed
    - new make kselftest target to run various tests on the kernel"

    * 'misc' of git://git.kernel.org/pub/scm/linux/kernel/git/mmarek/kbuild:
    kbuild: kselftest - new make target to build and run kernel selftests
    Coccinelle: Script to replace if and BUG with BUG_ON
    Coccinelle: Script to detect incorrect argument to sizeof
    Coccinelle: Script to use ARRAY_SIZE instead of division of two sizeofs
    Coccinelle: Script to detect cast after memory allocation
    coccinelle/null: solve parse error
    Documentation: headers_install.txt is part of kbuild
    kbuild: make -s should be used with kernelrelease/kernelversion/image_name

    Linus Torvalds
     
  • Pull kbuild updates from Michal Marek:
    - make clean also considers $(extra-m) and $(extra-) to be consistent
    - cleanup and fixes in scripts/Makefile.host
    - allow to override the name of the Python 2 executable with make
    PYTHON=... (only needed for ia64 in practice)
    - option to split debugingo into *.dwo files to save disk space if the
    compiler supports it (CONFIG_DEBUG_INFO_SPLIT)
    - option to use dwarf4 debuginfo if the compiler supports it
    (CONFIG_DEBUG_INFO_DWARF4)
    - fix for disabling certain warnings with clang
    - fix for unneeded rebuild with dash when a command contains
    backslashes

    * 'kbuild' of git://git.kernel.org/pub/scm/linux/kernel/git/mmarek/kbuild:
    kbuild: Fix handling of backslashes in *.cmd files
    kbuild, LLVMLinux: Supress warnings unless W=1-3
    Kbuild: Add a option to enable dwarf4 v2
    kbuild: Support split debug info v4
    kbuild: allow to override Python command name
    kbuild: clean-up and bug fix of scripts/Makefile.host
    kbuild: clean up scripts/Makefile.host
    kbuild: drop shared library support from Makefile.host
    kbuild: fix a bug of C++ host program handling
    kbuild: fix a typo in scripts/Makefile.host
    scripts/Makefile.clean: clean also $(extra-m) and $(extra-)

    Linus Torvalds
     

08 Aug, 2014

1 commit

  • Add a new make target "kselftest" to enable kernel testing. This
    new target builds and runs kernel selftests. Running as root is
    recommended for a complete test run as some tests don't run when
    run by non-root user. Build, install, and boot kernel before
    running kselftest on it.

    Signed-off-by: Shuah Khan
    Acked-by: Sam Ravnborg
    Signed-off-by: Michal Marek

    Shuah Khan
     

07 Aug, 2014

2 commits

  • We have been chasing a memory corruption bug, which turned out to be
    caused by very old gcc (4.3.4), which happily turned conditional load
    into a non-conditional one, and that broke correctness (the condition
    was met only if lock was held) and corrupted memory.

    This particular problem with that particular code did not happen when
    never gccs were used. I've brought this up with our gcc folks, as I
    wanted to make sure that this can't really happen again, and it turns
    out it actually can.

    Quoting Martin Jambor :
    "More current GCCs are more careful when it comes to replacing a
    conditional load with a non-conditional one, most notably they check
    that a store happens in each iteration of _a_ loop but they assume
    loops are executed. They also perform a simple check whether the
    store cannot trap which currently passes only for non-const
    variables. A simple testcase demonstrating it on an x86_64 is for
    example the following:

    $ cat cond_store.c

    int g_1 = 1;

    int g_2[1024] __attribute__((section ("safe_section"), aligned (4096)));

    int c = 4;

    int __attribute__ ((noinline))
    foo (void)
    {
    int l;
    for (l = 0; (l != 4); l++) {
    if (g_1)
    return l;
    for (g_2[0] = 0; (g_2[0] >= 26); ++g_2[0])
    ;
    }
    return 2;
    }

    int main (int argc, char* argv[])
    {
    if (mprotect (g_2, sizeof(g_2), PROT_READ) == -1)
    {
    int e = errno;
    error (e, e, "mprotect error %i", e);
    }
    foo ();
    __builtin_printf("OK\n");
    return 0;
    }
    /* EOF */
    $ ~/gcc/trunk/inst/bin/gcc cond_store.c -O2 --param allow-store-data-races=0
    $ ./a.out
    OK
    $ ~/gcc/trunk/inst/bin/gcc cond_store.c -O2 --param allow-store-data-races=1
    $ ./a.out
    Segmentation fault

    The testcase fails the same at least with 4.9, 4.8 and 4.7. Therefore
    I would suggest building kernels with this parameter set to zero. I
    also agree with Jikos that the default should be changed for -O2. I
    have run most of the SPEC 2k6 CPU benchmarks (gamess and dealII
    failed, at -O2, not sure why) compiled with and without this option
    and did not see any real difference between respective run-times"

    Hopefully the default will be changed in newer gccs, but let's force it
    for kernel builds so that we are on a safe side even when older gcc are
    used.

    The code in question was out-of-tree printk-in-NMI (yeah, surprise
    suprise, once again) patch written by Petr Mladek, let me quote his
    comment from our internal bugzilla:

    "I have spent few days investigating inconsistent state of kernel ring buffer.
    It went out that it was caused by speculative store generated by
    gcc-4.3.4.

    The problem is in assembly generated for make_free_space(). The functions is
    called the following way:

    + vprintk_emit();
    + log = MAIN_LOG; // with logbuf_lock
    or
    log = NMI_LOG; // with nmi_logbuf_lock
    cont_add(log, ...);
    + cont_flush(log, ...);
    + log_store(log, ...);
    + log_make_free_space(log, ...);

    If called with log = NMI_LOG then only nmi_log_* global variables are safe to
    modify but the generated code does store also into (main_)log_* global
    variables:

    :
    55 push %rbp
    89 f6 mov %esi,%esi

    48 8b 05 03 99 51 01 mov 0x1519903(%rip),%rax # ffffffff82620868
    44 8b 1d ec 98 51 01 mov 0x15198ec(%rip),%r11d # ffffffff82620858
    8b 35 36 60 14 01 mov 0x1146036(%rip),%esi # ffffffff8224cfa8
    44 8b 35 33 60 14 01 mov 0x1146033(%rip),%r14d # ffffffff8224cfac
    4c 8b 2d d0 98 51 01 mov 0x15198d0(%rip),%r13 # ffffffff82620850
    4c 8b 25 11 61 14 01 mov 0x1146111(%rip),%r12 # ffffffff8224d098
    49 89 c2 mov %rax,%r10
    48 21 c2 and %rax,%rdx
    48 8b 1d 0c 99 55 01 mov 0x155990c(%rip),%rbx # ffffffff826608a0
    49 c1 ea 20 shr $0x20,%r10
    48 89 55 d0 mov %rdx,-0x30(%rbp)
    44 29 de sub %r11d,%esi
    45 29 d6 sub %r10d,%r14d
    4c 8b 0d 97 98 51 01 mov 0x1519897(%rip),%r9 # ffffffff82620840
    eb 7e jmp ffffffff81107029
    [...]
    85 ff test %edi,%edi # edi = 1 for NMI_LOG
    4c 89 e8 mov %r13,%rax
    4c 89 ca mov %r9,%rdx
    74 0a je ffffffff8110703d
    8b 15 27 98 51 01 mov 0x1519827(%rip),%edx # ffffffff82620860
    48 8b 45 d0 mov -0x30(%rbp),%rax
    48 39 c2 cmp %rax,%rdx # end of loop
    0f 84 da 00 00 00 je ffffffff81107120
    [...]
    85 ff test %edi,%edi # edi = 1 for NMI_LOG
    4c 89 0d 17 97 51 01 mov %r9,0x1519717(%rip) # ffffffff82620840
    ^^^^^^^^^^^^^^^^^^^^^^^^^^
    KABOOOM
    74 35 je ffffffff81107160

    It stores log_first_seq when edi == NMI_LOG. This instructions are used also
    when edi == MAIN_LOG but the store is done speculatively before the condition
    is decided. It is unsafe because we do not have "logbuf_lock" in NMI context
    and some other process migh modify "log_first_seq" in parallel"

    I believe that the best course of action is both

    - building kernel (and anything multi-threaded, I guess) with that
    optimization turned off
    - persuade gcc folks to change the default for future releases

    Signed-off-by: Jiri Kosina
    Cc: Martin Jambor
    Cc: Petr Mladek
    Cc: Linus Torvalds
    Cc: Paul E. McKenney
    Cc: Peter Zijlstra
    Cc: Marek Polacek
    Cc: Jakub Jelinek
    Cc: Steven Noonan
    Cc: Richard Biener
    Cc: Dan Carpenter
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Jiri Kosina
     
  • This adds a hopefully helpful comment above the (seemingly weird) compiler
    flag selection logic.

    Signed-off-by: Kees Cook
    Suggested-by: Andrew Morton
    Cc: Andi Kleen
    Cc: Randy Dunlap
    Cc: Michal Marek
    Cc: Michal Hocko
    Cc: Stephen Rothwell
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Kees Cook
     

05 Aug, 2014

1 commit

  • clang has more warnings enabled by default. Turn them off unless W is
    set. This patch fixes a logic bug where warnings in clang were disabled
    when W was set.

    Signed-off-by: Behan Webster
    Signed-off-by: Jan-Simon Möller
    Signed-off-by: Mark Charlebois
    Cc: bp@alien8.de
    Signed-off-by: Michal Marek

    Behan Webster
     

04 Aug, 2014

1 commit


31 Jul, 2014

2 commits

  • I found that a lot of unresolvable variables when using gdb on the
    kernel become resolvable when dwarf4 is enabled. So add a Kconfig flag
    to enable it.

    It definitely increases the debug information size, but on the other
    hand this isn't so bad when debug fusion is used.

    v2: Use cc-option
    Signed-off-by: Andi Kleen
    Acked-by: Sam Ravnborg
    Signed-off-by: Michal Marek

    Andi Kleen
     
  • This is an alternative approach to lower the overhead of debug info
    (as we discussed a few days ago)

    gcc 4.7+ and newer binutils have a new "split debug info" debug info
    model where the debug info is only written once into central ".dwo" files.

    This avoids having to copy it around multiple times, from the object
    files to the final executable. It lowers the disk space
    requirements. In addition it defaults to compressed debug data.

    More details here: http://gcc.gnu.org/wiki/DebugFission

    This patch adds a new option to enable it. It has to be an option,
    because it'll undoubtedly break everyone's debuginfo packaging scheme.
    gdb/objdump/etc. all still work, if you have new enough versions.

    I don't see big compile wins (maybe a second or two faster or so), but the
    object dirs with debuginfo get significantly smaller. My standard kernel
    config (slightly bigger than defconfig) shrinks from 2.9G disk space
    to 1.1G objdir (with non reduced debuginfo). I presume if you are IO limited
    the compile time difference will be larger.

    Only problem I've seen so far is that it doesn't play well with older
    versions of ccache (apparently fixed, see
    https://bugzilla.samba.org/show_bug.cgi?id=10005)

    v2: various fixes from Dirk Gouders. Improve commit message slightly.
    v3: Fix clean rules and improve Kconfig slightly
    v4: Fix merge error in last version (Sam Ravnborg)
    Clarify description that it mainly helps disk size.
    Cc: Dirk Gouders
    Signed-off-by: Andi Kleen
    Acked-by: Sam Ravnborg
    Signed-off-by: Michal Marek

    Andi Kleen
     

28 Jul, 2014

1 commit


27 Jul, 2014

1 commit

  • Michel Dänzer and a couple of other people reported inexplicable random
    oopses in the scheduler, and the cause turns out to be gcc mis-compiling
    the load_balance() function when debugging is enabled. The gcc bug
    apparently goes back to gcc-4.5, but slight optimization changes means
    that it now showed up as a problem in 4.9.0 and 4.9.1.

    The instruction scheduling problem causes gcc to schedule a spill
    operation to before the stack frame has been created, which in turn can
    corrupt the spilled value if an interrupt comes in. There may be other
    effects of this bug too, but that's the code generation problem seen in
    Michel's case.

    This is fixed in current gcc HEAD, but the workaround as suggested by
    Markus Trippelsdorf is pretty simple: use -fno-var-tracking-assignments
    when compiling the kernel, which disables the gcc code that causes the
    problem. This can result in slightly worse debug information for
    variable accesses, but that is infinitely preferable to actual code
    generation problems.

    Doing this unconditionally (not just for CONFIG_DEBUG_INFO) also allows
    non-debug builds to verify that the debug build would be identical: we
    can do

    export GCC_COMPARE_DEBUG=1

    to make gcc internally verify that the result of the build is
    independent of the "-g" flag (it will make the compiler build everything
    twice, toggling the debug flag, and compare the results).

    Without the "-fno-var-tracking-assignments" option, the build would fail
    (even with 4.8.3 that didn't show the actual stack frame bug) with a gcc
    compare failure.

    See also gcc bugzilla:

    https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61801

    Reported-by: Michel Dänzer
    Suggested-by: Markus Trippelsdorf
    Cc: Jakub Jelinek
    Cc: stable@kernel.org
    Signed-off-by: Linus Torvalds

    Linus Torvalds
     

21 Jul, 2014

1 commit


18 Jul, 2014

1 commit

  • The specification of Python 3 is largely different from that of
    Python 2.

    For example, arch/ia64/scripts/unwcheck.py seems to be written
    in Python 2, not compatible with Python 3.

    It is not a good idea to invoke python scripts with the hard-coded
    command name 'python'. The command 'python' could possibly be
    Python 3 on some systems.
    For that case, it is reasonable to allow to override the command name
    by giving 'PYTHON=python2' from the command line.

    The 'python' in arch/ia64/Makefile should be replaced with '$(PYTHON)'.

    Signed-off-by: Masahiro Yamada
    Cc: linux-ia64@vger.kernel.org
    Signed-off-by: Michal Marek

    Masahiro Yamada
     

14 Jul, 2014

1 commit


11 Jul, 2014

2 commits

  • If .config has been edited, there will be a silentoldconfig run:

    $ make defconfig
    ...
    $ make kernelrelease
    scripts/kconfig/conf --silentoldconfig Kconfig
    3.16.0-rc1+

    Recently, kbuild started to print the name of the build directory when
    using O=

    $ make O=build kernelrelease
    make[1]: Entering directory `/dev/shm/mmarek/linux-2.6/build'
    3.16.0-rc1+

    Since these targets are often used in scripts, add a hint to use make -s
    to the help text.

    Suggested-by: Russell King
    Signed-off-by: Michal Marek

    Michal Marek
     
  • Pull kbuild fixes from Michal Marek:
    "Three more fixes for the relative build dir feature:

    - Shut up make -s again
    - Fix for rpm/deb/tar-pkg with O=
    - Fix for CONFIG_EXTRA_FIRMWARE"

    * 'rc-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/mmarek/kbuild:
    firmware: Create directories for external firmware
    kbuild: Fix packaging targets with relative $(srctree)
    kbuild: Do not print the build directory with make -s

    Linus Torvalds
     

07 Jul, 2014

1 commit


05 Jul, 2014

1 commit

  • All other users of Makefile.build set $(obj) to the name of the
    subdirectory to build. Do the same for the packaging targets, otherwise
    the build fails if $(srctree) is a relative directory:

    $ make O=build tar-pkg
    make[1]: Entering directory `/home/mmarek/linux-2.6/build'
    CHK include/config/kernel.release
    ../scripts/Makefile.build:44: ../../scripts/package/Makefile: No such file or directory
    make[2]: *** No rule to make target `../../scripts/package/Makefile'. Stop.

    Fixes: 9da0763b ("kbuild: Use relative path when building in a subdir of the source tree")
    Signed-off-by: Michal Marek

    Michal Marek