1. 18 10月, 2018 1 次提交
  2. 16 10月, 2018 1 次提交
  3. 03 10月, 2018 1 次提交
    • J
      bpf: Add helper to retrieve socket in BPF · 6acc9b43
      Joe Stringer 提交于
      This patch adds new BPF helper functions, bpf_sk_lookup_tcp() and
      bpf_sk_lookup_udp() which allows BPF programs to find out if there is a
      socket listening on this host, and returns a socket pointer which the
      BPF program can then access to determine, for instance, whether to
      forward or drop traffic. bpf_sk_lookup_xxx() may take a reference on the
      socket, so when a BPF program makes use of this function, it must
      subsequently pass the returned pointer into the newly added sk_release()
      to return the reference.
      
      By way of example, the following pseudocode would filter inbound
      connections at XDP if there is no corresponding service listening for
      the traffic:
      
        struct bpf_sock_tuple tuple;
        struct bpf_sock_ops *sk;
      
        populate_tuple(ctx, &tuple); // Extract the 5tuple from the packet
        sk = bpf_sk_lookup_tcp(ctx, &tuple, sizeof tuple, netns, 0);
        if (!sk) {
          // Couldn't find a socket listening for this traffic. Drop.
          return TC_ACT_SHOT;
        }
        bpf_sk_release(sk, 0);
        return TC_ACT_OK;
      Signed-off-by: NJoe Stringer <joe@wand.net.nz>
      Acked-by: NAlexei Starovoitov <ast@kernel.org>
      Signed-off-by: NDaniel Borkmann <daniel@iogearbox.net>
      6acc9b43
  4. 01 10月, 2018 1 次提交
  5. 15 9月, 2018 1 次提交
  6. 13 9月, 2018 1 次提交
  7. 12 9月, 2018 3 次提交
    • A
      tools headers uapi: Update tools's copy of linux/if_link.h · 5db48a8d
      Arnaldo Carvalho de Melo 提交于
      To get the changes in:
      
      	3e7a50ce ("net: report min and max mtu network device settings")
      	2756f68c ("net: bridge: add support for backup port")
      	a25717d2 ("xdp: support simultaneous driver and hw XDP attachment")
      	4f91da26 ("xdp: add per mode attributes for attached programs")
      	f203b76d ("xfrm: Add virtual xfrm interfaces")
      
      Silencing this libbpf build warning:
      
      	Warning: Kernel ABI header at 'tools/include/uapi/linux/if_link.h' differs from latest version at 'include/uapi/linux/if_link.h'
      
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: Daniel Borkmann <daniel@iogearbox.net>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: David S. Miller <davem@davemloft.net>
      Cc: Jakub Kicinski <jakub.kicinski@netronome.com>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Nikolay Aleksandrov <nikolay@cumulusnetworks.com>
      Cc: Steffen Klassert <steffen.klassert@secunet.com>
      Cc: Stephen Hemminger <stephen@networkplumber.org>
      Cc: Wang Nan <wangnan0@huawei.com>
      Link: https://lkml.kernel.org/n/tip-xd9ztioa894zemv8ag8kg64u@git.kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      5db48a8d
    • A
      tools headers uapi: Update tools's copy of linux/vhost.h · 7f28785c
      Arnaldo Carvalho de Melo 提交于
      To get the changes in:
      
      	c48300c9 ("vhost: fix VHOST_GET_BACKEND_FEATURES ioctl request definition")
      
      This makes 'perf trace' and other tools in the future using its
      beautifiers in a libbeauty.so library be able to translate these new
      ioctl to strings:
      
        $ tools/perf/trace/beauty/vhost_virtio_ioctl.sh  > /tmp/after
        $ diff -u /tmp/before /tmp/after
        --- /tmp/before	2018-09-11 13:10:57.923038244 -0300
        +++ /tmp/after	2018-09-11 13:11:20.329012685 -0300
        @@ -15,6 +15,7 @@
              [0x22] = "SET_VRING_ERR",
              [0x23] = "SET_VRING_BUSYLOOP_TIMEOUT",
              [0x24] = "GET_VRING_BUSYLOOP_TIMEOUT",
        +     [0x25] = "SET_BACKEND_FEATURES",
              [0x30] = "NET_SET_BACKEND",
              [0x40] = "SCSI_SET_ENDPOINT",
              [0x41] = "SCSI_CLEAR_ENDPOINT",
        @@ -27,4 +28,5 @@
         static const char *vhost_virtio_ioctl_read_cmds[] = {
              [0x00] = "GET_FEATURES",
              [0x12] = "GET_VRING_BASE",
        +	[0x26] = "GET_BACKEND_FEATURES",
        };
        $
      
      We'll also use this to be able to express syscall filters using symbolic
      these symbolic names, something like:
      
      	# perf trace --all-cpus -e ioctl(cmd=*GET_FEATURES)
      
      This silences the following warning during perf's build:
      
        Warning: Kernel ABI header at 'tools/include/uapi/linux/vhost.h' differs from latest version at 'include/uapi/linux/vhost.h'
        diff -u tools/include/uapi/linux/vhost.h include/uapi/linux/vhost.h
      
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: David S. Miller <davem@davemloft.net>
      Cc: Gleb Fotengauer-Malinovskiy <glebfm@altlinux.org>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Wang Nan <wangnan0@huawei.com>
      Link: https://lkml.kernel.org/n/tip-35x71oei2hdui9u0tarpimbq@git.kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      Signed-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      7f28785c
    • A
      tools headers uapi: Update tools's copies of kvm headers · 0210c156
      Arnaldo Carvalho de Melo 提交于
      To get the changes in:
      
      	a4499382 ("KVM: s390: Add huge page enablement control")
      	8fcc4b59 ("kvm: nVMX: Introduce KVM_CAP_NESTED_STATE")
      	be26b3a7 ("arm64: KVM: export the capability to set guest SError syndrome")
      	b7b27fac ("arm/arm64: KVM: Add KVM_GET/SET_VCPU_EVENTS")
      	b0960b95 ("KVM: arm: Add 32bit get/set events support")
      	a3da7b4a ("KVM: s390: add etoken support for guests")
      
      This makes 'perf trace' automagically get aware of these new ioctls:
      
        $ cp include/uapi/linux/kvm.h tools/include/uapi/linux/kvm.h
        $ tools/perf/trace/beauty/kvm_ioctl.sh  > /tmp/after
        $ diff -u /tmp/before /tmp/after
        --- /tmp/before	2018-09-11 11:18:29.173207586 -0300
        +++ /tmp/after	2018-09-11 11:18:38.488200446 -0300
        @@ -84,6 +84,8 @@
              [0xbb] = "MEMORY_ENCRYPT_REG_REGION",
              [0xbc] = "MEMORY_ENCRYPT_UNREG_REGION",
              [0xbd] = "HYPERV_EVENTFD",
        +     [0xbe] = "GET_NESTED_STATE",
        +     [0xbf] = "SET_NESTED_STATE",
              [0xe0] = "CREATE_DEVICE",
              [0xe1] = "SET_DEVICE_ATTR",
              [0xe2] = "G
      
      And cures the following warning during perf's build:
      
      	Warning: Kernel ABI header at 'tools/include/uapi/linux/kvm.h' differs from latest version at 'include/uapi/linux/kvm.h'
      	diff -u tools/include/uapi/linux/kvm.h include/uapi/linux/kvm.h
      
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: Christian Borntraeger <borntraeger@de.ibm.com>
      Cc: Cornelia Huck <cohuck@redhat.com>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: David Hildenbrand <david@redhat.com>
      Cc: Dongjiu Geng <gengdongjiu@huawei.com>
      Cc: Eduardo Habkost <ehabkost@redhat.com>
      Cc: James Morse <james.morse@arm.com>
      Cc: Janosch Frank <frankja@linux.ibm.com>
      Cc: Jim Mattson <jmattson@google.com>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Marc Zyngier <marc.zyngier@arm.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Paolo Bonzini <pbonzini@redhat.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Wang Nan <wangnan0@huawei.com>
      Link: https://lkml.kernel.org/n/tip-2vvwh2o19orn56di0ksrtgzr@git.kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      Signed-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      0210c156
  8. 11 9月, 2018 3 次提交
    • A
      tools headers uapi: Update tools's copy of drm/drm.h · 434ea1bf
      Arnaldo Carvalho de Melo 提交于
      To get the changes in:
      
      	d67b6a20 ("drm: writeback: Add client capability for exposing writeback connectors")
      
      This is for an argument to a DRM ioctl, which is not being prettyfied in
      the 'perf trace' DRM ioctl beautifier, but will now that syscalls are
      starting to have pointer arguments augmented via BPF.
      
      This time around this just cures the following warning during perf's
      build:
      
      	Warning: Kernel ABI header at 'tools/include/uapi/drm/drm.h' differs from latest version at 'include/uapi/drm/drm.h'
      	diff -u tools/include/uapi/drm/drm.h include/uapi/drm/drm.h
      
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: Brian Starkey <brian.starkey@arm.com>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Eric Anholt <eric@anholt.net>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Liviu Dudau <liviu.dudau@arm.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Sean Paul <seanpaul@chromium.org>
      Cc: Wang Nan <wangnan0@huawei.com>
      Link: https://lkml.kernel.org/n/tip-n7qib1bac6mc6w9oke7r4qdc@git.kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      Signed-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      434ea1bf
    • A
      tools headers uapi: Update tools's copy of asm-generic/unistd.h · f9e6e435
      Arnaldo Carvalho de Melo 提交于
      To get the changes in:
      
      	db7a2d18 ("asm-generic: unistd.h: Wire up sys_rseq")
      
      That wires up the new 'rsec' system call, which will automagically
      support that syscall in the syscall table used by 'perf trace' on
      arm/arm64.
      
      This cures the following warning during perf's build:
      
      	Warning: Kernel ABI header at 'tools/include/uapi/asm-generic/unistd.h' differs from latest version at 'include/uapi/asm-generic/unistd.h'
      	diff -u tools/include/uapi/asm-generic/unistd.h include/uapi/asm-generic/unistd.h
      
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: Arnd Bergmann <arnd@arndb.de>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Hendrik Brueckner <brueckner@linux.vnet.ibm.com>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Kim Phillips <kim.phillips@arm.com>
      Cc: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
      Cc: Michael Ellerman <mpe@ellerman.id.au>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Ravi Bangoria <ravi.bangoria@linux.vnet.ibm.com>
      Cc: Thomas Richter <tmricht@linux.vnet.ibm.com>
      Cc: Wang Nan <wangnan0@huawei.com>
      Cc: Will Deacon <will.deacon@arm.com>
      Link: https://lkml.kernel.org/n/tip-vt7k2itnitp1t9p3dp7qeb08@git.kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      f9e6e435
    • A
      tools headers uapi: Update tools's copy of linux/perf_event.h · 0ee03d93
      Arnaldo Carvalho de Melo 提交于
      To get the changes in:
      
      	09121255 ("perf/UAPI: Clearly mark __PERF_SAMPLE_CALLCHAIN_EARLY as internal use")
      
      This cures the following warning during perf's build:
      
      	Warning: Kernel ABI header at 'tools/include/uapi/linux/perf_event.h' differs from latest version at 'include/uapi/linux/perf_event.h'
      	diff -u tools/include/uapi/linux/perf_event.h include/uapi/linux/perf_event.h
      
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Wang Nan <wangnan0@huawei.com>
      Link: https://lkml.kernel.org/n/tip-2vvwh2o19orn56di0ksrtgzr@git.kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      0ee03d93
  9. 07 9月, 2018 1 次提交
  10. 06 9月, 2018 1 次提交
  11. 13 8月, 2018 1 次提交
  12. 11 8月, 2018 1 次提交
  13. 03 8月, 2018 1 次提交
  14. 31 7月, 2018 2 次提交
  15. 30 7月, 2018 2 次提交
    • A
      tools headers uapi: Refresh linux/bpf.h copy · fc73bfd6
      Arnaldo Carvalho de Melo 提交于
      To get the changes in:
      
        4c79579b ("bpf: Change bpf_fib_lookup to return lookup status")
      
      That do not entail changes in tools/perf/ use of it, elliminating the
      following perf build warning:
      
        Warning: Kernel ABI header at 'tools/include/uapi/linux/bpf.h' differs from latest version at 'include/uapi/linux/bpf.h'
      
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: Daniel Borkmann <daniel@iogearbox.net>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Wang Nan <wangnan0@huawei.com>
      Link: https://lkml.kernel.org/n/tip-yei494y6b3mn6bjzz9g0ws12@git.kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      fc73bfd6
    • A
      tools headers uapi: Update tools's copy of linux/perf_event.h · 2c3ee0e1
      Arnaldo Carvalho de Melo 提交于
      To get the changes in:
      
        6cbc304f ("perf/x86/intel: Fix unwind errors from PEBS entries (mk-II)")
      
      That do not imply any changes in the tooling side, the (ab)use of
      sample_type is entirely done in kernel space, nothing for userspace to
      witness here.
      
      This cures the following warning during perf's build:
      
        Warning: Kernel ABI header at 'tools/include/uapi/linux/perf_event.h' differs from latest version at 'include/uapi/linux/perf_event.h'
      
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Josh Poimboeuf <jpoimboe@redhat.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Prashant Bhole <bhole_prashant_q7@lab.ntt.co.jp>
      Cc: Stephane Eranian <eranian@google.com>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Vince Weaver <vincent.weaver@maine.edu>
      Cc: Wang Nan <wangnan0@huawei.com>
      Link: https://lkml.kernel.org/n/tip-o64mjoy35s9gd1gitunw1zg4@git.kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      2c3ee0e1
  16. 25 7月, 2018 2 次提交
  17. 15 7月, 2018 1 次提交
  18. 13 7月, 2018 1 次提交
  19. 26 6月, 2018 1 次提交
    • I
      tools/headers: Pick up latest kernel ABIs · 32fdbd90
      Ingo Molnar 提交于
      Sync KVM ABI additions and x86 CPU features additions - neither of which
      has any impact on the tooling build.
      
      Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: linux-kernel@vger.kernel.org
      Signed-off-by: NIngo Molnar <mingo@kernel.org>
      32fdbd90
  20. 25 6月, 2018 3 次提交
  21. 16 6月, 2018 1 次提交
  22. 12 6月, 2018 1 次提交
  23. 04 6月, 2018 1 次提交
  24. 03 6月, 2018 1 次提交
  25. 02 6月, 2018 2 次提交
    • D
      bpf: fix uapi hole for 32 bit compat applications · 36f9814a
      Daniel Borkmann 提交于
      In 64 bit, we have a 4 byte hole between ifindex and netns_dev in the
      case of struct bpf_map_info but also struct bpf_prog_info. In net-next
      commit b85fab0e ("bpf: Add gpl_compatible flag to struct bpf_prog_info")
      added a bitfield into it to expose some flags related to programs. Thus,
      add an unnamed __u32 bitfield for both so that alignment keeps the same
      in both 32 and 64 bit cases, and can be naturally extended from there
      as in b85fab0e.
      
      Before:
      
        # file test.o
        test.o: ELF 32-bit LSB relocatable, Intel 80386, version 1 (SYSV), not stripped
        # pahole test.o
        struct bpf_map_info {
      	__u32                      type;                 /*     0     4 */
      	__u32                      id;                   /*     4     4 */
      	__u32                      key_size;             /*     8     4 */
      	__u32                      value_size;           /*    12     4 */
      	__u32                      max_entries;          /*    16     4 */
      	__u32                      map_flags;            /*    20     4 */
      	char                       name[16];             /*    24    16 */
      	__u32                      ifindex;              /*    40     4 */
      	__u64                      netns_dev;            /*    44     8 */
      	__u64                      netns_ino;            /*    52     8 */
      
      	/* size: 64, cachelines: 1, members: 10 */
      	/* padding: 4 */
        };
      
      After (same as on 64 bit):
      
        # file test.o
        test.o: ELF 32-bit LSB relocatable, Intel 80386, version 1 (SYSV), not stripped
        # pahole test.o
        struct bpf_map_info {
      	__u32                      type;                 /*     0     4 */
      	__u32                      id;                   /*     4     4 */
      	__u32                      key_size;             /*     8     4 */
      	__u32                      value_size;           /*    12     4 */
      	__u32                      max_entries;          /*    16     4 */
      	__u32                      map_flags;            /*    20     4 */
      	char                       name[16];             /*    24    16 */
      	__u32                      ifindex;              /*    40     4 */
      
      	/* XXX 4 bytes hole, try to pack */
      
      	__u64                      netns_dev;            /*    48     8 */
      	__u64                      netns_ino;            /*    56     8 */
      	/* --- cacheline 1 boundary (64 bytes) --- */
      
      	/* size: 64, cachelines: 1, members: 10 */
      	/* sum members: 60, holes: 1, sum holes: 4 */
        };
      Reported-by: NDmitry V. Levin <ldv@altlinux.org>
      Reported-by: NEugene Syromiatnikov <esyr@redhat.com>
      Fixes: 52775b33 ("bpf: offload: report device information about offloaded maps")
      Fixes: 675fc275 ("bpf: offload: report device information for offloaded programs")
      Signed-off-by: NDaniel Borkmann <daniel@iogearbox.net>
      Acked-by: NAlexei Starovoitov <ast@kernel.org>
      Signed-off-by: NAlexei Starovoitov <ast@kernel.org>
      36f9814a
    • A
      tools headers: Synchronize prctl.h ABI header · 63b89a19
      Arnaldo Carvalho de Melo 提交于
      To pick up changes from:
      
        $ git log --oneline -2 -i include/uapi/linux/prctl.h
        356e4bff prctl: Add force disable speculation
        b617cfc8 prctl: Add speculation control prctls
      
        $ tools/perf/trace/beauty/prctl_option.sh > before.c
        $ cp include/uapi/linux/prctl.h tools/include/uapi/linux/prctl.h
        $ tools/perf/trace/beauty/prctl_option.sh > after.c
        $ diff -u before.c after.c
        --- before.c	2018-06-01 10:39:53.834073962 -0300
        +++ after.c	2018-06-01 10:42:11.307985394 -0300
        @@ -35,6 +35,8 @@
                [42] = "GET_THP_DISABLE",
                [45] = "SET_FP_MODE",
                [46] = "GET_FP_MODE",
        +       [52] = "GET_SPECULATION_CTRL",
        +       [53] = "SET_SPECULATION_CTRL",
         };
         static const char *prctl_set_mm_options[] = {
       	  [1] = "START_CODE",
        $
      
      This will be used by 'perf trace' to show these strings when beautifying
      the prctl syscall args. At some point we'll be able to say something
      like:
      
      	'perf trace --all-cpus -e prctl(option=*SPEC*)'
      
      To filter by arg by name.
      
        This silences this warning when building tools/perf:
      
          Warning: Kernel ABI header at 'tools/include/uapi/linux/prctl.h' differs from latest version at 'include/uapi/linux/prctl.h'
      
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Wang Nan <wangnan0@huawei.com>
      Link: https://lkml.kernel.org/n/tip-zztsptwhc264r8wg44tqh5gp@git.kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      63b89a19
  26. 30 5月, 2018 2 次提交
  27. 28 5月, 2018 2 次提交
  28. 25 5月, 2018 1 次提交