28 Jun, 2014

1 commit

  • Pull MIPS fixes from Ralf Baechle:
    "This is dominated by a large number of changes necessary for the MIPS
    BPF code. code. Aside of that there are

    - a fix for the MSC system controller support code.
    - a Turbochannel fix.
    - a recordmcount fix that's MIPS-specific.
    - barrier fixes to smp-cps / pm-cps after unrelated changes elsewhere
    in the kernel.
    - revert support for MSA registers in the signal frames. The
    reverted patch did modify the signal stack frame which of course is
    inacceptable.
    - fix math-emu build breakage with older compilers.
    - some related cleanup.
    - fix Lasat build error if CONFIG_CRC32 isn't set to y by the user"

    * 'upstream' of git://git.linux-mips.org/pub/scm/ralf/upstream-linus: (27 commits)
    MIPS: Lasat: Fix build error if CRC32 is not enabled.
    TC: Handle device_register() errors.
    MIPS: MSC: Prevent out-of-bounds writes to MIPS SC ioremap'd region
    MIPS: bpf: Fix stack space allocation for BPF memwords on MIPS64
    MIPS: BPF: Use 32 or 64-bit load instruction to load an address to register
    MIPS: bpf: Fix PKT_TYPE case for big-endian cores
    MIPS: BPF: Prevent kernel fall over for >=32bit shifts
    MIPS: bpf: Drop update_on_xread and always initialize the X register
    MIPS: bpf: Fix is_range() semantics
    MIPS: bpf: Use pr_debug instead of pr_warn for unhandled opcodes
    MIPS: bpf: Fix return values for VLAN_TAG_PRESENT case
    MIPS: bpf: Use correct mask for VLAN_TAG case
    MIPS: bpf: Fix branch conditional for BPF_J{GT/GE} cases
    MIPS: bpf: Add SEEN_SKB to flags when looking for the PKT_TYPE
    MIPS: bpf: Use 'andi' instead of 'and' for the VLAN cases
    MIPS: bpf: Return error code if the offset is a negative number
    MIPS: bpf: Use the LO register to get division's quotient
    MIPS: mm: uasm: Fix lh micro-assembler instruction
    MIPS: uasm: Add SLT uasm instruction
    MIPS: uasm: Add s3s1s2 instruction builder
    ...

    Linus Torvalds
     

26 Jun, 2014

1 commit

  • On MIPS calls to _mcount in modules generate 2 instructions to load
    the _mcount address (and therefore 2 relocations). The mcount_loc
    table should only reference the first of these, so the second is
    filtered out by checking the relocation offset and ignoring ones that
    immediately follow the previous one seen.

    However if a module has an _mcount call at offset 0, the second
    relocation would not be filtered out due to old_r_offset == 0
    being taken to mean that the current relocation is the first one
    seen, and both would end up in the mcount_loc table.

    This results in ftrace_make_nop() patching both (adjacent)
    instructions to branches over the _mcount call sequence like so:

    0xffffffffc08a8000: 04 00 00 10 b 0xffffffffc08a8014
    0xffffffffc08a8004: 04 00 00 10 b 0xffffffffc08a8018
    0xffffffffc08a8008: 2d 08 e0 03 move at,ra
    ...

    The second branch is in the delay slot of the first, which is
    defined to be unpredictable - on the platform on which this bug was
    encountered, it triggers a reserved instruction exception.

    Fix by initializing old_r_offset to ~0 and using that instead of 0
    to determine whether the current relocation is the first seen.

    Signed-off-by: Alex Smith
    Cc: linux-kernel@vger.kernel.org
    Cc: stable@vger.kernel.org
    Cc: linux-mips@linux-mips.org
    Patchwork: https://patchwork.linux-mips.org/patch/7098/
    Signed-off-by: Ralf Baechle

    Alex Smith
     

24 Jun, 2014

1 commit


19 Jun, 2014

1 commit

  • The kernel headers package (linux-headers) doesn't include several
    header files required to build out-of-tree modules.

    It makes the package unusable on e.g. ARM architecture:
    /usr/src/linux-headers-3.14.0/arch/arm/include/asm/memory.h:24:25:
    fatal error: mach/memory.h: No such file or directory
    #include
    ^
    compilation terminated.

    Signed-off-by: Fathi Boudra
    Reviewed-by: Ben Hutchings
    Signed-off-by: Michal Marek

    Fathi Boudra
     

