1. 16 Nov, 2017 11 commits
  2. 13 Nov, 2017 7 commits
    • Masahiro Yamada's avatar
      sh: select KBUILD_DEFCONFIG depending on ARCH · 859fd586
      Masahiro Yamada authored
      You can not select KBUILD_DEFCONFIG depending on any CONFIG option
      because include/config/auto.conf is not included when building config
      targets.  So, CONFIG_SUPERH32 is never set during the configuration,
      then cayman_defconfig is always chosen.
      
      This commit provides a sensible way to choose shx3/cayman_defconfig.
      
      arch/sh/Kconfig sets either SUPERH32 or SUPERH64 depending on ARCH
      environment, like follows:
      
        config SUPERH32
                def_bool ARCH = "sh"
      
                ...
      
        config SUPERH64
                def_bool ARCH = "sh64"
      
      It should make sense to choose the default defconfig by ARCH,
      like arch/sparc/Makefile.
      Signed-off-by: default avatarMasahiro Yamada <yamada.masahiro@socionext.com>
      859fd586
    • Nick Desaulniers's avatar
      kbuild: fix linker feature test macros when cross compiling with Clang · 86a9df59
      Nick Desaulniers authored
      I was not seeing my linker flags getting added when using ld-option when
      cross compiling with Clang. Upon investigation, this seems to be due to
      a difference in how GCC vs Clang handle cross compilation.
      
      GCC is configured at build time to support one backend, that is implicit
      when compiling.  Clang is explicit via the use of `-target <triple>` and
      ships with all supported backends by default.
      
      GNU Make feature test macros that compile then link will always fail
      when cross compiling with Clang unless Clang's triple is passed along to
      the compiler. For example:
      
      $ clang -x c /dev/null -c -o temp.o
      $ aarch64-linux-android/bin/ld -E temp.o
      aarch64-linux-android/bin/ld:
      unknown architecture of input file `temp.o' is incompatible with
      aarch64 output
      aarch64-linux-android/bin/ld:
      warning: cannot find entry symbol _start; defaulting to
      0000000000400078
      $ echo $?
      1
      
      $ clang -target aarch64-linux-android- -x c /dev/null -c -o temp.o
      $ aarch64-linux-android/bin/ld -E temp.o
      aarch64-linux-android/bin/ld:
      warning: cannot find entry symbol _start; defaulting to 00000000004002e4
      $ echo $?
      0
      
      This causes conditional checks that invoke $(CC) without the target
      triple, then $(LD) on the result, to always fail.
      Suggested-by: default avatarMasahiro Yamada <yamada.masahiro@socionext.com>
      Signed-off-by: default avatarNick Desaulniers <ndesaulniers@google.com>
      Reviewed-by: default avatarMatthias Kaehlcke <mka@chromium.org>
      Signed-off-by: default avatarMasahiro Yamada <yamada.masahiro@socionext.com>
      86a9df59
    • Masahiro Yamada's avatar
      kbuild: shrink .cache.mk when it exceeds 1000 lines · e17c400a
      Masahiro Yamada authored
      The cache files are only cleaned away by "make clean".  If you continue
      incremental builds, the cache files will grow up little by little.
      It is not a big deal in general use cases because compiler flags do not
      change quite often.
      
      However, if you do build-test for various architectures, compilers, and
      kernel configurations, you will end up with huge cache files soon.
      
      When the cache file exceeds 1000 lines, shrink it down to 500 by "tail".
      The Least Recently Added lines are cut. (not Least Recently Used)
      I hope it will work well enough.
      Signed-off-by: default avatarMasahiro Yamada <yamada.masahiro@socionext.com>
      Reviewed-by: default avatarDouglas Anderson <dianders@chromium.org>
      e17c400a
    • Masahiro Yamada's avatar
      kbuild: do not call cc-option before KBUILD_CFLAGS initialization · 433dc2eb
      Masahiro Yamada authored
      Some $(call cc-option,...) are invoked very early, even before
      KBUILD_CFLAGS, etc. are initialized.
      
      The returned string from $(call cc-option,...) depends on
      KBUILD_CPPFLAGS, KBUILD_CFLAGS, and GCC_PLUGINS_CFLAGS.
      
      Since they are exported, they are not empty when the top Makefile
      is recursively invoked.
      
      The recursion occurs in several places.  For example, the top
      Makefile invokes itself for silentoldconfig.  "make tinyconfig",
      "make rpm-pkg" are the cases, too.
      
      In those cases, the second call of cc-option from the same line
      runs a different shell command due to non-pristine KBUILD_CFLAGS.
      
      To get the same result all the time, KBUILD_* and GCC_PLUGINS_CFLAGS
      must be initialized before any call of cc-option.  This avoids
      garbage data in the .cache.mk file.
      
      Move all calls of cc-option below the config targets because target
      compiler flags are unnecessary for Kconfig.
      Signed-off-by: default avatarMasahiro Yamada <yamada.masahiro@socionext.com>
      Reviewed-by: default avatarDouglas Anderson <dianders@chromium.org>
      433dc2eb
    • Douglas Anderson's avatar
      kbuild: Cache a few more calls to the compiler · 4e562071
      Douglas Anderson authored
      These are a few stragglers that I left out of the original patch to
      cache calls to the C compiler ("kbuild: Add a cache for generated
      variables") because they bleed out into the main Makefile and thus
      uglify things a little bit.  The idea is the same here, though.
      Signed-off-by: default avatarDouglas Anderson <dianders@chromium.org>
      Tested-by: default avatarIngo Molnar <mingo@kernel.org>
      Tested-by: default avatarGuenter Roeck <linux@roeck-us.net>
      Signed-off-by: default avatarMasahiro Yamada <yamada.masahiro@socionext.com>
      4e562071
    • Douglas Anderson's avatar
      kbuild: Add a cache for generated variables · 3298b690
      Douglas Anderson authored
      While timing a "no-op" build of the kernel (incrementally building the
      kernel even though nothing changed) in the Chrome OS build system I
      found that it was much slower than I expected.
      
      Digging into things a bit, I found that quite a bit of the time was
      spent invoking the C compiler even though we weren't actually building
      anything.  Currently in the Chrome OS build system the C compiler is
      called through a number of wrappers (one of which is written in
      python!) and can take upwards of 100 ms to invoke even if we're not
      doing anything difficult, so these invocations of the compiler were
      taking a lot of time.  Worse the invocations couldn't seem to take
      advantage of the multiple cores on my system.
      
      Certainly it seems like we could make the compiler invocations in the
      Chrome OS build system faster, but only to a point.  Inherently
      invoking a program as big as a C compiler is a fairly heavy
      operation.  Thus even if we can speed the compiler calls it made sense
      to track down what was happening.
      
      It turned out that all the compiler invocations were coming from
      usages like this in the kernel's Makefile:
      
      KBUILD_CFLAGS += $(call cc-option,-fno-delete-null-pointer-checks,)
      
      Due to the way cc-option and similar statements work the above
      contains an implicit call to the C compiler.  ...and due to the fact
      that we're storing the result in KBUILD_CFLAGS, a simply expanded
      variable, the call will happen every time the Makefile is parsed, even
      if there are no users of KBUILD_CFLAGS.
      
      Rather than redoing this computation every time, it makes a lot of
      sense to cache the result of all of the Makefile's compiler calls just
      like we do when we compile a ".c" file to a ".o" file.  Conceptually
      this is quite a simple idea.  ...and since the calls to invoke the
      compiler and similar tools are centrally located in the Kbuild.include
      file this doesn't even need to be super invasive.
      
      Implementing the cache in a simple-to-use and efficient way is not
      quite as simple as it first sounds, though.  To get maximum speed we
      really want the cache in a format that make can natively understand
      and make doesn't really have an ability to load/parse files. ...but
      make _can_ import other Makefiles, so the solution is to store the
      cache in Makefile format.  This requires coming up with a valid/unique
      Makefile variable name for each value to be cached, but that's
      solvable with some cleverness.
      
      After this change, we'll automatically create a ".cache.mk" file that
      will contain our cached variables.  We'll load this on each invocation
      of make and will avoid recomputing anything that's already in our
      cache.  The cache is stored in a format that it shouldn't need any
      invalidation since anything that might change should affect the "key"
      and any old cached value won't be used.
      Signed-off-by: default avatarDouglas Anderson <dianders@chromium.org>
      Tested-by: default avatarIngo Molnar <mingo@kernel.org>
      Tested-by: default avatarGuenter Roeck <linux@roeck-us.net>
      Signed-off-by: default avatarMasahiro Yamada <yamada.masahiro@socionext.com>
      3298b690
    • Masahiro Yamada's avatar
      kbuild: add forward declaration of default target to Makefile.asm-generic · a7d34df3
      Masahiro Yamada authored
      $(kbuild-file) and Kbuild.include are included before the default
      target "all".
      
      We will add a target into Kbuild.include.  In advance, add a forward
      declaration of the default target.
      Signed-off-by: default avatarMasahiro Yamada <yamada.masahiro@socionext.com>
      Reviewed-by: default avatarDouglas Anderson <dianders@chromium.org>
      a7d34df3
  3. 30 Oct, 2017 4 commits
  4. 26 Oct, 2017 2 commits
  5. 10 Oct, 2017 3 commits
  6. 09 Oct, 2017 3 commits
  7. 01 Oct, 2017 9 commits
    • Linus Torvalds's avatar
      Linux 4.14-rc3 · 9e66317d
      Linus Torvalds authored
      9e66317d
    • Linus Torvalds's avatar
      Merge branch 'x86-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · 368f8998
      Linus Torvalds authored
      Pull x86 fixes from Thomas Gleixner:
       "This contains the following fixes and improvements:
      
         - Avoid dereferencing an unprotected VMA pointer in the fault signal
           generation code
      
         - Fix inline asm call constraints for GCC 4.4
      
         - Use existing register variable to retrieve the stack pointer
           instead of forcing the compiler to create another indirect access
           which results in excessive extra 'mov %rsp, %<dst>' instructions
      
         - Disable branch profiling for the memory encryption code to prevent
           an early boot crash
      
         - Fix a sparse warning caused by casting the __user annotation in
           __get_user_asm_u64() away
      
         - Fix an off by one error in the loop termination of the error patch
           in the x86 sysfs init code
      
         - Add missing CPU IDs to various Intel specific drivers to enable the
           functionality on recent hardware
      
         - More (init) constification in the numachip code"
      
      * 'x86-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        x86/asm: Use register variable to get stack pointer value
        x86/mm: Disable branch profiling in mem_encrypt.c
        x86/asm: Fix inline asm call constraints for GCC 4.4
        perf/x86/intel/uncore: Correct num_boxes for IIO and IRP
        perf/x86/intel/rapl: Add missing CPU IDs
        perf/x86/msr: Add missing CPU IDs
        perf/x86/intel/cstate: Add missing CPU IDs
        x86: Don't cast away the __user in __get_user_asm_u64()
        x86/sysfs: Fix off-by-one error in loop termination
        x86/mm: Fix fault error path using unsafe vma pointer
        x86/numachip: Add const and __initconst to numachip2_clockevent
      368f8998
    • Linus Torvalds's avatar
      Merge branch 'timers-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · c42ed9f9
      Linus Torvalds authored
      Pull timer fixes from Thomas Gleixner:
       "This adds a new timer wheel function which is required for the
        conversion of the timer callback function from the 'unsigned long
        data' argument to 'struct timer_list *timer'. This conversion has two
        benefits:
      
         1) It makes struct timer_list smaller
      
         2) Many callers hand in a pointer to the timer or to the structure
            containing the timer, which happens via type casting both at setup
            and in the callback. This change gets rid of the typecasts.
      
        Once the conversion is complete, which is planned for 4.15, the old
        setup function and the intermediate typecast in the new setup function
        go away along with the data field in struct timer_list.
      
        Merging this now into mainline allows a smooth queueing of the actual
        conversion in the affected maintainer trees without creating
        dependencies"
      
      * 'timers-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        um/time: Fixup namespace collision
        timer: Prepare to change timer callback argument type
      c42ed9f9
    • Linus Torvalds's avatar
      Merge branch 'smp-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · 82513545
      Linus Torvalds authored
      Pull smp/hotplug fixes from Thomas Gleixner:
       "This addresses the fallout of the new lockdep mechanism which covers
        completions in the CPU hotplug code.
      
        The lockdep splats are false positives, but there is no way to
        annotate that reliably. The solution is to split the completions for
        CPU up and down, which requires some reshuffling of the failure
        rollback handling as well"
      
      * 'smp-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        smp/hotplug: Hotplug state fail injection
        smp/hotplug: Differentiate the AP completion between up and down
        smp/hotplug: Differentiate the AP-work lockdep class between up and down
        smp/hotplug: Callback vs state-machine consistency
        smp/hotplug: Rewrite AP state machine core
        smp/hotplug: Allow external multi-instance rollback
        smp/hotplug: Add state diagram
      82513545
    • Linus Torvalds's avatar
      Merge branch 'sched-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · 7e103ace
      Linus Torvalds authored
      Pull scheduler fixes from Thomas Gleixner:
       "The scheduler pull request comes with the following updates:
      
         - Prevent a divide by zero issue by validating the input value of
           sysctl_sched_time_avg
      
         - Make task state printing consistent all over the place and have
           explicit state characters for IDLE and PARKED so they wont be
           displayed as 'D' state which confuses tools"
      
      * 'sched-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        sched/sysctl: Check user input value of sysctl_sched_time_avg
        sched/debug: Add explicit TASK_PARKED printing
        sched/debug: Ignore TASK_IDLE for SysRq-W
        sched/debug: Add explicit TASK_IDLE printing
        sched/tracing: Use common task-state helpers
        sched/tracing: Fix trace_sched_switch task-state printing
        sched/debug: Remove unused variable
        sched/debug: Convert TASK_state to hex
        sched/debug: Implement consistent task-state printing
      7e103ace
    • Linus Torvalds's avatar
      Merge branch 'perf-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · 1c6f705b
      Linus Torvalds authored
      Pull perf fixes from Thomas Gleixner:
      
       - Prevent a division by zero in the perf aux buffer handling
      
       - Sync kernel headers with perf tool headers
      
       - Fix a build failure in the syscalltbl code
      
       - Make the debug messages of perf report --call-graph work correctly
      
       - Make sure that all required perf files are in the MANIFEST for
         container builds
      
       - Fix the atrr.exclude kernel handling so it respects the
         perf_event_paranoid and the user permissions
      
       - Make perf test on s390x work correctly
      
      * 'perf-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        perf/aux: Only update ->aux_wakeup in non-overwrite mode
        perf test: Fix vmlinux failure on s390x part 2
        perf test: Fix vmlinux failure on s390x
        perf tools: Fix syscalltbl build failure
        perf report: Fix debug messages with --call-graph option
        perf evsel: Fix attr.exclude_kernel setting for default cycles:p
        tools include: Sync kernel ABI headers with tooling headers
        perf tools: Get all of tools/{arch,include}/ in the MANIFEST
      1c6f705b
    • Linus Torvalds's avatar
      Merge branch 'locking-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · 1de47f3c
      Linus Torvalds authored
      Pull  locking fixes from Thomas Gleixner:
       "Two fixes for locking:
      
         - Plug a hole the pi_stat->owner serialization which was changed
           recently and failed to fixup two usage sites.
      
         - Prevent reordering of the rwsem_has_spinner() check vs the
           decrement of rwsem count in up_write() which causes a missed
           wakeup"
      
      * 'locking-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        locking/rwsem-xadd: Fix missed wakeup due to reordering of load
        futex: Fix pi_state->owner serialization
      1de47f3c
    • Linus Torvalds's avatar
      Merge branch 'irq-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · 3d9d62b9
      Linus Torvalds authored
      Pull irq fixes from Thomas Gleixner:
      
       - Add a missing NULL pointer check in free_irq()
      
       - Fix a memory leak/memory corruption in the generic irq chip
      
       - Add missing rcu annotations for radix tree access
      
       - Use ffs instead of fls when extracting data from a chip register in
         the MIPS GIC irq driver
      
       - Fix the unmasking of IPI interrupts in the MIPS GIC driver so they
         end up at the target CPU and not at CPU0
      
      * 'irq-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        irq/generic-chip: Don't replace domain's name
        irqdomain: Add __rcu annotations to radix tree accessors
        irqchip/mips-gic: Use effective affinity to unmask
        irqchip/mips-gic: Fix shifts to extract register fields
        genirq: Check __free_irq() return value for NULL
      3d9d62b9
    • Linus Torvalds's avatar
      Merge branch 'core-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · 156069f8
      Linus Torvalds authored
      Pull objtool fixes from Thomas Gleixner:
       "Two small fixes for objtool:
      
         - Support frame pointer setup via 'lea (%rsp), %rbp' which was not
           yet supported and caused build warnings
      
         - Disable unreacahble warnings for GCC4.4 and older to avoid false
           positives caused by the compiler itself"
      
      * 'core-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        objtool: Support unoptimized frame pointer setup
        objtool: Skip unreachable warnings for GCC 4.4 and older
      156069f8
  8. 30 Sep, 2017 1 commit