02 Sep, 2020

1 commit


31 Jan, 2020

1 commit

  • Commit 8580ac9404f6 ("bpf: Process in-kernel BTF") introduced two weak
    symbols that may be unresolved at link time which result in an absolute
    relocation to 0. relocs_check.sh emits the following warning:

    "WARNING: 2 bad relocations
    c000000001a41478 R_PPC64_ADDR64 _binary__btf_vmlinux_bin_start
    c000000001a41480 R_PPC64_ADDR64 _binary__btf_vmlinux_bin_end"

    whereas those relocations are legitimate even for a relocatable kernel
    compiled with -pie option.

    relocs_check.sh already excluded some weak unresolved symbols explicitly:
    remove those hardcoded symbols and add some logic that parses the symbols
    using nm, retrieves all the weak unresolved symbols and excludes those from
    the list of the potential bad relocations.

    Reported-by: Stephen Rothwell
    Signed-off-by: Alexandre Ghiti
    Signed-off-by: Michael Ellerman
    Link: https://lore.kernel.org/r/20200118170335.21440-1-alex@ghiti.fr

    Alexandre Ghiti
     

04 Sep, 2019

1 commit

  • CONFIG_SHELL falls back to sh when bash is not installed on the system,
    but nobody is testing such a case since bash is usually installed.
    So, shell scripts invoked by CONFIG_SHELL are only tested with bash.

    It makes it difficult to test whether the hashbang #!/bin/sh is real.
    For example, #!/bin/sh in arch/powerpc/kernel/prom_init_check.sh is
    false. (I fixed it up)

    Besides, some shell scripts invoked by CONFIG_SHELL use bash-extension
    and #!/bin/bash is specified as the hashbang, while CONFIG_SHELL may
    not always be set to bash.

    Probably, the right thing to do is to introduce BASH, which is bash by
    default, and always set CONFIG_SHELL to sh. Replace $(CONFIG_SHELL)
    with $(BASH) for bash scripts.

    If somebody tries to add bash-extension to a #!/bin/sh script, it will
    be caught in testing because /bin/sh is a symlink to dash on some major
    distributions.

    Signed-off-by: Masahiro Yamada

    Masahiro Yamada
     

02 Nov, 2017

1 commit

  • Many source files in the tree are missing licensing information, which
    makes it harder for compliance tools to determine the correct license.

    By default all files without license information are under the default
    license of the kernel, which is GPL version 2.

    Update the files which contain no license information with the 'GPL-2.0'
    SPDX license identifier. The SPDX identifier is a legally binding
    shorthand, which can be used instead of the full boiler plate text.

    This patch is based on work done by Thomas Gleixner and Kate Stewart and
    Philippe Ombredanne.

    How this work was done:

    Patches were generated and checked against linux-4.14-rc6 for a subset of
    the use cases:
    - file had no licensing information it it.
    - file was a */uapi/* one with no licensing information in it,
    - file was a */uapi/* one with existing licensing information,

    Further patches will be generated in subsequent months to fix up cases
    where non-standard license headers were used, and references to license
    had to be inferred by heuristics based on keywords.

    The analysis to determine which SPDX License Identifier to be applied to
    a file was done in a spreadsheet of side by side results from of the
    output of two independent scanners (ScanCode & Windriver) producing SPDX
    tag:value files created by Philippe Ombredanne. Philippe prepared the
    base worksheet, and did an initial spot review of a few 1000 files.

    The 4.13 kernel was the starting point of the analysis with 60,537 files
    assessed. Kate Stewart did a file by file comparison of the scanner
    results in the spreadsheet to determine which SPDX license identifier(s)
    to be applied to the file. She confirmed any determination that was not
    immediately clear with lawyers working with the Linux Foundation.

    Criteria used to select files for SPDX license identifier tagging was:
    - Files considered eligible had to be source code files.
    - Make and config files were included as candidates if they contained >5
    lines of source
    - File already had some variant of a license header in it (even if
    Reviewed-by: Philippe Ombredanne
    Reviewed-by: Thomas Gleixner
    Signed-off-by: Greg Kroah-Hartman

    Greg Kroah-Hartman
     

30 May, 2017

2 commits

  • Use a tool to check that the location of "fixed sections" are where
    we expected them to be, which catches cases the linker script can't
    (stubs being added to start of .text section), and which ends up
    being neater.

    Sample output:

    ERROR: start_text address is c000000000008100, should be c000000000008000
    ERROR: see comments in arch/powerpc/tools/head_check.sh

    Signed-off-by: Nicholas Piggin
    [mpe: Fold in fix from Nick for 4.6 era toolchains]
    Signed-off-by: Michael Ellerman

    Nicholas Piggin
     
  • Direct banches from code below __end_interrupts to code above
    __end_interrupts when built with CONFIG_RELOCATABLE are disallowed
    because they will break when the kernel is not located at 0.

    Sample output:

    WARNING: Unrelocated relative branches
    c000000000000118 bl-> 0xc000000000038fb8
    c00000000000013c b-> 0xc0000000001068a4
    c000000000000148 b-> 0xc00000000003919c
    c00000000000014c b-> 0xc00000000003923c
    c0000000000005a4 b-> 0xc000000000106ffc
    c000000000001af0 b-> 0xc000000000106ffc
    c000000000001b24 b-> 0xc000000000106ffc
    c000000000001b58 b-> 0xc000000000106ffc

    Signed-off-by: Balbir Singh
    Signed-off-by: Nicholas Piggin
    Signed-off-by: Michael Ellerman

    Nicholas Piggin
     

09 May, 2017

1 commit

  • Makefile.postlink always includes include/config/auto.conf, however
    this file is not present in a clean kernel tree, causing make to fail:

    $ git clone linuxppc.git
    $ cd linuxppc.git
    $ make distclean
    arch/powerpc/Makefile.postlink:10: include/config/auto.conf: No such file or directory
    make[1]: *** No rule to make target `include/config/auto.conf'. Stop.
    make: *** [vmlinuxclean] Error 2

    Equally running 'make distclean; make distclean' will trip the error case.

    Change the inclusion such that file not being found does not trigger an error.

    Fixes: f188d0524d7e ("powerpc: Use the new post-link pass to check relocations")
    Reported-by: Mircea Pop
    Signed-off-by: Horia Geantă
    Tested-by: Justin M. Forbes
    Signed-off-by: Michael Ellerman

    Horia Geantă
     

28 Apr, 2017

2 commits

  • Move a couple of existing scripts under there. Remove scripts directory:
    a script is a tool, a tool is not a script.

    Signed-off-by: Nicholas Piggin
    Signed-off-by: Michael Ellerman

    Nicholas Piggin
     
  • Currently powerpc has to introduce a dependency on its default build
    target zImage in order to run a relocation check pass over the linked
    vmlinux. This is deficient because the check is not run if the plain
    vmlinux target is built, or if one of the other boot targets is built.

    Switch to using the kbuild post-link pass, added in commit fbe6e37dab97
    ("kbuild: add arch specific post-link Makefile") in order to run this
    check. In future powerpc will use this to do more complicated operations,
    but initially using it for something simple is a good first step.

    Signed-off-by: Nicholas Piggin
    Signed-off-by: Michael Ellerman

    Nicholas Piggin