10 Dec, 2018

1 commit


03 Dec, 2018

1 commit


26 Nov, 2018

1 commit


19 Nov, 2018

1 commit


12 Nov, 2018

1 commit


05 Nov, 2018

1 commit


02 Nov, 2018

2 commits

  • There is one more user of $(cc-name) in the top Makefile. It is supposed
    to detect Clang before invoking Kconfig, so it should still be there
    in the $(shell ...) form. All the other users of $(cc-name) have been
    replaced with $(CONFIG_CC_IS_CLANG). Hence, scripts/Kbuild.include does
    not need to define cc-name any more.

    Signed-off-by: Masahiro Yamada

    Masahiro Yamada
     
  • Evaluating cc-name invokes the compiler every time even when you are
    not compiling anything, like 'make help'. This is not efficient.

    The compiler type has been already detected in the Kconfig stage.
    Use CONFIG_CC_IS_CLANG, instead.

    Signed-off-by: Masahiro Yamada
    Acked-by: Michael Ellerman (powerpc)
    Acked-by: Paul Burton (MIPS)
    Acked-by: Joel Stanley

    Masahiro Yamada
     

29 Oct, 2018

2 commits

  • Pull VLA removal from Kees Cook:
    "Globally warn on VLA use.

    This turns on "-Wvla" globally now that the last few trees with their
    VLA removals have landed (crypto, block, net, and powerpc).

    Arnd mentioned that there may be a couple more VLAs hiding in
    hard-to-find randconfigs, but nothing big has shaken out in the last
    month or so in linux-next.

    We should be basically VLA-free now! Wheee. :)

    Summary:

    - Remove unused fallback for BUILD_BUG_ON (which technically contains
    a VLA)

    - Lift -Wvla to the top-level Makefile"

    * tag 'vla-v4.20-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/kees/linux:
    Makefile: Globally enable VLA warning
    compiler.h: give up __compiletime_assert_fallback()

    Linus Torvalds
     
  • Pull Kbuild updates from Masahiro Yamada:

    - optimize kallsyms slightly

    - remove check for old CFLAGS usage

    - add some compiler flags unconditionally instead of evaluating
    $(call cc-option,...)

    - fix variable shadowing in host tools

    - refactor scripts/mkmakefile

    - refactor various makefiles

    * tag 'kbuild-v4.20' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild:
    modpost: Create macro to avoid variable shadowing
    ASN.1: Remove unnecessary shadowed local variable
    kbuild: use 'else ifeq' for checksrc to improve readability
    kbuild: remove unneeded link_multi_deps
    kbuild: add -Wno-unused-but-set-variable flag unconditionally
    kbuild: add -Wdeclaration-after-statement flag unconditionally
    kbuild: add -Wno-pointer-sign flag unconditionally
    modpost: remove leftover symbol prefix handling for module device table
    kbuild: simplify command line creation in scripts/mkmakefile
    kbuild: do not pass $(objtree) to scripts/mkmakefile
    kbuild: remove user ID check in scripts/mkmakefile
    kbuild: remove VERSION and PATCHLEVEL from $(objtree)/Makefile
    kbuild: add --include-dir flag only for out-of-tree build
    kbuild: remove dead code in cmd_files calculation in top Makefile
    kbuild: hide most of targets when running config or mixed targets
    kbuild: remove old check for CFLAGS use
    kbuild: prefix Makefile.dtbinst path with $(srctree) unconditionally
    kallsyms: remove left-over Blackfin code
    kallsyms: reduce size a little on 64-bit

    Linus Torvalds
     

27 Oct, 2018

