1. 06 5月, 2021 3 次提交
  2. 01 5月, 2021 1 次提交
  3. 25 4月, 2021 2 次提交
  4. 24 3月, 2021 2 次提交
  5. 16 3月, 2021 1 次提交
    • R
      kbuild: Enable DT undocumented compatible checks · c59773d2
      Rob Herring 提交于
      dt-validate has an option to warn on any compatible strings which don't
      match any schema. The option has recently been improved to fix false
      positives, so let's enable the option. This is useful for tracking
      compatibles which are undocumented or not yet converted to DT schema.
      Previously, the only check of undocumented compatible strings has been
      an imperfect checkpatch.pl check.
      
      The option is enabled by default for 'dtbs_check'. This will add more
      warnings, but some platforms are down to only a handful of these
      warnings (good job!).
      
      There's about 100 cases in the binding examples, so the option is
      disabled until these are fixed. In the meantime, they can be checked
      with:
      
      make DT_CHECKER_FLAGS=-m dt_binding_check
      
      Cc: Maxime Ripard <mripard@kernel.org>
      Cc: Masahiro Yamada <masahiroy@kernel.org>
      Cc: Michal Marek <michal.lkml@markovi.net>
      Cc: linux-kbuild@vger.kernel.org
      Signed-off-by: NRob Herring <robh@kernel.org>
      Link: https://lore.kernel.org/r/20210311233640.1581526-2-robh@kernel.org
      c59773d2
  6. 11 3月, 2021 2 次提交
    • M
      kbuild: remove meaningless parameter to $(call if_changed_rule,dtc) · 285a65f1
      Masahiro Yamada 提交于
      This is a remnant of commit 78046fab ("kbuild: determine the output
      format of DTC by the target suffix").
      
      The parameter "yaml" is meaningless because cmd_dtc no loner takes $(2).
      Reported-by: NRob Herring <robh@kernel.org>
      Signed-off-by: NMasahiro Yamada <masahiroy@kernel.org>
      285a65f1
    • M
      kbuild: remove unneeded -O option to dtc · 64bfc994
      Masahiro Yamada 提交于
      This piece of code converts the target suffix to the dtc -O option:
      
          *.dtb      ->  -O dtb
          *.dt.yaml  ->  -O yaml
      
      Commit ce88c9c7 ("kbuild: Add support to build overlays (%.dtbo)")
      added the third case:
      
          *.dtbo     ->  -O dtbo
      
      This works thanks to commit 163f0469bf2e ("dtc: Allow overlays to have
      .dtbo extension") in the upstream DTC, which has already been pulled in
      the kernel.
      
      However, I think it is a bit odd because "dtbo" is not a format name.
      At least, it does not show up in the help message of dtc.
      
      $ scripts/dtc/dtc --help
        [ snip ]
        -O, --out-format <arg>
              Output formats are:
                      dts - device tree source text
                      dtb - device tree blob
                      yaml - device tree encoded as YAML
                      asm - assembler source
      
      So, I am not a big fan of the second hunk of that change:
      
              } else if (streq(outform, "dtbo")) {
                      dt_to_blob(outf, dti, outversion);
      
      Anyway, we did not need to do this in Makefile in the first place.
      
      guess_type_by_name() had already understood ".yaml" before commit
      4f0e3a57 ("kbuild: Add support for DT binding schema checks"),
      and now does ".dtbo" as well.
      
      Makefile does not need to duplicate the same logic. Let's leave it
      to dtc.
      Signed-off-by: NMasahiro Yamada <masahiroy@kernel.org>
      Reviewed-by: NViresh Kumar <viresh.kumar@linaro.org>
      Acked-by: NRob Herring <robh@kernel.org>
      64bfc994
  7. 24 2月, 2021 2 次提交
  8. 16 2月, 2021 2 次提交
  9. 04 2月, 2021 1 次提交
  10. 15 1月, 2021 1 次提交
    • S
      init: lto: ensure initcall ordering · a8cccdd9
      Sami Tolvanen 提交于
      With LTO, the compiler doesn't necessarily obey the link order for
      initcalls, and initcall variables need globally unique names to avoid
      collisions at link time.
      
      This change exports __KBUILD_MODNAME and adds the initcall_id() macro,
      which uses it together with __COUNTER__ and __LINE__ to help ensure
      these variables have unique names, and moves each variable to its own
      section when LTO is enabled, so the correct order can be specified using
      a linker script.
      
      The generate_initcall_ordering.pl script uses nm to find initcalls from
      the object files passed to the linker, and generates a linker script
      that specifies the same order for initcalls that we would have without
      LTO. With LTO enabled, the script is called in link-vmlinux.sh through
      jobserver-exec to limit the number of jobs spawned.
      Signed-off-by: NSami Tolvanen <samitolvanen@google.com>
      Reviewed-by: NKees Cook <keescook@chromium.org>
      Signed-off-by: NKees Cook <keescook@chromium.org>
      Link: https://lore.kernel.org/r/20201211184633.3213045-8-samitolvanen@google.com
      a8cccdd9
  11. 23 12月, 2020 1 次提交
  12. 20 8月, 2020 1 次提交
    • A
      dt-bindings: Use json for processed-schema* · b8a49399
      Andrei Ziureaev 提交于
      Change the format of processed-schema* from yaml to json to speed up
      validation. With json output, using xargs and appending the output won't
      work since json has explicit list begin and end characters. Instead,
      we pass the schema files as a list in a temp file.
      
      The parsing time for the processed schema goes down from ~2sec to 70ms.
      Also, 'make dtbs_check' becomes 33% faster.
      
      Some error messages are affected by this change. For example, "True was
      expected" becomes "... is not of type 'boolean'". The order of messages
      is also changed.
      Signed-off-by: NAndrei Ziureaev <andrei.ziureaev@arm.com>
      Signed-off-by: NRob Herring <robh@kernel.org>
      b8a49399
  13. 10 8月, 2020 2 次提交
    • M
      kbuild: introduce hostprogs-always-y and userprogs-always-y · faabed29
      Masahiro Yamada 提交于
      To build host programs, you need to add the program names to 'hostprogs'
      to use the necessary build rule, but it is not enough to build them
      because there is no dependency.
      
      There are two types of host programs: built as the prerequisite of
      another (e.g. gen_crc32table in lib/Makefile), or always built when
      Kbuild visits the Makefile (e.g. genksyms in scripts/genksyms/Makefile).
      
      The latter is typical in Makefiles under scripts/, which contains host
      programs globally used during the kernel build. To build them, you need
      to add them to both 'hostprogs' and 'always-y'.
      
      This commit adds hostprogs-always-y as a shorthand.
      
      The same applies to user programs. net/bpfilter/Makefile builds
      bpfilter_umh on demand, hence always-y is unneeded. In contrast,
      programs under samples/ are added to both 'userprogs' and 'always-y'
      so they are always built when Kbuild visits the Makefiles.
      
      userprogs-always-y works as a shorthand.
      Signed-off-by: NMasahiro Yamada <masahiroy@kernel.org>
      Acked-by: NMiguel Ojeda <miguel.ojeda.sandonis@gmail.com>
      faabed29
    • M
      kbuild: introduce ccflags-remove-y and asflags-remove-y · 15d5761a
      Masahiro Yamada 提交于
      CFLAGS_REMOVE_<file>.o filters out flags when compiling a particular
      object, but there is no convenient way to do that for every object in
      a directory.
      
      Add ccflags-remove-y and asflags-remove-y to make it easily.
      
      Use ccflags-remove-y to clean up some Makefiles.
      
      The add/remove order works as follows:
      
       [1] KBUILD_CFLAGS specifies compiler flags used globally
      
       [2] ccflags-y adds compiler flags for all objects in the
           current Makefile
      
       [3] ccflags-remove-y removes compiler flags for all objects in the
           current Makefile (New feature)
      
       [4] CFLAGS_<file> adds compiler flags per file.
      
       [5] CFLAGS_REMOVE_<file> removes compiler flags per file.
      
      Having [3] before [4] allows us to remove flags from most (but not all)
      objects in the current Makefile.
      
      For example, kernel/trace/Makefile removes $(CC_FLAGS_FTRACE)
      from all objects in the directory, then adds it back to
      trace_selftest_dynamic.o and CFLAGS_trace_kprobe_selftest.o
      
      The same applies to lib/livepatch/Makefile.
      
      Please note ccflags-remove-y has no effect to the sub-directories.
      In contrast, the previous notation got rid of compiler flags also from
      all the sub-directories.
      
      The following are not affected because they have no sub-directories:
      
        arch/arm/boot/compressed/
        arch/powerpc/xmon/
        arch/sh/
        kernel/trace/
      
      However, lib/ has several sub-directories.
      
      To keep the behavior, I added ccflags-remove-y to all Makefiles
      in subdirectories of lib/, except the following:
      
        lib/vdso/Makefile        - Kbuild does not descend into this Makefile
        lib/raid/test/Makefile   - This is not used for the kernel build
      
      I think commit 2464a609 ("ftrace: do not trace library functions")
      excluded too much. In the next commit, I will remove ccflags-remove-y
      from the sub-directories of lib/.
      Suggested-by: NSami Tolvanen <samitolvanen@google.com>
      Signed-off-by: NMasahiro Yamada <masahiroy@kernel.org>
      Acked-by: NSteven Rostedt (VMware) <rostedt@goodmis.org>
      Acked-by: Michael Ellerman <mpe@ellerman.id.au> (powerpc)
      Acked-by: Brendan Higgins <brendanhiggins@google.com> (KUnit)
      Tested-by: NAnders Roxell <anders.roxell@linaro.org>
      15d5761a
  14. 31 7月, 2020 1 次提交
  15. 07 7月, 2020 1 次提交
  16. 30 6月, 2020 2 次提交
    • M
      dt-bindings: copy process-schema-examples.yaml to process-schema.yaml · dee9c0b5
      Masahiro Yamada 提交于
      There are two processed schema files:
      
       - processed-schema-examples.yaml
      
          Used for 'make dt_binding_check'. This is always a full schema.
      
       - processed-schema.yaml
      
          Used for 'make dtbs_check'. This may be a full schema, or a smaller
          subset if DT_SCHEMA_FILES is given by a user.
      
      If DT_SCHEMA_FILES is not specified, they are the same. You can copy
      the former to the latter instead of running dt-mk-schema twice. This
      saves the cpu time a lot when you do 'make dt_binding_check dtbs_check'
      because building the full schema takes a couple of seconds.
      
      If DT_SCHEMA_FILES is specified, processed-schema.yaml is generated
      based on the specified yaml files.
      Signed-off-by: NMasahiro Yamada <masahiroy@kernel.org>
      Link: https://lore.kernel.org/r/20200625170434.635114-4-masahiroy@kernel.orgSigned-off-by: NRob Herring <robh@kernel.org>
      dee9c0b5
    • R
      scripts/dtc: Update to upstream version v1.6.0-11-g9d7888cbf19c · 3eb619b2
      Rob Herring 提交于
      Sync with upstream dtc primarily to pickup the I2C bus check fixes. The
      interrupt_provider check is noisy, so turn it off for now.
      
      This adds the following commits from upstream:
      
      9d7888cbf19c dtc: Consider one-character strings as strings
      8259d59f59de checks: Improve i2c reg property checking
      fdabcf2980a4 checks: Remove warning for I2C_OWN_SLAVE_ADDRESS
      2478b1652c8d libfdt: add extern "C" for C++
      f68bfc2668b2 libfdt: trivial typo fix
      7be250b4d059 libfdt: Correct condition for reordering blocks
      81e0919a3e21 checks: Add interrupt provider test
      85e5d839847a Makefile: when building libfdt only, do not add unneeded deps
      b28464a550c5 Fix some potential unaligned accesses in dtc
      Signed-off-by: NRob Herring <robh@kernel.org>
      3eb619b2
  17. 11 6月, 2020 1 次提交
  18. 06 6月, 2020 1 次提交
    • D
      kbuild: add variables for compression tools · 8dfb61dc
      Denis Efremov 提交于
      Allow user to use alternative implementations of compression tools,
      such as pigz, pbzip2, pxz. For example, multi-threaded tools to
      speed up the build:
      $ make GZIP=pigz BZIP2=pbzip2
      
      Variables _GZIP, _BZIP2, _LZOP are used internally because original env
      vars are reserved by the tools. The use of GZIP in gzip tool is obsolete
      since 2015. However, alternative implementations (e.g., pigz) still rely
      on it. BZIP2, BZIP, LZOP vars are not obsolescent.
      
      The credit goes to @grsecurity.
      
      As a sidenote, for multi-threaded lzma, xz compression one can use:
      $ export XZ_OPT="--threads=0"
      Signed-off-by: NDenis Efremov <efremov@linux.com>
      Signed-off-by: NMasahiro Yamada <masahiroy@kernel.org>
      8dfb61dc
  19. 03 6月, 2020 1 次提交
  20. 01 6月, 2020 1 次提交
  21. 25 5月, 2020 2 次提交
  22. 17 5月, 2020 1 次提交
  23. 12 5月, 2020 2 次提交
    • M
      kbuild: determine the output format of DTC by the target suffix · 78046fab
      Masahiro Yamada 提交于
      cmd_dtc takes the additional parameter $(2) to select the target
      format, dtb or yaml. This makes things complicated when it is used
      with cmd_and_fixdep and if_changed_rule. I actually stumbled on this.
      See commit 3d4b2238 ("kbuild: fix DT binding schema rule again to
      avoid needless rebuilds").
      
      Extract the suffix part of the target instead of passing the parameter.
      Fortunately, this works for both $(obj)/%.dtb and $(obj)/%.dt.yaml .
      Signed-off-by: NMasahiro Yamada <masahiroy@kernel.org>
      78046fab
    • M
      kbuild: use -MMD instead of -MD to exclude system headers from dependency · 30a77297
      Masahiro Yamada 提交于
      This omits system headers from the generated header dependency.
      
      System headers are not updated unless you upgrade the compiler. Nor do
      they contain CONFIG options, so fixdep does not need to parse them.
      
      Having said that, the effect of this optimization will be quite small
      because the kernel code generally does not include system headers
      except <stdarg.h>. Host programs include a lot of system headers,
      but there are not so many in the kernel tree.
      
      At first, keeping system headers in .*.cmd files might be useful to
      detect the compiler update, but there is no guarantee that <stdarg.h>
      is included from every file. So, I implemented a more reliable way in
      the previous commit.
      Signed-off-by: NMasahiro Yamada <masahiroy@kernel.org>
      30a77297
  24. 23 4月, 2020 1 次提交
  25. 03 3月, 2020 1 次提交
  26. 27 2月, 2020 2 次提交
  27. 04 2月, 2020 1 次提交
    • M
      kbuild: rename hostprogs-y/always to hostprogs/always-y · 5f2fb52f
      Masahiro Yamada 提交于
      In old days, the "host-progs" syntax was used for specifying host
      programs. It was renamed to the current "hostprogs-y" in 2004.
      
      It is typically useful in scripts/Makefile because it allows Kbuild to
      selectively compile host programs based on the kernel configuration.
      
      This commit renames like follows:
      
        always       ->  always-y
        hostprogs-y  ->  hostprogs
      
      So, scripts/Makefile will look like this:
      
        always-$(CONFIG_BUILD_BIN2C) += ...
        always-$(CONFIG_KALLSYMS)    += ...
            ...
        hostprogs := $(always-y) $(always-m)
      
      I think this makes more sense because a host program is always a host
      program, irrespective of the kernel configuration. We want to specify
      which ones to compile by CONFIG options, so always-y will be handier.
      
      The "always", "hostprogs-y", "hostprogs-m" will be kept for backward
      compatibility for a while.
      Signed-off-by: NMasahiro Yamada <masahiroy@kernel.org>
      5f2fb52f
  28. 07 1月, 2020 1 次提交