1. 25 8月, 2017 4 次提交
  2. 23 8月, 2017 1 次提交
  3. 19 8月, 2017 1 次提交
    • G
      PCI/IB: add support for pci driver attribute groups · 92d50fc1
      Greg Kroah-Hartman 提交于
      Some drivers (specifically the nes IB driver), want to create a lot of
      sysfs driver attributes.  Instead of open-coding the creation and
      removal of these files (and getting it wrong btw), it's a better idea to
      let the driver core handle all of this logic for us.
      
      So add a new field to the pci driver structure, **groups, that allows
      pci drivers to specify an attribute group list it wishes to have created
      when it is registered with the driver core.
      
      Big bonus is now the driver doesn't race with userspace when the sysfs
      files are created vs. when the kobject is announced, so any script/tool
      that actually wanted to use these files will not have to poll waiting
      for them to show up.
      
      Cc: Faisal Latif <faisal.latif@intel.com>
      Cc: Doug Ledford <dledford@redhat.com>
      Cc: Sean Hefty <sean.hefty@intel.com>
      Cc: Hal Rosenstock <hal.rosenstock@gmail.com>
      Cc: Bjorn Helgaas <bhelgaas@google.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      Acked-by: NBjorn Helgaas <bhelgaas@google.com>
      Signed-off-by: NDoug Ledford <dledford@redhat.com>
      92d50fc1
  4. 09 8月, 2017 3 次提交
  5. 05 8月, 2017 1 次提交
  6. 24 7月, 2017 10 次提交
    • M
      (IB, net)/mlx4: Add resource utilization support · f3301870
      Moshe Shemesh 提交于
      Adding visibility of resource usage of QPs, CQs and counters used by
      virtual functions. This feature will be used to give the PF administrator
      more data while debugging VF status. Usage info was added to ALLOC_RES
      command, to notify the PF if the resource which is being reserved or
      allocated for the VF will be used by kernel driver or by user verbs.
      
      Updated reservation and allocation functions of QP, CQ and counter with
      additional usage parameter.
      Signed-off-by: NMoshe Shemesh <moshe@mellanox.com>
      Signed-off-by: NLeon Romanovsky <leon@kernel.org>
      Signed-off-by: NDoug Ledford <dledford@redhat.com>
      f3301870
    • P
      IB/mlx5: Expose extended error counters · 58dcb60a
      Parav Pandit 提交于
      This patch adds below requester and responder side error counters,
      which will be exposed by hardware counters interface and are supported
      as part of query Q counters command extension.
      
       +---------------------------+-------------------------------------+
       |      Name                 |           Description               |
       |---------------------------+-------------------------------------|
       |resp_local_length_error    | Number of times responder detected  |
       |                           | local length errors                 |
       |---------------------------+-------------------------------------|
       |resp_cqe_error             | Number of CQEs completed with error |
       |                           | at responder                        |
       |---------------------------+-------------------------------------|
       |req_cqe_error              | Number of CQEs completed with error |
       |                           | at requester                        |
       |---------------------------+-------------------------------------|
       |req_remote_invalid_request | Number of times requester detected  |
       |                           | remote invalid request error        |
       |---------------------------+-------------------------------------|
       |req_remote_access_error    | Number of times requester detected  |
       |                           | remote access error                 |
       |---------------------------+-------------------------------------|
       |resp_remote_access_error   | Number of times responder detected  |
       |                           | remote access error                 |
       |---------------------------+-------------------------------------|
       |resp_cqe_flush_error       | Number of CQEs completed with       |
       |                           | flushed with error at responder     |
       |---------------------------+-------------------------------------|
       |req_cqe_flush_error        | Number of CQEs completed with       |
       |                           | flushed with error at requester     |
       +---------------------------+-------------------------------------+
      Signed-off-by: NParav Pandit <parav@mellanox.com>
      Reviewed-by: NDaniel Jurgens <danielj@mellanox.com>
      Reviewed-by: NEli Cohen <eli@mellanox.com>
      Signed-off-by: NLeon Romanovsky <leon@kernel.org>
      Signed-off-by: NDoug Ledford <dledford@redhat.com>
      58dcb60a
    • L
      IB/mlx5: Fix existence check for extended address vector · 3fffc82a
      Leon Romanovsky 提交于
      The extended address vector is the highest bit in be32 variable,
      but it was compared with the lowest. This patch fixes the endianness
      of that check and removes already declared define.
      
      Fixes: 17d2f88f ("IB/mlx5: Add ODP atomics support")
      Reviewed-by: NArtemy Kovalyov <artemyko@mellanox.com>
      Signed-off-by: NLeon Romanovsky <leonro@mellanox.com>
      Signed-off-by: NDoug Ledford <dledford@redhat.com>
      3fffc82a
    • Y
      net/mlx5: Report enhanced capabilities for IPoIB · 4ce749bd
      Yishai Hadas 提交于
      Report 'ipoib_enhanced_offloads' capabilities from
      the core layer, it will be used in the next patch from this series.
      Signed-off-by: NYishai Hadas <yishaih@mellanox.com>
      Reviewed-by: NMaor Gottlieb <maorg@mellanox.com>
      Signed-off-by: NLeon Romanovsky <leon@kernel.org>
      Signed-off-by: NDoug Ledford <dledford@redhat.com>
      4ce749bd
    • M
      IB/mlx5: Add support to dropless RQ · 03404e8a
      Maor Gottlieb 提交于
      RQs that were configured for "delay drop" will prevent packet drops
      when their WQEs are depleted.
      Marking an RQ to be drop-less is done by setting delay_drop_en in RQ
      context using CREATE_RQ command.
      
      Since this feature is globally activated/deactivated by using the
      SET_DELAY_DROP command on all the marked RQs, we activated/deactivated
      it according to the number of RQs with 'delay_drop' enabled.
      
      When timeout is expired, then the feature is deactivated. Therefore
      the driver handles the delay drop timeout event and reactivate it.
      Signed-off-by: NMaor Gottlieb <maorg@mellanox.com>
      Reviewed-by: NYishai Hadas <yishaih@mellanox.com>
      Signed-off-by: NLeon Romanovsky <leon@kernel.org>
      Signed-off-by: NDoug Ledford <dledford@redhat.com>
      03404e8a
    • M
      net/mlx5: Introduce general notification event · 246ac981
      Maor Gottlieb 提交于
      When delay drop timeout is expired, the firmware raises
      general notification event of DELAY_DROP_TIMEOUT subtype.
      In addition the feature is disable so the driver have to
      reactivate the timeout.
      Signed-off-by: NMaor Gottlieb <maorg@mellanox.com>
      Reviewed-by: NYishai Hadas <yishaih@mellanox.com>
      Signed-off-by: NLeon Romanovsky <leon@kernel.org>
      Signed-off-by: NDoug Ledford <dledford@redhat.com>
      246ac981
    • M
      net/mlx5: Introduce set delay drop command · c1e0bfc1
      Maor Gottlieb 提交于
      Add support to SET_DELAY_DROP command.
      
      This command will be used in downstream patches for delay packet drop.
      The timeout value should be indicated by delay_drop_timeout field.
      Packet processing will be delayed till timeout value passed or until
      more WQEs are posted.
      
      Setting this value to 0 disables the feature.
      Signed-off-by: NMaor Gottlieb <maorg@mellanox.com>
      Reviewed-by: NYishai Hadas <yishaih@mellanox.com>
      Signed-off-by: NLeon Romanovsky <leon@kernel.org>
      Signed-off-by: NDoug Ledford <dledford@redhat.com>
      c1e0bfc1
    • B
      IB/mlx5: Restore IB guid/policy for virtual functions · 7ecf6d8f
      Bodong Wang 提交于
      When a user sets port_guid, node_guid or policy of an IB virtual
      function, save this information in "struct mlx5_vf_context".
      
      This information will be restored later when pci_resume is called.
      To make sure this works, one can use aer-inject to generate PCI
      errors on mlx5 devices and verify if relevant fields are restored
      after PCI resume.
      Signed-off-by: NBodong Wang <bodong@mellanox.com>
      Reviewed-by: NEli Cohen <eli@mellanox.com>
      Signed-off-by: NLeon Romanovsky <leon@kernel.org>
      Signed-off-by: NDoug Ledford <dledford@redhat.com>
      7ecf6d8f
    • P
      IB/mlx5: Add debug control parameters for congestion control · 4a2da0b8
      Parav Pandit 提交于
      This patch adds debug control parameters for congestion control which
      can be read or written through debugfs. They are for reaction point and
      notification point nodes.
      
      These control parameters are as below:
       +------------------------------+-----------------------------------------+
       |      Name                    |           Description                   |
       |------------------------------+-----------------------------------------|
       |rp_clamp_tgt_rate             | When set target rate is updated to      |
       |                              | current rate                            |
       |------------------------------+-----------------------------------------|
       |rp_clamp_tgt_rate_ati         | When set update target rate based on    |
       |                              | timer as well                           |
       |------------------------------+-----------------------------------------|
       |rp_time_reset                 | time between rate increase if no        |
       |                              | CNP is received unit in usec            |
       |------------------------------+-----------------------------------------|
       |rp_byte_reset                 | Number of bytes between rate inease if  |
       |                              | no CNP is received                      |
       |------------------------------+-----------------------------------------|
       |rp_threshold                  | Threshold for reaction point rate       |
       |                              | control                                 |
       |------------------------------+-----------------------------------------|
       |rp_ai_rate                    | Rate for target rate, unit in Mbps      |
       |------------------------------+-----------------------------------------|
       |rp_hai_rate                   | Rate for hyper increase state           |
       |                              | unit in Mbps                            |
       |------------------------------+-----------------------------------------|
       |rp_min_dec_fac                | Minimum factor by which the current     |
       |                              | transmit rate can be changed when       |
       |                              | processing a CNP, unit is percerntage   |
       |------------------------------+-----------------------------------------|
       |rp_min_rate                   | Minimum value for rate limit,           |
       |                              | unit in Mbps                            |
       |------------------------------+-----------------------------------------|
       |rp_rate_to_set_on_first_cnp   | Rate that is set when first CNP is      |
       |                              | received, unit is Mbps                  |
       |------------------------------+-----------------------------------------|
       |rp_dce_tcp_g                  | Used to calculate alpha                 |
       |------------------------------+-----------------------------------------|
       |rp_dce_tcp_rtt                | Time between updates of alpha value,    |
       |                              | unit is usec                            |
       |------------------------------+-----------------------------------------|
       |rp_rate_reduce_monitor_period | Minimum time between consecutive rate   |
       |                              | reductions                              |
       |------------------------------+-----------------------------------------|
       |rp_initial_alpha_value        | Initial value of alpha                  |
       |------------------------------+-----------------------------------------|
       |rp_gd                         | When CNP is received, flow rate is      |
       |                              | reduced based on gd, rp_gd is given as  |
       |                              | log2(rp_gd)                             |
       |------------------------------+-----------------------------------------|
       |np_cnp_dscp                   | dscp code point for generated cnp       |
       |------------------------------+-----------------------------------------|
       |np_cnp_prio_mode              | 802.1p priority for generated cnp       |
       |------------------------------+-----------------------------------------|
       |np_cnp_prio                   | cnp priority mode                       |
       +------------------------------+-----------------------------------------+
      Signed-off-by: NParav Pandit <parav@mellanox.com>
      Reviewed-by: NDaniel Jurgens <danielj@mellanox.com>
      Reviewed-by: NEli Cohen <eli@mellanox.com>
      Signed-off-by: NLeon Romanovsky <leon@kernel.org>
      Signed-off-by: NDoug Ledford <dledford@redhat.com>
      4a2da0b8
    • H
      net/mlx5: Add raw ethernet local loopback firmware command · bded747b
      Huy Nguyen 提交于
      Add support for raw ethernet local loopback firmware command.
      Signed-off-by: NHuy Nguyen <huyn@mellanox.com>
      Reviewed-by: NDaniel Jurgens <danielj@mellanox.com>
      Signed-off-by: NLeon Romanovsky <leon@kernel.org>
      Signed-off-by: NDoug Ledford <dledford@redhat.com>
      bded747b
  7. 21 7月, 2017 2 次提交
    • T
    • D
      bpf: fix mixed signed/unsigned derived min/max value bounds · 4cabc5b1
      Daniel Borkmann 提交于
      Edward reported that there's an issue in min/max value bounds
      tracking when signed and unsigned compares both provide hints
      on limits when having unknown variables. E.g. a program such
      as the following should have been rejected:
      
         0: (7a) *(u64 *)(r10 -8) = 0
         1: (bf) r2 = r10
         2: (07) r2 += -8
         3: (18) r1 = 0xffff8a94cda93400
         5: (85) call bpf_map_lookup_elem#1
         6: (15) if r0 == 0x0 goto pc+7
        R0=map_value(ks=8,vs=8,id=0),min_value=0,max_value=0 R10=fp
         7: (7a) *(u64 *)(r10 -16) = -8
         8: (79) r1 = *(u64 *)(r10 -16)
         9: (b7) r2 = -1
        10: (2d) if r1 > r2 goto pc+3
        R0=map_value(ks=8,vs=8,id=0),min_value=0,max_value=0 R1=inv,min_value=0
        R2=imm-1,max_value=18446744073709551615,min_align=1 R10=fp
        11: (65) if r1 s> 0x1 goto pc+2
        R0=map_value(ks=8,vs=8,id=0),min_value=0,max_value=0 R1=inv,min_value=0,max_value=1
        R2=imm-1,max_value=18446744073709551615,min_align=1 R10=fp
        12: (0f) r0 += r1
        13: (72) *(u8 *)(r0 +0) = 0
        R0=map_value_adj(ks=8,vs=8,id=0),min_value=0,max_value=1 R1=inv,min_value=0,max_value=1
        R2=imm-1,max_value=18446744073709551615,min_align=1 R10=fp
        14: (b7) r0 = 0
        15: (95) exit
      
      What happens is that in the first part ...
      
         8: (79) r1 = *(u64 *)(r10 -16)
         9: (b7) r2 = -1
        10: (2d) if r1 > r2 goto pc+3
      
      ... r1 carries an unsigned value, and is compared as unsigned
      against a register carrying an immediate. Verifier deduces in
      reg_set_min_max() that since the compare is unsigned and operation
      is greater than (>), that in the fall-through/false case, r1's
      minimum bound must be 0 and maximum bound must be r2. Latter is
      larger than the bound and thus max value is reset back to being
      'invalid' aka BPF_REGISTER_MAX_RANGE. Thus, r1 state is now
      'R1=inv,min_value=0'. The subsequent test ...
      
        11: (65) if r1 s> 0x1 goto pc+2
      
      ... is a signed compare of r1 with immediate value 1. Here,
      verifier deduces in reg_set_min_max() that since the compare
      is signed this time and operation is greater than (>), that
      in the fall-through/false case, we can deduce that r1's maximum
      bound must be 1, meaning with prior test, we result in r1 having
      the following state: R1=inv,min_value=0,max_value=1. Given that
      the actual value this holds is -8, the bounds are wrongly deduced.
      When this is being added to r0 which holds the map_value(_adj)
      type, then subsequent store access in above case will go through
      check_mem_access() which invokes check_map_access_adj(), that
      will then probe whether the map memory is in bounds based
      on the min_value and max_value as well as access size since
      the actual unknown value is min_value <= x <= max_value; commit
      fce366a9 ("bpf, verifier: fix alu ops against map_value{,
      _adj} register types") provides some more explanation on the
      semantics.
      
      It's worth to note in this context that in the current code,
      min_value and max_value tracking are used for two things, i)
      dynamic map value access via check_map_access_adj() and since
      commit 06c1c049 ("bpf: allow helpers access to variable memory")
      ii) also enforced at check_helper_mem_access() when passing a
      memory address (pointer to packet, map value, stack) and length
      pair to a helper and the length in this case is an unknown value
      defining an access range through min_value/max_value in that
      case. The min_value/max_value tracking is /not/ used in the
      direct packet access case to track ranges. However, the issue
      also affects case ii), for example, the following crafted program
      based on the same principle must be rejected as well:
      
         0: (b7) r2 = 0
         1: (bf) r3 = r10
         2: (07) r3 += -512
         3: (7a) *(u64 *)(r10 -16) = -8
         4: (79) r4 = *(u64 *)(r10 -16)
         5: (b7) r6 = -1
         6: (2d) if r4 > r6 goto pc+5
        R1=ctx R2=imm0,min_value=0,max_value=0,min_align=2147483648 R3=fp-512
        R4=inv,min_value=0 R6=imm-1,max_value=18446744073709551615,min_align=1 R10=fp
         7: (65) if r4 s> 0x1 goto pc+4
        R1=ctx R2=imm0,min_value=0,max_value=0,min_align=2147483648 R3=fp-512
        R4=inv,min_value=0,max_value=1 R6=imm-1,max_value=18446744073709551615,min_align=1
        R10=fp
         8: (07) r4 += 1
         9: (b7) r5 = 0
        10: (6a) *(u16 *)(r10 -512) = 0
        11: (85) call bpf_skb_load_bytes#26
        12: (b7) r0 = 0
        13: (95) exit
      
      Meaning, while we initialize the max_value stack slot that the
      verifier thinks we access in the [1,2] range, in reality we
      pass -7 as length which is interpreted as u32 in the helper.
      Thus, this issue is relevant also for the case of helper ranges.
      Resetting both bounds in check_reg_overflow() in case only one
      of them exceeds limits is also not enough as similar test can be
      created that uses values which are within range, thus also here
      learned min value in r1 is incorrect when mixed with later signed
      test to create a range:
      
         0: (7a) *(u64 *)(r10 -8) = 0
         1: (bf) r2 = r10
         2: (07) r2 += -8
         3: (18) r1 = 0xffff880ad081fa00
         5: (85) call bpf_map_lookup_elem#1
         6: (15) if r0 == 0x0 goto pc+7
        R0=map_value(ks=8,vs=8,id=0),min_value=0,max_value=0 R10=fp
         7: (7a) *(u64 *)(r10 -16) = -8
         8: (79) r1 = *(u64 *)(r10 -16)
         9: (b7) r2 = 2
        10: (3d) if r2 >= r1 goto pc+3
        R0=map_value(ks=8,vs=8,id=0),min_value=0,max_value=0 R1=inv,min_value=3
        R2=imm2,min_value=2,max_value=2,min_align=2 R10=fp
        11: (65) if r1 s> 0x4 goto pc+2
        R0=map_value(ks=8,vs=8,id=0),min_value=0,max_value=0
        R1=inv,min_value=3,max_value=4 R2=imm2,min_value=2,max_value=2,min_align=2 R10=fp
        12: (0f) r0 += r1
        13: (72) *(u8 *)(r0 +0) = 0
        R0=map_value_adj(ks=8,vs=8,id=0),min_value=3,max_value=4
        R1=inv,min_value=3,max_value=4 R2=imm2,min_value=2,max_value=2,min_align=2 R10=fp
        14: (b7) r0 = 0
        15: (95) exit
      
      This leaves us with two options for fixing this: i) to invalidate
      all prior learned information once we switch signed context, ii)
      to track min/max signed and unsigned boundaries separately as
      done in [0]. (Given latter introduces major changes throughout
      the whole verifier, it's rather net-next material, thus this
      patch follows option i), meaning we can derive bounds either
      from only signed tests or only unsigned tests.) There is still the
      case of adjust_reg_min_max_vals(), where we adjust bounds on ALU
      operations, meaning programs like the following where boundaries
      on the reg get mixed in context later on when bounds are merged
      on the dst reg must get rejected, too:
      
         0: (7a) *(u64 *)(r10 -8) = 0
         1: (bf) r2 = r10
         2: (07) r2 += -8
         3: (18) r1 = 0xffff89b2bf87ce00
         5: (85) call bpf_map_lookup_elem#1
         6: (15) if r0 == 0x0 goto pc+6
        R0=map_value(ks=8,vs=8,id=0),min_value=0,max_value=0 R10=fp
         7: (7a) *(u64 *)(r10 -16) = -8
         8: (79) r1 = *(u64 *)(r10 -16)
         9: (b7) r2 = 2
        10: (3d) if r2 >= r1 goto pc+2
        R0=map_value(ks=8,vs=8,id=0),min_value=0,max_value=0 R1=inv,min_value=3
        R2=imm2,min_value=2,max_value=2,min_align=2 R10=fp
        11: (b7) r7 = 1
        12: (65) if r7 s> 0x0 goto pc+2
        R0=map_value(ks=8,vs=8,id=0),min_value=0,max_value=0 R1=inv,min_value=3
        R2=imm2,min_value=2,max_value=2,min_align=2 R7=imm1,max_value=0 R10=fp
        13: (b7) r0 = 0
        14: (95) exit
      
        from 12 to 15: R0=map_value(ks=8,vs=8,id=0),min_value=0,max_value=0
        R1=inv,min_value=3 R2=imm2,min_value=2,max_value=2,min_align=2 R7=imm1,min_value=1 R10=fp
        15: (0f) r7 += r1
        16: (65) if r7 s> 0x4 goto pc+2
        R0=map_value(ks=8,vs=8,id=0),min_value=0,max_value=0 R1=inv,min_value=3
        R2=imm2,min_value=2,max_value=2,min_align=2 R7=inv,min_value=4,max_value=4 R10=fp
        17: (0f) r0 += r7
        18: (72) *(u8 *)(r0 +0) = 0
        R0=map_value_adj(ks=8,vs=8,id=0),min_value=4,max_value=4 R1=inv,min_value=3
        R2=imm2,min_value=2,max_value=2,min_align=2 R7=inv,min_value=4,max_value=4 R10=fp
        19: (b7) r0 = 0
        20: (95) exit
      
      Meaning, in adjust_reg_min_max_vals() we must also reset range
      values on the dst when src/dst registers have mixed signed/
      unsigned derived min/max value bounds with one unbounded value
      as otherwise they can be added together deducing false boundaries.
      Once both boundaries are established from either ALU ops or
      compare operations w/o mixing signed/unsigned insns, then they
      can safely be added to other regs also having both boundaries
      established. Adding regs with one unbounded side to a map value
      where the bounded side has been learned w/o mixing ops is
      possible, but the resulting map value won't recover from that,
      meaning such op is considered invalid on the time of actual
      access. Invalid bounds are set on the dst reg in case i) src reg,
      or ii) in case dst reg already had them. The only way to recover
      would be to perform i) ALU ops but only 'add' is allowed on map
      value types or ii) comparisons, but these are disallowed on
      pointers in case they span a range. This is fine as only BPF_JEQ
      and BPF_JNE may be performed on PTR_TO_MAP_VALUE_OR_NULL registers
      which potentially turn them into PTR_TO_MAP_VALUE type depending
      on the branch, so only here min/max value cannot be invalidated
      for them.
      
      In terms of state pruning, value_from_signed is considered
      as well in states_equal() when dealing with adjusted map values.
      With regards to breaking existing programs, there is a small
      risk, but use-cases are rather quite narrow where this could
      occur and mixing compares probably unlikely.
      
      Joint work with Josef and Edward.
      
        [0] https://lists.iovisor.org/pipermail/iovisor-dev/2017-June/000822.html
      
      Fixes: 48461135 ("bpf: allow access into map value arrays")
      Reported-by: NEdward Cree <ecree@solarflare.com>
      Signed-off-by: NDaniel Borkmann <daniel@iogearbox.net>
      Signed-off-by: NEdward Cree <ecree@solarflare.com>
      Signed-off-by: NJosef Bacik <jbacik@fb.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      4cabc5b1
  8. 20 7月, 2017 3 次提交
  9. 18 7月, 2017 4 次提交
  10. 17 7月, 2017 2 次提交
  11. 15 7月, 2017 3 次提交
    • D
      replace incorrect strscpy use in FORTIFY_SOURCE · 077d2ba5
      Daniel Micay 提交于
      Using strscpy was wrong because FORTIFY_SOURCE is passing the maximum
      possible size of the outermost object, but strscpy defines the count
      parameter as the exact buffer size, so this could copy past the end of
      the source.  This would still be wrong with the planned usage of
      __builtin_object_size(p, 1) for intra-object overflow checks since it's
      the maximum possible size of the specified object with no guarantee of
      it being that large.
      
      Reuse of the fortified functions like this currently makes the runtime
      error reporting less precise but that can be improved later on.
      
      Noticed by Dave Jones and KASAN.
      Signed-off-by: NDaniel Micay <danielmicay@gmail.com>
      Acked-by: NKees Cook <keescook@chromium.org>
      Reported-by: NDave Jones <davej@codemonkey.org.uk>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      077d2ba5
    • A
      fault-inject: parse as natural 1-based value for fail-nth write interface · 9049f2f6
      Akinobu Mita 提交于
      The value written to fail-nth file is parsed as 0-based.  Parsing as
      one-based is more natural to understand and it enables to cancel the
      previous setup by simply writing '0'.
      
      This change also converts task->fail_nth from signed to unsigned int.
      
      Link: http://lkml.kernel.org/r/1491490561-10485-3-git-send-email-akinobu.mita@gmail.comSigned-off-by: NAkinobu Mita <akinobu.mita@gmail.com>
      Cc: Dmitry Vyukov <dvyukov@google.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      9049f2f6
    • C
      dma-buf/fence: Avoid use of uninitialised timestamp · 76250f2b
      Chris Wilson 提交于
      [  236.821534] WARNING: kmemcheck: Caught 64-bit read from uninitialized memory (ffff8802538683d0)
      [  236.828642] 420000001e7f0000000000000000000000080000000000000000000000000000
      [  236.839543]  i i i i u u u u i i i i i i i i u u u u u u u u u u u u u u u u
      [  236.850420]                                  ^
      [  236.854123] RIP: 0010:[<ffffffff81396f07>]  [<ffffffff81396f07>] fence_signal+0x17/0xd0
      [  236.861313] RSP: 0018:ffff88024acd7ba0  EFLAGS: 00010282
      [  236.865027] RAX: ffffffff812f6a90 RBX: ffff8802527ca800 RCX: ffff880252cb30e0
      [  236.868801] RDX: ffff88024ac5d918 RSI: ffff880252f780e0 RDI: ffff880253868380
      [  236.872579] RBP: ffff88024acd7bc0 R08: ffff88024acd7be0 R09: 0000000000000000
      [  236.876407] R10: 0000000000000000 R11: 0000000000000000 R12: ffff880253868380
      [  236.880185] R13: ffff8802538684d0 R14: ffff880253868380 R15: ffff88024cd48e00
      [  236.883983] FS:  00007f1646d1a740(0000) GS:ffff88025d000000(0000) knlGS:0000000000000000
      [  236.890959] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
      [  236.894702] CR2: ffff880251360318 CR3: 000000024ad21000 CR4: 00000000001406f0
      [  236.898481]  [<ffffffff8130d1ad>] i915_gem_request_retire+0x1cd/0x230
      [  236.902439]  [<ffffffff8130e2b3>] i915_gem_request_alloc+0xa3/0x2f0
      [  236.906435]  [<ffffffff812fb1bd>] i915_gem_do_execbuffer.isra.41+0xb6d/0x18b0
      [  236.910434]  [<ffffffff812fc265>] i915_gem_execbuffer2+0x95/0x1e0
      [  236.914390]  [<ffffffff812ad625>] drm_ioctl+0x1e5/0x460
      [  236.918275]  [<ffffffff8110d4cf>] do_vfs_ioctl+0x8f/0x5c0
      [  236.922168]  [<ffffffff8110da3c>] SyS_ioctl+0x3c/0x70
      [  236.926090]  [<ffffffff814b7a5f>] entry_SYSCALL_64_fastpath+0x17/0x93
      [  236.930045]  [<ffffffffffffffff>] 0xffffffffffffffff
      
      We only set the timestamp before we mark the fence as signaled. It is
      done before to avoid observers having a window in which they may see the
      fence as complete but no timestamp. Having it does incur a potential for
      the timestamp to be written twice, and even for it to be corrupted if
      the u64 write is not atomic. Instead use a new bit to record the
      presence of the timestamp, and teach the readers to wait until it is set
      if the fence is complete. There still remains a race where the timestamp
      for the signaled fence may be shown before the fence is reported as
      signaled, but that's a pre-existing error.
      Signed-off-by: NChris Wilson <chris@chris-wilson.co.uk>
      Cc: Sumit Semwal <sumit.semwal@linaro.org>
      Cc: Gustavo Padovan <gustavo@padovan.org>
      Cc: Daniel Vetter <daniel.vetter@intel.com>
      Reported-by: NRafael Antognolli <rafael.antognolli@intel.com>
      Signed-off-by: NGustavo Padovan <gustavo.padovan@collabora.com>
      Link: http://patchwork.freedesktop.org/patch/msgid/20170214124001.1930-1-chris@chris-wilson.co.uk
      76250f2b
  12. 14 7月, 2017 6 次提交