18 Jun, 2014

2 commits

  • Commit 7e1c0477 (kbuild: Use relative path for $(objtree)) assumes that
    the build process does not change its working directory. make tar-pkg
    was a couterexample, fix this by changing directory only for the tar
    command and not for the whole script, which at one point references the
    now relative $(objtree).

    Reported-and-tested-by: "J. Bruce Fields"
    Signed-off-by: Michal Marek

    Michal Marek
     
  • When $srctree or $objtree are relative paths, we cannot change directory
    and refer to them in the same subshell. Do the redirection outside of
    the subshell to fix this.

    Reported-and-tested-by: Ilya Dryomov
    Signed-off-by: Michal Marek

    Michal Marek
     

13 Jun, 2014

2 commits

  • Pull kbuild misc updates from Michal Marek:
    "This is the non-critical part of kbuild for v3.16-rc1:
    - make deb-pkg can do s390x and arm64
    - new patterns in scripts/tags.sh
    - scripts/tags.sh skips userspace tools' sources (which sometimes
    have copies of kernel structures) and symlinks
    - improvements to the objdiff tool
    - two new coccinelle patches
    - other minor fixes"

    * 'misc' of git://git.kernel.org/pub/scm/linux/kernel/git/mmarek/kbuild:
    scripts: objdiff: support directories for the augument of record command
    scripts: objdiff: fix a comment
    scripts: objdiff: change the extension of disassembly from .o to .dis
    scripts: objdiff: improve path flexibility for record command
    scripts: objdiff: remove unnecessary code
    scripts: objdiff: direct error messages to stderr
    scripts: objdiff: get the path to .tmp_objdiff more simply
    deb-pkg: Add automatic support for s390x architecture
    coccicheck: Add unneeded return variable test
    kbuild: Fix a typo in documentation
    kbuild: trivial - use tabs for code indent where possible
    kbuild: trivial - remove trailing empty lines
    coccinelle: Check for missing NULL terminators in of_device_id tables
    scripts/tags.sh: ignore symlink'ed source files
    scripts/tags.sh: add regular expression replacement pattern for memcg
    builddeb: add arm64 in the supported architectures
    builddeb: use $OBJCOPY variable instead of objcopy
    scripts/tags.sh: ignore code of user space tools
    scripts/tags.sh: add pattern for DEFINE_HASHTABLE
    .gitignore: ignore Module.symvers in all directories

    Linus Torvalds
     
  • Pull kbuild updates from Michal Marek:
    "Kbuild changes for v3.16-rc1:

    - cross-compilation fix so that cc-option is testing the right
    compiler
    - Fix for make defconfig all
    - Using relative paths to the object and source directory where
    possible, plus fixes for the fallout of the change
    - several cleanups in the Makefiles and scripts

    The powerpc fix is from today, because it was only discovered
    recently. The rest has been in linux-next for some time"

    * 'kbuild' of git://git.kernel.org/pub/scm/linux/kernel/git/mmarek/kbuild:
    powerpc: Avoid circular dependency with zImage.%
    kbuild: create include/config directory in scripts/kconfig/Makefile
    kbuild: do not create include/linux directory
    Makefile: Fix unrecognized cross-compiler command line options
    kbuild: do not add "selinux" to subdir- twice
    um: Fix for relative objtree when generating x86 headers
    kbuild: Use relative path when building in a subdir of the source tree
    kbuild: Use relative path when building in the source tree
    kbuild: Use relative path for $(objtree)
    firmware: Use $(quote) in the Makefile
    firmware: Simplify directory creation
    kbuild: trivial - fix comment block indent
    kbuild: trivial - remove trailing spaces
    kbuild: support simultaneous "make %config" and "make all"
    kbuild: move extra gcc checks to scripts/Makefile.extrawarn

    Linus Torvalds
     

12 Jun, 2014

