1. 08 7月, 2022 1 次提交
  2. 28 5月, 2022 1 次提交
  3. 18 5月, 2022 1 次提交
    • J
      random: remove ratelimiting for in-kernel unseeded randomness · cc1e127b
      Jason A. Donenfeld 提交于
      The CONFIG_WARN_ALL_UNSEEDED_RANDOM debug option controls whether the
      kernel warns about all unseeded randomness or just the first instance.
      There's some complicated rate limiting and comparison to the previous
      caller, such that even with CONFIG_WARN_ALL_UNSEEDED_RANDOM enabled,
      developers still don't see all the messages or even an accurate count of
      how many were missed. This is the result of basically parallel
      mechanisms aimed at accomplishing more or less the same thing, added at
      different points in random.c history, which sort of compete with the
      first-instance-only limiting we have now.
      
      It turns out, however, that nobody cares about the first unseeded
      randomness instance of in-kernel users. The same first user has been
      there for ages now, and nobody is doing anything about it. It isn't even
      clear that anybody _can_ do anything about it. Most places that can do
      something about it have switched over to using get_random_bytes_wait()
      or wait_for_random_bytes(), which is the right thing to do, but there is
      still much code that needs randomness sometimes during init, and as a
      geeneral rule, if you're not using one of the _wait functions or the
      readiness notifier callback, you're bound to be doing it wrong just
      based on that fact alone.
      
      So warning about this same first user that can't easily change is simply
      not an effective mechanism for anything at all. Users can't do anything
      about it, as the Kconfig text points out -- the problem isn't in
      userspace code -- and kernel developers don't or more often can't react
      to it.
      
      Instead, show the warning for all instances when CONFIG_WARN_ALL_UNSEEDED_RANDOM
      is set, so that developers can debug things need be, or if it isn't set,
      don't show a warning at all.
      
      At the same time, CONFIG_WARN_ALL_UNSEEDED_RANDOM now implies setting
      random.ratelimit_disable=1 on by default, since if you care about one
      you probably care about the other too. And we can clean up usage around
      the related urandom_warning ratelimiter as well (whose behavior isn't
      changing), so that it properly counts missed messages after the 10
      message threshold is reached.
      
      Cc: Theodore Ts'o <tytso@mit.edu>
      Cc: Dominik Brodowski <linux@dominikbrodowski.net>
      Signed-off-by: NJason A. Donenfeld <Jason@zx2c4.com>
      cc1e127b
  4. 13 5月, 2022 1 次提交
  5. 30 4月, 2022 1 次提交
  6. 29 4月, 2022 2 次提交
  7. 22 4月, 2022 4 次提交
  8. 06 4月, 2022 1 次提交
    • O
      mm/slub: use stackdepot to save stack trace in objects · 5cf909c5
      Oliver Glitta 提交于
      Many stack traces are similar so there are many similar arrays.
      Stackdepot saves each unique stack only once.
      
      Replace field addrs in struct track with depot_stack_handle_t handle.  Use
      stackdepot to save stack trace.
      
      The benefits are smaller memory overhead and possibility to aggregate
      per-cache statistics in the following patch using the stackdepot handle
      instead of matching stacks manually.
      
      [ vbabka@suse.cz: rebase to 5.17-rc1 and adjust accordingly ]
      
      This was initially merged as commit 78869146 and reverted by commit
      ae14c63a due to several issues, that should now be fixed.
      The problem of unconditional memory overhead by stackdepot has been
      addressed by commit 2dba5eb1 ("lib/stackdepot: allow optional init
      and stack_table allocation by kvmalloc()"), so the dependency on
      stackdepot will result in extra memory usage only when a slab cache
      tracking is actually enabled, and not for all CONFIG_SLUB_DEBUG builds.
      The build failures on some architectures were also addressed, and the
      reported issue with xfs/433 test did not reproduce on 5.17-rc1 with this
      patch.
      Signed-off-by: NOliver Glitta <glittao@gmail.com>
      Signed-off-by: NVlastimil Babka <vbabka@suse.cz>
      Reviewed-and-tested-by: NHyeonggon Yoo <42.hyeyoo@gmail.com>
      Acked-by: NDavid Rientjes <rientjes@google.com>
      Cc: David Rientjes <rientjes@google.com>
      Cc: Christoph Lameter <cl@linux.com>
      Cc: Pekka Enberg <penberg@kernel.org>
      Cc: Joonsoo Kim <iamjoonsoo.kim@lge.com>
      5cf909c5
  9. 24 3月, 2022 2 次提交
  10. 21 3月, 2022 1 次提交
    • K
      lib: stackinit: Convert to KUnit · 02788ebc
      Kees Cook 提交于
      Convert stackinit unit tests to KUnit, for better integration
      into the kernel self test framework. Includes a rename of
      test_stackinit.c to stackinit_kunit.c, and CONFIG_TEST_STACKINIT to
      CONFIG_STACKINIT_KUNIT_TEST.
      
      Adjust expected test results based on which stack initialization method
      was chosen:
      
       $ CMD="./tools/testing/kunit/kunit.py run stackinit --raw_output \
              --arch=x86_64 --kconfig_add"
      
       $ $CMD | grep stackinit:
       # stackinit: pass:36 fail:0 skip:29 total:65
      
       $ $CMD CONFIG_GCC_PLUGIN_STRUCTLEAK_USER=y | grep stackinit:
       # stackinit: pass:37 fail:0 skip:28 total:65
      
       $ $CMD CONFIG_GCC_PLUGIN_STRUCTLEAK_BYREF=y | grep stackinit:
       # stackinit: pass:55 fail:0 skip:10 total:65
      
       $ $CMD CONFIG_GCC_PLUGIN_STRUCTLEAK_BYREF_ALL=y | grep stackinit:
       # stackinit: pass:62 fail:0 skip:3 total:65
      
       $ $CMD CONFIG_INIT_STACK_ALL_PATTERN=y --make_option LLVM=1 | grep stackinit:
       # stackinit: pass:60 fail:0 skip:5 total:65
      
       $ $CMD CONFIG_INIT_STACK_ALL_ZERO=y --make_option LLVM=1 | grep stackinit:
       # stackinit: pass:60 fail:0 skip:5 total:65
      
      Temporarily remove the userspace-build mode, which will be restored in a
      later patch.
      
      Expand the size of the pre-case switch variable so it doesn't get
      accidentally cleared.
      
      Cc: David Gow <davidgow@google.com>
      Cc: Daniel Latypov <dlatypov@google.com>
      Cc: Arnd Bergmann <arnd@arndb.de>
      Signed-off-by: NKees Cook <keescook@chromium.org>
      ---
      v1: https://lore.kernel.org/lkml/20220224055145.1853657-1-keescook@chromium.org
      v2:
       - split "userspace KUnit stub" into separate header and patch (Daniel)
       - Improve commit log and comments (David)
       - Provide mapping of expected XFAIL tests to CONFIGs (David)
      02788ebc
  11. 18 3月, 2022 1 次提交
  12. 28 2月, 2022 2 次提交
  13. 09 2月, 2022 1 次提交
  14. 02 2月, 2022 2 次提交
  15. 28 1月, 2022 1 次提交
    • Y
      compiler_types: define __user as __attribute__((btf_type_tag("user"))) · 7472d5a6
      Yonghong Song 提交于
      The __user attribute is currently mainly used by sparse for type checking.
      The attribute indicates whether a memory access is in user memory address
      space or not. Such information is important during tracing kernel
      internal functions or data structures as accessing user memory often
      has different mechanisms compared to accessing kernel memory. For example,
      the perf-probe needs explicit command line specification to indicate a
      particular argument or string in user-space memory ([1], [2], [3]).
      Currently, vmlinux BTF is available in kernel with many distributions.
      If __user attribute information is available in vmlinux BTF, the explicit
      user memory access information from users will not be necessary as
      the kernel can figure it out by itself with vmlinux BTF.
      
      Besides the above possible use for perf/probe, another use case is
      for bpf verifier. Currently, for bpf BPF_PROG_TYPE_TRACING type of bpf
      programs, users can write direct code like
        p->m1->m2
      and "p" could be a function parameter. Without __user information in BTF,
      the verifier will assume p->m1 accessing kernel memory and will generate
      normal loads. Let us say "p" actually tagged with __user in the source
      code.  In such cases, p->m1 is actually accessing user memory and direct
      load is not right and may produce incorrect result. For such cases,
      bpf_probe_read_user() will be the correct way to read p->m1.
      
      To support encoding __user information in BTF, a new attribute
        __attribute__((btf_type_tag("<arbitrary_string>")))
      is implemented in clang ([4]). For example, if we have
        #define __user __attribute__((btf_type_tag("user")))
      during kernel compilation, the attribute "user" information will
      be preserved in dwarf. After pahole converting dwarf to BTF, __user
      information will be available in vmlinux BTF.
      
      The following is an example with latest upstream clang (clang14) and
      pahole 1.23:
      
        [$ ~] cat test.c
        #define __user __attribute__((btf_type_tag("user")))
        int foo(int __user *arg) {
                return *arg;
        }
        [$ ~] clang -O2 -g -c test.c
        [$ ~] pahole -JV test.o
        ...
        [1] INT int size=4 nr_bits=32 encoding=SIGNED
        [2] TYPE_TAG user type_id=1
        [3] PTR (anon) type_id=2
        [4] FUNC_PROTO (anon) return=1 args=(3 arg)
        [5] FUNC foo type_id=4
        [$ ~]
      
      You can see for the function argument "int __user *arg", its type is
      described as
        PTR -> TYPE_TAG(user) -> INT
      The kernel can use this information for bpf verification or other
      use cases.
      
      Current btf_type_tag is only supported in clang (>= clang14) and
      pahole (>= 1.23). gcc support is also proposed and under development ([5]).
      
        [1] http://lkml.kernel.org/r/155789874562.26965.10836126971405890891.stgit@devnote2
        [2] http://lkml.kernel.org/r/155789872187.26965.4468456816590888687.stgit@devnote2
        [3] http://lkml.kernel.org/r/155789871009.26965.14167558859557329331.stgit@devnote2
        [4] https://reviews.llvm.org/D111199
        [5] https://lore.kernel.org/bpf/0cbeb2fb-1a18-f690-e360-24b1c90c2a91@fb.com/Signed-off-by: NYonghong Song <yhs@fb.com>
      Link: https://lore.kernel.org/r/20220127154600.652613-1-yhs@fb.comSigned-off-by: NAlexei Starovoitov <ast@kernel.org>
      7472d5a6
  16. 20 1月, 2022 4 次提交
  17. 07 12月, 2021 2 次提交
    • E
      net: add net device refcount tracker infrastructure · 4d92b95f
      Eric Dumazet 提交于
      net device are refcounted. Over the years we had numerous bugs
      caused by imbalanced dev_hold() and dev_put() calls.
      
      The general idea is to be able to precisely pair each decrement with
      a corresponding prior increment. Both share a cookie, basically
      a pointer to private data storing stack traces.
      
      This patch adds dev_hold_track() and dev_put_track().
      
      To use these helpers, each data structure owning a refcount
      should also use a "netdevice_tracker" to pair the hold and put.
      
      netdevice_tracker dev_tracker;
      ...
      dev_hold_track(dev, &dev_tracker, GFP_ATOMIC);
      ...
      dev_put_track(dev, &dev_tracker);
      
      Whenever a leak happens, we will get precise stack traces
      of the point dev_hold_track() happened, at device dismantle phase.
      
      We will also get a stack trace if too many dev_put_track() for the same
      netdevice_tracker are attempted.
      
      This is guarded by CONFIG_NET_DEV_REFCNT_TRACKER option.
      Signed-off-by: NEric Dumazet <edumazet@google.com>
      Signed-off-by: NJakub Kicinski <kuba@kernel.org>
      4d92b95f
    • E
      lib: add tests for reference tracker · 914a7b50
      Eric Dumazet 提交于
      This module uses reference tracker, forcing two issues.
      
      1) Double free of a tracker
      
      2) leak of two trackers, one being allocated from softirq context.
      
      "modprobe test_ref_tracker" would emit the following traces.
      (Use scripts/decode_stacktrace.sh if necessary)
      
      [  171.648681] reference already released.
      [  171.653213] allocated in:
      [  171.656523]  alloctest_ref_tracker_alloc2+0x1c/0x20 [test_ref_tracker]
      [  171.656526]  init_module+0x86/0x1000 [test_ref_tracker]
      [  171.656528]  do_one_initcall+0x9c/0x220
      [  171.656532]  do_init_module+0x60/0x240
      [  171.656536]  load_module+0x32b5/0x3610
      [  171.656538]  __do_sys_init_module+0x148/0x1a0
      [  171.656540]  __x64_sys_init_module+0x1d/0x20
      [  171.656542]  do_syscall_64+0x4a/0xb0
      [  171.656546]  entry_SYSCALL_64_after_hwframe+0x44/0xae
      [  171.656549] freed in:
      [  171.659520]  alloctest_ref_tracker_free+0x13/0x20 [test_ref_tracker]
      [  171.659522]  init_module+0xec/0x1000 [test_ref_tracker]
      [  171.659523]  do_one_initcall+0x9c/0x220
      [  171.659525]  do_init_module+0x60/0x240
      [  171.659527]  load_module+0x32b5/0x3610
      [  171.659529]  __do_sys_init_module+0x148/0x1a0
      [  171.659532]  __x64_sys_init_module+0x1d/0x20
      [  171.659534]  do_syscall_64+0x4a/0xb0
      [  171.659536]  entry_SYSCALL_64_after_hwframe+0x44/0xae
      [  171.659575] ------------[ cut here ]------------
      [  171.659576] WARNING: CPU: 5 PID: 13016 at lib/ref_tracker.c:112 ref_tracker_free+0x224/0x270
      [  171.659581] Modules linked in: test_ref_tracker(+)
      [  171.659591] CPU: 5 PID: 13016 Comm: modprobe Tainted: G S                5.16.0-smp-DEV #290
      [  171.659595] RIP: 0010:ref_tracker_free+0x224/0x270
      [  171.659599] Code: 5e 41 5f 5d c3 48 c7 c7 04 9c 74 a6 31 c0 e8 62 ee 67 00 83 7b 14 00 75 1a 83 7b 18 00 75 30 4c 89 ff 4c 89 f6 e8 9c 00 69 00 <0f> 0b bb ea ff ff ff eb ae 48 c7 c7 3a 0a 77 a6 31 c0 e8 34 ee 67
      [  171.659601] RSP: 0018:ffff89058ba0bbd0 EFLAGS: 00010286
      [  171.659603] RAX: 0000000000000029 RBX: ffff890586b19780 RCX: 08895bff57c7d100
      [  171.659604] RDX: c0000000ffff7fff RSI: 0000000000000282 RDI: ffffffffc0407000
      [  171.659606] RBP: ffff89058ba0bc88 R08: 0000000000000000 R09: ffffffffa6f342e0
      [  171.659607] R10: 00000000ffff7fff R11: 0000000000000000 R12: 000000008f000000
      [  171.659608] R13: 0000000000000014 R14: 0000000000000282 R15: ffffffffc0407000
      [  171.659609] FS:  00007f97ea29d740(0000) GS:ffff8923ff940000(0000) knlGS:0000000000000000
      [  171.659611] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
      [  171.659613] CR2: 00007f97ea299000 CR3: 0000000186b4a004 CR4: 00000000001706e0
      [  171.659614] Call Trace:
      [  171.659615]  <TASK>
      [  171.659631]  ? alloctest_ref_tracker_free+0x13/0x20 [test_ref_tracker]
      [  171.659633]  ? init_module+0x105/0x1000 [test_ref_tracker]
      [  171.659636]  ? do_one_initcall+0x9c/0x220
      [  171.659638]  ? do_init_module+0x60/0x240
      [  171.659641]  ? load_module+0x32b5/0x3610
      [  171.659644]  ? __do_sys_init_module+0x148/0x1a0
      [  171.659646]  ? __x64_sys_init_module+0x1d/0x20
      [  171.659649]  ? do_syscall_64+0x4a/0xb0
      [  171.659652]  ? entry_SYSCALL_64_after_hwframe+0x44/0xae
      [  171.659656]  ? 0xffffffffc040a000
      [  171.659658]  alloctest_ref_tracker_free+0x13/0x20 [test_ref_tracker]
      [  171.659660]  init_module+0x105/0x1000 [test_ref_tracker]
      [  171.659663]  do_one_initcall+0x9c/0x220
      [  171.659666]  do_init_module+0x60/0x240
      [  171.659669]  load_module+0x32b5/0x3610
      [  171.659672]  __do_sys_init_module+0x148/0x1a0
      [  171.659676]  __x64_sys_init_module+0x1d/0x20
      [  171.659678]  do_syscall_64+0x4a/0xb0
      [  171.659694]  ? exc_page_fault+0x6e/0x140
      [  171.659696]  entry_SYSCALL_64_after_hwframe+0x44/0xae
      [  171.659698] RIP: 0033:0x7f97ea3dbe7a
      [  171.659700] Code: 48 8b 0d 61 8d 06 00 f7 d8 64 89 01 48 83 c8 ff c3 cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc 49 89 ca b8 af 00 00 00 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 8b 0d 2e 8d 06 00 f7 d8 64 89 01 48
      [  171.659701] RSP: 002b:00007ffea67ce608 EFLAGS: 00000246 ORIG_RAX: 00000000000000af
      [  171.659703] RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 00007f97ea3dbe7a
      [  171.659704] RDX: 00000000013a0ba0 RSI: 0000000000002808 RDI: 00007f97ea299000
      [  171.659705] RBP: 00007ffea67ce670 R08: 0000000000000003 R09: 0000000000000000
      [  171.659706] R10: 0000000000000000 R11: 0000000000000246 R12: 00000000013a1048
      [  171.659707] R13: 00000000013a0ba0 R14: 0000000001399930 R15: 00000000013a1030
      [  171.659709]  </TASK>
      [  171.659710] ---[ end trace f5dbd6afa41e60a9 ]---
      [  171.659712] leaked reference.
      [  171.663393]  alloctest_ref_tracker_alloc0+0x1c/0x20 [test_ref_tracker]
      [  171.663395]  test_ref_tracker_timer_func+0x9/0x20 [test_ref_tracker]
      [  171.663397]  call_timer_fn+0x31/0x140
      [  171.663401]  expire_timers+0x46/0x110
      [  171.663403]  __run_timers+0x16f/0x1b0
      [  171.663404]  run_timer_softirq+0x1d/0x40
      [  171.663406]  __do_softirq+0x148/0x2d3
      [  171.663408] leaked reference.
      [  171.667101]  alloctest_ref_tracker_alloc1+0x1c/0x20 [test_ref_tracker]
      [  171.667103]  init_module+0x81/0x1000 [test_ref_tracker]
      [  171.667104]  do_one_initcall+0x9c/0x220
      [  171.667106]  do_init_module+0x60/0x240
      [  171.667108]  load_module+0x32b5/0x3610
      [  171.667111]  __do_sys_init_module+0x148/0x1a0
      [  171.667113]  __x64_sys_init_module+0x1d/0x20
      [  171.667115]  do_syscall_64+0x4a/0xb0
      [  171.667117]  entry_SYSCALL_64_after_hwframe+0x44/0xae
      [  171.667131] ------------[ cut here ]------------
      [  171.667132] WARNING: CPU: 5 PID: 13016 at lib/ref_tracker.c:30 ref_tracker_dir_exit+0x104/0x130
      [  171.667136] Modules linked in: test_ref_tracker(+)
      [  171.667144] CPU: 5 PID: 13016 Comm: modprobe Tainted: G S      W         5.16.0-smp-DEV #290
      [  171.667147] RIP: 0010:ref_tracker_dir_exit+0x104/0x130
      [  171.667150] Code: 01 00 00 00 00 ad de 48 89 03 4c 89 63 08 48 89 df e8 20 a0 d5 ff 4c 89 f3 4d 39 ee 75 a8 4c 89 ff 48 8b 75 d0 e8 7c 05 69 00 <0f> 0b eb 0c 4c 89 ff 48 8b 75 d0 e8 6c 05 69 00 41 8b 47 08 83 f8
      [  171.667151] RSP: 0018:ffff89058ba0bc68 EFLAGS: 00010286
      [  171.667154] RAX: 08895bff57c7d100 RBX: ffffffffc0407010 RCX: 000000000000003b
      [  171.667156] RDX: 000000000000003c RSI: 0000000000000282 RDI: ffffffffc0407000
      [  171.667157] RBP: ffff89058ba0bc98 R08: 0000000000000000 R09: ffffffffa6f342e0
      [  171.667159] R10: 00000000ffff7fff R11: 0000000000000000 R12: dead000000000122
      [  171.667160] R13: ffffffffc0407010 R14: ffffffffc0407010 R15: ffffffffc0407000
      [  171.667162] FS:  00007f97ea29d740(0000) GS:ffff8923ff940000(0000) knlGS:0000000000000000
      [  171.667164] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
      [  171.667166] CR2: 00007f97ea299000 CR3: 0000000186b4a004 CR4: 00000000001706e0
      [  171.667169] Call Trace:
      [  171.667170]  <TASK>
      [  171.667171]  ? 0xffffffffc040a000
      [  171.667173]  init_module+0x126/0x1000 [test_ref_tracker]
      [  171.667175]  do_one_initcall+0x9c/0x220
      [  171.667179]  do_init_module+0x60/0x240
      [  171.667182]  load_module+0x32b5/0x3610
      [  171.667186]  __do_sys_init_module+0x148/0x1a0
      [  171.667189]  __x64_sys_init_module+0x1d/0x20
      [  171.667192]  do_syscall_64+0x4a/0xb0
      [  171.667194]  ? exc_page_fault+0x6e/0x140
      [  171.667196]  entry_SYSCALL_64_after_hwframe+0x44/0xae
      [  171.667199] RIP: 0033:0x7f97ea3dbe7a
      [  171.667200] Code: 48 8b 0d 61 8d 06 00 f7 d8 64 89 01 48 83 c8 ff c3 cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc 49 89 ca b8 af 00 00 00 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 8b 0d 2e 8d 06 00 f7 d8 64 89 01 48
      [  171.667201] RSP: 002b:00007ffea67ce608 EFLAGS: 00000246 ORIG_RAX: 00000000000000af
      [  171.667203] RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 00007f97ea3dbe7a
      [  171.667204] RDX: 00000000013a0ba0 RSI: 0000000000002808 RDI: 00007f97ea299000
      [  171.667205] RBP: 00007ffea67ce670 R08: 0000000000000003 R09: 0000000000000000
      [  171.667206] R10: 0000000000000000 R11: 0000000000000246 R12: 00000000013a1048
      [  171.667207] R13: 00000000013a0ba0 R14: 0000000001399930 R15: 00000000013a1030
      [  171.667209]  </TASK>
      [  171.667210] ---[ end trace f5dbd6afa41e60aa ]---
      Signed-off-by: NEric Dumazet <edumazet@google.com>
      Signed-off-by: NJakub Kicinski <kuba@kernel.org>
      914a7b50
  18. 03 12月, 2021 1 次提交
  19. 22 11月, 2021 1 次提交
  20. 07 11月, 2021 1 次提交
  21. 22 10月, 2021 1 次提交
  22. 19 10月, 2021 1 次提交
  23. 25 9月, 2021 1 次提交
  24. 17 9月, 2021 1 次提交
    • P
      objtool: Support pv_opsindirect calls for noinstr · db2b0c5d
      Peter Zijlstra 提交于
      Normally objtool will now follow indirect calls; there is no need.
      
      However, this becomes a problem with noinstr validation; if there's an
      indirect call from noinstr code, we very much need to know it is to
      another noinstr function. Luckily there aren't many indirect calls in
      entry code with the obvious exception of paravirt. As such, noinstr
      validation didn't work with paravirt kernels.
      
      In order to track pv_ops[] call targets, objtool reads the static
      pv_ops[] tables as well as direct assignments to the pv_ops[] array,
      provided the compiler makes them a single instruction like:
      
        bf87:       48 c7 05 00 00 00 00 00 00 00 00        movq   $0x0,0x0(%rip)
          bf92 <xen_init_spinlocks+0x5f>
          bf8a: R_X86_64_PC32     pv_ops+0x268
      
      There are, as of yet, no warnings for when this goes wrong :/
      
      Using the functions found with the above means, all pv_ops[] calls are
      now subject to noinstr validation.
      Signed-off-by: NPeter Zijlstra (Intel) <peterz@infradead.org>
      Link: https://lore.kernel.org/r/20210624095149.118815755@infradead.org
      db2b0c5d
  25. 14 9月, 2021 1 次提交
  26. 09 9月, 2021 3 次提交
  27. 03 9月, 2021 1 次提交
    • N
      Makefile: remove stale cc-option checks · 7d73c3e9
      Nick Desaulniers 提交于
      cc-option, cc-option-yn, and cc-disable-warning all invoke the compiler
      during build time, and can slow down the build when these checks become
      stale for our supported compilers, whose minimally supported versions
      increases over time. See Documentation/process/changes.rst for the
      current supported minimal versions (GCC 4.9+, clang 10.0.1+). Compiler
      version support for these flags may be verified on godbolt.org.
      
      The following flags are GCC only and supported since at least GCC 4.9.
      Remove cc-option and cc-disable-warning tests.
      * -fno-tree-loop-im
      * -Wno-maybe-uninitialized
      * -fno-reorder-blocks
      * -fno-ipa-cp-clone
      * -fno-partial-inlining
      * -femit-struct-debug-baseonly
      * -fno-inline-functions-called-once
      * -fconserve-stack
      
      The following flags are supported by all supported versions of GCC and
      Clang. Remove their cc-option, cc-option-yn, and cc-disable-warning tests.
      * -fno-delete-null-pointer-checks
      * -fno-var-tracking
      * -Wno-array-bounds
      
      The following configs are made dependent on GCC, since they use GCC
      specific flags.
      * READABLE_ASM
      * DEBUG_SECTION_MISMATCH
      
      -mfentry was not supported by s390-linux-gnu-gcc until gcc-9+, add a
      comment.
      
      --param=allow-store-data-races=0 was renamed to -fno-allow-store-data-races
      in the GCC 10 release; add a comment.
      
      -Wmaybe-uninitialized (GCC specific) was being added for CONFIG_GCOV,
      then again unconditionally; add it only once.
      
      Also, base RETPOLINE_CFLAGS and RETPOLINE_VDSO_CFLAGS on CONFIC_CC_IS_*
      then remove cc-option tests for Clang.
      
      Link: https://github.com/ClangBuiltLinux/linux/issues/1436Acked-by: NMiguel Ojeda <ojeda@kernel.org>
      Reviewed-by: NNathan Chancellor <nathan@kernel.org>
      Signed-off-by: NNick Desaulniers <ndesaulniers@google.com>
      Signed-off-by: NMasahiro Yamada <masahiroy@kernel.org>
      7d73c3e9