1. 08 12月, 2020 1 次提交
  2. 24 11月, 2020 1 次提交
  3. 18 9月, 2020 1 次提交
  4. 11 9月, 2020 1 次提交
  5. 10 9月, 2020 1 次提交
  6. 16 7月, 2020 1 次提交
  7. 08 7月, 2020 1 次提交
  8. 07 7月, 2020 1 次提交
  9. 18 6月, 2020 1 次提交
    • Y
      RDMA/hns: Fix a calltrace when registering MR from userspace · 98a61519
      Yangyang Li 提交于
      ibmr.device is assigned after MR is successfully registered, but both
      write_mtpt() and frmr_write_mtpt() accesses it during the mr registration
      process, which may cause the following error when trying to register MR in
      userspace and pbl_hop_num is set to 0.
      
        pc : hns_roce_mtr_find+0xa0/0x200 [hns_roce]
        lr : set_mtpt_pbl+0x54/0x118 [hns_roce_hw_v2]
        sp : ffff00023e73ba20
        x29: ffff00023e73ba20 x28: ffff00023e73bad8
        x27: 0000000000000000 x26: 0000000000000000
        x25: 0000000000000002 x24: 0000000000000000
        x23: ffff00023e73bad0 x22: 0000000000000000
        x21: ffff0000094d9000 x20: 0000000000000000
        x19: ffff8020a6bdb2c0 x18: 0000000000000000
        x17: 0000000000000000 x16: 0000000000000000
        x15: 0000000000000000 x14: 0000000000000000
        x13: 0140000000000000 x12: 0040000000000041
        x11: ffff000240000000 x10: 0000000000001000
        x9 : 0000000000000000 x8 : ffff802fb7558480
        x7 : ffff802fb7558480 x6 : 000000000003483d
        x5 : ffff00023e73bad0 x4 : 0000000000000002
        x3 : ffff00023e73bad8 x2 : 0000000000000000
        x1 : 0000000000000000 x0 : ffff0000094d9708
        Call trace:
         hns_roce_mtr_find+0xa0/0x200 [hns_roce]
         set_mtpt_pbl+0x54/0x118 [hns_roce_hw_v2]
         hns_roce_v2_write_mtpt+0x14c/0x168 [hns_roce_hw_v2]
         hns_roce_mr_enable+0x6c/0x148 [hns_roce]
         hns_roce_reg_user_mr+0xd8/0x130 [hns_roce]
         ib_uverbs_reg_mr+0x14c/0x2e0 [ib_uverbs]
         ib_uverbs_write+0x27c/0x3e8 [ib_uverbs]
         __vfs_write+0x60/0x190
         vfs_write+0xac/0x1c0
         ksys_write+0x6c/0xd8
         __arm64_sys_write+0x24/0x30
         el0_svc_common+0x78/0x130
         el0_svc_handler+0x38/0x78
         el0_svc+0x8/0xc
      
      Solve above issue by adding a pointer of structure hns_roce_dev as a
      parameter of write_mtpt() and frmr_write_mtpt(), so that both of these
      functions can access it before finishing MR's registration.
      
      Fixes: 9b2cf76c ("RDMA/hns: Optimize PBL buffer allocation process")
      Link: https://lore.kernel.org/r/1592314629-51715-1-git-send-email-liweihang@huawei.comSigned-off-by: NYangyang Li <liyangyang20@huawei.com>
      Signed-off-by: NWeihang Li <liweihang@huawei.com>
      Signed-off-by: NJason Gunthorpe <jgg@mellanox.com>
      98a61519
  10. 26 5月, 2020 2 次提交
  11. 20 5月, 2020 2 次提交
  12. 07 5月, 2020 2 次提交
  13. 23 4月, 2020 2 次提交
  14. 27 3月, 2020 1 次提交
  15. 16 1月, 2020 1 次提交
  16. 08 1月, 2020 1 次提交
  17. 17 11月, 2019 1 次提交
  18. 09 11月, 2019 2 次提交
  19. 28 8月, 2019 1 次提交
  20. 12 8月, 2019 1 次提交
  21. 25 7月, 2019 2 次提交
  22. 26 6月, 2019 1 次提交
  23. 21 6月, 2019 2 次提交
  24. 28 5月, 2019 1 次提交
  25. 09 4月, 2019 1 次提交
    • L
      RDMA/hns: Fix bug that caused srq creation to fail · 4772e03d
      Lijun Ou 提交于
      Due to the incorrect use of the seg and obj information, the position of
      the mtt is calculated incorrectly, and the free space of the page is not
      enough to store the entire mtt, resulting in access to the next page. This
      patch fixes this problem.
      
       Unable to handle kernel paging request at virtual address ffff00006e3cd000
       ...
       Call trace:
        hns_roce_write_mtt+0x154/0x2f0 [hns_roce]
        hns_roce_buf_write_mtt+0xa8/0xd8 [hns_roce]
        hns_roce_create_srq+0x74c/0x808 [hns_roce]
        ib_create_srq+0x28/0xc8
      
      Fixes: 0203b14c ("RDMA/hns: Unify the calculation for hem index in hip08")
      Signed-off-by: Nchenglang <chenglang@huawei.com>
      Signed-off-by: NLijun Ou <oulijun@huawei.com>
      Signed-off-by: NJason Gunthorpe <jgg@mellanox.com>
      4772e03d
  26. 02 4月, 2019 1 次提交
  27. 12 2月, 2019 1 次提交
  28. 11 1月, 2019 1 次提交
  29. 12 12月, 2018 1 次提交
  30. 05 12月, 2018 1 次提交
  31. 16 10月, 2018 1 次提交
  32. 27 9月, 2018 1 次提交
  33. 13 6月, 2018 1 次提交
    • K
      treewide: Use array_size() in vzalloc() · fad953ce
      Kees Cook 提交于
      The vzalloc() function has no 2-factor argument form, so multiplication
      factors need to be wrapped in array_size(). This patch replaces cases of:
      
              vzalloc(a * b)
      
      with:
              vzalloc(array_size(a, b))
      
      as well as handling cases of:
      
              vzalloc(a * b * c)
      
      with:
      
              vzalloc(array3_size(a, b, c))
      
      This does, however, attempt to ignore constant size factors like:
      
              vzalloc(4 * 1024)
      
      though any constants defined via macros get caught up in the conversion.
      
      Any factors with a sizeof() of "unsigned char", "char", and "u8" were
      dropped, since they're redundant.
      
      The Coccinelle script used for this was:
      
      // Fix redundant parens around sizeof().
      @@
      type TYPE;
      expression THING, E;
      @@
      
      (
        vzalloc(
      -	(sizeof(TYPE)) * E
      +	sizeof(TYPE) * E
        , ...)
      |
        vzalloc(
      -	(sizeof(THING)) * E
      +	sizeof(THING) * E
        , ...)
      )
      
      // Drop single-byte sizes and redundant parens.
      @@
      expression COUNT;
      typedef u8;
      typedef __u8;
      @@
      
      (
        vzalloc(
      -	sizeof(u8) * (COUNT)
      +	COUNT
        , ...)
      |
        vzalloc(
      -	sizeof(__u8) * (COUNT)
      +	COUNT
        , ...)
      |
        vzalloc(
      -	sizeof(char) * (COUNT)
      +	COUNT
        , ...)
      |
        vzalloc(
      -	sizeof(unsigned char) * (COUNT)
      +	COUNT
        , ...)
      |
        vzalloc(
      -	sizeof(u8) * COUNT
      +	COUNT
        , ...)
      |
        vzalloc(
      -	sizeof(__u8) * COUNT
      +	COUNT
        , ...)
      |
        vzalloc(
      -	sizeof(char) * COUNT
      +	COUNT
        , ...)
      |
        vzalloc(
      -	sizeof(unsigned char) * COUNT
      +	COUNT
        , ...)
      )
      
      // 2-factor product with sizeof(type/expression) and identifier or constant.
      @@
      type TYPE;
      expression THING;
      identifier COUNT_ID;
      constant COUNT_CONST;
      @@
      
      (
        vzalloc(
      -	sizeof(TYPE) * (COUNT_ID)
      +	array_size(COUNT_ID, sizeof(TYPE))
        , ...)
      |
        vzalloc(
      -	sizeof(TYPE) * COUNT_ID
      +	array_size(COUNT_ID, sizeof(TYPE))
        , ...)
      |
        vzalloc(
      -	sizeof(TYPE) * (COUNT_CONST)
      +	array_size(COUNT_CONST, sizeof(TYPE))
        , ...)
      |
        vzalloc(
      -	sizeof(TYPE) * COUNT_CONST
      +	array_size(COUNT_CONST, sizeof(TYPE))
        , ...)
      |
        vzalloc(
      -	sizeof(THING) * (COUNT_ID)
      +	array_size(COUNT_ID, sizeof(THING))
        , ...)
      |
        vzalloc(
      -	sizeof(THING) * COUNT_ID
      +	array_size(COUNT_ID, sizeof(THING))
        , ...)
      |
        vzalloc(
      -	sizeof(THING) * (COUNT_CONST)
      +	array_size(COUNT_CONST, sizeof(THING))
        , ...)
      |
        vzalloc(
      -	sizeof(THING) * COUNT_CONST
      +	array_size(COUNT_CONST, sizeof(THING))
        , ...)
      )
      
      // 2-factor product, only identifiers.
      @@
      identifier SIZE, COUNT;
      @@
      
        vzalloc(
      -	SIZE * COUNT
      +	array_size(COUNT, SIZE)
        , ...)
      
      // 3-factor product with 1 sizeof(type) or sizeof(expression), with
      // redundant parens removed.
      @@
      expression THING;
      identifier STRIDE, COUNT;
      type TYPE;
      @@
      
      (
        vzalloc(
      -	sizeof(TYPE) * (COUNT) * (STRIDE)
      +	array3_size(COUNT, STRIDE, sizeof(TYPE))
        , ...)
      |
        vzalloc(
      -	sizeof(TYPE) * (COUNT) * STRIDE
      +	array3_size(COUNT, STRIDE, sizeof(TYPE))
        , ...)
      |
        vzalloc(
      -	sizeof(TYPE) * COUNT * (STRIDE)
      +	array3_size(COUNT, STRIDE, sizeof(TYPE))
        , ...)
      |
        vzalloc(
      -	sizeof(TYPE) * COUNT * STRIDE
      +	array3_size(COUNT, STRIDE, sizeof(TYPE))
        , ...)
      |
        vzalloc(
      -	sizeof(THING) * (COUNT) * (STRIDE)
      +	array3_size(COUNT, STRIDE, sizeof(THING))
        , ...)
      |
        vzalloc(
      -	sizeof(THING) * (COUNT) * STRIDE
      +	array3_size(COUNT, STRIDE, sizeof(THING))
        , ...)
      |
        vzalloc(
      -	sizeof(THING) * COUNT * (STRIDE)
      +	array3_size(COUNT, STRIDE, sizeof(THING))
        , ...)
      |
        vzalloc(
      -	sizeof(THING) * COUNT * STRIDE
      +	array3_size(COUNT, STRIDE, sizeof(THING))
        , ...)
      )
      
      // 3-factor product with 2 sizeof(variable), with redundant parens removed.
      @@
      expression THING1, THING2;
      identifier COUNT;
      type TYPE1, TYPE2;
      @@
      
      (
        vzalloc(
      -	sizeof(TYPE1) * sizeof(TYPE2) * COUNT
      +	array3_size(COUNT, sizeof(TYPE1), sizeof(TYPE2))
        , ...)
      |
        vzalloc(
      -	sizeof(TYPE1) * sizeof(THING2) * (COUNT)
      +	array3_size(COUNT, sizeof(TYPE1), sizeof(TYPE2))
        , ...)
      |
        vzalloc(
      -	sizeof(THING1) * sizeof(THING2) * COUNT
      +	array3_size(COUNT, sizeof(THING1), sizeof(THING2))
        , ...)
      |
        vzalloc(
      -	sizeof(THING1) * sizeof(THING2) * (COUNT)
      +	array3_size(COUNT, sizeof(THING1), sizeof(THING2))
        , ...)
      |
        vzalloc(
      -	sizeof(TYPE1) * sizeof(THING2) * COUNT
      +	array3_size(COUNT, sizeof(TYPE1), sizeof(THING2))
        , ...)
      |
        vzalloc(
      -	sizeof(TYPE1) * sizeof(THING2) * (COUNT)
      +	array3_size(COUNT, sizeof(TYPE1), sizeof(THING2))
        , ...)
      )
      
      // 3-factor product, only identifiers, with redundant parens removed.
      @@
      identifier STRIDE, SIZE, COUNT;
      @@
      
      (
        vzalloc(
      -	(COUNT) * STRIDE * SIZE
      +	array3_size(COUNT, STRIDE, SIZE)
        , ...)
      |
        vzalloc(
      -	COUNT * (STRIDE) * SIZE
      +	array3_size(COUNT, STRIDE, SIZE)
        , ...)
      |
        vzalloc(
      -	COUNT * STRIDE * (SIZE)
      +	array3_size(COUNT, STRIDE, SIZE)
        , ...)
      |
        vzalloc(
      -	(COUNT) * (STRIDE) * SIZE
      +	array3_size(COUNT, STRIDE, SIZE)
        , ...)
      |
        vzalloc(
      -	COUNT * (STRIDE) * (SIZE)
      +	array3_size(COUNT, STRIDE, SIZE)
        , ...)
      |
        vzalloc(
      -	(COUNT) * STRIDE * (SIZE)
      +	array3_size(COUNT, STRIDE, SIZE)
        , ...)
      |
        vzalloc(
      -	(COUNT) * (STRIDE) * (SIZE)
      +	array3_size(COUNT, STRIDE, SIZE)
        , ...)
      |
        vzalloc(
      -	COUNT * STRIDE * SIZE
      +	array3_size(COUNT, STRIDE, SIZE)
        , ...)
      )
      
      // Any remaining multi-factor products, first at least 3-factor products
      // when they're not all constants...
      @@
      expression E1, E2, E3;
      constant C1, C2, C3;
      @@
      
      (
        vzalloc(C1 * C2 * C3, ...)
      |
        vzalloc(
      -	E1 * E2 * E3
      +	array3_size(E1, E2, E3)
        , ...)
      )
      
      // And then all remaining 2 factors products when they're not all constants.
      @@
      expression E1, E2;
      constant C1, C2;
      @@
      
      (
        vzalloc(C1 * C2, ...)
      |
        vzalloc(
      -	E1 * E2
      +	array_size(E1, E2)
        , ...)
      )
      Signed-off-by: NKees Cook <keescook@chromium.org>
      fad953ce