1 commit

  • Pull Devicetree updates from Rob Herring:
    "A bit bigger than normal as I've been busy this cycle.

    There's a few things with dependencies and a few things subsystem
    maintainers didn't pick up, so I'm taking them thru my tree.

    The fixes from Johan didn't get into linux-next, but they've been
    waiting for some time now and they are what's left of what subsystem
    maintainers didn't pick up.

    Summary:

    - Sync dtc with upstream version v1.4.7-14-gc86da84d30e4

    - Work to get rid of direct accesses to struct device_node name and
    type pointers in preparation for removing them. New helpers for
    parsing DT cpu nodes and conversions to use the helpers. printk
    conversions to %pOFn for printing DT node names. Most went thru
    subystem trees, so this is the remainder.

    - Fixes to DT child node lookups to actually be restricted to child
    nodes instead of treewide.

    - Refactoring of dtb targets out of arch code. This makes the support
    more uniform and enables building all dtbs on c6x, microblaze, and
    powerpc.

    - Various DT binding updates for Renesas r8a7744 SoC

    - Vendor prefixes for Facebook, OLPC

    - Restructuring of some ARM binding docs moving some peripheral
    bindings out of board/SoC binding files

    - New "secure-chosen" binding for secure world settings on ARM

    - Dual licensing of 2 DT IRQ binding headers"

    * tag 'devicetree-for-4.20' of git://git.kernel.org/pub/scm/linux/kernel/git/robh/linux: (78 commits)
    ARM: dt: relicense two DT binding IRQ headers
    power: supply: twl4030-charger: fix OF sibling-node lookup
    NFC: nfcmrvl_uart: fix OF child-node lookup
    net: stmmac: dwmac-sun8i: fix OF child-node lookup
    net: bcmgenet: fix OF child-node lookup
    drm/msm: fix OF child-node lookup
    drm/mediatek: fix OF sibling-node lookup
    of: Add missing exports of node name compare functions
    dt-bindings: Add OLPC vendor prefix
    dt-bindings: misc: bk4: Add device tree binding for Liebherr's BK4 SPI bus
    dt-bindings: thermal: samsung: Add SPDX license identifier
    dt-bindings: clock: samsung: Add SPDX license identifiers
    dt-bindings: timer: ostm: Add R7S9210 support
    dt-bindings: phy: rcar-gen2: Add r8a7744 support
    dt-bindings: can: rcar_can: Add r8a7744 support
    dt-bindings: timer: renesas, cmt: Document r8a7744 CMT support
    dt-bindings: watchdog: renesas-wdt: Document r8a7744 support
    dt-bindings: thermal: rcar: Add device tree support for r8a7744
    Documentation: dt: Add binding for /secure-chosen/stdout-path
    dt-bindings: arm: zte: Move sysctrl bindings to their own doc
    ...

    Linus Torvalds
     

23 Oct, 2018

1 commit

  • Pull locking and misc x86 updates from Ingo Molnar:
    "Lots of changes in this cycle - in part because locking/core attracted
    a number of related x86 low level work which was easier to handle in a
    single tree:

    - Linux Kernel Memory Consistency Model updates (Alan Stern, Paul E.
    McKenney, Andrea Parri)

    - lockdep scalability improvements and micro-optimizations (Waiman
    Long)

    - rwsem improvements (Waiman Long)

    - spinlock micro-optimization (Matthew Wilcox)

    - qspinlocks: Provide a liveness guarantee (more fairness) on x86.
    (Peter Zijlstra)

    - Add support for relative references in jump tables on arm64, x86
    and s390 to optimize jump labels (Ard Biesheuvel, Heiko Carstens)

    - Be a lot less permissive on weird (kernel address) uaccess faults
    on x86: BUG() when uaccess helpers fault on kernel addresses (Jann
    Horn)

    - macrofy x86 asm statements to un-confuse the GCC inliner. (Nadav
    Amit)

    - ... and a handful of other smaller changes as well"

    * 'locking-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (57 commits)
    locking/lockdep: Make global debug_locks* variables read-mostly
    locking/lockdep: Fix debug_locks off performance problem
    locking/pvqspinlock: Extend node size when pvqspinlock is configured
    locking/qspinlock_stat: Count instances of nested lock slowpaths
    locking/qspinlock, x86: Provide liveness guarantee
    x86/asm: 'Simplify' GEN_*_RMWcc() macros
    locking/qspinlock: Rework some comments
    locking/qspinlock: Re-order code
    locking/lockdep: Remove duplicated 'lock_class_ops' percpu array
    x86/defconfig: Enable CONFIG_USB_XHCI_HCD=y
    futex: Replace spin_is_locked() with lockdep
    locking/lockdep: Make class->ops a percpu counter and move it under CONFIG_DEBUG_LOCKDEP=y
    x86/jump-labels: Macrofy inline assembly code to work around GCC inlining bugs
    x86/cpufeature: Macrofy inline assembly code to work around GCC inlining bugs
    x86/extable: Macrofy inline assembly code to work around GCC inlining bugs
    x86/paravirt: Work around GCC inlining bugs when compiling paravirt ops
    x86/bug: Macrofy the BUG table section handling, to work around GCC inlining bugs
    x86/alternatives: Macrofy lock prefixes to work around GCC inlining bugs
    x86/refcount: Work around GCC inlining bug
    x86/objtool: Use asm macros to work around GCC inlining bugs
    ...

    Linus Torvalds
     

