1. 14 5月, 2018 1 次提交
  2. 24 4月, 2018 1 次提交
    • J
      bpf: sockmap sample use clang flag, -target bpf · 4dfe1bb9
      John Fastabend 提交于
      Per Documentation/bpf/bpf_devel_QA.txt add the -target flag to the
      sockmap Makefile. Relevant text quoted here,
      
         Otherwise, you can use bpf target. Additionally, you _must_ use
         bpf target when:
      
       - Your program uses data structures with pointer or long / unsigned
         long types that interface with BPF helpers or context data
         structures. Access into these structures is verified by the BPF
         verifier and may result in verification failures if the native
         architecture is not aligned with the BPF architecture, e.g. 64-bit.
         An example of this is BPF_PROG_TYPE_SK_MSG require '-target bpf'
      
      Fixes: 69e8cc13 ("bpf: sockmap sample program")
      Signed-off-by: NJohn Fastabend <john.fastabend@gmail.com>
      Acked-by: NAlexei Starovoitov <ast@kernel.org>
      Signed-off-by: NDaniel Borkmann <daniel@iogearbox.net>
      4dfe1bb9
  3. 17 4月, 2018 2 次提交
    • P
      livepatch: Allow to call a custom callback when freeing shadow variables · 3b2c77d0
      Petr Mladek 提交于
      We might need to do some actions before the shadow variable is freed.
      For example, we might need to remove it from a list or free some data
      that it points to.
      
      This is already possible now. The user can get the shadow variable
      by klp_shadow_get(), do the necessary actions, and then call
      klp_shadow_free().
      
      This patch allows to do it a more elegant way. The user could implement
      the needed actions in a callback that is passed to klp_shadow_free()
      as a parameter. The callback usually does reverse operations to
      the constructor callback that can be called by klp_shadow_*alloc().
      
      It is especially useful for klp_shadow_free_all(). There we need to do
      these extra actions for each found shadow variable with the given ID.
      
      Note that the memory used by the shadow variable itself is still released
      later by rcu callback. It is needed to protect internal structures that
      keep all shadow variables. But the destructor is called immediately.
      The shadow variable must not be access anyway after klp_shadow_free()
      is called. The user is responsible to protect this any suitable way.
      
      Be aware that the destructor is called under klp_shadow_lock. It is
      the same as for the contructor in klp_shadow_alloc().
      Signed-off-by: NPetr Mladek <pmladek@suse.com>
      Acked-by: NJosh Poimboeuf <jpoimboe@redhat.com>
      Acked-by: NMiroslav Benes <mbenes@suse.cz>
      Signed-off-by: NJiri Kosina <jkosina@suse.cz>
      3b2c77d0
    • P
      livepatch: Initialize shadow variables safely by a custom callback · e91c2518
      Petr Mladek 提交于
      The existing API allows to pass a sample data to initialize the shadow
      data. It works well when the data are position independent. But it fails
      miserably when we need to set a pointer to the shadow structure itself.
      
      Unfortunately, we might need to initialize the pointer surprisingly
      often because of struct list_head. It is even worse because the list
      might be hidden in other common structures, for example, struct mutex,
      struct wait_queue_head.
      
      For example, this was needed to fix races in ALSA sequencer. It required
      to add mutex into struct snd_seq_client. See commit b3defb79
      ("ALSA: seq: Make ioctls race-free") and commit d15d662e
      ("ALSA: seq: Fix racy pool initializations")
      
      This patch makes the API more safe. A custom constructor function and data
      are passed to klp_shadow_*alloc() functions instead of the sample data.
      
      Note that ctor_data are no longer a template for shadow->data. It might
      point to any data that might be necessary when the constructor is called.
      
      Also note that the constructor is called under klp_shadow_lock. It is
      an internal spin_lock that synchronizes alloc() vs. get() operations,
      see klp_shadow_get_or_alloc(). On one hand, this adds a risk of ABBA
      deadlocks. On the other hand, it allows to do some operations safely.
      For example, we could add the new structure into an existing list.
      This must be done only once when the structure is allocated.
      Reported-by: NNicolai Stange <nstange@suse.de>
      Signed-off-by: NPetr Mladek <pmladek@suse.com>
      Acked-by: NJosh Poimboeuf <jpoimboe@redhat.com>
      Acked-by: NMiroslav Benes <mbenes@suse.cz>
      Signed-off-by: NJiri Kosina <jkosina@suse.cz>
      e91c2518
  4. 30 3月, 2018 2 次提交
  5. 29 3月, 2018 1 次提交
  6. 28 3月, 2018 2 次提交
  7. 23 3月, 2018 1 次提交
  8. 20 3月, 2018 8 次提交
  9. 16 3月, 2018 2 次提交
    • A
      arch: remove tile port · bb9d8126
      Arnd Bergmann 提交于
      The Tile architecture port was added by Chris Metcalf in 2010, and
      maintained until early 2018 when he orphaned it due to his departure
      from Mellanox, and nobody else stepped up to maintain it. The product
      line is still around in the form of the BlueField SoC, but no longer
      uses the Tile architecture.
      
      There are also still products for sale with Tile-GX SoCs, notably the
      Mikrotik CCR router family. The products all use old (linux-3.3) kernels
      with lots of patches and won't be upgraded by their manufacturers. There
      have been efforts to port both OpenWRT and Debian to these, but both
      projects have stalled and are very unlikely to be continued in the future.
      
      Given that we are reasonably sure that nobody is still using the port
      with an upstream kernel any more, it seems better to remove it now while
      the port is in a good shape than to let it bitrot for a few years first.
      
      Cc: Chris Metcalf <chris.d.metcalf@gmail.com>
      Cc: John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de>
      Link: http://www.mellanox.com/page/npu_multicore_overview
      Link: https://jenkins.debian.net/view/rebootstrap/job/rebootstrap_tilegx_gcc7/Signed-off-by: NArnd Bergmann <arnd@arndb.de>
      bb9d8126
    • A
      arch: remove blackfin port · 4ba66a97
      Arnd Bergmann 提交于
      The Analog Devices Blackfin port was added in 2007 and was rather
      active for a while, but all work on it has come to a standstill
      over time, as Analog have changed their product line-up.
      
      Aaron Wu confirmed that the architecture port is no longer relevant,
      and multiple people suggested removing blackfin independently because
      of some of its oddities like a non-working SMP port, and the amount of
      duplication between the chip variants, which cause extra work when
      doing cross-architecture changes.
      
      Link: https://docs.blackfin.uclinux.org/Acked-by: NAaron Wu <Aaron.Wu@analog.com>
      Acked-by: NBryan Wu <cooloney@gmail.com>
      Cc: Steven Miao <realmz6@gmail.com>
      Cc: Mike Frysinger <vapier@chromium.org>
      Signed-off-by: NArnd Bergmann <arnd@arndb.de>
      4ba66a97
  10. 08 3月, 2018 1 次提交
  11. 05 3月, 2018 1 次提交
  12. 02 3月, 2018 1 次提交
  13. 26 2月, 2018 1 次提交
    • L
      samples/bpf: Add program for CPU state statistics · c5350777
      Leo Yan 提交于
      CPU is active when have running tasks on it and CPUFreq governor can
      select different operating points (OPP) according to different workload;
      we use 'pstate' to present CPU state which have running tasks with one
      specific OPP.  On the other hand, CPU is idle which only idle task on
      it, CPUIdle governor can select one specific idle state to power off
      hardware logics; we use 'cstate' to present CPU idle state.
      
      Based on trace events 'cpu_idle' and 'cpu_frequency' we can accomplish
      the duration statistics for every state.  Every time when CPU enters
      into or exits from idle states, the trace event 'cpu_idle' is recorded;
      trace event 'cpu_frequency' records the event for CPU OPP changing, so
      it's easily to know how long time the CPU stays in the specified OPP,
      and the CPU must be not in any idle state.
      
      This patch is to utilize the mentioned trace events for pstate and
      cstate statistics.  To achieve more accurate profiling data, the program
      uses below sequence to insure CPU running/idle time aren't missed:
      
      - Before profiling the user space program wakes up all CPUs for once, so
        can avoid to missing account time for CPU staying in idle state for
        long time; the program forces to set 'scaling_max_freq' to lowest
        frequency and then restore 'scaling_max_freq' to highest frequency,
        this can ensure the frequency to be set to lowest frequency and later
        after start to run workload the frequency can be easily to be changed
        to higher frequency;
      
      - User space program reads map data and update statistics for every 5s,
        so this is same with other sample bpf programs for avoiding big
        overload introduced by bpf program self;
      
      - When send signal to terminate program, the signal handler wakes up
        all CPUs, set lowest frequency and restore highest frequency to
        'scaling_max_freq'; this is exactly same with the first step so
        avoid to missing account CPU pstate and cstate time during last
        stage.  Finally it reports the latest statistics.
      
      The program has been tested on Hikey board with octa CA53 CPUs, below
      is one example for statistics result, the format mainly follows up
      Jesper Dangaard Brouer suggestion.
      
      Jesper reminds to 'get printf to pretty print with thousands separators
      use %' and setlocale(LC_NUMERIC, "en_US")', tried three different arm64
      GCC toolchains (5.4.0 20160609, 6.2.1 20161016, 6.3.0 20170516) but all
      of them cannot support printf flag character %' on arm64 platform, so go
      back print number without grouping mode.
      
      CPU states statistics:
      state(ms)  cstate-0    cstate-1    cstate-2    pstate-0    pstate-1    pstate-2    pstate-3    pstate-4
      CPU-0      767         6111        111863      561         31          756         853         190
      CPU-1      241         10606       107956      484         125         646         990         85
      CPU-2      413         19721       98735       636         84          696         757         89
      CPU-3      84          11711       79989       17516       909         4811        5773        341
      CPU-4      152         19610       98229       444         53          649         708         1283
      CPU-5      185         8781        108697      666         91          671         677         1365
      CPU-6      157         21964       95825       581         67          566         684         1284
      CPU-7      125         15238       102704      398         20          665         786         1197
      
      Cc: Daniel Lezcano <daniel.lezcano@linaro.org>
      Cc: Vincent Guittot <vincent.guittot@linaro.org>
      Signed-off-by: NLeo Yan <leo.yan@linaro.org>
      Signed-off-by: NDaniel Borkmann <daniel@iogearbox.net>
      c5350777
  14. 23 2月, 2018 1 次提交
    • M
      samples/seccomp: do not compile when cross compiled · 6275ecbc
      Michal Hocko 提交于
      samples/seccomp relies on the host setting which is not suitable for
      crosscompilation and it actually fails when crosscompiling s390 and
      powerpc all{yes,mod}config on x86_64 with
      
      samples/seccomp/bpf-helper.h:135:2: error: #error __BITS_PER_LONG value unusable.
       #error __BITS_PER_LONG value unusable.
        ^
      In file included from samples/seccomp/bpf-fancy.c:13:0:
      samples/seccomp/bpf-fancy.c: In function ‘main’:
      samples/seccomp/bpf-fancy.c:38:11: error: ‘__NR_exit’ undeclared (first use in this function)
         SYSCALL(__NR_exit, ALLOW),
      
      and many others. I am doing these for compile testing and it's been
      quite useful to catch issues. Crosscompiling sample code on the other
      hand doesn't seem all that important so it seems like the easiest way to
      simply disable samples/seccomp when crosscompiling.
      
      Fixing this properly is not that easy as Kees explains:
      : IIRC, one of the problems is with build ordering problems: the kernel
      : headers used by the samples aren't available when cross compiling.
      Signed-off-by: NMichal Hocko <mhocko@suse.com>
      Signed-off-by: NKees Cook <keescook@chromium.org>
      6275ecbc
  15. 14 2月, 2018 3 次提交
  16. 13 2月, 2018 1 次提交
  17. 07 2月, 2018 1 次提交
  18. 03 2月, 2018 2 次提交
  19. 27 1月, 2018 1 次提交
  20. 24 1月, 2018 7 次提交