1. 10 4月, 2018 4 次提交
    • B
      scsi: qla2xxx: Avoid double completion of abort command · 3a9910d7
      Ben Hutchings 提交于
      qla2x00_tmf_sp_done() now deletes the timer that will run
      qla2x00_tmf_iocb_timeout(), but doesn't check whether the timer already
      expired.  Check the return value from del_timer() to avoid calling
      complete() a second time.
      
      Fixes: 4440e46d ("[SCSI] qla2xxx: Add IOCB Abort command asynchronous ...")
      Fixes: 1514839b ("scsi: qla2xxx: Fix NULL pointer crash due to active ...")
      Signed-off-by: NBen Hutchings <ben.hutchings@codethink.co.uk>
      Acked-by: NHimanshu Madhani <himanshu.madhani@cavium.com>
      Signed-off-by: NMartin K. Petersen <martin.petersen@oracle.com>
      3a9910d7
    • B
      scsi: qla2xxx: Fix small memory leak in qla2x00_probe_one on probe failure · 6d634067
      Bill Kuzeja 提交于
      The code that fixes the crashes in the following commit introduced a small
      memory leak:
      
      commit 6a2cf8d3 ("scsi: qla2xxx: Fix crashes in qla2x00_probe_one on probe failure")
      
      Fixing this requires a bit of reworking, which I've explained. Also provide
      some code cleanup.
      
      There is a small window in qla2x00_probe_one where if qla2x00_alloc_queues
      fails, we end up never freeing req and rsp and leak 0xc0 and 0xc8 bytes
      respectively (the sizes of req and rsp).
      
      I originally put in checks to test for this condition which were based on
      the incorrect assumption that if ha->rsp_q_map and ha->req_q_map were
      allocated, then rsp and req were allocated as well. This is incorrect.
      There is a window between these allocations:
      
             ret = qla2x00_mem_alloc(ha, req_length, rsp_length, &req, &rsp);
                      goto probe_hw_failed;
      
      [if successful, both rsp and req allocated]
      
             base_vha = qla2x00_create_host(sht, ha);
                      goto probe_hw_failed;
      
             ret = qla2x00_request_irqs(ha, rsp);
                      goto probe_failed;
      
             if (qla2x00_alloc_queues(ha, req, rsp)) {
                      goto probe_failed;
      
      [if successful, now ha->rsp_q_map and ha->req_q_map allocated]
      
      To simplify this, we should just set req and rsp to NULL after we free
      them. Sounds simple enough? The problem is that req and rsp are pointers
      defined in the qla2x00_probe_one and they are not always passed by reference
      to the routines that free them.
      
      Here are paths which can free req and rsp:
      
      PATH 1:
      qla2x00_probe_one
         ret = qla2x00_mem_alloc(ha, req_length, rsp_length, &req, &rsp);
         [req and rsp are passed by reference, but if this fails, we currently
          do not NULL out req and rsp. Easily fixed]
      
      PATH 2:
      qla2x00_probe_one
         failing in qla2x00_request_irqs or qla2x00_alloc_queues
            probe_failed:
               qla2x00_free_device(base_vha);
                  qla2x00_free_req_que(ha, req)
                  qla2x00_free_rsp_que(ha, rsp)
      
      PATH 3:
      qla2x00_probe_one:
         failing in qla2x00_mem_alloc or qla2x00_create_host
            probe_hw_failed:
               qla2x00_free_req_que(ha, req)
               qla2x00_free_rsp_que(ha, rsp)
      
      PATH 1: This should currently work, but it doesn't because rsp and rsp are
      not set to NULL in qla2x00_mem_alloc. Easily remedied.
      
      PATH 2: req and rsp aren't passed in at all to qla2x00_free_device but are
      derived from ha->req_q_map[0] and ha->rsp_q_map[0]. These are only set up if
      qla2x00_alloc_queues succeeds.
      
      In qla2x00_free_queues, we are protected from crashing if these don't exist
      because req_qid_map and rsp_qid_map are only set on their allocation. We are
      guarded in this way:
      
              for (cnt = 0; cnt < ha->max_req_queues; cnt++) {
                      if (!test_bit(cnt, ha->req_qid_map))
                              continue;
      
      PATH 3: This works. We haven't freed req or rsp yet (or they were never
      allocated if qla2x00_mem_alloc failed), so we'll attempt to free them here.
      
      To summarize, there are a few small changes to make this work correctly and
      (and for some cleanup):
      
      1) (For PATH 1) Set *rsp and *req to NULL in case of failure in
      qla2x00_mem_alloc so these are correctly set to NULL back in
      qla2x00_probe_one
      
      2) After jumping to probe_failed: and calling qla2x00_free_device,
      explicitly set rsp and req to NULL so further calls with these pointers do
      not crash, i.e. the free queue calls in the probe_hw_failed section we fall
      through to.
      
      3) Fix return code check in the call to qla2x00_alloc_queues. We currently
      drop the return code on the floor. The probe fails but the caller of the
      probe doesn't have an error code, so it attaches to pci. This can result in
      a crash on module shutdown.
      
      4) Remove unnecessary NULL checks in qla2x00_free_req_que,
      qla2x00_free_rsp_que, and the egregious NULL checks before kfrees and vfrees
      in qla2x00_mem_free.
      
      I tested this out running a scenario where the card breaks at various times
      during initialization. I made sure I forced every error exit path in
      qla2x00_probe_one.
      
      Cc: <stable@vger.kernel.org> # v4.16
      Fixes: 6a2cf8d3 ("scsi: qla2xxx: Fix crashes in qla2x00_probe_one on probe failure")
      Signed-off-by: NBill Kuzeja <william.kuzeja@stratus.com>
      Acked-by: NHimanshu Madhani <himanshu.madhani@cavium.com>
      Signed-off-by: NMartin K. Petersen <martin.petersen@oracle.com>
      6d634067
    • J
      scsi: scsi_dh: Don't look for NULL devices handlers by name · 2ee5671e
      Johannes Thumshirn 提交于
      Currently scsi_dh_lookup() doesn't check for NULL as a device name. This
      combined with nvme over dm-mpath results in the following messages
      emitted by device-mapper:
      
       device-mapper: multipath: Could not failover device 259:67: Handler scsi_dh_(null) error 14.
      
      Let scsi_dh_lookup() fail fast on NULL names.
      
      [mkp: typo fix]
      
      Cc: <stable@vger.kernel.org> # v4.16
      Signed-off-by: NJohannes Thumshirn <jthumshirn@suse.de>
      Reviewed-by: NHannes Reinecke <hare@suse.com>
      Reviewed-by: NBart Van Assche <bart.vanassche@wdc.com>
      Signed-off-by: NMartin K. Petersen <martin.petersen@oracle.com>
      2ee5671e
    • C
      scsi: core: remove redundant assignment to shost->use_blk_mq · cbee67c2
      Colin Ian King 提交于
      The first assignment to shost->use_blk_mq is redundant as it is
      overwritten by the following statement. Remove this redundant code.
      
      Detected by CoverityScan, CID#1466993 ("Unused value")
      Signed-off-by: NColin Ian King <colin.king@canonical.com>
      Reviewed-by: NBart Van Assche <bart.vanassche@wdc.com>
      Signed-off-by: NMartin K. Petersen <martin.petersen@oracle.com>
      cbee67c2
  2. 08 4月, 2018 1 次提交
    • L
      treewide: fix up files incorrectly marked executable · 90fda63f
      Linus Torvalds 提交于
      Joe Perches noted that we have a few source files that for some
      inexplicable reason (read: I'm too lazy to even go look at the history)
      are marked executable:
      
        drivers/gpu/drm/amd/amdgpu/vce_v4_0.c
        drivers/net/ethernet/cadence/macb_ptp.c
      
      A simple git command line to show executable C/asm/header files is this:
      
          git ls-files -s '*.[chsS]' | grep '^100755'
      
      and then you can fix them up with scripting by just feeding that output
      into:
      
          | cut -f2 | xargs chmod -x
      
      and commit it.
      
      Which is exactly what this commit does.
      Reported-by: NJoe Perches <joe@perches.com>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      90fda63f
  3. 06 4月, 2018 18 次提交
    • R
      headers: untangle kmemleak.h from mm.h · 514c6032
      Randy Dunlap 提交于
      Currently <linux/slab.h> #includes <linux/kmemleak.h> for no obvious
      reason.  It looks like it's only a convenience, so remove kmemleak.h
      from slab.h and add <linux/kmemleak.h> to any users of kmemleak_* that
      don't already #include it.  Also remove <linux/kmemleak.h> from source
      files that do not use it.
      
      This is tested on i386 allmodconfig and x86_64 allmodconfig.  It would
      be good to run it through the 0day bot for other $ARCHes.  I have
      neither the horsepower nor the storage space for the other $ARCHes.
      
      Update: This patch has been extensively build-tested by both the 0day
      bot & kisskb/ozlabs build farms.  Both of them reported 2 build failures
      for which patches are included here (in v2).
      
      [ slab.h is the second most used header file after module.h; kernel.h is
        right there with slab.h. There could be some minor error in the
        counting due to some #includes having comments after them and I didn't
        combine all of those. ]
      
      [akpm@linux-foundation.org: security/keys/big_key.c needs vmalloc.h, per sfr]
      Link: http://lkml.kernel.org/r/e4309f98-3749-93e1-4bb7-d9501a39d015@infradead.org
      Link: http://kisskb.ellerman.id.au/kisskb/head/13396/Signed-off-by: NRandy Dunlap <rdunlap@infradead.org>
      Reviewed-by: NIngo Molnar <mingo@kernel.org>
      Reported-by: Michael Ellerman <mpe@ellerman.id.au>	[2 build failures]
      Reported-by: Fengguang Wu <fengguang.wu@intel.com>	[2 build failures]
      Reviewed-by: NAndrew Morton <akpm@linux-foundation.org>
      Cc: Wei Yongjun <weiyongjun1@huawei.com>
      Cc: Luis R. Rodriguez <mcgrof@kernel.org>
      Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
      Cc: Mimi Zohar <zohar@linux.vnet.ibm.com>
      Cc: John Johansen <john.johansen@canonical.com>
      Cc: Stephen Rothwell <sfr@canb.auug.org.au>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      514c6032
    • S
      zram: drop max_zpage_size and use zs_huge_class_size() · 60f5921a
      Sergey Senozhatsky 提交于
      Remove ZRAM's enforced "huge object" value and use zsmalloc huge-class
      watermark instead, which makes more sense.
      
      TEST
      - I used a 1G zram device, LZO compression back-end, original
        data set size was 444MB. Looking at zsmalloc classes stats the
        test ended up to be pretty fair.
      
      BASE ZRAM/ZSMALLOC
      =====================
      zram mm_stat
      
      498978816 191482495 199831552        0 199831552    15634        0
      
      zsmalloc classes
      
       class  size almost_full almost_empty obj_allocated   obj_used pages_used pages_per_zspage freeable
      ...
         151  2448           0            0          1240       1240        744                3        0
         168  2720           0            0          4200       4200       2800                2        0
         190  3072           0            0         10100      10100       7575                3        0
         202  3264           0            0           380        380        304                4        0
         254  4096           0            0         10620      10620      10620                1        0
      
       Total                 7           46        106982     106187      48787                         0
      
      PATCHED ZRAM/ZSMALLOC
      =====================
      
      zram mm_stat
      
      498978816 182579184 194248704        0 194248704    15628        0
      
      zsmalloc classes
      
       class  size almost_full almost_empty obj_allocated   obj_used pages_used pages_per_zspage freeable
      ...
         151  2448           0            0          1240       1240        744                3        0
         168  2720           0            0          4200       4200       2800                2        0
         190  3072           0            0         10100      10100       7575                3        0
         202  3264           0            0          7180       7180       5744                4        0
         254  4096           0            0          3820       3820       3820                1        0
      
       Total                 8           45        106959     106193      47424                         0
      
      As we can see, we reduced the number of objects stored in class-4096,
      because a huge number of objects which we previously forcibly stored in
      class-4096 now stored in non-huge class-3264.  This results in lower
      memory consumption:
      
      - zsmalloc now uses 47424 physical pages, which is less than 48787 pages
        zsmalloc used before.
      
      - objects that we store in class-3264 share zspages.  That's why overall
        the number of pages that both class-4096 and class-3264 consumed went
        down from 10924 to 9564.
      
      [sergey.senozhatsky.work@gmail.com: add pool param to zs_huge_class_size()]
        Link: http://lkml.kernel.org/r/20180314081833.1096-3-sergey.senozhatsky@gmail.com
      Link: http://lkml.kernel.org/r/20180306070639.7389-3-sergey.senozhatsky@gmail.comSigned-off-by: NSergey Senozhatsky <sergey.senozhatsky@gmail.com>
      Acked-by: NMinchan Kim <minchan@kernel.org>
      Cc: Mike Rapoport <rppt@linux.vnet.ibm.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      60f5921a
    • D
      device-dax: implement ->pagesize() for smaps to report MMUPageSize · c1d53b92
      Dan Williams 提交于
      Given that device-dax is making similar page mapping size guarantees as
      hugetlbfs, emit the size in smaps and any other kernel path that
      requests the mapping size of a vma.
      
      Link: http://lkml.kernel.org/r/151996255287.27922.18397777516059080245.stgit@dwillia2-desk3.amr.corp.intel.comSigned-off-by: NDan Williams <dan.j.williams@intel.com>
      Reported-by: NJane Chu <jane.chu@oracle.com>
      Reviewed-by: NAndrew Morton <akpm@linux-foundation.org>
      Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
      Cc: Michael Ellerman <mpe@ellerman.id.au>
      Cc: Paul Mackerras <paulus@samba.org>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      c1d53b92
    • P
      mm/memory_hotplug: optimize memory hotplug · d0dc12e8
      Pavel Tatashin 提交于
      During memory hotplugging we traverse struct pages three times:
      
      1. memset(0) in sparse_add_one_section()
      2. loop in __add_section() to set do: set_page_node(page, nid); and
         SetPageReserved(page);
      3. loop in memmap_init_zone() to call __init_single_pfn()
      
      This patch removes the first two loops, and leaves only loop 3.  All
      struct pages are initialized in one place, the same as it is done during
      boot.
      
      The benefits:
      
       - We improve memory hotplug performance because we are not evicting the
         cache several times and also reduce loop branching overhead.
      
       - Remove condition from hotpath in __init_single_pfn(), that was added
         in order to fix the problem that was reported by Bharata in the above
         email thread, thus also improve performance during normal boot.
      
       - Make memory hotplug more similar to the boot memory initialization
         path because we zero and initialize struct pages only in one
         function.
      
       - Simplifies memory hotplug struct page initialization code, and thus
         enables future improvements, such as multi-threading the
         initialization of struct pages in order to improve hotplug
         performance even further on larger machines.
      
      [pasha.tatashin@oracle.com: v5]
        Link: http://lkml.kernel.org/r/20180228030308.1116-7-pasha.tatashin@oracle.com
      Link: http://lkml.kernel.org/r/20180215165920.8570-7-pasha.tatashin@oracle.comSigned-off-by: NPavel Tatashin <pasha.tatashin@oracle.com>
      Reviewed-by: NIngo Molnar <mingo@kernel.org>
      Cc: Michal Hocko <mhocko@suse.com>
      Cc: Baoquan He <bhe@redhat.com>
      Cc: Bharata B Rao <bharata@linux.vnet.ibm.com>
      Cc: Daniel Jordan <daniel.m.jordan@oracle.com>
      Cc: Dan Williams <dan.j.williams@intel.com>
      Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
      Cc: "H. Peter Anvin" <hpa@zytor.com>
      Cc: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
      Cc: Mel Gorman <mgorman@techsingularity.net>
      Cc: Steven Sistare <steven.sistare@oracle.com>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Vlastimil Babka <vbabka@suse.cz>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      d0dc12e8
    • P
      mm/memory_hotplug: don't read nid from struct page during hotplug · fc44f7f9
      Pavel Tatashin 提交于
      During memory hotplugging the probe routine will leave struct pages
      uninitialized, the same as it is currently done during boot.  Therefore,
      we do not want to access the inside of struct pages before
      __init_single_page() is called during onlining.
      
      Because during hotplug we know that pages in one memory block belong to
      the same numa node, we can skip the checking.  We should keep checking
      for the boot case.
      
      [pasha.tatashin@oracle.com: s/register_new_memory()/hotplug_memory_register()]
        Link: http://lkml.kernel.org/r/20180228030308.1116-6-pasha.tatashin@oracle.com
      Link: http://lkml.kernel.org/r/20180215165920.8570-6-pasha.tatashin@oracle.comSigned-off-by: NPavel Tatashin <pasha.tatashin@oracle.com>
      Acked-by: NMichal Hocko <mhocko@suse.com>
      Reviewed-by: NIngo Molnar <mingo@kernel.org>
      Cc: Baoquan He <bhe@redhat.com>
      Cc: Bharata B Rao <bharata@linux.vnet.ibm.com>
      Cc: Daniel Jordan <daniel.m.jordan@oracle.com>
      Cc: Dan Williams <dan.j.williams@intel.com>
      Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
      Cc: "H. Peter Anvin" <hpa@zytor.com>
      Cc: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
      Cc: Mel Gorman <mgorman@techsingularity.net>
      Cc: Steven Sistare <steven.sistare@oracle.com>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Vlastimil Babka <vbabka@suse.cz>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      fc44f7f9
    • P
      mm/memory_hotplug: optimize probe routine · b77eab70
      Pavel Tatashin 提交于
      When memory is hotplugged pages_correctly_reserved() is called to verify
      that the added memory is present, this routine traverses through every
      struct page and verifies that PageReserved() is set.  This is a slow
      operation especially if a large amount of memory is added.
      
      Instead of checking every page, it is enough to simply check that the
      section is present, has mapping (struct page array is allocated), and
      the mapping is online.
      
      In addition, we should not excpect that probe routine sets flags in
      struct page, as the struct pages have not yet been initialized.  The
      initialization should be done in __init_single_page(), the same as
      during boot.
      
      Link: http://lkml.kernel.org/r/20180215165920.8570-5-pasha.tatashin@oracle.comSigned-off-by: NPavel Tatashin <pasha.tatashin@oracle.com>
      Acked-by: NMichal Hocko <mhocko@suse.com>
      Cc: Ingo Molnar <mingo@kernel.org>
      Cc: Baoquan He <bhe@redhat.com>
      Cc: Bharata B Rao <bharata@linux.vnet.ibm.com>
      Cc: Daniel Jordan <daniel.m.jordan@oracle.com>
      Cc: Dan Williams <dan.j.williams@intel.com>
      Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
      Cc: "H. Peter Anvin" <hpa@zytor.com>
      Cc: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
      Cc: Mel Gorman <mgorman@techsingularity.net>
      Cc: Steven Sistare <steven.sistare@oracle.com>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Vlastimil Babka <vbabka@suse.cz>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      b77eab70
    • K
      kernel.h: Retain constant expression output for max()/min() · 3c8ba0d6
      Kees Cook 提交于
      In the effort to remove all VLAs from the kernel[1], it is desirable to
      build with -Wvla.  However, this warning is overly pessimistic, in that
      it is only happy with stack array sizes that are declared as constant
      expressions, and not constant values.  One case of this is the
      evaluation of the max() macro which, due to its construction, ends up
      converting constant expression arguments into a constant value result.
      
      All attempts to rewrite this macro with __builtin_constant_p() failed
      with older compilers (e.g.  gcc 4.4)[2].  However, Martin Uecker,
      constructed[3] a mind-shattering solution that works everywhere.
      Cthulhu fhtagn!
      
      This patch updates the min()/max() macros to evaluate to a constant
      expression when called on constant expression arguments.  This removes
      several false-positive stack VLA warnings from an x86 allmodconfig build
      when -Wvla is added:
      
        $ diff -u before.txt after.txt | grep ^-
        -drivers/input/touchscreen/cyttsp4_core.c:871:2: warning: ISO C90 forbids variable length array ‘ids’ [-Wvla]
        -fs/btrfs/tree-checker.c:344:4: warning: ISO C90 forbids variable length array ‘namebuf’ [-Wvla]
        -lib/vsprintf.c:747:2: warning: ISO C90 forbids variable length array ‘sym’ [-Wvla]
        -net/ipv4/proc.c:403:2: warning: ISO C90 forbids variable length array ‘buff’ [-Wvla]
        -net/ipv6/proc.c:198:2: warning: ISO C90 forbids variable length array ‘buff’ [-Wvla]
        -net/ipv6/proc.c:218:2: warning: ISO C90 forbids variable length array ‘buff64’ [-Wvla]
      
      This also updates two cases where different enums were being compared
      and explicitly casts them to int (which matches the old side-effect of
      the single-evaluation code): one in tpm/tpm_tis_core.h, and one in
      drm/drm_color_mgmt.c.
      
       [1] https://lkml.org/lkml/2018/3/7/621
       [2] https://lkml.org/lkml/2018/3/10/170
       [3] https://lkml.org/lkml/2018/3/20/845Co-Developed-by: NLinus Torvalds <torvalds@linux-foundation.org>
      Co-Developed-by: NMartin Uecker <Martin.Uecker@med.uni-goettingen.de>
      Signed-off-by: NKees Cook <keescook@chromium.org>
      Acked-by: NIngo Molnar <mingo@kernel.org>
      Acked-by: NMiguel Ojeda <miguel.ojeda.sandonis@gmail.com>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      3c8ba0d6
    • M
      IB/rxe: Fix for oops in rxe_register_device on ppc64le arch · efc365e7
      Mikhail Malygin 提交于
      On ppc64le arch rxe_add command causes oops in kernel log:
      
      [   92.495140] Oops: Kernel access of bad area, sig: 11 [#1]
      [   92.499710] SMP NR_CPUS=2048 NUMA pSeries
      [   92.499792] Modules linked in: ipt_MASQUERADE(E) nf_nat_masquerade_ipv4(E) nf_conntrack_netlink(E) nfnetlink(E) xfrm_user(E) iptable
      _nat(E) nf_conntrack_ipv4(E) nf_defrag_ipv4(E) nf_nat_ipv4(E) xt_addrtype(E) iptable_filter(E) ip_tables(E) xt_conntrack(E) x_tables(E)
       nf_nat(E) nf_conntrack(E) br_netfilter(E) bridge(E) stp(E) llc(E) overlay(E) af_packet(E) rpcrdma(E) ib_isert(E) iscsi_target_mod(E) i
      b_iser(E) libiscsi(E) ib_srpt(E) target_core_mod(E) ib_srp(E) ib_ipoib(E) rdma_ucm(E) ib_ucm(E) ib_uverbs(E) ib_umad(E) bochs_drm(E) tt
      m(E) drm_kms_helper(E) syscopyarea(E) sysfillrect(E) sysimgblt(E) fb_sys_fops(E) drm(E) agpgart(E) virtio_rng(E) virtio_console(E) rtc_
      generic(E) dm_ec(OEN) ttln_rdma(OEN) rdma_cm(E) configfs(E) iw_cm(E) ib_cm(E) rdma_rxe(E) ip6_udp_tunnel(E) udp_tunnel(E) ib_core(E) ql
      a2xxx(E)
      [   92.499832]  scsi_transport_fc(E) nvme_fc(E) nvme_fabrics(E) nvme_core(E) ipmi_watchdog(E) ipmi_ssif(E) ipmi_poweroff(E) ipmi_powernv(EX) ipmi_devintf(E) ipmi_msghandler(E) dummy(E) ext4(E) crc16(E) jbd2(E) mbcache(E) dm_service_time(E) scsi_transport_iscsi(E) sd_mod(E) sr_mod(E) cdrom(E) hid_generic(E) usbhid(E) virtio_blk(E) virtio_scsi(E) virtio_net(E) ibmvscsi(EX) scsi_transport_srp(E) xhci_pci(E) xhci_hcd(E) usbcore(E) usb_common(E) virtio_pci(E) virtio_ring(E) virtio(E) sunrpc(E) dm_mirror(E) dm_region_hash(E) dm_log(E) sg(E) dm_multipath(E) dm_mod(E) scsi_dh_rdac(E) scsi_dh_emc(E) scsi_dh_alua(E) scsi_mod(E) autofs4(E)
      [   92.499834] Supported: No, Unsupported modules are loaded
      [   92.499839] CPU: 3 PID: 5576 Comm: sh Tainted: G           OE   NX 4.4.120-ttln.17-default #1
      [   92.499841] task: c0000000afe8a490 ti: c0000000beba8000 task.ti: c0000000beba8000
      [   92.499842] NIP: c00000000008ba3c LR: c000000000027644 CTR: c00000000008ba10
      [   92.499844] REGS: c0000000bebab750 TRAP: 0300   Tainted: G           OE   NX  (4.4.120-ttln.17-default)
      [   92.499850] MSR: 8000000000009033 <SF,EE,ME,IR,DR,RI,LE>  CR: 28424428  XER: 20000000
      [   92.499871] CFAR: 0000000000002424 DAR: 0000000000000208 DSISR: 40000000 SOFTE: 1
                     GPR00: c000000000027644 c0000000bebab9d0 c000000000f09700 0000000000000000
                     GPR04: d0000000043d7192 0000000000000002 000000000000001a fffffffffffffffe
                     GPR08: 000000000000009c c00000000008ba10 d0000000043e5848 d0000000043d3828
                     GPR12: c00000000008ba10 c000000007a02400 0000000010062e38 0000010020388860
                     GPR16: 0000000000000000 0000000000000000 00000100203885f0 00000000100f6c98
                     GPR20: c0000000b3f1fcc0 c0000000b3f1fc48 c0000000b3f1fbd0 c0000000b3f1fb58
                     GPR24: c0000000b3f1fae0 c0000000b3f1fa68 00000000000005dc c0000000b3f1f9f0
                     GPR28: d0000000043e5848 c0000000b3f1f900 c0000000b3f1f320 c0000000b3f1f000
      [   92.499881] NIP [c00000000008ba3c] dma_get_required_mask_pSeriesLP+0x2c/0x1a0
      [   92.499885] LR [c000000000027644] dma_get_required_mask+0x44/0xac
      [   92.499886] Call Trace:
      [   92.499891] [c0000000bebab9d0] [c0000000bebaba30] 0xc0000000bebaba30 (unreliable)
      [   92.499894] [c0000000bebaba10] [c000000000027644] dma_get_required_mask+0x44/0xac
      [   92.499904] [c0000000bebaba30] [d0000000043cb4b4] rxe_register_device+0xc4/0x430 [rdma_rxe]
      [   92.499910] [c0000000bebabab0] [d0000000043c06c8] rxe_add+0x448/0x4e0 [rdma_rxe]
      [   92.499915] [c0000000bebabb30] [d0000000043d28dc] rxe_net_add+0x4c/0xf0 [rdma_rxe]
      [   92.499921] [c0000000bebabb60] [d0000000043d305c] rxe_param_set_add+0x6c/0x1ac [rdma_rxe]
      [   92.499924] [c0000000bebabbf0] [c0000000000e78c0] param_attr_store+0xa0/0x180
      [   92.499927] [c0000000bebabc70] [c0000000000e6448] module_attr_store+0x48/0x70
      [   92.499932] [c0000000bebabc90] [c000000000391f60] sysfs_kf_write+0x70/0xb0
      [   92.499935] [c0000000bebabcb0] [c000000000390f1c] kernfs_fop_write+0x18c/0x1e0
      [   92.499939] [c0000000bebabd00] [c0000000002e22ac] __vfs_write+0x4c/0x1d0
      [   92.499942] [c0000000bebabd90] [c0000000002e2f94] vfs_write+0xc4/0x200
      [   92.499945] [c0000000bebabde0] [c0000000002e488c] SyS_write+0x6c/0x110
      [   92.499948] [c0000000bebabe30] [c000000000009384] system_call+0x38/0xe4
      [   92.499949] Instruction dump:
      [   92.499954] 4e800020 3c4c00e8 3842dcf0 7c0802a6 f8010010 60000000 7c0802a6 fba1ffe8
      [   92.499958] fbc1fff0 fbe1fff8 f8010010 f821ffc1 <e9230208> 7c7e1b78 2fa90000 419e0078
      [   92.499962] ---[ end trace bed077e15eb420cf ]---
      
      It fails in dma_get_required_mask, that has ppc-specific implementation,
      and fail if provided device argument is NULL
      Signed-off-by: NMikhail Malygin <mikhail@malygin.me>
      Reviewed-by: NYonatan Cohen <yonatanc@mellanox.com>
      Signed-off-by: NJason Gunthorpe <jgg@mellanox.com>
      efc365e7
    • A
      IB/mlx5: Device memory mr registration support · 6c29f57e
      Ariel Levkovich 提交于
      Adding mlx5_ib driver implementation for reg_dm_mr callback
      which allows registering device memory (DM) as an MR for
      local and remote access.
      Signed-off-by: NAriel Levkovich <lariel@mellanox.com>
      Signed-off-by: NLeon Romanovsky <leonro@mellanox.com>
      Signed-off-by: NJason Gunthorpe <jgg@mellanox.com>
      6c29f57e
    • A
      net/mlx5: Mkey creation command adjustments · cdbd0d2b
      Ariel Levkovich 提交于
      This change updates the mlx5 interface to create mkey
      on the device.
      
      The updates in the command mailbox include increasing the
      access mode type field to 5 bits in order to support additional
      types such as MLX5_MKC_ACCESS_MODE_MEMIC which represents device
      memory access type and will be used when registering MR on allocated
      device memory.
      
      All the places that use the old access mode format are adjusted as
      well.
      Signed-off-by: NAriel Levkovich <lariel@mellanox.com>
      Signed-off-by: NLeon Romanovsky <leonro@mellanox.com>
      Signed-off-by: NJason Gunthorpe <jgg@mellanox.com>
      cdbd0d2b
    • A
      IB/mlx5: Device memory support in mlx5_ib · 24da0016
      Ariel Levkovich 提交于
      This patch adds the mlx5_ib driver implementation for the device
      memory allocation API.
      It implements the ib_device callbacks for allocation and deallocation
      operations as well as a new mmap command support which allows mapping
      an allocated device memory to a VMA.
      
      The change also adds reporting of device memory maximum size and
      alignment parameters reported in device capabilities.
      
      The allocation/deallocation operations are using new firmware
      commands to allocate MEMIC memory on the device.
      Signed-off-by: NAriel Levkovich <lariel@mellanox.com>
      Signed-off-by: NLeon Romanovsky <leonro@mellanox.com>
      Signed-off-by: NJason Gunthorpe <jgg@mellanox.com>
      24da0016
    • A
      net/mlx5: Query device memory capabilities · e72bd817
      Ariel Levkovich 提交于
      This patch adds querying of device memory capabilities by the mlx5_core
      driver during initialization.
      
      Device memory capabilities is a new capability type and structure
      which contains the necessary data that is needed for future device
      memory allocation.
      
      The presence of this new capabilities struct is indicated in the
      general capabilities struct which is queried first by the driver.
      If the presence bit is set, the driver will also query the new
      capabilities struct and save it in the device context.
      Signed-off-by: NAriel Levkovich <lariel@mellanox.com>
      Signed-off-by: NLeon Romanovsky <leonro@mellanox.com>
      Signed-off-by: NJason Gunthorpe <jgg@mellanox.com>
      e72bd817
    • A
      IB/uverbs: Add device memory registration ioctl support · be934cca
      Ariel Levkovich 提交于
      Adding new ioctl method for the MR object - REG_DM_MR.
      
      This command can be used by users to register an allocated
      device memory buffer as an MR and receive lkey and rkey
      to be used within work requests.
      
      It is added as a new method under the MR object and using a new
      ib_device callback - reg_dm_mr.
      The command creates a standard ib_mr object which represents the
      registered memory.
      Signed-off-by: NAriel Levkovich <lariel@mellanox.com>
      Signed-off-by: NLeon Romanovsky <leonro@mellanox.com>
      Signed-off-by: NJason Gunthorpe <jgg@mellanox.com>
      be934cca
    • A
      IB/uverbs: Add alloc/free dm uverbs ioctl support · bee76d7a
      Ariel Levkovich 提交于
      This change adds uverbs support for allocation/freeing
      of device memory commands.
      
      A new uverbs object is defined of type idr to represent
      and track the new resource type allocation per context.
      
      The API requires provider driver to implement 2 new ib_device
      callbacks - one for allocation and one for deallocation which
      return and accept (respectively) the ib_dm object which represents
      the allocated memory on the device.
      
      The support is added via the ioctl command infrastructure
      only.
      Signed-off-by: NAriel Levkovich <lariel@mellanox.com>
      Signed-off-by: NLeon Romanovsky <leonro@mellanox.com>
      Signed-off-by: NJason Gunthorpe <jgg@mellanox.com>
      bee76d7a
    • A
      IB/uverbs: Add device memory capabilities reporting · 1d8eeb9f
      Ariel Levkovich 提交于
      This change allows vendors to report device memory capability
      max_dm_size - to user via uverbs command.
      Signed-off-by: NAriel Levkovich <lariel@mellanox.com>
      Signed-off-by: NLeon Romanovsky <leonro@mellanox.com>
      Signed-off-by: NJason Gunthorpe <jgg@mellanox.com>
      1d8eeb9f
    • K
      RDMA/qedr: Fix wmb usage in qedr · 09c4854f
      Kalderon, Michal 提交于
      This patch comes as a result of Sinan Kaya's work and the decision that
      writel() must be a strong enough barrier for DMA.
      
      wmb usages in qedr driver have either been removed where they were there
      only to order DMA accesses, and replaced with smp_wmb and comments for the
      places that the barrier was there for SMP reasons.
      
      Fixes: 561e5d48 ("RDMA/qedr: eliminate duplicate barriers on weakly-ordered archs")
      Signed-off-by: NMichal Kalderon <Michal.Kalderon@cavium.com>
      Signed-off-by: NAriel Elior <Ariel.Elior@cavium.com>
      Signed-off-by: NJason Gunthorpe <jgg@mellanox.com>
      09c4854f
    • P
      IB/rxe: Removed GID add/del dummy routines · 39e00b6c
      Parav Pandit 提交于
      rxe driver's add_gid() and del_gid() callbacks are doing simple
      checks which are already done by the ib core before invoking these
      callback routines.
      Therefore, code is simplified to skip implementing add_gid() and
      del_gid() callback functions.
      They are only invoked by ib_core if they are implemented.
      Signed-off-by: NParav Pandit <parav@mellanox.com>
      Reviewed-by: NLeon Romanovsky <leonro@mellanox.com>
      Signed-off-by: NJason Gunthorpe <jgg@mellanox.com>
      39e00b6c
    • J
      RDMA/qedr: Zero stack memory before copying to user space · 57939021
      Jason Gunthorpe 提交于
      The fact this struct was not init'd like all the others was missed when
      the padding reserved field was added.
      Reported-by: NDan Carpenter <dan.carpenter@oracle.com>
      Fixes: 71e80a47 ("RDMA/qedr: Fix uABI structure layouts for 32/64 compat")
      Acked-by: NMichal Kalderon <Michal.Kalderon@cavium.com>
      Signed-off-by: NJason Gunthorpe <jgg@mellanox.com>
      57939021
  4. 05 4月, 2018 17 次提交