1 commit

  • Pull module updates from Rusty Russell:
    "Most of this is cleaning up various driver sysfs permissions so we can
    re-add the perm check (we unified the module param and sysfs checks,
    but the module ones were stronger so we weakened them temporarily).

    Param parsing gets documented, and also "--" now forces args to be
    handed to init (and ignored by the kernel).

    Module NX/RO protections get tightened: we now set them before calling
    parse_args()"

    * tag 'modules-next-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rusty/linux:
    module: set nx before marking module MODULE_STATE_COMING.
    samples/kobject/: avoid world-writable sysfs files.
    drivers/hid/hid-picolcd_fb: avoid world-writable sysfs files.
    drivers/staging/speakup/: avoid world-writable sysfs files.
    drivers/regulator/virtual: avoid world-writable sysfs files.
    drivers/scsi/pm8001/pm8001_ctl.c: avoid world-writable sysfs files.
    drivers/hid/hid-lg4ff.c: avoid world-writable sysfs files.
    drivers/video/fbdev/sm501fb.c: avoid world-writable sysfs files.
    drivers/mtd/devices/docg3.c: avoid world-writable sysfs files.
    speakup: fix incorrect perms on speakup_acntsa.c
    cpumask.h: silence warning with -Wsign-compare
    Documentation: Update kernel-parameters.tx
    param: hand arguments after -- straight to init
    modpost: Fix resource leak in read_dump()

    Linus Torvalds
     

11 Jun, 2014

1 commit

  • Right now when people try to report issues in the kernel they send stack
    dumps to eachother, which looks something like this:

    [ 6.906437] [] ? backtrace_test_irq_callback+0x20/0x20
    [ 6.907121] [] dump_stack+0x52/0x7f
    [ 6.907640] [] backtrace_regression_test+0x38/0x110
    [ 6.908281] [] ? proc_create_data+0xa0/0xd0
    [ 6.908870] [] ? proc_modules_init+0x22/0x22
    [ 6.909480] [] do_one_initcall+0xc2/0x1e0
    [...]

    However, most of the text you get is pure garbage.

    The only useful thing above is the function name. Due to the amount of
    different kernel code versions and various configurations being used,
    the kernel address and the offset into the function are not really
    helpful in determining where the problem actually occured.

    Too often the result of someone looking at a stack dump is asking the
    person who sent it for a translation for one or more 'addr2line'
    translations. Which slows down the entire process of debugging the
    issue (and really annoying).

    The decode_stacktrace script is an attempt to make the output more
    useful and easy to work with by translating all kernel addresses in the
    stack dump into line numbers. Which means that the stack dump would
    look like this:

    [ 635.148361] dump_stack (lib/dump_stack.c:52)
    [ 635.149127] warn_slowpath_common (kernel/panic.c:418)
    [ 635.150214] warn_slowpath_null (kernel/panic.c:453)
    [ 635.151031] _oalloc_pages_slowpath+0x6a/0x7d0
    [ 635.152171] ? zone_watermark_ok (mm/page_alloc.c:1728)
    [ 635.152988] ? get_page_from_freelist (mm/page_alloc.c:1939)
    [ 635.154766] __alloc_pages_nodemask (mm/page_alloc.c:2766)

    It's pretty obvious why this is better than the previous stack dump
    before.

    Usage is pretty simple:

    ./decode_stacktrace.sh [vmlinux] [base path]

    Where vmlinux is the vmlinux to extract line numbers from and base path
    is the path that points to the root of the build tree, for example:

    ./decode_stacktrace.sh vmlinux /home/sasha/linux/ < input.log > output.log

    The stack trace should be piped through it (I, for example, just pipe
    the output of the serial console of my KVM test box through it).

    Signed-off-by: Sasha Levin
    Signed-off-by: Linus Torvalds

    Sasha Levin
     

10 Jun, 2014

