Skip to content
  1. Jan 17, 2021
    • Jian Shen's avatar
      net: hns3: fix incorrect handling of sctp6 rss tuple · 799d8080
      Jian Shen authored
      
      
      [ Upstream commit ab6e32d2 ]
      
      For DEVICE_VERSION_V2, the hardware only supports src-ip,
      dst-ip and verification-tag for rss tuple set of sctp6
      packet. For DEVICE_VERSION_V3, the hardware supports
      src-port and dst-port as well.
      
      Currently, when user queries the sctp6 rss tuples info,
      some unsupported information will be showed on V2. So add
      a check for hardware version when initializing and queries
      sctp6 rss tuple to fix this issue.
      
      Fixes: 46a3df9f ("net: hns3: Add HNS3 Acceleration Engine & Compatibility Layer Support")
      Signed-off-by: default avatarJian Shen <shenjian15@huawei.com>
      Signed-off-by: default avatarHuazhong Tan <tanhuazhong@huawei.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      799d8080
    • Jouni K. Seppänen's avatar
      net: cdc_ncm: correct overhead in delayed_ndp_size · b044a949
      Jouni K. Seppänen authored
      
      
      [ Upstream commit 7a68d725 ]
      
      Aligning to tx_ndp_modulus is not sufficient because the next align
      call can be cdc_ncm_align_tail, which can add up to ctx->tx_modulus +
      ctx->tx_remainder - 1 bytes. This used to lead to occasional crashes
      on a Huawei 909s-120 LTE module as follows:
      
      - the condition marked /* if there is a remaining skb [...] */ is true
        so the swaps happen
      - skb_out is set from ctx->tx_curr_skb
      - skb_out->len is exactly 0x3f52
      - ctx->tx_curr_size is 0x4000 and delayed_ndp_size is 0xac
        (note that the sum of skb_out->len and delayed_ndp_size is 0x3ffe)
      - the for loop over n is executed once
      - the cdc_ncm_align_tail call marked /* align beginning of next frame */
        increases skb_out->len to 0x3f56 (the sum is now 0x4002)
      - the condition marked /* check if we had enough room left [...] */ is
        false so we break out of the loop
      - the condition marked /* If requested, put NDP at end of frame. */ is
        true so the NDP is written into skb_out
      - now skb_out->len is 0x4002, so padding_count is minus two interpreted
        as an unsigned number, which is used as the length argument to memset,
        leading to a crash with various symptoms but usually including
      
      > Call Trace:
      >  <IRQ>
      >  cdc_ncm_fill_tx_frame+0x83a/0x970 [cdc_ncm]
      >  cdc_mbim_tx_fixup+0x1d9/0x240 [cdc_mbim]
      >  usbnet_start_xmit+0x5d/0x720 [usbnet]
      
      The cdc_ncm_align_tail call first aligns on a ctx->tx_modulus
      boundary (adding at most ctx->tx_modulus-1 bytes), then adds
      ctx->tx_remainder bytes. Alternatively, the next alignment call can
      occur in cdc_ncm_ndp16 or cdc_ncm_ndp32, in which case at most
      ctx->tx_ndp_modulus-1 bytes are added.
      
      A similar problem has occurred before, and the code is nontrivial to
      reason about, so add a guard before the crashing call. By that time it
      is too late to prevent any memory corruption (we'll have written past
      the end of the buffer already) but we can at least try to get a warning
      written into an on-disk log by avoiding the hard crash caused by padding
      past the buffer with a huge number of zeros.
      
      Signed-off-by: default avatarJouni K. Seppänen <jks@iki.fi>
      Fixes: 4a0e3e98 ("cdc_ncm: Add support for moving NDP to end of NCM frame")
      Link: https://bugzilla.kernel.org/show_bug.cgi?id=209407
      
      
      Reported-by: default avatarkernel test robot <lkp@intel.com>
      Reviewed-by: default avatarBjørn Mork <bjorn@mork.no>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      b044a949
    • Josef Bacik's avatar
      btrfs: shrink delalloc pages instead of full inodes · e3b5252b
      Josef Bacik authored
      
      
      [ Upstream commit e076ab2a ]
      
      Commit 38d715f4 ("btrfs: use btrfs_start_delalloc_roots in
      shrink_delalloc") cleaned up how we do delalloc shrinking by utilizing
      some infrastructure we have in place to flush inodes that we use for
      device replace and snapshot.  However this introduced a pretty serious
      performance regression.  To reproduce the user untarred the source
      tarball of Firefox (360MiB xz compressed/1.5GiB uncompressed), and would
      see it take anywhere from 5 to 20 times as long to untar in 5.10
      compared to 5.9. This was observed on fast devices (SSD and better) and
      not on HDD.
      
      The root cause is because before we would generally use the normal
      writeback path to reclaim delalloc space, and for this we would provide
      it with the number of pages we wanted to flush.  The referenced commit
      changed this to flush that many inodes, which drastically increased the
      amount of space we were flushing in certain cases, which severely
      affected performance.
      
      We cannot revert this patch unfortunately because of 3d45f221
      ("btrfs: fix deadlock when cloning inline extent and low on free
      metadata space") which requires the ability to skip flushing inodes that
      are being cloned in certain scenarios, which means we need to keep using
      our flushing infrastructure or risk re-introducing the deadlock.
      
      Instead to fix this problem we can go back to providing
      btrfs_start_delalloc_roots with a number of pages to flush, and then set
      up a writeback_control and utilize sync_inode() to handle the flushing
      for us.  This gives us the same behavior we had prior to the fix, while
      still allowing us to avoid the deadlock that was fixed by Filipe.  I
      redid the users original test and got the following results on one of
      our test machines (256GiB of ram, 56 cores, 2TiB Intel NVMe drive)
      
        5.9		0m54.258s
        5.10		1m26.212s
        5.10+patch	0m38.800s
      
      5.10+patch is significantly faster than plain 5.9 because of my patch
      series "Change data reservations to use the ticketing infra" which
      contained the patch that introduced the regression, but generally
      improved the overall ENOSPC flushing mechanisms.
      
      Additional testing on consumer-grade SSD (8GiB ram, 8 CPU) confirm
      the results:
      
        5.10.5            4m00s
        5.10.5+patch      1m08s
        5.11-rc2	    5m14s
        5.11-rc2+patch    1m30s
      
      Reported-by: default avatarRené Rebe <rene@exactcode.de>
      Fixes: 38d715f4 ("btrfs: use btrfs_start_delalloc_roots in shrink_delalloc")
      CC: stable@vger.kernel.org # 5.10
      Signed-off-by: default avatarJosef Bacik <josef@toxicpanda.com>
      Tested-by: default avatarDavid Sterba <dsterba@suse.com>
      Reviewed-by: default avatarDavid Sterba <dsterba@suse.com>
      [ add my test results ]
      Signed-off-by: default avatarDavid Sterba <dsterba@suse.com>
      Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
      e3b5252b
    • Filipe Manana's avatar
      btrfs: fix deadlock when cloning inline extent and low on free metadata space · 17243f73
      Filipe Manana authored
      
      
      [ Upstream commit 3d45f221 ]
      
      When cloning an inline extent there are cases where we can not just copy
      the inline extent from the source range to the target range (e.g. when the
      target range starts at an offset greater than zero). In such cases we copy
      the inline extent's data into a page of the destination inode and then
      dirty that page. However, after that we will need to start a transaction
      for each processed extent and, if we are ever low on available metadata
      space, we may need to flush existing delalloc for all dirty inodes in an
      attempt to release metadata space - if that happens we may deadlock:
      
      * the async reclaim task queued a delalloc work to flush delalloc for
        the destination inode of the clone operation;
      
      * the task executing that delalloc work gets blocked waiting for the
        range with the dirty page to be unlocked, which is currently locked
        by the task doing the clone operation;
      
      * the async reclaim task blocks waiting for the delalloc work to complete;
      
      * the cloning task is waiting on the waitqueue of its reservation ticket
        while holding the range with the dirty page locked in the inode's
        io_tree;
      
      * if metadata space is not released by some other task (like delalloc for
        some other inode completing for example), the clone task waits forever
        and as a consequence the delalloc work and async reclaim tasks will hang
        forever as well. Releasing more space on the other hand may require
        starting a transaction, which will hang as well when trying to reserve
        metadata space, resulting in a deadlock between all these tasks.
      
      When this happens, traces like the following show up in dmesg/syslog:
      
        [87452.323003] INFO: task kworker/u16:11:1810830 blocked for more than 120 seconds.
        [87452.323644]       Tainted: G    B   W         5.10.0-rc4-btrfs-next-73 #1
        [87452.324248] "echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
        [87452.324852] task:kworker/u16:11  state:D stack:    0 pid:1810830 ppid:     2 flags:0x00004000
        [87452.325520] Workqueue: btrfs-flush_delalloc btrfs_work_helper [btrfs]
        [87452.326136] Call Trace:
        [87452.326737]  __schedule+0x5d1/0xcf0
        [87452.327390]  schedule+0x45/0xe0
        [87452.328174]  lock_extent_bits+0x1e6/0x2d0 [btrfs]
        [87452.328894]  ? finish_wait+0x90/0x90
        [87452.329474]  btrfs_invalidatepage+0x32c/0x390 [btrfs]
        [87452.330133]  ? __mod_memcg_state+0x8e/0x160
        [87452.330738]  __extent_writepage+0x2d4/0x400 [btrfs]
        [87452.331405]  extent_write_cache_pages+0x2b2/0x500 [btrfs]
        [87452.332007]  ? lock_release+0x20e/0x4c0
        [87452.332557]  ? trace_hardirqs_on+0x1b/0xf0
        [87452.333127]  extent_writepages+0x43/0x90 [btrfs]
        [87452.333653]  ? lock_acquire+0x1a3/0x490
        [87452.334177]  do_writepages+0x43/0xe0
        [87452.334699]  ? __filemap_fdatawrite_range+0xa4/0x100
        [87452.335720]  __filemap_fdatawrite_range+0xc5/0x100
        [87452.336500]  btrfs_run_delalloc_work+0x17/0x40 [btrfs]
        [87452.337216]  btrfs_work_helper+0xf1/0x600 [btrfs]
        [87452.337838]  process_one_work+0x24e/0x5e0
        [87452.338437]  worker_thread+0x50/0x3b0
        [87452.339137]  ? process_one_work+0x5e0/0x5e0
        [87452.339884]  kthread+0x153/0x170
        [87452.340507]  ? kthread_mod_delayed_work+0xc0/0xc0
        [87452.341153]  ret_from_fork+0x22/0x30
        [87452.341806] INFO: task kworker/u16:1:2426217 blocked for more than 120 seconds.
        [87452.342487]       Tainted: G    B   W         5.10.0-rc4-btrfs-next-73 #1
        [87452.343274] "echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
        [87452.344049] task:kworker/u16:1   state:D stack:    0 pid:2426217 ppid:     2 flags:0x00004000
        [87452.344974] Workqueue: events_unbound btrfs_async_reclaim_metadata_space [btrfs]
        [87452.345655] Call Trace:
        [87452.346305]  __schedule+0x5d1/0xcf0
        [87452.346947]  ? kvm_clock_read+0x14/0x30
        [87452.347676]  ? wait_for_completion+0x81/0x110
        [87452.348389]  schedule+0x45/0xe0
        [87452.349077]  schedule_timeout+0x30c/0x580
        [87452.349718]  ? _raw_spin_unlock_irqrestore+0x3c/0x60
        [87452.350340]  ? lock_acquire+0x1a3/0x490
        [87452.351006]  ? try_to_wake_up+0x7a/0xa20
        [87452.351541]  ? lock_release+0x20e/0x4c0
        [87452.352040]  ? lock_acquired+0x199/0x490
        [87452.352517]  ? wait_for_completion+0x81/0x110
        [87452.353000]  wait_for_completion+0xab/0x110
        [87452.353490]  start_delalloc_inodes+0x2af/0x390 [btrfs]
        [87452.353973]  btrfs_start_delalloc_roots+0x12d/0x250 [btrfs]
        [87452.354455]  flush_space+0x24f/0x660 [btrfs]
        [87452.355063]  btrfs_async_reclaim_metadata_space+0x1bb/0x480 [btrfs]
        [87452.355565]  process_one_work+0x24e/0x5e0
        [87452.356024]  worker_thread+0x20f/0x3b0
        [87452.356487]  ? process_one_work+0x5e0/0x5e0
        [87452.356973]  kthread+0x153/0x170
        [87452.357434]  ? kthread_mod_delayed_work+0xc0/0xc0
        [87452.357880]  ret_from_fork+0x22/0x30
        (...)
        < stack traces of several tasks waiting for the locks of the inodes of the
          clone operation >
        (...)
        [92867.444138] RSP: 002b:00007ffc3371bbe8 EFLAGS: 00000246 ORIG_RAX: 0000000000000052
        [92867.444624] RAX: ffffffffffffffda RBX: 00007ffc3371bea0 RCX: 00007f61efe73f97
        [92867.445116] RDX: 0000000000000000 RSI: 0000560fbd5d7a40 RDI: 0000560fbd5d8960
        [92867.445595] RBP: 00007ffc3371beb0 R08: 0000000000000001 R09: 0000000000000003
        [92867.446070] R10: 00007ffc3371b996 R11: 0000000000000246 R12: 0000000000000000
        [92867.446820] R13: 000000000000001f R14: 00007ffc3371bea0 R15: 00007ffc3371beb0
        [92867.447361] task:fsstress        state:D stack:    0 pid:2508238 ppid:2508153 flags:0x00004000
        [92867.447920] Call Trace:
        [92867.448435]  __schedule+0x5d1/0xcf0
        [92867.448934]  ? _raw_spin_unlock_irqrestore+0x3c/0x60
        [92867.449423]  schedule+0x45/0xe0
        [92867.449916]  __reserve_bytes+0x4a4/0xb10 [btrfs]
        [92867.450576]  ? finish_wait+0x90/0x90
        [92867.451202]  btrfs_reserve_metadata_bytes+0x29/0x190 [btrfs]
        [92867.451815]  btrfs_block_rsv_add+0x1f/0x50 [btrfs]
        [92867.452412]  start_transaction+0x2d1/0x760 [btrfs]
        [92867.453216]  clone_copy_inline_extent+0x333/0x490 [btrfs]
        [92867.453848]  ? lock_release+0x20e/0x4c0
        [92867.454539]  ? btrfs_search_slot+0x9a7/0xc30 [btrfs]
        [92867.455218]  btrfs_clone+0x569/0x7e0 [btrfs]
        [92867.455952]  btrfs_clone_files+0xf6/0x150 [btrfs]
        [92867.456588]  btrfs_remap_file_range+0x324/0x3d0 [btrfs]
        [92867.457213]  do_clone_file_range+0xd4/0x1f0
        [92867.457828]  vfs_clone_file_range+0x4d/0x230
        [92867.458355]  ? lock_release+0x20e/0x4c0
        [92867.458890]  ioctl_file_clone+0x8f/0xc0
        [92867.459377]  do_vfs_ioctl+0x342/0x750
        [92867.459913]  __x64_sys_ioctl+0x62/0xb0
        [92867.460377]  do_syscall_64+0x33/0x80
        [92867.460842]  entry_SYSCALL_64_after_hwframe+0x44/0xa9
        (...)
        < stack traces of more tasks blocked on metadata reservation like the clone
          task above, because the async reclaim task has deadlocked >
        (...)
      
      Another thing to notice is that the worker task that is deadlocked when
      trying to flush the destination inode of the clone operation is at
      btrfs_invalidatepage(). This is simply because the clone operation has a
      destination offset greater than the i_size and we only update the i_size
      of the destination file after cloning an extent (just like we do in the
      buffered write path).
      
      Since the async reclaim path uses btrfs_start_delalloc_roots() to trigger
      the flushing of delalloc for all inodes that have delalloc, add a runtime
      flag to an inode to signal it should not be flushed, and for inodes with
      that flag set, start_delalloc_inodes() will simply skip them. When the
      cloning code needs to dirty a page to copy an inline extent, set that flag
      on the inode and then clear it when the clone operation finishes.
      
      This could be sporadically triggered with test case generic/269 from
      fstests, which exercises many fsstress processes running in parallel with
      several dd processes filling up the entire filesystem.
      
      CC: stable@vger.kernel.org # 5.9+
      Fixes: 05a5a762 ("Btrfs: implement full reflink support for inline extents")
      Reviewed-by: default avatarJosef Bacik <josef@toxicpanda.com>
      Signed-off-by: default avatarFilipe Manana <fdmanana@suse.com>
      Reviewed-by: default avatarDavid Sterba <dsterba@suse.com>
      Signed-off-by: default avatarDavid Sterba <dsterba@suse.com>
      Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
      17243f73
    • Filipe Manana's avatar
      btrfs: skip unnecessary searches for xattrs when logging an inode · 87738164
      Filipe Manana authored
      
      
      [ Upstream commit f2f121ab ]
      
      Every time we log an inode we lookup in the fs/subvol tree for xattrs and
      if we have any, log them into the log tree. However it is very common to
      have inodes without any xattrs, so doing the search wastes times, but more
      importantly it adds contention on the fs/subvol tree locks, either making
      the logging code block and wait for tree locks or making the logging code
      making other concurrent operations block and wait.
      
      The most typical use cases where xattrs are used are when capabilities or
      ACLs are defined for an inode, or when SELinux is enabled.
      
      This change makes the logging code detect when an inode does not have
      xattrs and skip the xattrs search the next time the inode is logged,
      unless the inode is evicted and loaded again or a xattr is added to the
      inode. Therefore skipping the search for xattrs on inodes that don't ever
      have xattrs and are fsynced with some frequency.
      
      The following script that calls dbench was used to measure the impact of
      this change on a VM with 8 CPUs, 16Gb of ram, using a raw NVMe device
      directly (no intermediary filesystem on the host) and using a non-debug
      kernel (default configuration on Debian distributions):
      
        $ cat test.sh
        #!/bin/bash
      
        DEV=/dev/sdk
        MNT=/mnt/sdk
        MOUNT_OPTIONS="-o ssd"
      
        mkfs.btrfs -f -m single -d single $DEV
        mount $MOUNT_OPTIONS $DEV $MNT
      
        dbench -D $MNT -t 200 40
      
        umount $MNT
      
      The results before this change:
      
       Operation      Count    AvgLat    MaxLat
       ----------------------------------------
       NTCreateX    5761605     0.172   312.057
       Close        4232452     0.002    10.927
       Rename        243937     1.406   277.344
       Unlink       1163456     0.631   298.402
       Deltree          160    11.581   221.107
       Mkdir             80     0.003     0.005
       Qpathinfo    5221410     0.065   122.309
       Qfileinfo     915432     0.001     3.333
       Qfsinfo       957555     0.003     3.992
       Sfileinfo     469244     0.023    20.494
       Find         2018865     0.448   123.659
       WriteX       2874851     0.049   118.529
       ReadX        9030579     0.004    21.654
       LockX          18754     0.003     4.423
       UnlockX        18754     0.002     0.331
       Flush         403792    10.944   359.494
      
      Throughput 908.444 MB/sec  40 clients  40 procs  max_latency=359.500 ms
      
      The results after this change:
      
       Operation      Count    AvgLat    MaxLat
       ----------------------------------------
       NTCreateX    6442521     0.159   230.693
       Close        4732357     0.002    10.972
       Rename        272809     1.293   227.398
       Unlink       1301059     0.563   218.500
       Deltree          160     7.796    54.887
       Mkdir             80     0.008     0.478
       Qpathinfo    5839452     0.047   124.330
       Qfileinfo    1023199     0.001     4.996
       Qfsinfo      1070760     0.003     5.709
       Sfileinfo     524790     0.033    21.765
       Find         2257658     0.314   125.611
       WriteX       3211520     0.040   232.135
       ReadX        10098969     0.004    25.340
       LockX          20974     0.003     1.569
       UnlockX        20974     0.002     3.475
       Flush         451553    10.287   331.037
      
      Throughput 1011.77 MB/sec  40 clients  40 procs  max_latency=331.045 ms
      
      +10.8% throughput, -8.2% max latency
      
      Reviewed-by: default avatarJosef Bacik <josef@toxicpanda.com>
      Signed-off-by: default avatarFilipe Manana <fdmanana@suse.com>
      Reviewed-by: default avatarDavid Sterba <dsterba@suse.com>
      Signed-off-by: default avatarDavid Sterba <dsterba@suse.com>
      Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
      87738164
    • Arnd Bergmann's avatar
      scsi: ufs: Fix -Wsometimes-uninitialized warning · e28ace86
      Arnd Bergmann authored
      [ Upstream commit 4c60244d ]
      
      clang complains about a possible code path in which a variable is used
      without an initialization:
      
      drivers/scsi/ufs/ufshcd.c:7690:3: error: variable 'sdp' is used uninitialized whenever 'if' condition is false [-Werror,-Wsometimes-uninitialized]
                      BUG_ON(1);
                      ^~~~~~~~~
      include/asm-generic/bug.h:63:36: note: expanded from macro 'BUG_ON'
       #define BUG_ON(condition) do { if (unlikely(condition)) BUG(); } while (0)
                                         ^~~~~~~~~~~~~~~~~~~
      
      Turn the BUG_ON(1) into an unconditional BUG() that makes it clear to clang
      that this code path is never hit.
      
      Link: https://lore.kernel.org/r/20201203223137.1205933-1-arnd@kernel.org
      
      
      Fixes: 4f3e900b ("scsi: ufs: Clear UAC for FFU and RPMB LUNs")
      Reviewed-by: default avatarAvri Altman <avri.altman@wdc.com>
      Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
      Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
      Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
      e28ace86
    • Matthew Wilcox (Oracle)'s avatar
      io_uring: Fix return value from alloc_fixed_file_ref_node · 458b4059
      Matthew Wilcox (Oracle) authored
      
      
      [ Upstream commit 3e2224c5 ]
      
      alloc_fixed_file_ref_node() currently returns an ERR_PTR on failure.
      io_sqe_files_unregister() expects it to return NULL and since it can only
      return -ENOMEM, it makes more sense to change alloc_fixed_file_ref_node()
      to behave that way.
      
      Fixes: 1ffc5422 ("io_uring: fix io_sqe_files_unregister() hangs")
      Reported-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
      Signed-off-by: default avatarMatthew Wilcox (Oracle) <willy@infradead.org>
      Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
      Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
      458b4059
    • Steven Price's avatar
      drm/panfrost: Don't corrupt the queue mutex on open/close · 51495b71
      Steven Price authored
      
      
      [ Upstream commit a17d609e ]
      
      The mutex within the panfrost_queue_state should have the lifetime of
      the queue, however it was erroneously initialised/destroyed during
      panfrost_job_{open,close} which is called every time a client
      opens/closes the drm node.
      
      Move the initialisation/destruction to panfrost_job_{init,fini} where it
      belongs.
      
      Fixes: 1a11a88c ("drm/panfrost: Fix job timeout handling")
      Signed-off-by: default avatarSteven Price <steven.price@arm.com>
      Reviewed-by: default avatarBoris Brezillon <boris.brezillon@collabora.com>
      Signed-off-by: default avatarBoris Brezillon <boris.brezillon@collabora.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20201029170047.30564-1-steven.price@arm.com
      
      
      Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
      51495b71
    • Bjorn Andersson's avatar
      iommu/arm-smmu-qcom: Initialize SCTLR of the bypass context · 9d7751a3
      Bjorn Andersson authored
      
      
      [ Upstream commit aded8c7c ]
      
      On SM8150 it's occasionally observed that the boot hangs in between the
      writing of SMEs and context banks in arm_smmu_device_reset().
      
      The problem seems to coincide with a display refresh happening after
      updating the stream mapping, but before clearing - and there by
      disabling translation - the context bank picked to emulate translation
      bypass.
      
      Resolve this by explicitly disabling the bypass context already in
      cfg_probe.
      
      Fixes: f9081b8f ("iommu/arm-smmu-qcom: Implement S2CR quirk")
      Signed-off-by: default avatarBjorn Andersson <bjorn.andersson@linaro.org>
      Link: https://lore.kernel.org/r/20210106005038.4152731-1-bjorn.andersson@linaro.org
      
      
      Signed-off-by: default avatarWill Deacon <will@kernel.org>
      Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
      9d7751a3
    • Weihang Li's avatar
      RDMA/hns: Avoid filling sl in high 3 bits of vlan_id · 85bbe2e6
      Weihang Li authored
      [ Upstream commit 94a8c4df ]
      
      Only the low 12 bits of vlan_id is valid, and service level has been
      filled in Address Vector. So there is no need to fill sl in vlan_id in
      Address Vector.
      
      Fixes: 7406c003 ("RDMA/hns: Only record vlan info for HIP08")
      Link: https://lore.kernel.org/r/1607650657-35992-5-git-send-email-liweihang@huawei.com
      
      
      Signed-off-by: default avatarWeihang Li <liweihang@huawei.com>
      Signed-off-by: default avatarJason Gunthorpe <jgg@nvidia.com>
      Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
      85bbe2e6
    • Pavel Begunkov's avatar
      io_uring: patch up IOPOLL overflow_flush sync · 85e25e23
      Pavel Begunkov authored
      
      
      commit 6c503150 upstream
      
      IOPOLL skips completion locking but keeps it under uring_lock, thus
      io_cqring_overflow_flush() and so io_cqring_events() need additional
      locking with uring_lock in some cases for IOPOLL.
      
      Remove __io_cqring_overflow_flush() from io_cqring_events(), introduce a
      wrapper around flush doing needed synchronisation and call it by hand.
      
      Signed-off-by: default avatarPavel Begunkov <asml.silence@gmail.com>
      Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
      Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
      85e25e23
    • Pavel Begunkov's avatar
      io_uring: limit {io|sq}poll submit locking scope · bc924dd2
      Pavel Begunkov authored
      
      
      commit 89448c47 upstream
      
      We don't need to take uring_lock for SQPOLL|IOPOLL to do
      io_cqring_overflow_flush() when cq_overflow_list is empty, remove it
      from the hot path.
      
      Signed-off-by: default avatarPavel Begunkov <asml.silence@gmail.com>
      Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
      Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
      bc924dd2
    • Pavel Begunkov's avatar
      io_uring: synchronise IOPOLL on task_submit fail · 1d5e50da
      Pavel Begunkov authored
      
      
      commit 81b6d05c upstream
      
      io_req_task_submit() might be called for IOPOLL, do the fail path under
      uring_lock to comply with IOPOLL synchronisation based solely on it.
      
      Cc: stable@vger.kernel.org # 5.5+
      Signed-off-by: default avatarPavel Begunkov <asml.silence@gmail.com>
      Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
      Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
      1d5e50da
    • Christophe Leroy's avatar
      powerpc/32s: Fix RTAS machine check with VMAP stack · bca9ca5a
      Christophe Leroy authored
      
      
      [ Upstream commit 98bf2d3f ]
      
      When we have VMAP stack, exception prolog 1 sets r1, not r11.
      
      When it is not an RTAS machine check, don't trash r1 because it is
      needed by prolog 1.
      
      Fixes: da7bb43a ("powerpc/32: Fix vmap stack - Properly set r1 before activating MMU")
      Fixes: d2e00603 ("powerpc/32: Use SPRN_SPRG_SCRATCH2 in exception prologs")
      Cc: stable@vger.kernel.org # v5.10+
      Signed-off-by: default avatarChristophe Leroy <christophe.leroy@csgroup.eu>
      [mpe: Squash in fixup for RTAS machine check from Christophe]
      Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
      Link: https://lore.kernel.org/r/bc77d61d1c18940e456a2dee464f1e2eda65a3f0.1608621048.git.christophe.leroy@csgroup.eu
      
      
      Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
      bca9ca5a
  2. Jan 13, 2021