1. 22 10月, 2020 1 次提交
    • D
      bpf, libbpf: Guard bpf inline asm from bpf_tail_call_static · 3652c9a1
      Daniel Borkmann 提交于
      Yaniv reported a compilation error after pulling latest libbpf:
      
        [...]
        ../libbpf/src/root/usr/include/bpf/bpf_helpers.h:99:10: error:
        unknown register name 'r0' in asm
                           : "r0", "r1", "r2", "r3", "r4", "r5");
        [...]
      
      The issue got triggered given Yaniv was compiling tracing programs with native
      target (e.g. x86) instead of BPF target, hence no BTF generated vmlinux.h nor
      CO-RE used, and later llc with -march=bpf was invoked to compile from LLVM IR
      to BPF object file. Given that clang was expecting x86 inline asm and not BPF
      one the error complained that these regs don't exist on the former.
      
      Guard bpf_tail_call_static() with defined(__bpf__) where BPF inline asm is valid
      to use. BPF tracing programs on more modern kernels use BPF target anyway and
      thus the bpf_tail_call_static() function will be available for them. BPF inline
      asm is supported since clang 7 (clang <= 6 otherwise throws same above error),
      and __bpf_unreachable() since clang 8, therefore include the latter condition
      in order to prevent compilation errors for older clang versions. Given even an
      old Ubuntu 18.04 LTS has official LLVM packages all the way up to llvm-10, I did
      not bother to special case the __bpf_unreachable() inside bpf_tail_call_static()
      further.
      
      Also, undo the sockex3_kern's use of bpf_tail_call_static() sample given they
      still have the old hacky way to even compile networking progs with native instead
      of BPF target so bpf_tail_call_static() won't be defined there anymore.
      
      Fixes: 0e9f6841 ("bpf, libbpf: Add bpf_tail_call_static helper for bpf programs")
      Reported-by: NYaniv Agman <yanivagman@gmail.com>
      Signed-off-by: NDaniel Borkmann <daniel@iogearbox.net>
      Acked-by: NAndrii Nakryiko <andrii@kernel.org>
      Acked-by: NYonghong Song <yhs@fb.com>
      Tested-by: NYaniv Agman <yanivagman@gmail.com>
      Link: https://lore.kernel.org/bpf/CAMy7=ZUk08w5Gc2Z-EKi4JFtuUCaZYmE4yzhJjrExXpYKR4L8w@mail.gmail.com
      Link: https://lore.kernel.org/bpf/20201021203257.26223-1-daniel@iogearbox.net
      3652c9a1
  2. 14 10月, 2020 1 次提交
    • liulangrenaaa's avatar
      mm,kmemleak-test.c: move kmemleak-test.c to samples dir · 1abbef4f
      liulangrenaaa 提交于
      kmemleak-test.c is just a kmemleak test module, which also can not be used
      as a built-in kernel module.  Thus, i think it may should not be in mm
      dir, and move the kmemleak-test.c to samples/kmemleak/kmemleak-test.c.
      Fix the spelling of built-in by the way.
      Signed-off-by: liulangrenaaa's avatarHui Su <sh_def@163.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Cc: Catalin Marinas <catalin.marinas@arm.com>
      Cc: Jonathan Corbet <corbet@lwn.net>
      Cc: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
      Cc: David S. Miller <davem@davemloft.net>
      Cc: Rob Herring <robh@kernel.org>
      Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
      Cc: Sam Ravnborg <sam@ravnborg.org>
      Cc: Josh Poimboeuf <jpoimboe@redhat.com>
      Cc: Steven Rostedt (VMware) <rostedt@goodmis.org>
      Cc: Miguel Ojeda <miguel.ojeda.sandonis@gmail.com>
      Cc: Divya Indi <divya.indi@oracle.com>
      Cc: Tomas Winkler <tomas.winkler@intel.com>
      Cc: David Howells <dhowells@redhat.com>
      Link: https://lkml.kernel.org/r/20200925183729.GA172837@rlkSigned-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      1abbef4f
  3. 12 10月, 2020 3 次提交
  4. 07 10月, 2020 13 次提交
  5. 02 10月, 2020 2 次提交
  6. 01 10月, 2020 1 次提交
  7. 22 9月, 2020 1 次提交
    • A
      nitro_enclaves: Add sample for ioctl interface usage · acc4229c
      Andra Paraschiv 提交于
      Add a user space sample for the usage of the ioctl interface provided by
      the Nitro Enclaves driver.
      
      Changelog
      
      v9 -> v10
      
      * Update commit message to include the changelog before the SoB tag(s).
      
      v8 -> v9
      
      * No changes.
      
      v7 -> v8
      
      * Track NE custom error codes for invalid page size, invalid flags and
        enclave CID.
      * Update the heartbeat logic to have a listener fd first, then start the
        enclave and then accept connection to get the heartbeat.
      * Update the reference link to the hugetlb documentation.
      
      v6 -> v7
      
      * Track POLLNVAL as poll event in addition to POLLHUP.
      
      v5 -> v6
      
      * Remove "rc" mentioning when printing errno string.
      * Remove the ioctl to query API version.
      * Include usage info for NUMA-aware hugetlb configuration.
      * Update documentation to kernel-doc format.
      * Add logic for enclave image loading.
      
      v4 -> v5
      
      * Print enclave vCPU ids when they are created.
      * Update logic to map the modified vCPU ioctl call.
      * Add check for the path to the enclave image to be less than PATH_MAX.
      * Update the ioctl calls error checking logic to match the NE specific
        error codes.
      
      v3 -> v4
      
      * Update usage details to match the updates in v4.
      * Update NE ioctl interface usage.
      
      v2 -> v3
      
      * Remove the include directory to use the uapi from the kernel.
      * Remove the GPL additional wording as SPDX-License-Identifier is
        already in place.
      
      v1 -> v2
      
      * New in v2.
      Reviewed-by: NAlexander Graf <graf@amazon.com>
      Signed-off-by: NAlexandru Vasile <lexnv@amazon.com>
      Signed-off-by: NAndra Paraschiv <andraprs@amazon.com>
      Link: https://lore.kernel.org/r/20200921121732.44291-17-andraprs@amazon.comSigned-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      acc4229c
  8. 19 9月, 2020 1 次提交
  9. 15 9月, 2020 3 次提交
  10. 11 9月, 2020 1 次提交
  11. 10 9月, 2020 1 次提交
    • M
      samples: vfio-mdev/mbochs: fix common struct sg_table related issues · be0704be
      Marek Szyprowski 提交于
      The Documentation/DMA-API-HOWTO.txt states that the dma_map_sg() function
      returns the number of the created entries in the DMA address space.
      However the subsequent calls to the dma_sync_sg_for_{device,cpu}() and
      dma_unmap_sg must be called with the original number of the entries
      passed to the dma_map_sg().
      
      struct sg_table is a common structure used for describing a non-contiguous
      memory buffer, used commonly in the DRM and graphics subsystems. It
      consists of a scatterlist with memory pages and DMA addresses (sgl entry),
      as well as the number of scatterlist entries: CPU pages (orig_nents entry)
      and DMA mapped pages (nents entry).
      
      It turned out that it was a common mistake to misuse nents and orig_nents
      entries, calling DMA-mapping functions with a wrong number of entries or
      ignoring the number of mapped entries returned by the dma_map_sg()
      function.
      
      To avoid such issues, lets use a common dma-mapping wrappers operating
      directly on the struct sg_table objects and use scatterlist page
      iterators where possible. This, almost always, hides references to the
      nents and orig_nents entries, making the code robust, easier to follow
      and copy/paste safe.
      
      While touching this code, also add missing call to dma_unmap_sgtable.
      Signed-off-by: NMarek Szyprowski <m.szyprowski@samsung.com>
      Reviewed-by: NRobin Murphy <robin.murphy@arm.com>
      be0704be
  12. 04 9月, 2020 2 次提交
  13. 01 9月, 2020 3 次提交
  14. 25 8月, 2020 3 次提交
  15. 24 8月, 2020 1 次提交
  16. 20 8月, 2020 2 次提交
  17. 19 8月, 2020 1 次提交