1. 29 6月, 2022 1 次提交
  2. 03 6月, 2022 1 次提交
  3. 24 5月, 2022 5 次提交
  4. 21 5月, 2022 1 次提交
  5. 16 5月, 2022 1 次提交
  6. 12 5月, 2022 1 次提交
  7. 11 5月, 2022 3 次提交
  8. 09 5月, 2022 1 次提交
    • A
      tools headers UAPI: Sync linux/kvm.h with the kernel sources · 474e76c4
      Arnaldo Carvalho de Melo 提交于
      To pick the changes in:
      
        d495f942 ("KVM: fix bad user ABI for KVM_EXIT_SYSTEM_EVENT")
      
      That just rebuilds perf, as these patches don't add any new KVM ioctl to
      be harvested for the the 'perf trace' ioctl syscall argument
      beautifiers.
      
      This is also by now used by tools/testing/selftests/kvm/, a simple test
      build succeeded.
      
      This silences this perf build warning:
      
        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: Jiri Olsa <jolsa@kernel.org>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Paolo Bonzini <pbonzini@redhat.com>
      Link: http://lore.kernel.org/lkml/YnE5BIweGmCkpOTN@kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      474e76c4
  9. 29 4月, 2022 1 次提交
  10. 27 4月, 2022 3 次提交
  11. 26 4月, 2022 1 次提交
    • K
      bpf: Allow storing referenced kptr in map · c0a5a21c
      Kumar Kartikeya Dwivedi 提交于
      Extending the code in previous commits, introduce referenced kptr
      support, which needs to be tagged using 'kptr_ref' tag instead. Unlike
      unreferenced kptr, referenced kptr have a lot more restrictions. In
      addition to the type matching, only a newly introduced bpf_kptr_xchg
      helper is allowed to modify the map value at that offset. This transfers
      the referenced pointer being stored into the map, releasing the
      references state for the program, and returning the old value and
      creating new reference state for the returned pointer.
      
      Similar to unreferenced pointer case, return value for this case will
      also be PTR_TO_BTF_ID_OR_NULL. The reference for the returned pointer
      must either be eventually released by calling the corresponding release
      function, otherwise it must be transferred into another map.
      
      It is also allowed to call bpf_kptr_xchg with a NULL pointer, to clear
      the value, and obtain the old value if any.
      
      BPF_LDX, BPF_STX, and BPF_ST cannot access referenced kptr. A future
      commit will permit using BPF_LDX for such pointers, but attempt at
      making it safe, since the lifetime of object won't be guaranteed.
      
      There are valid reasons to enforce the restriction of permitting only
      bpf_kptr_xchg to operate on referenced kptr. The pointer value must be
      consistent in face of concurrent modification, and any prior values
      contained in the map must also be released before a new one is moved
      into the map. To ensure proper transfer of this ownership, bpf_kptr_xchg
      returns the old value, which the verifier would require the user to
      either free or move into another map, and releases the reference held
      for the pointer being moved in.
      
      In the future, direct BPF_XCHG instruction may also be permitted to work
      like bpf_kptr_xchg helper.
      
      Note that process_kptr_func doesn't have to call
      check_helper_mem_access, since we already disallow rdonly/wronly flags
      for map, which is what check_map_access_type checks, and we already
      ensure the PTR_TO_MAP_VALUE refers to kptr by obtaining its off_desc,
      so check_map_access is also not required.
      Signed-off-by: NKumar Kartikeya Dwivedi <memxor@gmail.com>
      Signed-off-by: NAlexei Starovoitov <ast@kernel.org>
      Link: https://lore.kernel.org/bpf/20220424214901.2743946-4-memxor@gmail.com
      c0a5a21c
  12. 11 4月, 2022 1 次提交
  13. 09 4月, 2022 1 次提交
    • A
      tools include UAPI: Sync linux/vhost.h with the kernel sources · 940442de
      Arnaldo Carvalho de Melo 提交于
      To get the changes in:
      
        b04d910a ("vdpa: support exposing the count of vqs to userspace")
        a61280dd ("vdpa: support exposing the config size to userspace")
      
      Silencing this perf build warning:
      
        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
      
        $ diff -u tools/include/uapi/linux/vhost.h include/uapi/linux/vhost.h
        --- tools/include/uapi/linux/vhost.h	2021-07-15 16:17:01.840818309 -0300
        +++ include/uapi/linux/vhost.h	2022-04-02 18:55:05.702522387 -0300
        @@ -150,4 +150,11 @@
         /* Get the valid iova range */
         #define VHOST_VDPA_GET_IOVA_RANGE	_IOR(VHOST_VIRTIO, 0x78, \
         					     struct vhost_vdpa_iova_range)
        +
        +/* Get the config size */
        +#define VHOST_VDPA_GET_CONFIG_SIZE	_IOR(VHOST_VIRTIO, 0x79, __u32)
        +
        +/* Get the count of all virtqueues */
        +#define VHOST_VDPA_GET_VQS_COUNT	_IOR(VHOST_VIRTIO, 0x80, __u32)
        +
         #endif
        $ tools/perf/trace/beauty/vhost_virtio_ioctl.sh > before
        $ cp include/uapi/linux/vhost.h tools/include/uapi/linux/vhost.h
        $ tools/perf/trace/beauty/vhost_virtio_ioctl.sh > after
        $ diff -u before after
        --- before	2022-04-04 14:52:25.036375145 -0300
        +++ after	2022-04-04 14:52:31.906549976 -0300
        @@ -38,4 +38,6 @@
         	[0x73] = "VDPA_GET_CONFIG",
         	[0x76] = "VDPA_GET_VRING_NUM",
         	[0x78] = "VDPA_GET_IOVA_RANGE",
        +	[0x79] = "VDPA_GET_CONFIG_SIZE",
        +	[0x80] = "VDPA_GET_VQS_COUNT",
         };
        $
      
      Cc: Longpeng <longpeng2@huawei.com>
      Cc: Michael S. Tsirkin <mst@redhat.com>
      Link: https://lore.kernel.org/lkml/YksxoFcOARk%2Fldev@kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      940442de
  14. 04 4月, 2022 1 次提交
  15. 02 4月, 2022 3 次提交
    • A
      tools headers UAPI: Sync drm/i915_drm.h with the kernel sources · f444b2d1
      Arnaldo Carvalho de Melo 提交于
      To pick up the changes in:
      
        caa574ff ("drm/i915/uapi: document behaviour for DG2 64K support")
      
      That don't add any new ioctl, so no changes in tooling.
      
      This silences this perf build warning:
      
        Warning: Kernel ABI header at 'tools/include/uapi/drm/i915_drm.h' differs from latest version at 'include/uapi/drm/i915_drm.h'
        diff -u tools/include/uapi/drm/i915_drm.h include/uapi/drm/i915_drm.h
      
      Cc: Lucas De Marchi <lucas.demarchi@intel.com>
      Cc: Matthew Auld <matthew.auld@intel.com>
      Link: http://lore.kernel.org/lkml/YkSChHqaOApscFQ0@kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      f444b2d1
    • A
      tools headers UAPI: Sync linux/kvm.h with the kernel sources · 7ceda0cf
      Arnaldo Carvalho de Melo 提交于
      To pick the changes in:
      
        6d849191 ("KVM: x86: Introduce KVM_CAP_DISABLE_QUIRKS2")
        ef11c946 ("KVM: s390: Add vm IOCTL for key checked guest absolute memory access")
        e9e9feeb ("KVM: s390: Add optional storage key checking to MEMOP IOCTL")
      
      That just rebuilds perf, as these patches don't add any new KVM ioctl to
      be harvested for the the 'perf trace' ioctl syscall argument
      beautifiers.
      
      This is also by now used by tools/testing/selftests/kvm/, a simple test
      build succeeded.
      
      This silences this perf build warning:
      
        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: Christian Borntraeger <borntraeger@linux.ibm.com>
      Cc: Janis Schoetterl-Glausch <scgl@linux.ibm.com>
      Cc: Oliver Upton <oupton@google.com>
      Cc: Paolo Bonzini <pbonzini@redhat.com>
      Link: http://lore.kernel.org/lkml/YkSCOWHQdir1lhdJ@kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      7ceda0cf
    • A
      tools headers UAPI: Sync asm-generic/mman-common.h with the kernel · 6d05e139
      Arnaldo Carvalho de Melo 提交于
      To pick the changes from:
      
        9457056a ("mm: madvise: MADV_DONTNEED_LOCKED")
      
      That result in these changes in the tools:
      
        $ diff -u tools/include/uapi/asm-generic/mman-common.h include/uapi/asm-generic/mman-common.h
        --- tools/include/uapi/asm-generic/mman-common.h	2022-03-29 16:17:50.461694991 -0300
        +++ include/uapi/asm-generic/mman-common.h	2022-03-27 19:12:48.923250468 -0300
        @@ -75,6 +75,8 @@
         #define MADV_POPULATE_READ	22	/* populate (prefault) page tables readable */
         #define MADV_POPULATE_WRITE	23	/* populate (prefault) page tables writable */
      
        +#define MADV_DONTNEED_LOCKED	24	/* like DONTNEED, but drop locked pages too */
        +
         /* compatibility flags */
         #define MAP_FILE	0
      
        $ tools/perf/trace/beauty/madvise_behavior.sh > before
        $ cp include/uapi/asm-generic/mman-common.h tools/include/uapi/asm-generic/mman-common.h
        $ tools/perf/trace/beauty/madvise_behavior.sh > after
        $ diff -u before after
        --- before	2022-03-29 16:18:04.091044244 -0300
        +++ after	2022-03-29 16:18:11.692238906 -0300
        @@ -20,6 +20,7 @@
         	[21] = "PAGEOUT",
         	[22] = "POPULATE_READ",
         	[23] = "POPULATE_WRITE",
        +	[24] = "DONTNEED_LOCKED",
         	[100] = "HWPOISON",
         	[101] = "SOFT_OFFLINE",
         };
        $
      
      I.e. now when madvise gets those behaviours as args, 'perf trace' will
      be able to translate from the number to a human readable string and to
      use the strings in tracepoint filter expressions.
      
      This addresses the following perf build warning:
      
        Warning: Kernel ABI header at 'tools/include/uapi/asm-generic/mman-common.h' differs from latest version at 'include/uapi/asm-generic/mman-common.h'
        diff -u tools/include/uapi/asm-generic/mman-common.h include/uapi/asm-generic/mman-common.h
      
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: Ian Rogers <irogers@google.com>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Johannes Weiner <hannes@cmpxchg.org>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Link: http://lore.kernel.org/lkml/YkNcUfeh795yqGMV@kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      6d05e139
  16. 29 3月, 2022 1 次提交
  17. 18 3月, 2022 2 次提交
  18. 11 3月, 2022 3 次提交
  19. 10 3月, 2022 1 次提交
    • T
      bpf: Add "live packet" mode for XDP in BPF_PROG_RUN · b530e9e1
      Toke Høiland-Jørgensen 提交于
      This adds support for running XDP programs through BPF_PROG_RUN in a mode
      that enables live packet processing of the resulting frames. Previous uses
      of BPF_PROG_RUN for XDP returned the XDP program return code and the
      modified packet data to userspace, which is useful for unit testing of XDP
      programs.
      
      The existing BPF_PROG_RUN for XDP allows userspace to set the ingress
      ifindex and RXQ number as part of the context object being passed to the
      kernel. This patch reuses that code, but adds a new mode with different
      semantics, which can be selected with the new BPF_F_TEST_XDP_LIVE_FRAMES
      flag.
      
      When running BPF_PROG_RUN in this mode, the XDP program return codes will
      be honoured: returning XDP_PASS will result in the frame being injected
      into the networking stack as if it came from the selected networking
      interface, while returning XDP_TX and XDP_REDIRECT will result in the frame
      being transmitted out that interface. XDP_TX is translated into an
      XDP_REDIRECT operation to the same interface, since the real XDP_TX action
      is only possible from within the network drivers themselves, not from the
      process context where BPF_PROG_RUN is executed.
      
      Internally, this new mode of operation creates a page pool instance while
      setting up the test run, and feeds pages from that into the XDP program.
      The setup cost of this is amortised over the number of repetitions
      specified by userspace.
      
      To support the performance testing use case, we further optimise the setup
      step so that all pages in the pool are pre-initialised with the packet
      data, and pre-computed context and xdp_frame objects stored at the start of
      each page. This makes it possible to entirely avoid touching the page
      content on each XDP program invocation, and enables sending up to 9
      Mpps/core on my test box.
      
      Because the data pages are recycled by the page pool, and the test runner
      doesn't re-initialise them for each run, subsequent invocations of the XDP
      program will see the packet data in the state it was after the last time it
      ran on that particular page. This means that an XDP program that modifies
      the packet before redirecting it has to be careful about which assumptions
      it makes about the packet content, but that is only an issue for the most
      naively written programs.
      
      Enabling the new flag is only allowed when not setting ctx_out and data_out
      in the test specification, since using it means frames will be redirected
      somewhere else, so they can't be returned.
      Signed-off-by: NToke Høiland-Jørgensen <toke@redhat.com>
      Signed-off-by: NAlexei Starovoitov <ast@kernel.org>
      Acked-by: NMartin KaFai Lau <kafai@fb.com>
      Link: https://lore.kernel.org/bpf/20220309105346.100053-2-toke@redhat.com
      b530e9e1
  20. 03 3月, 2022 1 次提交
    • M
      bpf: Add __sk_buff->delivery_time_type and bpf_skb_set_skb_delivery_time() · 8d21ec0e
      Martin KaFai Lau 提交于
      * __sk_buff->delivery_time_type:
      This patch adds __sk_buff->delivery_time_type.  It tells if the
      delivery_time is stored in __sk_buff->tstamp or not.
      
      It will be most useful for ingress to tell if the __sk_buff->tstamp
      has the (rcv) timestamp or delivery_time.  If delivery_time_type
      is 0 (BPF_SKB_DELIVERY_TIME_NONE), it has the (rcv) timestamp.
      
      Two non-zero types are defined for the delivery_time_type,
      BPF_SKB_DELIVERY_TIME_MONO and BPF_SKB_DELIVERY_TIME_UNSPEC.  For UNSPEC,
      it can only happen in egress because only mono delivery_time can be
      forwarded to ingress now.  The clock of UNSPEC delivery_time
      can be deduced from the skb->sk->sk_clockid which is how
      the sch_etf doing it also.
      
      * Provide forwarded delivery_time to tc-bpf@ingress:
      With the help of the new delivery_time_type, the tc-bpf has a way
      to tell if the __sk_buff->tstamp has the (rcv) timestamp or
      the delivery_time.  During bpf load time, the verifier will learn if
      the bpf prog has accessed the new __sk_buff->delivery_time_type.
      If it does, it means the tc-bpf@ingress is expecting the
      skb->tstamp could have the delivery_time.  The kernel will then
      read the skb->tstamp as-is during bpf insn rewrite without
      checking the skb->mono_delivery_time.  This is done by adding a
      new prog->delivery_time_access bit.  The same goes for
      writing skb->tstamp.
      
      * bpf_skb_set_delivery_time():
      The bpf_skb_set_delivery_time() helper is added to allow setting both
      delivery_time and the delivery_time_type at the same time.  If the
      tc-bpf does not need to change the delivery_time_type, it can directly
      write to the __sk_buff->tstamp as the existing tc-bpf has already been
      doing.  It will be most useful at ingress to change the
      __sk_buff->tstamp from the (rcv) timestamp to
      a mono delivery_time and then bpf_redirect_*().
      
      bpf only has mono clock helper (bpf_ktime_get_ns), and
      the current known use case is the mono EDT for fq, and
      only mono delivery time can be kept during forward now,
      so bpf_skb_set_delivery_time() only supports setting
      BPF_SKB_DELIVERY_TIME_MONO.  It can be extended later when use cases
      come up and the forwarding path also supports other clock bases.
      Signed-off-by: NMartin KaFai Lau <kafai@fb.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      8d21ec0e
  21. 01 3月, 2022 1 次提交
  22. 25 2月, 2022 1 次提交
  23. 22 2月, 2022 1 次提交
  24. 21 2月, 2022 1 次提交
  25. 17 2月, 2022 1 次提交
  26. 10 2月, 2022 1 次提交
  27. 06 2月, 2022 1 次提交