]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
4.19-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 27 May 2019 12:12:36 +0000 (14:12 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 27 May 2019 12:12:36 +0000 (14:12 +0200)
added patches:
bio-fix-improper-use-of-smp_mb__before_atomic.patch
crypto-vmx-ctr-always-increment-iv-as-quadword.patch
f2fs-fix-use-of-number-of-devices.patch
kvm-svm-avic-fix-off-by-one-in-checking-host-apic-id.patch
kvm-x86-fix-return-value-for-reserved-efer.patch
libnvdimm-pmem-bypass-config_hardened_usercopy-overhead.patch
mmc-sdhci-iproc-cygnus-set-no_hispd-bit-to-fix-hs50-data-hold-time-problem.patch
mmc-sdhci-iproc-set-no_hispd-bit-to-fix-hs50-data-hold-time-problem.patch
revert-scsi-sd-keep-disk-read-only-when-re-reading-partition.patch
sbitmap-fix-improper-use-of-smp_mb__before_atomic.patch

queue-4.19/bio-fix-improper-use-of-smp_mb__before_atomic.patch [new file with mode: 0644]
queue-4.19/crypto-vmx-ctr-always-increment-iv-as-quadword.patch [new file with mode: 0644]
queue-4.19/f2fs-fix-use-of-number-of-devices.patch [new file with mode: 0644]
queue-4.19/kvm-svm-avic-fix-off-by-one-in-checking-host-apic-id.patch [new file with mode: 0644]
queue-4.19/kvm-x86-fix-return-value-for-reserved-efer.patch [new file with mode: 0644]
queue-4.19/libnvdimm-pmem-bypass-config_hardened_usercopy-overhead.patch [new file with mode: 0644]
queue-4.19/mmc-sdhci-iproc-cygnus-set-no_hispd-bit-to-fix-hs50-data-hold-time-problem.patch [new file with mode: 0644]
queue-4.19/mmc-sdhci-iproc-set-no_hispd-bit-to-fix-hs50-data-hold-time-problem.patch [new file with mode: 0644]
queue-4.19/revert-scsi-sd-keep-disk-read-only-when-re-reading-partition.patch [new file with mode: 0644]
queue-4.19/sbitmap-fix-improper-use-of-smp_mb__before_atomic.patch [new file with mode: 0644]
queue-4.19/series

diff --git a/queue-4.19/bio-fix-improper-use-of-smp_mb__before_atomic.patch b/queue-4.19/bio-fix-improper-use-of-smp_mb__before_atomic.patch
new file mode 100644 (file)
index 0000000..c91a28c
--- /dev/null
@@ -0,0 +1,43 @@
+From f381c6a4bd0ae0fde2d6340f1b9bb0f58d915de6 Mon Sep 17 00:00:00 2001
+From: Andrea Parri <andrea.parri@amarulasolutions.com>
+Date: Mon, 20 May 2019 19:23:56 +0200
+Subject: bio: fix improper use of smp_mb__before_atomic()
+
+From: Andrea Parri <andrea.parri@amarulasolutions.com>
+
+commit f381c6a4bd0ae0fde2d6340f1b9bb0f58d915de6 upstream.
+
+This barrier only applies to the read-modify-write operations; in
+particular, it does not apply to the atomic_set() primitive.
+
+Replace the barrier with an smp_mb().
+
+Fixes: dac56212e8127 ("bio: skip atomic inc/dec of ->bi_cnt for most use cases")
+Cc: stable@vger.kernel.org
+Reported-by: "Paul E. McKenney" <paulmck@linux.ibm.com>
+Reported-by: Peter Zijlstra <peterz@infradead.org>
+Signed-off-by: Andrea Parri <andrea.parri@amarulasolutions.com>
+Reviewed-by: Ming Lei <ming.lei@redhat.com>
+Cc: Jens Axboe <axboe@kernel.dk>
+Cc: Ming Lei <ming.lei@redhat.com>
+Cc: linux-block@vger.kernel.org
+Cc: "Paul E. McKenney" <paulmck@linux.ibm.com>
+Cc: Peter Zijlstra <peterz@infradead.org>
+Signed-off-by: Jens Axboe <axboe@kernel.dk>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ include/linux/bio.h |    2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/include/linux/bio.h
++++ b/include/linux/bio.h
+@@ -257,7 +257,7 @@ static inline void bio_cnt_set(struct bi
+ {
+       if (count != 1) {
+               bio->bi_flags |= (1 << BIO_REFFED);
+-              smp_mb__before_atomic();
++              smp_mb();
+       }
+       atomic_set(&bio->__bi_cnt, count);
+ }
diff --git a/queue-4.19/crypto-vmx-ctr-always-increment-iv-as-quadword.patch b/queue-4.19/crypto-vmx-ctr-always-increment-iv-as-quadword.patch
new file mode 100644 (file)
index 0000000..07bcccb
--- /dev/null
@@ -0,0 +1,57 @@
+From 009b30ac7444c17fae34c4f435ebce8e8e2b3250 Mon Sep 17 00:00:00 2001
+From: Daniel Axtens <dja@axtens.net>
+Date: Wed, 15 May 2019 20:24:50 +1000
+Subject: crypto: vmx - CTR: always increment IV as quadword
+
+From: Daniel Axtens <dja@axtens.net>
+
+commit 009b30ac7444c17fae34c4f435ebce8e8e2b3250 upstream.
+
+The kernel self-tests picked up an issue with CTR mode:
+alg: skcipher: p8_aes_ctr encryption test failed (wrong result) on test vector 3, cfg="uneven misaligned splits, may sleep"
+
+Test vector 3 has an IV of FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFD, so
+after 3 increments it should wrap around to 0.
+
+In the aesp8-ppc code from OpenSSL, there are two paths that
+increment IVs: the bulk (8 at a time) path, and the individual
+path which is used when there are fewer than 8 AES blocks to
+process.
+
+In the bulk path, the IV is incremented with vadduqm: "Vector
+Add Unsigned Quadword Modulo", which does 128-bit addition.
+
+In the individual path, however, the IV is incremented with
+vadduwm: "Vector Add Unsigned Word Modulo", which instead
+does 4 32-bit additions. Thus the IV would instead become
+FFFFFFFFFFFFFFFFFFFFFFFF00000000, throwing off the result.
+
+Use vadduqm.
+
+This was probably a typo originally, what with q and w being
+adjacent. It is a pretty narrow edge case: I am really
+impressed by the quality of the kernel self-tests!
+
+Fixes: 5c380d623ed3 ("crypto: vmx - Add support for VMS instructions by ASM")
+Cc: stable@vger.kernel.org
+Signed-off-by: Daniel Axtens <dja@axtens.net>
+Acked-by: Nayna Jain <nayna@linux.ibm.com>
+Tested-by: Nayna Jain <nayna@linux.ibm.com>
+Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/crypto/vmx/aesp8-ppc.pl |    2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/drivers/crypto/vmx/aesp8-ppc.pl
++++ b/drivers/crypto/vmx/aesp8-ppc.pl
+@@ -1357,7 +1357,7 @@ Loop_ctr32_enc:
+       addi            $idx,$idx,16
+       bdnz            Loop_ctr32_enc
+-      vadduwm         $ivec,$ivec,$one
++      vadduqm         $ivec,$ivec,$one
+        vmr            $dat,$inptail
+        lvx            $inptail,0,$inp
+        addi           $inp,$inp,16
diff --git a/queue-4.19/f2fs-fix-use-of-number-of-devices.patch b/queue-4.19/f2fs-fix-use-of-number-of-devices.patch
new file mode 100644 (file)
index 0000000..5b64fde
--- /dev/null
@@ -0,0 +1,192 @@
+From 0916878da355650d7e77104a7ac0fa1784eca852 Mon Sep 17 00:00:00 2001
+From: Damien Le Moal <damien.lemoal@wdc.com>
+Date: Sat, 16 Mar 2019 09:13:06 +0900
+Subject: f2fs: Fix use of number of devices
+
+From: Damien Le Moal <damien.lemoal@wdc.com>
+
+commit 0916878da355650d7e77104a7ac0fa1784eca852 upstream.
+
+For a single device mount using a zoned block device, the zone
+information for the device is stored in the sbi->devs single entry
+array and sbi->s_ndevs is set to 1. This differs from a single device
+mount using a regular block device which does not allocate sbi->devs
+and sets sbi->s_ndevs to 0.
+
+However, sbi->s_devs == 0 condition is used throughout the code to
+differentiate a single device mount from a multi-device mount where
+sbi->s_ndevs is always larger than 1. This results in problems with
+single zoned block device volumes as these are treated as multi-device
+mounts but do not have the start_blk and end_blk information set. One
+of the problem observed is skipping of zone discard issuing resulting in
+write commands being issued to full zones or unaligned to a zone write
+pointer.
+
+Fix this problem by simply treating the cases sbi->s_ndevs == 0 (single
+regular block device mount) and sbi->s_ndevs == 1 (single zoned block
+device mount) in the same manner. This is done by introducing the
+helper function f2fs_is_multi_device() and using this helper in place
+of direct tests of sbi->s_ndevs value, improving code readability.
+
+Fixes: 7bb3a371d199 ("f2fs: Fix zoned block device support")
+Cc: <stable@vger.kernel.org>
+Signed-off-by: Damien Le Moal <damien.lemoal@wdc.com>
+Reviewed-by: Chao Yu <yuchao0@huawei.com>
+Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+
+diff --git a/fs/f2fs/data.c b/fs/f2fs/data.c
+index 08314fb42652..4d02e76b648a 100644
+--- a/fs/f2fs/data.c
++++ b/fs/f2fs/data.c
+@@ -197,12 +197,14 @@ struct block_device *f2fs_target_device(struct f2fs_sb_info *sbi,
+       struct block_device *bdev = sbi->sb->s_bdev;
+       int i;
+-      for (i = 0; i < sbi->s_ndevs; i++) {
+-              if (FDEV(i).start_blk <= blk_addr &&
+-                                      FDEV(i).end_blk >= blk_addr) {
+-                      blk_addr -= FDEV(i).start_blk;
+-                      bdev = FDEV(i).bdev;
+-                      break;
++      if (f2fs_is_multi_device(sbi)) {
++              for (i = 0; i < sbi->s_ndevs; i++) {
++                      if (FDEV(i).start_blk <= blk_addr &&
++                          FDEV(i).end_blk >= blk_addr) {
++                              blk_addr -= FDEV(i).start_blk;
++                              bdev = FDEV(i).bdev;
++                              break;
++                      }
+               }
+       }
+       if (bio) {
+@@ -216,6 +218,9 @@ int f2fs_target_device_index(struct f2fs_sb_info *sbi, block_t blkaddr)
+ {
+       int i;
++      if (!f2fs_is_multi_device(sbi))
++              return 0;
++
+       for (i = 0; i < sbi->s_ndevs; i++)
+               if (FDEV(i).start_blk <= blkaddr && FDEV(i).end_blk >= blkaddr)
+                       return i;
+diff --git a/fs/f2fs/f2fs.h b/fs/f2fs/f2fs.h
+index 1f5d5f62bb77..a4b6eacf22ea 100644
+--- a/fs/f2fs/f2fs.h
++++ b/fs/f2fs/f2fs.h
+@@ -1336,6 +1336,17 @@ static inline bool time_to_inject(struct f2fs_sb_info *sbi, int type)
+ }
+ #endif
++/*
++ * Test if the mounted volume is a multi-device volume.
++ *   - For a single regular disk volume, sbi->s_ndevs is 0.
++ *   - For a single zoned disk volume, sbi->s_ndevs is 1.
++ *   - For a multi-device volume, sbi->s_ndevs is always 2 or more.
++ */
++static inline bool f2fs_is_multi_device(struct f2fs_sb_info *sbi)
++{
++      return sbi->s_ndevs > 1;
++}
++
+ /* For write statistics. Suppose sector size is 512 bytes,
+  * and the return value is in kbytes. s is of struct f2fs_sb_info.
+  */
+@@ -3455,7 +3466,7 @@ static inline bool f2fs_force_buffered_io(struct inode *inode, int rw)
+ {
+       return (f2fs_post_read_required(inode) ||
+                       (rw == WRITE && test_opt(F2FS_I_SB(inode), LFS)) ||
+-                      F2FS_I_SB(inode)->s_ndevs);
++                      f2fs_is_multi_device(F2FS_I_SB(inode)));
+ }
+ #ifdef CONFIG_F2FS_FAULT_INJECTION
+diff --git a/fs/f2fs/file.c b/fs/f2fs/file.c
+index b3f46e3bec17..8d1eb8dec605 100644
+--- a/fs/f2fs/file.c
++++ b/fs/f2fs/file.c
+@@ -2539,7 +2539,7 @@ static int f2fs_ioc_flush_device(struct file *filp, unsigned long arg)
+                                                       sizeof(range)))
+               return -EFAULT;
+-      if (sbi->s_ndevs <= 1 || sbi->s_ndevs - 1 <= range.dev_num ||
++      if (!f2fs_is_multi_device(sbi) || sbi->s_ndevs - 1 <= range.dev_num ||
+                       sbi->segs_per_sec != 1) {
+               f2fs_msg(sbi->sb, KERN_WARNING,
+                       "Can't flush %u in %d for segs_per_sec %u != 1\n",
+diff --git a/fs/f2fs/gc.c b/fs/f2fs/gc.c
+index 5c8d00422237..d44b57a363ff 100644
+--- a/fs/f2fs/gc.c
++++ b/fs/f2fs/gc.c
+@@ -1256,7 +1256,7 @@ void f2fs_build_gc_manager(struct f2fs_sb_info *sbi)
+       sbi->gc_pin_file_threshold = DEF_GC_FAILED_PINNED_FILES;
+       /* give warm/cold data area from slower device */
+-      if (sbi->s_ndevs && sbi->segs_per_sec == 1)
++      if (f2fs_is_multi_device(sbi) && sbi->segs_per_sec == 1)
+               SIT_I(sbi)->last_victim[ALLOC_NEXT] =
+                               GET_SEGNO(sbi, FDEV(0).end_blk) + 1;
+ }
+diff --git a/fs/f2fs/segment.c b/fs/f2fs/segment.c
+index ac038563273d..03fa2c4d3d79 100644
+--- a/fs/f2fs/segment.c
++++ b/fs/f2fs/segment.c
+@@ -574,7 +574,7 @@ static int submit_flush_wait(struct f2fs_sb_info *sbi, nid_t ino)
+       int ret = 0;
+       int i;
+-      if (!sbi->s_ndevs)
++      if (!f2fs_is_multi_device(sbi))
+               return __submit_flush_wait(sbi, sbi->sb->s_bdev);
+       for (i = 0; i < sbi->s_ndevs; i++) {
+@@ -640,7 +640,8 @@ int f2fs_issue_flush(struct f2fs_sb_info *sbi, nid_t ino)
+               return ret;
+       }
+-      if (atomic_inc_return(&fcc->issing_flush) == 1 || sbi->s_ndevs > 1) {
++      if (atomic_inc_return(&fcc->issing_flush) == 1 ||
++          f2fs_is_multi_device(sbi)) {
+               ret = submit_flush_wait(sbi, ino);
+               atomic_dec(&fcc->issing_flush);
+@@ -746,7 +747,7 @@ int f2fs_flush_device_cache(struct f2fs_sb_info *sbi)
+ {
+       int ret = 0, i;
+-      if (!sbi->s_ndevs)
++      if (!f2fs_is_multi_device(sbi))
+               return 0;
+       for (i = 1; i < sbi->s_ndevs; i++) {
+@@ -1289,7 +1290,7 @@ static int __queue_discard_cmd(struct f2fs_sb_info *sbi,
+       trace_f2fs_queue_discard(bdev, blkstart, blklen);
+-      if (sbi->s_ndevs) {
++      if (f2fs_is_multi_device(sbi)) {
+               int devi = f2fs_target_device_index(sbi, blkstart);
+               blkstart -= FDEV(devi).start_blk;
+@@ -1638,7 +1639,7 @@ static int __f2fs_issue_discard_zone(struct f2fs_sb_info *sbi,
+       block_t lblkstart = blkstart;
+       int devi = 0;
+-      if (sbi->s_ndevs) {
++      if (f2fs_is_multi_device(sbi)) {
+               devi = f2fs_target_device_index(sbi, blkstart);
+               blkstart -= FDEV(devi).start_blk;
+       }
+@@ -2971,7 +2972,7 @@ static void update_device_state(struct f2fs_io_info *fio)
+       struct f2fs_sb_info *sbi = fio->sbi;
+       unsigned int devidx;
+-      if (!sbi->s_ndevs)
++      if (!f2fs_is_multi_device(sbi))
+               return;
+       devidx = f2fs_target_device_index(sbi, fio->new_blkaddr);
+-- 
+2.21.0
+
diff --git a/queue-4.19/kvm-svm-avic-fix-off-by-one-in-checking-host-apic-id.patch b/queue-4.19/kvm-svm-avic-fix-off-by-one-in-checking-host-apic-id.patch
new file mode 100644 (file)
index 0000000..b8f4f33
--- /dev/null
@@ -0,0 +1,43 @@
+From c9bcd3e3335d0a29d89fabd2c385e1b989e6f1b0 Mon Sep 17 00:00:00 2001
+From: "Suthikulpanit, Suravee" <Suravee.Suthikulpanit@amd.com>
+Date: Tue, 14 May 2019 15:49:52 +0000
+Subject: kvm: svm/avic: fix off-by-one in checking host APIC ID
+
+From: Suthikulpanit, Suravee <Suravee.Suthikulpanit@amd.com>
+
+commit c9bcd3e3335d0a29d89fabd2c385e1b989e6f1b0 upstream.
+
+Current logic does not allow VCPU to be loaded onto CPU with
+APIC ID 255. This should be allowed since the host physical APIC ID
+field in the AVIC Physical APIC table entry is an 8-bit value,
+and APIC ID 255 is valid in system with x2APIC enabled.
+Instead, do not allow VCPU load if the host APIC ID cannot be
+represented by an 8-bit value.
+
+Also, use the more appropriate AVIC_PHYSICAL_ID_ENTRY_HOST_PHYSICAL_ID_MASK
+instead of AVIC_MAX_PHYSICAL_ID_COUNT.
+
+Signed-off-by: Suravee Suthikulpanit <suravee.suthikulpanit@amd.com>
+Cc: stable@vger.kernel.org
+Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ arch/x86/kvm/svm.c |    6 +++++-
+ 1 file changed, 5 insertions(+), 1 deletion(-)
+
+--- a/arch/x86/kvm/svm.c
++++ b/arch/x86/kvm/svm.c
+@@ -2022,7 +2022,11 @@ static void avic_vcpu_load(struct kvm_vc
+       if (!kvm_vcpu_apicv_active(vcpu))
+               return;
+-      if (WARN_ON(h_physical_id >= AVIC_MAX_PHYSICAL_ID_COUNT))
++      /*
++       * Since the host physical APIC id is 8 bits,
++       * we can support host APIC ID upto 255.
++       */
++      if (WARN_ON(h_physical_id > AVIC_PHYSICAL_ID_ENTRY_HOST_PHYSICAL_ID_MASK))
+               return;
+       entry = READ_ONCE(*(svm->avic_physical_id_cache));
diff --git a/queue-4.19/kvm-x86-fix-return-value-for-reserved-efer.patch b/queue-4.19/kvm-x86-fix-return-value-for-reserved-efer.patch
new file mode 100644 (file)
index 0000000..974bd25
--- /dev/null
@@ -0,0 +1,36 @@
+From 66f61c92889ff3ca365161fb29dd36d6354682ba Mon Sep 17 00:00:00 2001
+From: Paolo Bonzini <pbonzini@redhat.com>
+Date: Fri, 24 May 2019 21:52:46 +0200
+Subject: KVM: x86: fix return value for reserved EFER
+
+From: Paolo Bonzini <pbonzini@redhat.com>
+
+commit 66f61c92889ff3ca365161fb29dd36d6354682ba upstream.
+
+Commit 11988499e62b ("KVM: x86: Skip EFER vs. guest CPUID checks for
+host-initiated writes", 2019-04-02) introduced a "return false" in a
+function returning int, and anyway set_efer has a "nonzero on error"
+conventon so it should be returning 1.
+
+Reported-by: Pavel Machek <pavel@denx.de>
+Fixes: 11988499e62b ("KVM: x86: Skip EFER vs. guest CPUID checks for host-initiated writes")
+Cc: Sean Christopherson <sean.j.christopherson@intel.com>
+Cc: stable@vger.kernel.org
+Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ arch/x86/kvm/x86.c |    2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/arch/x86/kvm/x86.c
++++ b/arch/x86/kvm/x86.c
+@@ -1188,7 +1188,7 @@ static int set_efer(struct kvm_vcpu *vcp
+       u64 efer = msr_info->data;
+       if (efer & efer_reserved_bits)
+-              return false;
++              return 1;
+       if (!msr_info->host_initiated) {
+               if (!__kvm_valid_efer(vcpu, efer))
diff --git a/queue-4.19/libnvdimm-pmem-bypass-config_hardened_usercopy-overhead.patch b/queue-4.19/libnvdimm-pmem-bypass-config_hardened_usercopy-overhead.patch
new file mode 100644 (file)
index 0000000..055a47c
--- /dev/null
@@ -0,0 +1,79 @@
+From 52f476a323f9efc959be1c890d0cdcf12e1582e0 Mon Sep 17 00:00:00 2001
+From: Dan Williams <dan.j.williams@intel.com>
+Date: Thu, 16 May 2019 17:05:21 -0700
+Subject: libnvdimm/pmem: Bypass CONFIG_HARDENED_USERCOPY overhead
+
+From: Dan Williams <dan.j.williams@intel.com>
+
+commit 52f476a323f9efc959be1c890d0cdcf12e1582e0 upstream.
+
+Jeff discovered that performance improves from ~375K iops to ~519K iops
+on a simple psync-write fio workload when moving the location of 'struct
+page' from the default PMEM location to DRAM. This result is surprising
+because the expectation is that 'struct page' for dax is only needed for
+third party references to dax mappings. For example, a dax-mapped buffer
+passed to another system call for direct-I/O requires 'struct page' for
+sending the request down the driver stack and pinning the page. There is
+no usage of 'struct page' for first party access to a file via
+read(2)/write(2) and friends.
+
+However, this "no page needed" expectation is violated by
+CONFIG_HARDENED_USERCOPY and the check_copy_size() performed in
+copy_from_iter_full_nocache() and copy_to_iter_mcsafe(). The
+check_heap_object() helper routine assumes the buffer is backed by a
+slab allocator (DRAM) page and applies some checks.  Those checks are
+invalid, dax pages do not originate from the slab, and redundant,
+dax_iomap_actor() has already validated that the I/O is within bounds.
+Specifically that routine validates that the logical file offset is
+within bounds of the file, then it does a sector-to-pfn translation
+which validates that the physical mapping is within bounds of the block
+device.
+
+Bypass additional hardened usercopy overhead and call the 'no check'
+versions of the copy_{to,from}_iter operations directly.
+
+Fixes: 0aed55af8834 ("x86, uaccess: introduce copy_from_iter_flushcache...")
+Cc: <stable@vger.kernel.org>
+Cc: Jeff Moyer <jmoyer@redhat.com>
+Cc: Ingo Molnar <mingo@redhat.com>
+Cc: Christoph Hellwig <hch@lst.de>
+Cc: Al Viro <viro@zeniv.linux.org.uk>
+Cc: Thomas Gleixner <tglx@linutronix.de>
+Cc: Matthew Wilcox <willy@infradead.org>
+Reported-and-tested-by: Jeff Smits <jeff.smits@intel.com>
+Acked-by: Kees Cook <keescook@chromium.org>
+Acked-by: Jan Kara <jack@suse.cz>
+Signed-off-by: Dan Williams <dan.j.williams@intel.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/nvdimm/pmem.c |   10 ++++++++--
+ 1 file changed, 8 insertions(+), 2 deletions(-)
+
+--- a/drivers/nvdimm/pmem.c
++++ b/drivers/nvdimm/pmem.c
+@@ -281,16 +281,22 @@ static long pmem_dax_direct_access(struc
+       return __pmem_direct_access(pmem, pgoff, nr_pages, kaddr, pfn);
+ }
++/*
++ * Use the 'no check' versions of copy_from_iter_flushcache() and
++ * copy_to_iter_mcsafe() to bypass HARDENED_USERCOPY overhead. Bounds
++ * checking, both file offset and device offset, is handled by
++ * dax_iomap_actor()
++ */
+ static size_t pmem_copy_from_iter(struct dax_device *dax_dev, pgoff_t pgoff,
+               void *addr, size_t bytes, struct iov_iter *i)
+ {
+-      return copy_from_iter_flushcache(addr, bytes, i);
++      return _copy_from_iter_flushcache(addr, bytes, i);
+ }
+ static size_t pmem_copy_to_iter(struct dax_device *dax_dev, pgoff_t pgoff,
+               void *addr, size_t bytes, struct iov_iter *i)
+ {
+-      return copy_to_iter_mcsafe(addr, bytes, i);
++      return _copy_to_iter_mcsafe(addr, bytes, i);
+ }
+ static const struct dax_operations pmem_dax_ops = {
diff --git a/queue-4.19/mmc-sdhci-iproc-cygnus-set-no_hispd-bit-to-fix-hs50-data-hold-time-problem.patch b/queue-4.19/mmc-sdhci-iproc-cygnus-set-no_hispd-bit-to-fix-hs50-data-hold-time-problem.patch
new file mode 100644 (file)
index 0000000..9e81568
--- /dev/null
@@ -0,0 +1,46 @@
+From b7dfa695afc40d5396ed84b9f25aa3754de23e39 Mon Sep 17 00:00:00 2001
+From: Trac Hoang <trac.hoang@broadcom.com>
+Date: Thu, 9 May 2019 10:24:26 -0700
+Subject: mmc: sdhci-iproc: cygnus: Set NO_HISPD bit to fix HS50 data hold time problem
+
+From: Trac Hoang <trac.hoang@broadcom.com>
+
+commit b7dfa695afc40d5396ed84b9f25aa3754de23e39 upstream.
+
+The iproc host eMMC/SD controller hold time does not meet the
+specification in the HS50 mode. This problem can be mitigated
+by disabling the HISPD bit; thus forcing the controller output
+data to be driven on the falling clock edges rather than the
+rising clock edges.
+
+This change applies only to the Cygnus platform.
+
+Stable tag (v4.12+) chosen to assist stable kernel maintainers so that
+the change does not produce merge conflicts backporting to older kernel
+versions. In reality, the timing bug existed since the driver was first
+introduced but there is no need for this driver to be supported in kernel
+versions that old.
+
+Cc: stable@vger.kernel.org # v4.12+
+Signed-off-by: Trac Hoang <trac.hoang@broadcom.com>
+Signed-off-by: Scott Branden <scott.branden@broadcom.com>
+Acked-by: Adrian Hunter <adrian.hunter@intel.com>
+Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/mmc/host/sdhci-iproc.c |    3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+--- a/drivers/mmc/host/sdhci-iproc.c
++++ b/drivers/mmc/host/sdhci-iproc.c
+@@ -185,7 +185,8 @@ static const struct sdhci_ops sdhci_ipro
+ };
+ static const struct sdhci_pltfm_data sdhci_iproc_cygnus_pltfm_data = {
+-      .quirks = SDHCI_QUIRK_DATA_TIMEOUT_USES_SDCLK,
++      .quirks = SDHCI_QUIRK_DATA_TIMEOUT_USES_SDCLK |
++                SDHCI_QUIRK_NO_HISPD_BIT,
+       .quirks2 = SDHCI_QUIRK2_ACMD23_BROKEN | SDHCI_QUIRK2_HOST_OFF_CARD_ON,
+       .ops = &sdhci_iproc_32only_ops,
+ };
diff --git a/queue-4.19/mmc-sdhci-iproc-set-no_hispd-bit-to-fix-hs50-data-hold-time-problem.patch b/queue-4.19/mmc-sdhci-iproc-set-no_hispd-bit-to-fix-hs50-data-hold-time-problem.patch
new file mode 100644 (file)
index 0000000..6ce7d17
--- /dev/null
@@ -0,0 +1,44 @@
+From ec0970e0a1b2c807c908d459641a9f9a1be3e130 Mon Sep 17 00:00:00 2001
+From: Trac Hoang <trac.hoang@broadcom.com>
+Date: Thu, 9 May 2019 10:24:27 -0700
+Subject: mmc: sdhci-iproc: Set NO_HISPD bit to fix HS50 data hold time problem
+
+From: Trac Hoang <trac.hoang@broadcom.com>
+
+commit ec0970e0a1b2c807c908d459641a9f9a1be3e130 upstream.
+
+The iproc host eMMC/SD controller hold time does not meet the
+specification in the HS50 mode.  This problem can be mitigated
+by disabling the HISPD bit; thus forcing the controller output
+data to be driven on the falling clock edges rather than the
+rising clock edges.
+
+Stable tag (v4.12+) chosen to assist stable kernel maintainers so that
+the change does not produce merge conflicts backporting to older kernel
+versions. In reality, the timing bug existed since the driver was first
+introduced but there is no need for this driver to be supported in kernel
+versions that old.
+
+Cc: stable@vger.kernel.org # v4.12+
+Signed-off-by: Trac Hoang <trac.hoang@broadcom.com>
+Signed-off-by: Scott Branden <scott.branden@broadcom.com>
+Acked-by: Adrian Hunter <adrian.hunter@intel.com>
+Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/mmc/host/sdhci-iproc.c |    3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+--- a/drivers/mmc/host/sdhci-iproc.c
++++ b/drivers/mmc/host/sdhci-iproc.c
+@@ -209,7 +209,8 @@ static const struct sdhci_iproc_data ipr
+ static const struct sdhci_pltfm_data sdhci_iproc_pltfm_data = {
+       .quirks = SDHCI_QUIRK_DATA_TIMEOUT_USES_SDCLK |
+-                SDHCI_QUIRK_MULTIBLOCK_READ_ACMD12,
++                SDHCI_QUIRK_MULTIBLOCK_READ_ACMD12 |
++                SDHCI_QUIRK_NO_HISPD_BIT,
+       .quirks2 = SDHCI_QUIRK2_ACMD23_BROKEN,
+       .ops = &sdhci_iproc_ops,
+ };
diff --git a/queue-4.19/revert-scsi-sd-keep-disk-read-only-when-re-reading-partition.patch b/queue-4.19/revert-scsi-sd-keep-disk-read-only-when-re-reading-partition.patch
new file mode 100644 (file)
index 0000000..7d87d04
--- /dev/null
@@ -0,0 +1,51 @@
+From 8acf608e602f6ec38b7cc37b04c80f1ce9a1a6cc Mon Sep 17 00:00:00 2001
+From: "Martin K. Petersen" <martin.petersen@oracle.com>
+Date: Mon, 20 May 2019 10:57:18 -0400
+Subject: Revert "scsi: sd: Keep disk read-only when re-reading partition"
+
+From: Martin K. Petersen <martin.petersen@oracle.com>
+
+commit 8acf608e602f6ec38b7cc37b04c80f1ce9a1a6cc upstream.
+
+This reverts commit 20bd1d026aacc5399464f8328f305985c493cde3.
+
+This patch introduced regressions for devices that come online in
+read-only state and subsequently switch to read-write.
+
+Given how the partition code is currently implemented it is not
+possible to persist the read-only flag across a device revalidate
+call. This may need to get addressed in the future since it is common
+for user applications to proactively call BLKRRPART.
+
+Reverting this commit will re-introduce a regression where a
+device-initiated revalidate event will cause the admin state to be
+forgotten. A separate patch will address this issue.
+
+Fixes: 20bd1d026aac ("scsi: sd: Keep disk read-only when re-reading partition")
+Cc: <stable@vger.kernel.org>
+Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/scsi/sd.c |    3 +--
+ 1 file changed, 1 insertion(+), 2 deletions(-)
+
+--- a/drivers/scsi/sd.c
++++ b/drivers/scsi/sd.c
+@@ -2605,7 +2605,6 @@ sd_read_write_protect_flag(struct scsi_d
+       int res;
+       struct scsi_device *sdp = sdkp->device;
+       struct scsi_mode_data data;
+-      int disk_ro = get_disk_ro(sdkp->disk);
+       int old_wp = sdkp->write_prot;
+       set_disk_ro(sdkp->disk, 0);
+@@ -2646,7 +2645,7 @@ sd_read_write_protect_flag(struct scsi_d
+                         "Test WP failed, assume Write Enabled\n");
+       } else {
+               sdkp->write_prot = ((data.device_specific & 0x80) != 0);
+-              set_disk_ro(sdkp->disk, sdkp->write_prot || disk_ro);
++              set_disk_ro(sdkp->disk, sdkp->write_prot);
+               if (sdkp->first_scan || old_wp != sdkp->write_prot) {
+                       sd_printk(KERN_NOTICE, sdkp, "Write Protect is %s\n",
+                                 sdkp->write_prot ? "on" : "off");
diff --git a/queue-4.19/sbitmap-fix-improper-use-of-smp_mb__before_atomic.patch b/queue-4.19/sbitmap-fix-improper-use-of-smp_mb__before_atomic.patch
new file mode 100644 (file)
index 0000000..bedbec8
--- /dev/null
@@ -0,0 +1,44 @@
+From a0934fd2b1208458e55fc4b48f55889809fce666 Mon Sep 17 00:00:00 2001
+From: Andrea Parri <andrea.parri@amarulasolutions.com>
+Date: Mon, 20 May 2019 19:23:57 +0200
+Subject: sbitmap: fix improper use of smp_mb__before_atomic()
+
+From: Andrea Parri <andrea.parri@amarulasolutions.com>
+
+commit a0934fd2b1208458e55fc4b48f55889809fce666 upstream.
+
+This barrier only applies to the read-modify-write operations; in
+particular, it does not apply to the atomic_set() primitive.
+
+Replace the barrier with an smp_mb().
+
+Fixes: 6c0ca7ae292ad ("sbitmap: fix wakeup hang after sbq resize")
+Cc: stable@vger.kernel.org
+Reported-by: "Paul E. McKenney" <paulmck@linux.ibm.com>
+Reported-by: Peter Zijlstra <peterz@infradead.org>
+Signed-off-by: Andrea Parri <andrea.parri@amarulasolutions.com>
+Reviewed-by: Ming Lei <ming.lei@redhat.com>
+Cc: Jens Axboe <axboe@kernel.dk>
+Cc: Omar Sandoval <osandov@fb.com>
+Cc: Ming Lei <ming.lei@redhat.com>
+Cc: linux-block@vger.kernel.org
+Cc: "Paul E. McKenney" <paulmck@linux.ibm.com>
+Cc: Peter Zijlstra <peterz@infradead.org>
+Signed-off-by: Jens Axboe <axboe@kernel.dk>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ lib/sbitmap.c |    2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/lib/sbitmap.c
++++ b/lib/sbitmap.c
+@@ -356,7 +356,7 @@ static void sbitmap_queue_update_wake_ba
+                * to ensure that the batch size is updated before the wait
+                * counts.
+                */
+-              smp_mb__before_atomic();
++              smp_mb();
+               for (i = 0; i < SBQ_WAIT_QUEUES; i++)
+                       atomic_set(&sbq->ws[i].wait_cnt, 1);
+       }
index 00ad7fd0f9eea055a1c3f34eec896d16c88b294b..ca5018d6e855158cd2d1a57b79828f186af88f9b 100644 (file)
@@ -1,3 +1,13 @@
 x86-hide-the-int3_emulate_call-jmp-functions-from-uml.patch
 ext4-do-not-delete-unlinked-inode-from-orphan-list-on-failed-truncate.patch
 ext4-wait-for-outstanding-dio-during-truncate-in-nojournal-mode.patch
+f2fs-fix-use-of-number-of-devices.patch
+kvm-x86-fix-return-value-for-reserved-efer.patch
+bio-fix-improper-use-of-smp_mb__before_atomic.patch
+sbitmap-fix-improper-use-of-smp_mb__before_atomic.patch
+revert-scsi-sd-keep-disk-read-only-when-re-reading-partition.patch
+crypto-vmx-ctr-always-increment-iv-as-quadword.patch
+mmc-sdhci-iproc-cygnus-set-no_hispd-bit-to-fix-hs50-data-hold-time-problem.patch
+mmc-sdhci-iproc-set-no_hispd-bit-to-fix-hs50-data-hold-time-problem.patch
+kvm-svm-avic-fix-off-by-one-in-checking-host-apic-id.patch
+libnvdimm-pmem-bypass-config_hardened_usercopy-overhead.patch