15 commits

  • For example,

    $ scripts/objdiff record init drivers/usb

    disassembles all the objects under init and drivers/usb directories.

    This feature would be useful when we change various files under the
    specific directory.

    Signed-off-by: Masahiro Yamada
    Acked-by: Jason Cooper
    Signed-off-by: Michal Marek

    Masahiro Yamada
     
  • Signed-off-by: Masahiro Yamada
    Acked-by: Jason Cooper
    Signed-off-by: Michal Marek

    Masahiro Yamada
     
  • Prior to this commit, the command "scripts/objdiff record path/to/*.o"
    disassembled the given object into ".tmp_objdiff/path/to/*.o" file.

    The problem here is that recorded disassemblies are lost if we run
    "make clean" because it removes all the *.o files.
    Disassembled code should be dumped into *.dis instead of *.o files.

    Signed-off-by: Masahiro Yamada
    Acked-by: Jason Cooper
    Signed-off-by: Michal Marek

    Masahiro Yamada
     
  • Prior to this commit, scripts/objdiff expected to be run at the top
    directory and only the relative path of objects.

    This commit provides more flexibility in terms of object path:

    [1] scripts/objdiff can be run in any directory

    For example,

    $ scripts/objdiff record init/main.o

    and

    $ cd init; ../scripts/objdiff record main.o

    produce the same result.

    [2] Support absolute path for objects

    $ scripts/objdiff record /home/foo/bar/linux/init/main.o

    work as well.

    Signed-off-by: Masahiro Yamada
    Acked-by: Jason Cooper
    Signed-off-by: Michal Marek

    Masahiro Yamada
     
  • The directories for objdump is created by the code
    a few lines below:

    [ ! -d "$OBJDIFFD/$dn" ] && mkdir -p "$OBJDIFFD/$dn"

    Signed-off-by: Masahiro Yamada
    Acked-by: Jason Cooper
    Signed-off-by: Michal Marek

    Masahiro Yamada
     
  • Signed-off-by: Masahiro Yamada
    Acked-by: Jason Cooper
    Signed-off-by: Michal Marek

    Masahiro Yamada
     
  • This commit is a minor refactoring.

    Temporary files for objdiff are stored in .tmp_objdiff directory
    which is located at the top directory.

    To get the path to this directory,

    SRCTREE=`git rev-parse --show-toplevel`
    TMPD=$SRCTREE/.tmp_objdiff

    seems easier to understand than

    GIT_DIR=`git rev-parse --git-dir`
    TMPD=${GIT_DIR%git}tmp_objdiff

    Besides, it is not always necessary to create .tmp_objdiff dicrectory.
    It should be created only for "record" command.

    Signed-off-by: Masahiro Yamada
    Acked-by: Jason Cooper
    Signed-off-by: Michal Marek

    Masahiro Yamada
     
  • The Debian s390x architecture has 64-bit userland whereas s390 has
    32-bit userland. A 64-bit kernel can be used with either. Now that
    Debian supports multiarch and officially supports s390x, it makes more
    sense to assign a 64-bit kernel package to s390x.

    Reported-by: Stephen Powell
    References: https://bugs.debian.org/750925
    Signed-off-by: Ben Hutchings
    Signed-off-by: Michal Marek

    Ben Hutchings
     
  • This semantic patch looks for variables that are initialized with a
    constant, are never updated, and are only used as parameter of return.
    Return the constant instead of using a variable.

    Signed-off-by: Peter Senna Tschudin
    Signed-off-by: Michal Marek

    Peter Senna Tschudin
     
  • Signed-off-by: Masahiro Yamada
    Signed-off-by: Michal Marek

    Masahiro Yamada
     
  • The directory include/config is used only for
    silentoldconfig, localmodconfig, localyesconfig.

    Signed-off-by: Masahiro Yamada
    Signed-off-by: Michal Marek

    Masahiro Yamada
     
  • Signed-off-by: Masahiro Yamada

    Masahiro Yamada
     
  • Failure to terminate an of_device_id table can lead to confusing
    failures depending on where the compiler places the array. Add a
    check to make sure these tables are terminated. Thanks to Mitchel
    Humpherys for coming up with the pattern initially.

    Cc: Mitchel Humpherys
    Cc: Gilles Muller
    Cc: Nicolas Palix
    Cc: Rob Herring
    Cc: devicetree@vger.kernel.org
    Signed-off-by: Stephen Boyd
    Acked-by: Grant Likely
    Signed-off-by: Julia Lawall
    Signed-off-by: Michal Marek

    Stephen Boyd
     
  • scripts/Makefile adds "selinux" to subdir-y or subdir- twice.

    subdir-$(CONFIG_MODVERSIONS) += genksyms
    subdir-y += mod
    subdir-$(CONFIG_SECURITY_SELINUX) += selinux
    Signed-off-by: Michal Marek

    Masahiro Yamada
     
  • Since commit 22d651dcef536c75f75537290bf3da5038e68b6b ('selftests/powerpc:
    Import Anton's memcpy / copy_tofrom_user tests'), some source files in the
    tree appear as symlink.
    Until commit 8c38a5328af8080bc69a25b3e4e144b03eeea95e ('scripts/tags.sh:
    ignore code of user space tools'), those symlinks made cscope report some
    warnings:

    $ make ALLSOURCE_ARCHS=all O=./obj-cscope/ cscope
    GEN cscope
    cscope: cannot find
    file .../tools/testing/selftests/powerpc/copyloops/copyuser_power7.S
    cscope: cannot find
    file .../tools/testing/selftests/powerpc/copyloops/memcpy_64.S
    cscope: cannot find
    file .../tools/testing/selftests/powerpc/copyloops/memcpy_power7.S
    cscope: cannot find
    file .../tools/testing/selftests/powerpc/copyloops/copyuser_64.S

    In order to prevent the same kind of warnings to be triggered by future
    addition of symlinks, the best option is to ignore all symlinks when
    building the file list to be processed by cscope (and other tools
    supported by scripts/tags.sh).

    Ignoring symlinks won't hide source files from cscope (and others) as the
    target of these symlinks already appear somewhere else in the tree, and,
    as such, should be processed by cscope (or others).

    Note that, cscope, when used with -R option to make it find the files to
    process by itself, already skip symlinks: it's not expected that cscope
    access source files through symlink.

    On top of commit 8c38a5328af8080bc69a25b3e4e144b03eeea95e ('scripts/tags.sh:
    ignore code of user space tools'), scripts/tags.sh output from
    "make cscope tags TAGS" is the same with and without this patch: it doesn't
    seems to introduce any regression (on Fedora 20).

    Link: http://lkml.kernel.org/r/1396530975.4361.28.camel@localhost.localdomain
    Link: http://mid.gmane.org/534312F8.5090609@t-online.de
    Cc: Michael Ellerman
    Cc: Anton Blanchard
    Cc: Benjamin Herrenschmidt
    Cc: Hans-Bernhard Bröker ,
    Cc: Hans-Bernhard Broeker ,
    Cc: Neil Horman
    Cc: Neil Horman
    Cc: Gerhard Sittig
    Cc: Konstantin Khlebnikov
    Signed-off-by: Yann Droneaud
    Signed-off-by: Michal Marek

    Yann Droneaud
     

07 Jun, 2014

1 commit

  • Pull arm64 updates from Catalin Marinas:
    - Optimised assembly string/memory routines (based on the AArch64
    Cortex Strings library contributed to glibc but re-licensed under
    GPLv2)
    - Optimised crypto algorithms making use of the ARMv8 crypto extensions
    (together with kernel API for using FPSIMD instructions in interrupt
    context)
    - Ftrace support
    - CPU topology parsing from DT
    - ESR_EL1 (Exception Syndrome Register) exposed to user space signal
    handlers for SIGSEGV/SIGBUS (useful to emulation tools like Qemu)
    - 1GB section linear mapping if applicable
    - Barriers usage clean-up
    - Default pgprot clean-up

    Conflicts as per Catalin.

    * tag 'arm64-upstream' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux: (57 commits)
    arm64: kernel: initialize broadcast hrtimer based clock event device
    arm64: ftrace: Add system call tracepoint
    arm64: ftrace: Add CALLER_ADDRx macros
    arm64: ftrace: Add dynamic ftrace support
    arm64: Add ftrace support
    ftrace: Add arm64 support to recordmcount
    arm64: Add 'notrace' attribute to unwind_frame() for ftrace
    arm64: add __ASSEMBLY__ in asm/insn.h
    arm64: Fix linker script entry point
    arm64: lib: Implement optimized string length routines
    arm64: lib: Implement optimized string compare routines
    arm64: lib: Implement optimized memcmp routine
    arm64: lib: Implement optimized memset routine
    arm64: lib: Implement optimized memmove routine
    arm64: lib: Implement optimized memcpy routine
    arm64: defconfig: enable a few more common/useful options in defconfig
    ftrace: Make CALLER_ADDRx macros more generic
    arm64: Fix deadlock scenario with smp_send_stop()
    arm64: Fix machine_shutdown() definition
    arm64: Support arch_irq_work_raise() via self IPIs
    ...

    Linus Torvalds
     

05 Jun, 2014

9 commits


04 Jun, 2014

1 commit

  • Pull trivial tree changes from Jiri Kosina:
    "Usual pile of patches from trivial tree that make the world go round"

    * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial: (23 commits)
    staging: go7007: remove reference to CONFIG_KMOD
    aic7xxx: Remove obsolete preprocessor define
    of: dma: doc fixes
    doc: fix incorrect formula to calculate CommitLimit value
    doc: Note need of bc in the kernel build from 3.10 onwards
    mm: Fix printk typo in dmapool.c
    modpost: Fix comment typo "Modules.symvers"
    Kconfig.debug: Grammar s/addition/additional/
    wimax: Spelling s/than/that/, wording s/destinatary/recipient/
    aic7xxx: Spelling s/termnation/termination/
    arm64: mm: Remove superfluous "the" in comment
    of: Spelling s/anonymouns/anonymous/
    dma: imx-sdma: Spelling s/determnine/determine/
    ath10k: Improve grammar in comments
    ath6kl: Spelling s/determnine/determine/
    of: Improve grammar for of_alias_get_id() documentation
    drm/exynos: Spelling s/contro/control/
    radio-bcm2048.c: fix wrong overflow check
    doc: printk-formats: do not mention casts for u64/s64
    doc: spelling error changes
    ...

    Linus Torvalds
     

29 May, 2014

1 commit

  • Recordmcount utility under scripts is run, after compiling each object,
    to find out all the locations of calling _mcount() and put them into
    specific seciton named __mcount_loc.
    Then linker collects all such information into a table in the kernel image
    (between __start_mcount_loc and __stop_mcount_loc) for later use by ftrace.

    This patch adds arm64 specific definitions to identify such locations.
    There are two types of implementation, C and Perl. On arm64, only C version
    is used to build the kernel now that CONFIG_HAVE_C_RECORDMCOUNT is on.
    But Perl version is also maintained.

    This patch also contains a workaround just in case where a header file,
    elf.h, on host machine doesn't have definitions of EM_AARCH64 nor
    R_AARCH64_ABS64. Without them, compiling C version of recordmcount will
    fail.

    Acked-by: Will Deacon
    Signed-off-by: AKASHI Takahiro
    Signed-off-by: Will Deacon

    AKASHI Takahiro
     

20 May, 2014

1 commit

  • The new renameat2 syscall provides all the functionality of renameat
    with an additional flags argument, so make renameat optional so that
    future architectures can omit it without getting a warning.

    This patch doesn't affect existing architectures.

    Signed-off-by: James Hogan
    Acked-by: Arnd Bergmann
    Signed-off-by: Miklos Szeredi
    Cc: linux-arch@vger.kernel.org

    James Hogan
     

15 May, 2014

1 commit

  • When building the firmware blobs, use a simple loop to create
    directories in $(objtree), like in Makefile.build. This simplifies the
    rules and also makes it possible to set $(objtree) to '.' later. Before
    this change, a dependency on $(objtree)/ would be satisfied by
    in $(srctree).

    When installing the firmware blobs, call mkdir like in Makefile.modinst.

    Cc: David Woodhouse
    Acked-by: Sam Ravnborg
    Signed-off-by: Michal Marek

    Michal Marek
     

14 May, 2014

1 commit

  • Currently, while using ctags to read code, we would get stumbled on
    PageCgroup* symbols: no definition found. And it is quite dull to
    manually dig it out.

    This patch adds regular expression replacement pattern for such symbols,
    like what have done for the PageXXX flag. It will teach ctags to find
    out the definition for us.

    Signed-off-by: Jianyu Zhan
    Signed-off-by: Michal Marek

    Jianyu Zhan