22 Oct, 2018

1 commit


19 Oct, 2018

3 commits

  • We have raised the compiler requirement from time to time.
    With commit cafa0010cd51 ("Raise the minimum required gcc version
    to 4.6"), the minimum for GCC is 4.6 now.

    This flag was added by GCC 4.6, and it is recognized by ICC as well.

    It is true that Clang does not support this flag but this commit is
    just touching the else part of the "ifeq ($(cc-name),clang)" check.
    Hence, Clang build is not affected.

    Let's rip off the cc-disable-warning switch, and see if somebody
    complains about it.

    Signed-off-by: Masahiro Yamada
    Reviewed-by: Nick Desaulniers

    Masahiro Yamada
     
  • We have raised the compiler requirement from time to time.
    With commit cafa0010cd51 ("Raise the minimum required gcc version
    to 4.6"), the minimum for GCC is 4.6 now.

    This flag has been here since the pre-git era. It is documented in
    the GCC 4.6 manual, and it is recognized by Clang and ICC as well.

    Let's rip off the cc-option switch, and see if somebody complains
    about it.

    Signed-off-by: Masahiro Yamada
    Tested-by: Nick Desaulniers

    Masahiro Yamada
     
  • We have raised the compiler requirement from time to time.
    With commit cafa0010cd51 ("Raise the minimum required gcc version
    to 4.6"), the minimum for GCC is 4.6 now.

    The -Wno-pointer-sign has been here since the pre-git era. It is
    documented in the GCC 4.6 manual, and it is recognized by Clang
    and ICC as well.

    Let's rip off the cc-disable-warning switch, and see if somebody
    complains about it.

    Signed-off-by: Masahiro Yamada
    Tested-by: Nick Desaulniers

    Masahiro Yamada
     

15 Oct, 2018

1 commit


12 Oct, 2018

1 commit

  • …t/masahiroy/linux-kbuild

    Masahiro writes:
    "Kbuild fixes for v4.19 (2nd)
    - Fix warnings from recordmcount.pl when building with Clang
    - Allow Clang to use GNU toolchains correctly
    - Disable CONFIG_SAMPLES for UML to avoid build error"

    * tag 'kbuild-fixes-v4.19-2' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild:
    samples: disable CONFIG_SAMPLES for UML
    kbuild: allow to use GCC toolchain not in Clang search path
    ftrace: Build with CPPFLAGS to get -Qunused-arguments

    Greg Kroah-Hartman
     

11 Oct, 2018

1 commit

  • Now that Variable Length Arrays (VLAs) have been entirely removed[1]
    from the kernel, enable the VLA warning globally. The only exceptions
    to this are the KASan an UBSan tests which are explicitly checking that
    VLAs trigger their respective tests.

    [1] https://lkml.kernel.org/r/CA+55aFzCG-zNmZwX4A2FQpadafLfEzK6CC=qPXydAacU1RqZWA@mail.gmail.com

    Cc: Masahiro Yamada
    Cc: Andrew Morton
    Cc: David Airlie
    Cc: linux-kbuild@vger.kernel.org
    Cc: intel-gfx@lists.freedesktop.org
    Cc: dri-devel@lists.freedesktop.org
    Signed-off-by: Kees Cook

    Kees Cook
     

07 Oct, 2018

1 commit


04 Oct, 2018

4 commits

  • Since $(objtree) is always '.', it is not useful to pass it to
    scripts/mkmakefile. I assume nobody wants to run this script directly.

    Signed-off-by: Masahiro Yamada

    Masahiro Yamada
     
  • Neither VERSION nor PATCHLEVEL is used in any useful way.

    Signed-off-by: Masahiro Yamada

    Masahiro Yamada
     
  • The --include-dir flag is used to include check-in Makefiles from
    $(objtree) without $(srctree)/ prefix. Obviously, this is unneeded
    for in-tree build. Add the flag just before changing the working
    directory.

    This becomes effective after invoking sub-make. Add a little bit
    comments about it.

    Signed-off-by: Masahiro Yamada

    Masahiro Yamada
     
  • … asm() related GCC inlining bugs

    Using macros in inline assembly allows us to work around bugs
    in GCC's inlining decisions.

    Compile macros.S and use it to assemble all C files.
    Currently only x86 will use it.

    Background:

    The inlining pass of GCC doesn't include an assembler, so it's not aware
    of basic properties of the generated code, such as its size in bytes,
    or that there are such things as discontiuous blocks of code and data
    due to the newfangled linker feature called 'sections' ...

    Instead GCC uses a lazy and fragile heuristic: it does a linear count of
    certain syntactic and whitespace elements in inlined assembly block source
    code, such as a count of new-lines and semicolons (!), as a poor substitute
    for "code size and complexity".

    Unsurprisingly this heuristic falls over and breaks its neck whith certain
    common types of kernel code that use inline assembly, such as the frequent
    practice of putting useful information into alternative sections.

    As a result of this fresh, 20+ years old GCC bug, GCC's inlining decisions
    are effectively disabled for inlined functions that make use of such asm()
    blocks, because GCC thinks those sections of code are "large" - when in
    reality they are often result in just a very low number of machine
    instructions.

    This absolute lack of inlining provess when GCC comes across such asm()
    blocks both increases generated kernel code size and causes performance
    overhead, which is particularly noticeable on paravirt kernels, which make
    frequent use of these inlining facilities in attempt to stay out of the
    way when running on baremetal hardware.

    Instead of fixing the compiler we use a workaround: we set an assembly macro
    and call it from the inlined assembly block. As a result GCC considers the
    inline assembly block as a single instruction. (Which it often isn't but I digress.)

    This uglifies and bloats the source code - for example just the refcount
    related changes have this impact:

    Makefile | 9 +++++++--
    arch/x86/Makefile | 7 +++++++
    arch/x86/kernel/macros.S | 7 +++++++
    scripts/Kbuild.include | 4 +++-
    scripts/mod/Makefile | 2 ++
    5 files changed, 26 insertions(+), 3 deletions(-)

    Yay readability and maintainability, it's not like assembly code is hard to read
    and maintain ...

    We also hope that GCC will eventually get fixed, but we are not holding
    our breath for that. Yet we are optimistic, it might still happen, any decade now.

    [ mingo: Wrote new changelog describing the background. ]

    Tested-by: Kees Cook <keescook@chromium.org>
    Signed-off-by: Nadav Amit <namit@vmware.com>
    Acked-by: Masahiro Yamada <yamada.masahiro@socionext.com>
    Acked-by: Peter Zijlstra (Intel) <peterz@infradead.org>
    Cc: Andy Lutomirski <luto@amacapital.net>
    Cc: Borislav Petkov <bp@alien8.de>
    Cc: Brian Gerst <brgerst@gmail.com>
    Cc: Denys Vlasenko <dvlasenk@redhat.com>
    Cc: H. Peter Anvin <hpa@zytor.com>
    Cc: Linus Torvalds <torvalds@linux-foundation.org>
    Cc: Michal Marek <michal.lkml@markovi.net>
    Cc: Peter Zijlstra <peterz@infradead.org>
    Cc: Sam Ravnborg <sam@ravnborg.org>
    Cc: Thomas Gleixner <tglx@linutronix.de>
    Cc: linux-kbuild@vger.kernel.org
    Link: http://lkml.kernel.org/r/20181003213100.189959-3-namit@vmware.com
    Signed-off-by: Ingo Molnar <mingo@kernel.org>

    Nadav Amit
     

02 Oct, 2018

1 commit

  • There is nothing arch specific about building dtb files other than their
    location under /arch/*/boot/dts/. Keeping each arch aligned is a pain.
    The dependencies and supported targets are all slightly different.
    Also, a cross-compiler for each arch is needed, but really the host
    compiler preprocessor is perfectly fine for building dtbs. Move the
    build rules to a common location and remove the arch specific ones. This
    is done in a single step to avoid warnings about overriding rules.

    The build dependencies had been a mixture of 'scripts' and/or 'prepare'.
    These pull in several dependencies some of which need a target compiler
    (specifically devicetable-offsets.h) and aren't needed to build dtbs.
    All that is really needed is dtc, so adjust the dependencies to only be
    dtc.

    This change enables support 'dtbs_install' on some arches which were
    missing the target.

    Acked-by: Will Deacon
    Acked-by: Paul Burton
    Acked-by: Ley Foon Tan
    Acked-by: Masahiro Yamada
    Cc: Michal Marek
    Cc: Vineet Gupta
    Cc: Russell King
    Cc: Catalin Marinas
    Cc: Yoshinori Sato
    Cc: Michal Simek
    Cc: Ralf Baechle
    Cc: James Hogan
    Cc: Benjamin Herrenschmidt
    Cc: Paul Mackerras
    Cc: Michael Ellerman
    Cc: Chris Zankel
    Cc: Max Filippov
    Cc: linux-kbuild@vger.kernel.org
    Cc: linux-snps-arc@lists.infradead.org
    Cc: linux-arm-kernel@lists.infradead.org
    Cc: uclinux-h8-devel@lists.sourceforge.jp
    Cc: linux-mips@linux-mips.org
    Cc: nios2-dev@lists.rocketboards.org
    Cc: linuxppc-dev@lists.ozlabs.org
    Cc: linux-xtensa@linux-xtensa.org
    Signed-off-by: Rob Herring

    Rob Herring
     

30 Sep, 2018

1 commit


24 Sep, 2018

1 commit


19 Sep, 2018

1 commit

  • When using a GCC cross toolchain which is not in a compiled in
    Clang search path, Clang reverts to the system assembler and
    linker. This leads to assembler or linker errors, depending on
    which tool is first used for a given architecture.

    It seems that Clang is not searching $PATH for a matching
    assembler or linker.

    Make sure that Clang picks up the correct assembler or linker by
    passing the cross compilers bin directory as search path.

    This allows to use Clang provided by distributions with GCC
    toolchains not in /usr/bin.

    Link: https://github.com/ClangBuiltLinux/linux/issues/78
    Signed-off-by: Stefan Agner
    Reviewed-and-tested-by: Nick Desaulniers
    Signed-off-by: Masahiro Yamada

    Stefan Agner
     

17 Sep, 2018

2 commits


14 Sep, 2018

2 commits


13 Sep, 2018

1 commit

  • As a Kernel developer, I make heavy use of "make targz-pkg" in order
    to locally compile and remotely install my development Kernels. The
    nice feature I rely on is that after a normal "make", "make targz-pkg"
    only generates the tarball without having to recompile everything.

    That was true until commit f28bc3c32c05 ("tracing: Handle
    CC_FLAGS_FTRACE more accurately"). After it, running "make targz-pkg"
    after "make" will recompile the whole Kernel tree, making my
    development workflow much slower.

    The Kernel is choosing to recompile everything because it claims the
    command line has changed. A diff of the .cmd files show a repeated
    -mfentry in one of the files. That is because "make targz-pkg" calls
    "make modules_install" and the environment is already populated with
    the exported variables, CC_FLAGS_FTRACE being one of them. Then,
    -mfentry gets duplicated because it is not protected behind an ifndef
    block, like -pg.

    To complicate the problem a little bit more, architectures can define
    their own version CC_FLAGS_FTRACE, so our code not only has to
    consider recursive Makefiles, but also architecture overrides.

    So in this patch we move CC_FLAGS_FTRACE up and unconditionally
    define it to -pg. Then we let the architecture Makefiles possibly
    override it, and finally append the extra options later. This ensures
    the variable is always fully redefined at each invocation so recursive
    Makefiles don't keep appending, and hopefully it maintains the
    intended behavior on how architectures can override the defaults..

    Thanks Steven Rostedt and Vasily Gorbik for the help on this
    regression.

    Cc: Michal Marek
    Cc: Ingo Molnar
    Cc: Tvrtko Ursulin
    Cc: linux-kbuild@vger.kernel.org
    Fixes: commit f28bc3c32c05 ("tracing: Handle CC_FLAGS_FTRACE more accurately")
    Acked-by: Vasily Gorbik
    Signed-off-by: Paulo Zanoni
    Signed-off-by: Steven Rostedt (VMware)

    Paulo Zanoni
     

10 Sep, 2018

1 commit


05 Sep, 2018

1 commit

  • If the kernel headers aren't installed we can't build all the tests.
    Add a new make target rule 'khdr' in the file lib.mk to generate the
    kernel headers and that gets include for every test-dir Makefile that
    includes lib.mk If the testdir in turn have its own sub-dirs the
    top_srcdir needs to be set to the linux-rootdir to be able to generate
    the kernel headers.

    Signed-off-by: Anders Roxell
    Reviewed-by: Fathi Boudra
    Signed-off-by: Shuah Khan (Samsung OSG)

    Anders Roxell
     

03 Sep, 2018

1 commit


31 Aug, 2018

1 commit


27 Aug, 2018

2 commits

  • Linus Torvalds
     
  • Pull x86 fixes from Thomas Gleixner:

    - Correct the L1TF fallout on 32bit and the off by one in the 'too much
    RAM for protection' calculation.

    - Add a helpful kernel message for the 'too much RAM' case

    - Unbreak the VDSO in case that the compiler desides to use indirect
    jumps/calls and emits retpolines which cannot be resolved because the
    kernel uses its own thunks, which does not work for the VDSO. Make it
    use the builtin thunks.

    - Re-export start_thread() which was unexported when the 32/64bit
    implementation was unified. start_thread() is required by modular
    binfmt handlers.

    - Trivial cleanups

    * 'x86-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
    x86/speculation/l1tf: Suggest what to do on systems with too much RAM
    x86/speculation/l1tf: Fix off-by-one error when warning that system has too much RAM
    x86/kvm/vmx: Remove duplicate l1d flush definitions
    x86/speculation/l1tf: Fix overflow in l1tf_pfn_limit() on 32bit
    x86/process: Re-export start_thread()
    x86/mce: Add notifier_block forward declaration
    x86/vdso: Fix vDSO build if a retpoline is emitted

    Linus Torvalds
     

24 Aug, 2018

1 commit

  • Commit a0f97e06a43c ("kbuild: enable 'make CFLAGS=...' to add
    additional options to CC") renamed CFLAGS to KBUILD_CFLAGS.

    Commit 222d394d30e7 ("kbuild: enable 'make AFLAGS=...' to add
    additional options to AS") renamed AFLAGS to KBUILD_AFLAGS.

    Commit 06c5040cdb13 ("kbuild: enable 'make CPPFLAGS=...' to add
    additional options to CPP") renamed CPPFLAGS to KBUILD_CPPFLAGS.

    For some reason, LDFLAGS was not renamed.

    Using a well-known variable like LDFLAGS may result in accidental
    override of the variable.

    Kbuild generally uses KBUILD_ prefixed variables for the internally
    appended options, so here is one more conversion to sanitize the
    naming convention.

    I did not touch Makefiles under tools/ since the tools build system
    is a different world.

    Signed-off-by: Masahiro Yamada
    Acked-by: Kirill A. Shutemov
    Reviewed-by: Palmer Dabbelt

    Masahiro Yamada