]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
Fixes for 5.4
authorSasha Levin <sashal@kernel.org>
Mon, 22 Jun 2020 22:44:13 +0000 (18:44 -0400)
committerSasha Levin <sashal@kernel.org>
Mon, 22 Jun 2020 22:44:13 +0000 (18:44 -0400)
Signed-off-by: Sasha Levin <sashal@kernel.org>
queue-5.4/drm-amd-display-use-swap-where-appropriate.patch [new file with mode: 0644]
queue-5.4/drm-dp_mst-increase-act-retry-timeout-to-3s.patch [new file with mode: 0644]
queue-5.4/ext4-avoid-race-conditions-when-remounting-with-opti.patch [new file with mode: 0644]
queue-5.4/jbd2-clean-__jbd2_journal_abort_hard-and-__journal_a.patch [new file with mode: 0644]
queue-5.4/series
queue-5.4/x86-boot-compressed-relax-sed-symbol-type-regex-for-.patch [new file with mode: 0644]

diff --git a/queue-5.4/drm-amd-display-use-swap-where-appropriate.patch b/queue-5.4/drm-amd-display-use-swap-where-appropriate.patch
new file mode 100644 (file)
index 0000000..44b979d
--- /dev/null
@@ -0,0 +1,127 @@
+From 7544a863071c099c57df087796498cb61ff383bc Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Thu, 10 Oct 2019 16:11:57 +0300
+Subject: drm/amd/display: Use swap() where appropriate
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+From: Ville Syrjälä <ville.syrjala@linux.intel.com>
+
+[ Upstream commit 34b86b75dfc90ab3d996c224314ce51772a3b351 ]
+
+Mostly a cocci-job, but it flat out refused to remove the
+declaration in drivers/gpu/drm/amd/display/dc/core/dc.c so
+had to do that part manually.
+
+@swap@
+identifier TEMP;
+expression A,B;
+@@
+- TEMP = A;
+- A = B;
+- B = TEMP;
++ swap(A, B);
+
+@@
+type T;
+identifier swap.TEMP;
+@@
+(
+- T TEMP;
+|
+- T TEMP = {...};
+)
+... when != TEMP
+
+Cc: Harry Wentland <harry.wentland@amd.com>
+Cc: Leo Li <sunpeng.li@amd.com>
+Cc: Alex Deucher <alexander.deucher@amd.com>
+Cc: "Christian König" <christian.koenig@amd.com>
+Cc: "David (ChunMing) Zhou" <David1.Zhou@amd.com>
+Cc: amd-gfx@lists.freedesktop.org
+Reviewed-by: Nicholas Kazlauskas <nicholas.kazlauskas@amd.com>
+Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
+Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ drivers/gpu/drm/amd/display/dc/bios/bios_parser.c  | 7 ++-----
+ drivers/gpu/drm/amd/display/dc/bios/bios_parser2.c | 8 ++------
+ drivers/gpu/drm/amd/display/dc/core/dc.c           | 6 +-----
+ 3 files changed, 5 insertions(+), 16 deletions(-)
+
+diff --git a/drivers/gpu/drm/amd/display/dc/bios/bios_parser.c b/drivers/gpu/drm/amd/display/dc/bios/bios_parser.c
+index 221e0f56389f3..823843cd26133 100644
+--- a/drivers/gpu/drm/amd/display/dc/bios/bios_parser.c
++++ b/drivers/gpu/drm/amd/display/dc/bios/bios_parser.c
+@@ -2543,7 +2543,6 @@ static enum bp_result construct_integrated_info(
+       /* Sort voltage table from low to high*/
+       if (result == BP_RESULT_OK) {
+-              struct clock_voltage_caps temp = {0, 0};
+               uint32_t i;
+               uint32_t j;
+@@ -2553,10 +2552,8 @@ static enum bp_result construct_integrated_info(
+                                               info->disp_clk_voltage[j].max_supported_clk <
+                                               info->disp_clk_voltage[j-1].max_supported_clk) {
+                                       /* swap j and j - 1*/
+-                                      temp = info->disp_clk_voltage[j-1];
+-                                      info->disp_clk_voltage[j-1] =
+-                                                      info->disp_clk_voltage[j];
+-                                      info->disp_clk_voltage[j] = temp;
++                                      swap(info->disp_clk_voltage[j - 1],
++                                           info->disp_clk_voltage[j]);
+                               }
+                       }
+               }
+diff --git a/drivers/gpu/drm/amd/display/dc/bios/bios_parser2.c b/drivers/gpu/drm/amd/display/dc/bios/bios_parser2.c
+index dff65c0fe82f8..7873abea4112b 100644
+--- a/drivers/gpu/drm/amd/display/dc/bios/bios_parser2.c
++++ b/drivers/gpu/drm/amd/display/dc/bios/bios_parser2.c
+@@ -1613,8 +1613,6 @@ static enum bp_result construct_integrated_info(
+       struct atom_common_table_header *header;
+       struct atom_data_revision revision;
+-
+-      struct clock_voltage_caps temp = {0, 0};
+       uint32_t i;
+       uint32_t j;
+@@ -1644,10 +1642,8 @@ static enum bp_result construct_integrated_info(
+                               info->disp_clk_voltage[j-1].max_supported_clk
+                               ) {
+                               /* swap j and j - 1*/
+-                              temp = info->disp_clk_voltage[j-1];
+-                              info->disp_clk_voltage[j-1] =
+-                                      info->disp_clk_voltage[j];
+-                              info->disp_clk_voltage[j] = temp;
++                              swap(info->disp_clk_voltage[j - 1],
++                                   info->disp_clk_voltage[j]);
+                       }
+               }
+       }
+diff --git a/drivers/gpu/drm/amd/display/dc/core/dc.c b/drivers/gpu/drm/amd/display/dc/core/dc.c
+index b95a58aa82d91..47e7d11ca0c9c 100644
+--- a/drivers/gpu/drm/amd/display/dc/core/dc.c
++++ b/drivers/gpu/drm/amd/display/dc/core/dc.c
+@@ -907,15 +907,11 @@ static void program_timing_sync(
+               /* set first pipe with plane as master */
+               for (j = 0; j < group_size; j++) {
+-                      struct pipe_ctx *temp;
+-
+                       if (pipe_set[j]->plane_state) {
+                               if (j == 0)
+                                       break;
+-                              temp = pipe_set[0];
+-                              pipe_set[0] = pipe_set[j];
+-                              pipe_set[j] = temp;
++                              swap(pipe_set[0], pipe_set[j]);
+                               break;
+                       }
+               }
+-- 
+2.25.1
+
diff --git a/queue-5.4/drm-dp_mst-increase-act-retry-timeout-to-3s.patch b/queue-5.4/drm-dp_mst-increase-act-retry-timeout-to-3s.patch
new file mode 100644 (file)
index 0000000..932877e
--- /dev/null
@@ -0,0 +1,135 @@
+From be511d36675228e370367b836e1aa3755e6fbc4f Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Fri, 3 Apr 2020 15:47:15 -0400
+Subject: drm/dp_mst: Increase ACT retry timeout to 3s
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+From: Lyude Paul <lyude@redhat.com>
+
+[ Upstream commit 873a95e0d59ac06901ae261dda0b7165ffd002b8 ]
+
+Currently we only poll for an ACT up to 30 times, with a busy-wait delay
+of 100µs between each attempt - giving us a timeout of 2900µs. While
+this might seem sensible, it would appear that in certain scenarios it
+can take dramatically longer then that for us to receive an ACT. On one
+of the EVGA MST hubs that I have available, I observed said hub
+sometimes taking longer then a second before signalling the ACT. These
+delays mostly seem to occur when previous sideband messages we've sent
+are NAKd by the hub, however it wouldn't be particularly surprising if
+it's possible to reproduce times like this simply by introducing branch
+devices with large LCTs since payload allocations have to take effect on
+every downstream device up to the payload's target.
+
+So, instead of just retrying 30 times we poll for the ACT for up to 3ms,
+and additionally use usleep_range() to avoid a very long and rude
+busy-wait. Note that the previous retry count of 30 appears to have been
+arbitrarily chosen, as I can't find any mention of a recommended timeout
+or retry count for ACTs in the DisplayPort 2.0 specification. This also
+goes for the range we were previously using for udelay(), although I
+suspect that was just copied from the recommended delay for link
+training on SST devices.
+
+Changes since v1:
+* Use readx_poll_timeout() instead of open-coding timeout loop - Sean
+  Paul
+Changes since v2:
+* Increase poll interval to 200us - Sean Paul
+* Print status in hex when we timeout waiting for ACT - Sean Paul
+
+Signed-off-by: Lyude Paul <lyude@redhat.com>
+Fixes: ad7f8a1f9ced ("drm/helper: add Displayport multi-stream helper (v0.6)")
+Cc: Sean Paul <sean@poorly.run>
+Cc: <stable@vger.kernel.org> # v3.17+
+Reviewed-by: Sean Paul <sean@poorly.run>
+Link: https://patchwork.freedesktop.org/patch/msgid/20200406221253.1307209-4-lyude@redhat.com
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ drivers/gpu/drm/drm_dp_mst_topology.c | 54 ++++++++++++++++-----------
+ 1 file changed, 32 insertions(+), 22 deletions(-)
+
+diff --git a/drivers/gpu/drm/drm_dp_mst_topology.c b/drivers/gpu/drm/drm_dp_mst_topology.c
+index 313ca06a4fcb4..006d6087700fb 100644
+--- a/drivers/gpu/drm/drm_dp_mst_topology.c
++++ b/drivers/gpu/drm/drm_dp_mst_topology.c
+@@ -27,6 +27,7 @@
+ #include <linux/kernel.h>
+ #include <linux/sched.h>
+ #include <linux/seq_file.h>
++#include <linux/iopoll.h>
+ #include <drm/drm_atomic.h>
+ #include <drm/drm_atomic_helper.h>
+@@ -3498,6 +3499,17 @@ static int drm_dp_dpcd_write_payload(struct drm_dp_mst_topology_mgr *mgr,
+       return ret;
+ }
++static int do_get_act_status(struct drm_dp_aux *aux)
++{
++      int ret;
++      u8 status;
++
++      ret = drm_dp_dpcd_readb(aux, DP_PAYLOAD_TABLE_UPDATE_STATUS, &status);
++      if (ret < 0)
++              return ret;
++
++      return status;
++}
+ /**
+  * drm_dp_check_act_status() - Check ACT handled status.
+@@ -3507,30 +3519,28 @@ static int drm_dp_dpcd_write_payload(struct drm_dp_mst_topology_mgr *mgr,
+  */
+ int drm_dp_check_act_status(struct drm_dp_mst_topology_mgr *mgr)
+ {
+-      int count = 0, ret;
+-      u8 status;
+-
+-      do {
+-              ret = drm_dp_dpcd_readb(mgr->aux,
+-                                      DP_PAYLOAD_TABLE_UPDATE_STATUS,
+-                                      &status);
+-              if (ret < 0) {
+-                      DRM_DEBUG_KMS("failed to read payload table status %d\n",
+-                                    ret);
+-                      return ret;
+-              }
+-
+-              if (status & DP_PAYLOAD_ACT_HANDLED)
+-                      break;
+-              count++;
+-              udelay(100);
+-      } while (count < 30);
+-
+-      if (!(status & DP_PAYLOAD_ACT_HANDLED)) {
+-              DRM_DEBUG_KMS("failed to get ACT bit %d after %d retries\n",
+-                            status, count);
++      /*
++       * There doesn't seem to be any recommended retry count or timeout in
++       * the MST specification. Since some hubs have been observed to take
++       * over 1 second to update their payload allocations under certain
++       * conditions, we use a rather large timeout value.
++       */
++      const int timeout_ms = 3000;
++      int ret, status;
++
++      ret = readx_poll_timeout(do_get_act_status, mgr->aux, status,
++                               status & DP_PAYLOAD_ACT_HANDLED || status < 0,
++                               200, timeout_ms * USEC_PER_MSEC);
++      if (ret < 0 && status >= 0) {
++              DRM_DEBUG_KMS("Failed to get ACT after %dms, last status: %02x\n",
++                            timeout_ms, status);
+               return -EINVAL;
++      } else if (status < 0) {
++              DRM_DEBUG_KMS("Failed to read payload table status: %d\n",
++                            status);
++              return status;
+       }
++
+       return 0;
+ }
+ EXPORT_SYMBOL(drm_dp_check_act_status);
+-- 
+2.25.1
+
diff --git a/queue-5.4/ext4-avoid-race-conditions-when-remounting-with-opti.patch b/queue-5.4/ext4-avoid-race-conditions-when-remounting-with-opti.patch
new file mode 100644 (file)
index 0000000..0ac7335
--- /dev/null
@@ -0,0 +1,75 @@
+From 35b608b566f5fc7716ceb2e8dd6103c49a1272c8 Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Wed, 10 Jun 2020 11:16:37 -0400
+Subject: ext4: avoid race conditions when remounting with options that change
+ dax
+
+From: Theodore Ts'o <tytso@mit.edu>
+
+[ Upstream commit 829b37b8cddb1db75c1b7905505b90e593b15db1 ]
+
+Trying to change dax mount options when remounting could allow mount
+options to be enabled for a small amount of time, and then the mount
+option change would be reverted.
+
+In the case of "mount -o remount,dax", this can cause a race where
+files would temporarily treated as DAX --- and then not.
+
+Cc: stable@kernel.org
+Reported-by: syzbot+bca9799bf129256190da@syzkaller.appspotmail.com
+Signed-off-by: Theodore Ts'o <tytso@mit.edu>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ fs/ext4/super.c | 22 ++++++++++------------
+ 1 file changed, 10 insertions(+), 12 deletions(-)
+
+diff --git a/fs/ext4/super.c b/fs/ext4/super.c
+index 830160ad07a63..f7c20bb20da37 100644
+--- a/fs/ext4/super.c
++++ b/fs/ext4/super.c
+@@ -2034,6 +2034,16 @@ static int handle_mount_opt(struct super_block *sb, char *opt, int token,
+ #endif
+       } else if (token == Opt_dax) {
+ #ifdef CONFIG_FS_DAX
++              if (is_remount && test_opt(sb, DAX)) {
++                      ext4_msg(sb, KERN_ERR, "can't mount with "
++                              "both data=journal and dax");
++                      return -1;
++              }
++              if (is_remount && !(sbi->s_mount_opt & EXT4_MOUNT_DAX)) {
++                      ext4_msg(sb, KERN_ERR, "can't change "
++                                      "dax mount option while remounting");
++                      return -1;
++              }
+               ext4_msg(sb, KERN_WARNING,
+               "DAX enabled. Warning: EXPERIMENTAL, use at your own risk");
+               sbi->s_mount_opt |= m->mount_opt;
+@@ -5367,12 +5377,6 @@ static int ext4_remount(struct super_block *sb, int *flags, char *data)
+                       err = -EINVAL;
+                       goto restore_opts;
+               }
+-              if (test_opt(sb, DAX)) {
+-                      ext4_msg(sb, KERN_ERR, "can't mount with "
+-                               "both data=journal and dax");
+-                      err = -EINVAL;
+-                      goto restore_opts;
+-              }
+       } else if (test_opt(sb, DATA_FLAGS) == EXT4_MOUNT_ORDERED_DATA) {
+               if (test_opt(sb, JOURNAL_ASYNC_COMMIT)) {
+                       ext4_msg(sb, KERN_ERR, "can't mount with "
+@@ -5388,12 +5392,6 @@ static int ext4_remount(struct super_block *sb, int *flags, char *data)
+               goto restore_opts;
+       }
+-      if ((sbi->s_mount_opt ^ old_opts.s_mount_opt) & EXT4_MOUNT_DAX) {
+-              ext4_msg(sb, KERN_WARNING, "warning: refusing change of "
+-                      "dax flag with busy inodes while remounting");
+-              sbi->s_mount_opt ^= EXT4_MOUNT_DAX;
+-      }
+-
+       if (sbi->s_mount_flags & EXT4_MF_FS_ABORTED)
+               ext4_abort(sb, "Abort forced by user");
+-- 
+2.25.1
+
diff --git a/queue-5.4/jbd2-clean-__jbd2_journal_abort_hard-and-__journal_a.patch b/queue-5.4/jbd2-clean-__jbd2_journal_abort_hard-and-__journal_a.patch
new file mode 100644 (file)
index 0000000..ad086d7
--- /dev/null
@@ -0,0 +1,173 @@
+From 31d103da0690f60fab0d34e51501d34c0c2486fe Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Wed, 4 Dec 2019 20:46:14 +0800
+Subject: jbd2: clean __jbd2_journal_abort_hard() and __journal_abort_soft()
+
+From: zhangyi (F) <yi.zhang@huawei.com>
+
+[ Upstream commit 7f6225e446cc8dfa4c3c7959a4de3dd03ec277bf ]
+
+__jbd2_journal_abort_hard() is no longer used, so now we can merge
+__jbd2_journal_abort_hard() and __journal_abort_soft() these two
+functions into jbd2_journal_abort() and remove them.
+
+Signed-off-by: zhangyi (F) <yi.zhang@huawei.com>
+Reviewed-by: Jan Kara <jack@suse.cz>
+Link: https://lore.kernel.org/r/20191204124614.45424-5-yi.zhang@huawei.com
+Signed-off-by: Theodore Ts'o <tytso@mit.edu>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ fs/jbd2/journal.c    | 103 ++++++++++++++++++-------------------------
+ include/linux/jbd2.h |   1 -
+ 2 files changed, 42 insertions(+), 62 deletions(-)
+
+diff --git a/fs/jbd2/journal.c b/fs/jbd2/journal.c
+index c1ce2805c5639..fa58835668a62 100644
+--- a/fs/jbd2/journal.c
++++ b/fs/jbd2/journal.c
+@@ -96,7 +96,6 @@ EXPORT_SYMBOL(jbd2_journal_release_jbd_inode);
+ EXPORT_SYMBOL(jbd2_journal_begin_ordered_truncate);
+ EXPORT_SYMBOL(jbd2_inode_cache);
+-static void __journal_abort_soft (journal_t *journal, int errno);
+ static int jbd2_journal_create_slab(size_t slab_size);
+ #ifdef CONFIG_JBD2_DEBUG
+@@ -805,7 +804,7 @@ int jbd2_journal_bmap(journal_t *journal, unsigned long blocknr,
+                                       "at offset %lu on %s\n",
+                              __func__, blocknr, journal->j_devname);
+                       err = -EIO;
+-                      __journal_abort_soft(journal, err);
++                      jbd2_journal_abort(journal, err);
+               }
+       } else {
+               *retp = blocknr; /* +journal->j_blk_offset */
+@@ -2070,64 +2069,6 @@ int jbd2_journal_wipe(journal_t *journal, int write)
+       return err;
+ }
+-/*
+- * Journal abort has very specific semantics, which we describe
+- * for journal abort.
+- *
+- * Two internal functions, which provide abort to the jbd layer
+- * itself are here.
+- */
+-
+-/*
+- * Quick version for internal journal use (doesn't lock the journal).
+- * Aborts hard --- we mark the abort as occurred, but do _nothing_ else,
+- * and don't attempt to make any other journal updates.
+- */
+-void __jbd2_journal_abort_hard(journal_t *journal)
+-{
+-      transaction_t *transaction;
+-
+-      if (journal->j_flags & JBD2_ABORT)
+-              return;
+-
+-      printk(KERN_ERR "Aborting journal on device %s.\n",
+-             journal->j_devname);
+-
+-      write_lock(&journal->j_state_lock);
+-      journal->j_flags |= JBD2_ABORT;
+-      transaction = journal->j_running_transaction;
+-      if (transaction)
+-              __jbd2_log_start_commit(journal, transaction->t_tid);
+-      write_unlock(&journal->j_state_lock);
+-}
+-
+-/* Soft abort: record the abort error status in the journal superblock,
+- * but don't do any other IO. */
+-static void __journal_abort_soft (journal_t *journal, int errno)
+-{
+-      int old_errno;
+-
+-      write_lock(&journal->j_state_lock);
+-      old_errno = journal->j_errno;
+-      if (!journal->j_errno || errno == -ESHUTDOWN)
+-              journal->j_errno = errno;
+-
+-      if (journal->j_flags & JBD2_ABORT) {
+-              write_unlock(&journal->j_state_lock);
+-              if (old_errno != -ESHUTDOWN && errno == -ESHUTDOWN)
+-                      jbd2_journal_update_sb_errno(journal);
+-              return;
+-      }
+-      write_unlock(&journal->j_state_lock);
+-
+-      __jbd2_journal_abort_hard(journal);
+-
+-      jbd2_journal_update_sb_errno(journal);
+-      write_lock(&journal->j_state_lock);
+-      journal->j_flags |= JBD2_REC_ERR;
+-      write_unlock(&journal->j_state_lock);
+-}
+-
+ /**
+  * void jbd2_journal_abort () - Shutdown the journal immediately.
+  * @journal: the journal to shutdown.
+@@ -2171,7 +2112,47 @@ static void __journal_abort_soft (journal_t *journal, int errno)
+ void jbd2_journal_abort(journal_t *journal, int errno)
+ {
+-      __journal_abort_soft(journal, errno);
++      transaction_t *transaction;
++
++      /*
++       * ESHUTDOWN always takes precedence because a file system check
++       * caused by any other journal abort error is not required after
++       * a shutdown triggered.
++       */
++      write_lock(&journal->j_state_lock);
++      if (journal->j_flags & JBD2_ABORT) {
++              int old_errno = journal->j_errno;
++
++              write_unlock(&journal->j_state_lock);
++              if (old_errno != -ESHUTDOWN && errno == -ESHUTDOWN) {
++                      journal->j_errno = errno;
++                      jbd2_journal_update_sb_errno(journal);
++              }
++              return;
++      }
++
++      /*
++       * Mark the abort as occurred and start current running transaction
++       * to release all journaled buffer.
++       */
++      pr_err("Aborting journal on device %s.\n", journal->j_devname);
++
++      journal->j_flags |= JBD2_ABORT;
++      journal->j_errno = errno;
++      transaction = journal->j_running_transaction;
++      if (transaction)
++              __jbd2_log_start_commit(journal, transaction->t_tid);
++      write_unlock(&journal->j_state_lock);
++
++      /*
++       * Record errno to the journal super block, so that fsck and jbd2
++       * layer could realise that a filesystem check is needed.
++       */
++      jbd2_journal_update_sb_errno(journal);
++
++      write_lock(&journal->j_state_lock);
++      journal->j_flags |= JBD2_REC_ERR;
++      write_unlock(&journal->j_state_lock);
+ }
+ /**
+diff --git a/include/linux/jbd2.h b/include/linux/jbd2.h
+index 10e6049c0ba91..b0e97e5de8ca4 100644
+--- a/include/linux/jbd2.h
++++ b/include/linux/jbd2.h
+@@ -1402,7 +1402,6 @@ extern int          jbd2_journal_skip_recovery   (journal_t *);
+ extern void      jbd2_journal_update_sb_errno(journal_t *);
+ extern int       jbd2_journal_update_sb_log_tail      (journal_t *, tid_t,
+                               unsigned long, int);
+-extern void      __jbd2_journal_abort_hard    (journal_t *);
+ extern void      jbd2_journal_abort      (journal_t *, int);
+ extern int       jbd2_journal_errno      (journal_t *);
+ extern void      jbd2_journal_ack_err    (journal_t *);
+-- 
+2.25.1
+
index c91b9f74dfdd7aeaaaf8d4ca0035daeb0e738fa2..73e9f53f90fb0c03aab0e0e1f9ada4fdb88f6de4 100644 (file)
@@ -286,3 +286,8 @@ drm-dp_mst-reformat-drm_dp_check_act_status-a-bit.patch
 drm-qxl-use-correct-notify-port-address-when-creating-cursor-ring.patch
 drm-amdgpu-replace-invalid-device-id-with-a-valid-device-id.patch
 selinux-fix-double-free.patch
+jbd2-clean-__jbd2_journal_abort_hard-and-__journal_a.patch
+ext4-avoid-race-conditions-when-remounting-with-opti.patch
+drm-dp_mst-increase-act-retry-timeout-to-3s.patch
+drm-amd-display-use-swap-where-appropriate.patch
+x86-boot-compressed-relax-sed-symbol-type-regex-for-.patch
diff --git a/queue-5.4/x86-boot-compressed-relax-sed-symbol-type-regex-for-.patch b/queue-5.4/x86-boot-compressed-relax-sed-symbol-type-regex-for-.patch
new file mode 100644 (file)
index 0000000..33e4547
--- /dev/null
@@ -0,0 +1,69 @@
+From 4ac3ba05ee619a3801835aebdc057f2c6141f6e8 Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Mon, 22 Jun 2020 19:56:39 +0000
+Subject: x86/boot/compressed: Relax sed symbol type regex for LLVM ld.lld
+
+From: Ard Biesheuvel <ardb@kernel.org>
+
+commit bc310baf2ba381c648983c7f4748327f17324562 upstream.
+
+The final build stage of the x86 kernel captures some symbol
+addresses from the decompressor binary and copies them into zoffset.h.
+It uses sed with a regular expression that matches the address, symbol
+type and symbol name, and mangles the captured addresses and the names
+of symbols of interest into #define directives that are added to
+zoffset.h
+
+The symbol type is indicated by a single letter, which we match
+strictly: only letters in the set 'ABCDGRSTVW' are matched, even
+though the actual symbol type is relevant and therefore ignored.
+
+Commit bc7c9d620 ("efi/libstub/x86: Force 'hidden' visibility for
+extern declarations") made a change to the way external symbol
+references are classified, resulting in 'startup_32' now being
+emitted as a hidden symbol. This prevents the use of GOT entries to
+refer to this symbol via its absolute address, which recent toolchains
+(including Clang based ones) already avoid by default, making this
+change a no-op in the majority of cases.
+
+However, as it turns out, the LLVM linker classifies such hidden
+symbols as symbols with static linkage in fully linked ELF binaries,
+causing tools such as NM to output a lowercase 't' rather than an upper
+case 'T' for the type of such symbols. Since our sed expression only
+matches upper case letters for the symbol type, the line describing
+startup_32 is disregarded, resulting in a build error like the following
+
+  arch/x86/boot/header.S:568:18: error: symbol 'ZO_startup_32' can not be
+                                        undefined in a subtraction expression
+  init_size: .long (0x00000000008fd000 - ZO_startup_32 +
+                    (((0x0000000001f6361c + ((0x0000000001f6361c >> 8) + 65536)
+                     - 0x00000000008c32e5) + 4095) & ~4095)) # kernel initialization size
+
+Given that we are only interested in the value of the symbol, let's match
+any character in the set 'a-zA-Z' instead.
+
+Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
+Signed-off-by: Ingo Molnar <mingo@kernel.org>
+Tested-by: Nathan Chancellor <natechancellor@gmail.com>
+Signed-off-by: Nathan Chancellor <natechancellor@gmail.com>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ arch/x86/boot/Makefile | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/arch/x86/boot/Makefile b/arch/x86/boot/Makefile
+index e2839b5c246c2..6539c50fb9aae 100644
+--- a/arch/x86/boot/Makefile
++++ b/arch/x86/boot/Makefile
+@@ -87,7 +87,7 @@ $(obj)/vmlinux.bin: $(obj)/compressed/vmlinux FORCE
+ SETUP_OBJS = $(addprefix $(obj)/,$(setup-y))
+-sed-zoffset := -e 's/^\([0-9a-fA-F]*\) [ABCDGRSTVW] \(startup_32\|startup_64\|efi32_stub_entry\|efi64_stub_entry\|efi_pe_entry\|input_data\|_end\|_ehead\|_text\|z_.*\)$$/\#define ZO_\2 0x\1/p'
++sed-zoffset := -e 's/^\([0-9a-fA-F]*\) [a-zA-Z] \(startup_32\|startup_64\|efi32_stub_entry\|efi64_stub_entry\|efi_pe_entry\|input_data\|_end\|_ehead\|_text\|z_.*\)$$/\#define ZO_\2 0x\1/p'
+ quiet_cmd_zoffset = ZOFFSET $@
+       cmd_zoffset = $(NM) $< | sed -n $(sed-zoffset) > $@
+-- 
+2.25.1
+