Home Home > GIT Browse
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOlaf Hering <ohering@suse.de>2019-10-02 08:01:43 +0200
committerOlaf Hering <ohering@suse.de>2019-10-02 08:01:43 +0200
commite201004f90e6bfdc8ffb2183a8f76a9b13f14542 (patch)
tree1e54273ac12a9dc802c3c22a8f2313db3ac5d186
parenta437c8df8c565d514b40b385282659ec3b733de5 (diff)
parent1f97825a05ecae43c436851f53e7a4eda9871469 (diff)
Merge remote-tracking branch 'kerncvs/SLE12-SP4' into SLE12-SP4-AZURE
-rw-r--r--blacklist.conf3
-rw-r--r--patches.suse/0001-b2c2-flexcop-usb-add-sanity-checking.patch33
-rw-r--r--patches.suse/0001-mmc-sdhci-msm-fix-mutex-while-in-spinlock.patch53
-rw-r--r--patches.suse/0001-mmc-sdhci-of-arasan-Do-now-show-error-message-in-cas.patch32
-rw-r--r--patches.suse/panic-avoid-deadlocks-in-re-entrant-console-drivers.patch3
-rw-r--r--patches.suse/printk-Do-not-lose-last-line-in-kmsg-buffer-dump.patch73
-rw-r--r--patches.suse/printk-fix-printk_time-race.patch261
-rw-r--r--patches.suse/printk-panic-Avoid-deadlock-in-printk-after-stopping-CPUs-by-NMI.patch84
-rw-r--r--patches.suse/suse-hv-PCI-hv-Detect-and-fix-Hyper-V-PCI-domain-number-coll.patch173
-rw-r--r--series.conf9
10 files changed, 721 insertions, 3 deletions
diff --git a/blacklist.conf b/blacklist.conf
index e3fc163691..5f12b1523d 100644
--- a/blacklist.conf
+++ b/blacklist.conf
@@ -594,6 +594,7 @@ a338f84dc196f44b63ba0863d2f34fd9b1613572 # printk: fixes 719f6a7040f1bdaf96fcc t
03fc7f9c99c1e7ae2925d459e8487f1a6f199f79 # printk: fixes 719f6a7040f1bdaf96fcc that is needed only when printing trace buffer when panicing in NMI (bsc#1112173)
c3fee60908db4a8594f2e4a2131998384b8fa006 # printk: cosmetic; anyway, it fixes a commit that we do not have in SLE15
b60706644282af04e4aa57da5af57470d453cd1f # vsprintf: cosmetic
+36594b317c656bec8f968db93701d2cb9bc9155c # vsprintf: depends on a huge clean up; it is just nice to have check
741a76b350897604c48fb12beff1c9b77724dc96 # kthread: fixes rather rare races in CPU hotplug; there are several followup fixes on top of it to get it actually right; does not worth the risk
4950276672fce5c241857540f8561c440663673d # kmemcheck removal; not for released products
d8be75663cec0069b85f80191abd2682ce4a512f # related to kmemcheck removal; not for released products
@@ -1377,3 +1378,5 @@ cae5ec342645746d617dd420d206e1588d47768a # comment fix
c03cd7738a83b13739f00546166969342c8ff014 # not applicable, bsc#1146664
6b115bf58e6f013ca75e7115aabcbd56c20ff31d # non-functional prereq for c03cd7738a83b13739f00546166969342c8ff014
b636fd38dc40113f853337a7d2a6885ad23b8811 # non-functional prereq for c03cd7738a83b13739f00546166969342c8ff014
+1b7aebf0487613033aff26420e32fa2076d52846 # doesn't trigger here
+3751e008da0df4384031bd66a516c0292f915605 # depends on patch that breaks kABI
diff --git a/patches.suse/0001-b2c2-flexcop-usb-add-sanity-checking.patch b/patches.suse/0001-b2c2-flexcop-usb-add-sanity-checking.patch
new file mode 100644
index 0000000000..39680b0f14
--- /dev/null
+++ b/patches.suse/0001-b2c2-flexcop-usb-add-sanity-checking.patch
@@ -0,0 +1,33 @@
+From 182cbde95325d129b20a8b07f46af07affd19bb1 Mon Sep 17 00:00:00 2001
+From: Oliver Neukum <oneukum@suse.com>
+Date: Mon, 29 Jul 2019 16:21:11 +0200
+Subject: [PATCH] b2c2-flexcop-usb: add sanity checking
+References: bsc#1146540 CVE-2019-15291
+Patch-mainline: submitted https://www.mail-archive.com/linux-media@vger.kernel.org/msg148850.html
+
+The driver needs an isochronous endpoint to be present. It will
+oops in its absence. Add checking for it.
+
+Reported-by: syzbot+d93dff37e6a89431c158@syzkaller.appspotmail.com
+Signed-off-by: Oliver Neukum <oneukum@suse.com>
+---
+ drivers/media/usb/b2c2/flexcop-usb.c | 3 +++
+ 1 file changed, 3 insertions(+)
+
+diff --git a/drivers/media/usb/b2c2/flexcop-usb.c b/drivers/media/usb/b2c2/flexcop-usb.c
+index 1826ff825c2e..1a801dc286f8 100644
+--- a/drivers/media/usb/b2c2/flexcop-usb.c
++++ b/drivers/media/usb/b2c2/flexcop-usb.c
+@@ -538,6 +538,9 @@ static int flexcop_usb_probe(struct usb_interface *intf,
+ struct flexcop_device *fc = NULL;
+ int ret;
+
++ if (intf->cur_altsetting->desc.bNumEndpoints < 1)
++ return -ENODEV;
++
+ if ((fc = flexcop_device_kmalloc(sizeof(struct flexcop_usb))) == NULL) {
+ err("out of memory\n");
+ return -ENOMEM;
+--
+2.16.4
+
diff --git a/patches.suse/0001-mmc-sdhci-msm-fix-mutex-while-in-spinlock.patch b/patches.suse/0001-mmc-sdhci-msm-fix-mutex-while-in-spinlock.patch
new file mode 100644
index 0000000000..b6b0fc416c
--- /dev/null
+++ b/patches.suse/0001-mmc-sdhci-msm-fix-mutex-while-in-spinlock.patch
@@ -0,0 +1,53 @@
+From 5e6b6651d22de109ebf48ca00d0373bc2c0cc080 Mon Sep 17 00:00:00 2001
+From: Jorge Ramirez-Ortiz <jorge.ramirez-ortiz@linaro.org>
+Date: Mon, 1 Jul 2019 17:01:25 +0200
+Subject: [PATCH] mmc: sdhci-msm: fix mutex while in spinlock
+Git-commit: 5e6b6651d22de109ebf48ca00d0373bc2c0cc080
+Patch-mainline: v5.3
+References: bsc#1142635
+
+mutexes can sleep and therefore should not be taken while holding a
+spinlock. move clk_get_rate (can sleep) outside the spinlock protected
+region.
+
+Fixes: 83736352e0ca ("mmc: sdhci-msm: Update DLL reset sequence")
+Cc: stable@vger.kernel.org
+Signed-off-by: Jorge Ramirez-Ortiz <jorge.ramirez-ortiz@linaro.org>
+Reviewed-by: Bjorn Andersson <bjorn.andersson@linaro.org>
+Reviewed-by: Vinod Koul <vkoul@kernel.org>
+Acked-by: Adrian Hunter <adrian.hunter@intel.com>
+Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
+Signed-off-by: Oliver Neukum <oneukum@suse.com>
+---
+ drivers/mmc/host/sdhci-msm.c | 9 ++++++---
+ 1 file changed, 6 insertions(+), 3 deletions(-)
+
+--- a/drivers/mmc/host/sdhci-msm.c
++++ b/drivers/mmc/host/sdhci-msm.c
+@@ -411,9 +411,12 @@ static int msm_init_cm_dll(struct sdhci_
+ struct sdhci_pltfm_host *pltfm_host = sdhci_priv(host);
+ struct sdhci_msm_host *msm_host = sdhci_pltfm_priv(pltfm_host);
+ int wait_cnt = 50;
+- unsigned long flags;
++ unsigned long flags, xo_clk = 0;
+ u32 config;
+
++ if (msm_host->use_14lpp_dll_reset && !IS_ERR_OR_NULL(msm_host->xo_clk))
++ xo_clk = clk_get_rate(msm_host->xo_clk);
++
+ spin_lock_irqsave(&host->lock, flags);
+
+ /*
+@@ -452,10 +455,10 @@ static int msm_init_cm_dll(struct sdhci_
+ config &= CORE_FLL_CYCLE_CNT;
+ if (config)
+ mclk_freq = DIV_ROUND_CLOSEST_ULL((host->clock * 8),
+- clk_get_rate(msm_host->xo_clk));
++ xo_clk);
+ else
+ mclk_freq = DIV_ROUND_CLOSEST_ULL((host->clock * 4),
+- clk_get_rate(msm_host->xo_clk));
++ xo_clk);
+
+ config = readl_relaxed(host->ioaddr + CORE_DLL_CONFIG_2);
+ config &= ~(0xFF << 10);
diff --git a/patches.suse/0001-mmc-sdhci-of-arasan-Do-now-show-error-message-in-cas.patch b/patches.suse/0001-mmc-sdhci-of-arasan-Do-now-show-error-message-in-cas.patch
new file mode 100644
index 0000000000..3bc1eb2689
--- /dev/null
+++ b/patches.suse/0001-mmc-sdhci-of-arasan-Do-now-show-error-message-in-cas.patch
@@ -0,0 +1,32 @@
+From 60208a267208c27fa3f23dfd36cbda180471fa98 Mon Sep 17 00:00:00 2001
+From: Michal Simek <michal.simek@xilinx.com>
+Date: Mon, 6 Aug 2018 10:43:10 +0200
+Subject: [PATCH] mmc: sdhci-of-arasan: Do now show error message in case of
+ deffered probe
+Git-commit: 60208a267208c27fa3f23dfd36cbda180471fa98
+Patch-mainline: v4.20
+References: bsc#1119086
+
+When mmc-pwrseq property is passed mmc_pwrseq_alloc() can return
+-EPROBE_DEFER because driver for power sequence provider is not probed
+yet. Do not show error message when this situation happens.
+
+Signed-off-by: Michal Simek <michal.simek@xilinx.com>
+Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
+Signed-off-by: Oliver Neukum <oneukum@suse.com>
+---
+ drivers/mmc/host/sdhci-of-arasan.c | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+--- a/drivers/mmc/host/sdhci-of-arasan.c
++++ b/drivers/mmc/host/sdhci-of-arasan.c
+@@ -638,7 +638,8 @@ static int sdhci_arasan_probe(struct pla
+
+ ret = mmc_of_parse(host->mmc);
+ if (ret) {
+- dev_err(&pdev->dev, "parsing dt failed (%u)\n", ret);
++ if (ret != -EPROBE_DEFER)
++ dev_err(&pdev->dev, "parsing dt failed (%u)\n", ret);
+ goto unreg_clk;
+ }
+
diff --git a/patches.suse/panic-avoid-deadlocks-in-re-entrant-console-drivers.patch b/patches.suse/panic-avoid-deadlocks-in-re-entrant-console-drivers.patch
index b1441c5b11..d625b3d66f 100644
--- a/patches.suse/panic-avoid-deadlocks-in-re-entrant-console-drivers.patch
+++ b/patches.suse/panic-avoid-deadlocks-in-re-entrant-console-drivers.patch
@@ -3,8 +3,7 @@ From: Sergey Senozhatsky <sergey.senozhatsky.work@gmail.com>
Date: Thu, 25 Oct 2018 19:10:36 +0900
Subject: [PATCH] panic: avoid deadlocks in re-entrant console drivers
Git-commit: c7c3f05e341a9a2bd1a92993d4f996cfd6e7348e
-Patch-mainline: Queued in subsystem maintainer tree
-Git-repo: git://git.kernel.org/pub/scm/linux/kernel/git/pmladek/printk.git
+Patch-mainline: v5.0-rc1
References: bsc#1088386
From printk()/serial console point of view panic() is special, because
diff --git a/patches.suse/printk-Do-not-lose-last-line-in-kmsg-buffer-dump.patch b/patches.suse/printk-Do-not-lose-last-line-in-kmsg-buffer-dump.patch
new file mode 100644
index 0000000000..398a5c48e9
--- /dev/null
+++ b/patches.suse/printk-Do-not-lose-last-line-in-kmsg-buffer-dump.patch
@@ -0,0 +1,73 @@
+From c9dccacfccc72c32692eedff4a27a4b0833a2afd Mon Sep 17 00:00:00 2001
+From: Vincent Whitchurch <vincent.whitchurch@axis.com>
+Date: Thu, 11 Jul 2019 16:29:37 +0200
+Subject: [PATCH] printk: Do not lose last line in kmsg buffer dump
+Git-commit: c9dccacfccc72c32692eedff4a27a4b0833a2afd
+Patch-mainline: v5.4-rc1
+References: bsc#1152460
+
+kmsg_dump_get_buffer() is supposed to select all the youngest log
+messages which fit into the provided buffer. It determines the correct
+start index by using msg_print_text() with a NULL buffer to calculate
+the size of each entry. However, when performing the actual writes,
+msg_print_text() only writes the entry to the buffer if the written len
+is lesser than the size of the buffer. So if the lengths of the
+selected youngest log messages happen to precisely fill up the provided
+buffer, the last log message is not included.
+
+We don't want to modify msg_print_text() to fill up the buffer and start
+returning a length which is equal to the size of the buffer, since
+callers of its other users, such as kmsg_dump_get_line(), depend upon
+the current behaviour.
+
+Instead, fix kmsg_dump_get_buffer() to compensate for this.
+
+For example, with the following two final prints:
+
+[ 6.427502] AAAAAAAAAAAAA
+[ 6.427769] BBBBBBBB12345
+
+A dump of a 64-byte buffer filled by kmsg_dump_get_buffer(), before this
+Patch:
+
+ 00000000: 3c 30 3e 5b 20 20 20 20 36 2e 35 32 32 31 39 37 <0>[ 6.522197
+ 00000010: 5d 20 41 41 41 41 41 41 41 41 41 41 41 41 41 0a ] AAAAAAAAAAAAA.
+ 00000020: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 00000030: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+
+After this patch:
+
+ 00000000: 3c 30 3e 5b 20 20 20 20 36 2e 34 35 36 36 37 38 <0>[ 6.456678
+ 00000010: 5d 20 42 42 42 42 42 42 42 42 31 32 33 34 35 0a ] BBBBBBBB12345.
+ 00000020: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 00000030: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+
+Link: http://lkml.kernel.org/r/20190711142937.4083-1-vincent.whitchurch@axis.com
+Fixes: e2ae715d66bf4bec ("kmsg - kmsg_dump() use iterator to receive log buffer content")
+To: rostedt@goodmis.org
+Cc: linux-kernel@vger.kernel.org
+Cc: <stable@vger.kernel.org> # v3.5+
+Signed-off-by: Vincent Whitchurch <vincent.whitchurch@axis.com>
+Reviewed-by: Sergey Senozhatsky <sergey.senozhatsky@gmail.com>
+Signed-off-by: Petr Mladek <pmladek@suse.com>
+
+---
+ kernel/printk/printk.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/kernel/printk/printk.c b/kernel/printk/printk.c
+index 1888f6a3b694..424abf802f02 100644
+--- a/kernel/printk/printk.c
++++ b/kernel/printk/printk.c
+@@ -3274,7 +3274,7 @@ bool kmsg_dump_get_buffer(struct kmsg_dumper *dumper, bool syslog,
+ /* move first record forward until length fits into the buffer */
+ seq = dumper->cur_seq;
+ idx = dumper->cur_idx;
+- while (l > size && seq < dumper->next_seq) {
++ while (l >= size && seq < dumper->next_seq) {
+ struct printk_log *msg = log_from_idx(idx);
+
+ l -= msg_print_text(msg, true, time, NULL, 0);
+--
+2.16.4
+
diff --git a/patches.suse/printk-fix-printk_time-race.patch b/patches.suse/printk-fix-printk_time-race.patch
new file mode 100644
index 0000000000..cf5501d527
--- /dev/null
+++ b/patches.suse/printk-fix-printk_time-race.patch
@@ -0,0 +1,261 @@
+From e80c1a9d5f514ce5134c6c4263a11607341466c9 Mon Sep 17 00:00:00 2001
+From: Tetsuo Handa <penguin-kernel@i-love.sakura.ne.jp>
+Date: Tue, 4 Dec 2018 19:00:01 +0900
+Subject: [PATCH] printk: fix printk_time race.
+Git-commit: e80c1a9d5f514ce5134c6c4263a11607341466c9
+Patch-mainline: v5.0-rc1
+References: bsc#1152466
+
+Since printk_time can be toggled via /sys/module/printk/parameters/time ,
+it is not safe to assume that output length does not change across
+multiple msg_print_text() calls. If we hit this race, we can observe
+failures such as SYSLOG_ACTION_READ_ALL writes more bytes than userspace
+has supplied, SYSLOG_ACTION_SIZE_UNREAD returns -EFAULT when succeeded,
+SYSLOG_ACTION_READ reads garbage memory or even triggers an kernel oops
+at _copy_to_user() due to integer overflow.
+
+To close this race, get a snapshot value of printk_time and pass it to
+SYSLOG_ACTION_READ, SYSLOG_ACTION_READ_ALL, SYSLOG_ACTION_SIZE_UNREAD and
+kmsg_dump_get_buffer().
+
+Link: http://lkml.kernel.org/r/555af37c-b9e0-f940-cb73-a78eba2d4944@i-love.sakura.ne.jp
+To: Sergey Senozhatsky <sergey.senozhatsky.work@gmail.com>
+Cc: linux-kernel@vger.kernel.org
+Signed-off-by: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
+Reviewed-by: Sergey Senozhatsky <sergey.senozhatsky@gmail.com>
+Signed-off-by: Petr Mladek <pmladek@suse.com>
+
+---
+ kernel/printk/printk.c | 70 ++++++++++++++++++++++++++++---------------------
+ 1 file changed, 40 insertions(+), 30 deletions(-)
+
+--- a/kernel/printk/printk.c
++++ b/kernel/printk/printk.c
+@@ -406,6 +406,7 @@ DECLARE_WAIT_QUEUE_HEAD(log_wait);
+ static u64 syslog_seq;
+ static u32 syslog_idx;
+ static size_t syslog_partial;
++static bool syslog_time;
+
+ /* index and sequence number of the first record stored in the buffer */
+ static u64 log_first_seq;
+@@ -1212,12 +1213,7 @@ module_param_named(time, printk_time, bo
+
+ static size_t print_time(u64 ts, char *buf)
+ {
+- unsigned long rem_nsec;
+-
+- if (!printk_time)
+- return 0;
+-
+- rem_nsec = do_div(ts, 1000000000);
++ unsigned long rem_nsec = do_div(ts, 1000000000);
+
+ if (!buf)
+ return snprintf(NULL, 0, "[%5lu.000000] ", (unsigned long)ts);
+@@ -1226,7 +1222,8 @@ static size_t print_time(u64 ts, char *b
+ (unsigned long)ts, rem_nsec / 1000);
+ }
+
+-static size_t print_prefix(const struct printk_log *msg, bool syslog, char *buf)
++static size_t print_prefix(const struct printk_log *msg, bool syslog,
++ bool time, char *buf)
+ {
+ size_t len = 0;
+ unsigned int prefix = (msg->facility << 3) | msg->level;
+@@ -1245,11 +1242,13 @@ static size_t print_prefix(const struct
+ }
+ }
+
+- len += print_time(msg->ts_nsec, buf ? buf + len : NULL);
++ if (time)
++ len += print_time(msg->ts_nsec, buf ? buf + len : NULL);
+ return len;
+ }
+
+-static size_t msg_print_text(const struct printk_log *msg, bool syslog, char *buf, size_t size)
++static size_t msg_print_text(const struct printk_log *msg, bool syslog,
++ bool time, char *buf, size_t size)
+ {
+ const char *text = log_text(msg);
+ size_t text_size = msg->text_len;
+@@ -1268,17 +1267,17 @@ static size_t msg_print_text(const struc
+ }
+
+ if (buf) {
+- if (print_prefix(msg, syslog, NULL) +
++ if (print_prefix(msg, syslog, time, NULL) +
+ text_len + 1 >= size - len)
+ break;
+
+- len += print_prefix(msg, syslog, buf + len);
++ len += print_prefix(msg, syslog, time, buf + len);
+ memcpy(buf + len, text, text_len);
+ len += text_len;
+ buf[len++] = '\n';
+ } else {
+ /* SYSLOG_ACTION_* buffer size only calculation */
+- len += print_prefix(msg, syslog, NULL);
++ len += print_prefix(msg, syslog, time, NULL);
+ len += text_len;
+ len++;
+ }
+@@ -1315,9 +1314,17 @@ static int syslog_print(char __user *buf
+ break;
+ }
+
++ /*
++ * To keep reading/counting partial line consistent,
++ * use printk_time value as of the beginning of a line.
++ */
++ if (!syslog_partial)
++ syslog_time = printk_time;
++
+ skip = syslog_partial;
+ msg = log_from_idx(syslog_idx);
+- n = msg_print_text(msg, true, text, LOG_LINE_MAX + PREFIX_MAX);
++ n = msg_print_text(msg, true, syslog_time, text,
++ LOG_LINE_MAX + PREFIX_MAX);
+ if (n - syslog_partial <= size) {
+ /* message fits into buffer, move forward */
+ syslog_idx = log_next(syslog_idx);
+@@ -1353,12 +1360,14 @@ static int syslog_print(char __user *buf
+ static int syslog_print_all(char __user *buf, int size, bool clear)
+ {
+ char *text;
++ bool time;
+ int len = 0;
+
+ text = kmalloc(LOG_LINE_MAX + PREFIX_MAX, GFP_KERNEL);
+ if (!text)
+ return -ENOMEM;
+
++ time = printk_time;
+ logbuf_lock_irq();
+ if (buf) {
+ u64 next_seq;
+@@ -1374,7 +1383,7 @@ static int syslog_print_all(char __user
+ while (seq < log_next_seq) {
+ struct printk_log *msg = log_from_idx(idx);
+
+- len += msg_print_text(msg, true, NULL, 0);
++ len += msg_print_text(msg, true, time, NULL, 0);
+ idx = log_next(idx);
+ seq++;
+ }
+@@ -1385,7 +1394,7 @@ static int syslog_print_all(char __user
+ while (len > size && seq < log_next_seq) {
+ struct printk_log *msg = log_from_idx(idx);
+
+- len -= msg_print_text(msg, true, NULL, 0);
++ len -= msg_print_text(msg, true, time, NULL, 0);
+ idx = log_next(idx);
+ seq++;
+ }
+@@ -1396,14 +1405,9 @@ static int syslog_print_all(char __user
+ len = 0;
+ while (len >= 0 && seq < next_seq) {
+ struct printk_log *msg = log_from_idx(idx);
+- int textlen;
++ int textlen = msg_print_text(msg, true, time, text,
++ LOG_LINE_MAX + PREFIX_MAX);
+
+- textlen = msg_print_text(msg, true, text,
+- LOG_LINE_MAX + PREFIX_MAX);
+- if (textlen < 0) {
+- len = textlen;
+- break;
+- }
+ idx = log_next(idx);
+ seq++;
+
+@@ -1530,12 +1534,15 @@ int do_syslog(int type, char __user *buf
+ } else {
+ u64 seq = syslog_seq;
+ u32 idx = syslog_idx;
++ bool time = syslog_partial ? syslog_time : printk_time;
+
+ error = 0;
+ while (seq < log_next_seq) {
+ struct printk_log *msg = log_from_idx(idx);
+
+- error += msg_print_text(msg, true, NULL, 0);
++ error += msg_print_text(msg, true, time, NULL,
++ 0);
++ time = printk_time;
+ idx = log_next(idx);
+ seq++;
+ }
+@@ -2001,6 +2008,7 @@ EXPORT_SYMBOL(printk);
+
+ #define LOG_LINE_MAX 0
+ #define PREFIX_MAX 0
++#define printk_time false
+
+ static u64 syslog_seq;
+ static u32 syslog_idx;
+@@ -2023,8 +2031,8 @@ static void console_lock_spinning_enable
+ static int console_lock_spinning_disable_and_check(void) { return 0; }
+ static void call_console_drivers(const char *ext_text, size_t ext_len,
+ const char *text, size_t len) {}
+-static size_t msg_print_text(const struct printk_log *msg,
+- bool syslog, char *buf, size_t size) { return 0; }
++static size_t msg_print_text(const struct printk_log *msg, bool syslog,
++ bool time, char *buf, size_t size) { return 0; }
+ static bool suppress_message_printing(int level) { return false; }
+
+ #endif /* CONFIG_PRINTK */
+@@ -2368,7 +2376,8 @@ skip:
+ goto skip;
+ }
+
+- len += msg_print_text(msg, false, text + len, sizeof(text) - len);
++ len += msg_print_text(msg, false,
++ printk_time, text + len, sizeof(text) - len);
+ if (nr_ext_console_drivers) {
+ ext_len = msg_print_ext_header(ext_text,
+ sizeof(ext_text),
+@@ -3077,7 +3086,7 @@ bool kmsg_dump_get_line_nolock(struct km
+ goto out;
+
+ msg = log_from_idx(dumper->cur_idx);
+- l = msg_print_text(msg, syslog, line, size);
++ l = msg_print_text(msg, syslog, printk_time, line, size);
+
+ dumper->cur_idx = log_next(dumper->cur_idx);
+ dumper->cur_seq++;
+@@ -3148,6 +3157,7 @@ bool kmsg_dump_get_buffer(struct kmsg_du
+ u32 next_idx;
+ size_t l = 0;
+ bool ret = false;
++ bool time = printk_time;
+
+ if (!dumper->active)
+ goto out;
+@@ -3171,7 +3181,7 @@ bool kmsg_dump_get_buffer(struct kmsg_du
+ while (seq < dumper->next_seq) {
+ struct printk_log *msg = log_from_idx(idx);
+
+- l += msg_print_text(msg, true, NULL, 0);
++ l += msg_print_text(msg, true, time, NULL, 0);
+ idx = log_next(idx);
+ seq++;
+ }
+@@ -3182,7 +3192,7 @@ bool kmsg_dump_get_buffer(struct kmsg_du
+ while (l > size && seq < dumper->next_seq) {
+ struct printk_log *msg = log_from_idx(idx);
+
+- l -= msg_print_text(msg, true, NULL, 0);
++ l -= msg_print_text(msg, true, time, NULL, 0);
+ idx = log_next(idx);
+ seq++;
+ }
+@@ -3195,7 +3205,7 @@ bool kmsg_dump_get_buffer(struct kmsg_du
+ while (seq < dumper->next_seq) {
+ struct printk_log *msg = log_from_idx(idx);
+
+- l += msg_print_text(msg, syslog, buf + l, size - l);
++ l += msg_print_text(msg, syslog, time, buf + l, size - l);
+ idx = log_next(idx);
+ seq++;
+ }
diff --git a/patches.suse/printk-panic-Avoid-deadlock-in-printk-after-stopping-CPUs-by-NMI.patch b/patches.suse/printk-panic-Avoid-deadlock-in-printk-after-stopping-CPUs-by-NMI.patch
new file mode 100644
index 0000000000..3d9069e928
--- /dev/null
+++ b/patches.suse/printk-panic-Avoid-deadlock-in-printk-after-stopping-CPUs-by-NMI.patch
@@ -0,0 +1,84 @@
+From: Petr Mladek <pmladek@suse.com>
+Subject: [PATCH] printk/panic: Avoid deadlock in printk() after stopping CPUs by NMI
+Patch-mainline: No, major printk rework is being discussed to avoid these duct taping patches
+References: bsc#1148712
+
+crash_smp_send_stop() is called before switching to crash kernel image
+or before calling crash kernel notifiers. It uses NMI to stop all
+CPUs where they are.
+
+Any stopped CPU could be inside printk() code and cause deadlock
+in later printk() calls. Try to avoid them by resetting all printk()
+locks.
+
+This approach will not help in all situations. The logbuf lock might
+be in some inconsistent state. More complicated consoles might
+break on some internal locks.
+
+The most safe approach is to avoid printk() in crash dump code
+and notifiers.
+
+Signed-off-by: Petr Mladek <pmladek@suse.com>
+---
+ arch/x86/kernel/crash.c | 1 +
+ include/linux/printk.h | 6 ++++++
+ kernel/printk/printk.c | 16 ++++++++++++++++
+ 3 files changed, 23 insertions(+)
+
+--- a/include/linux/printk.h
++++ b/include/linux/printk.h
+@@ -196,6 +196,8 @@ devkmsg_sysctl_set_loglvl(struct ctl_tab
+
+ extern void wake_up_klogd(void);
+
++void printk_bust_locks(void);
++
+ char *log_buf_addr_get(void);
+ u32 log_buf_len_get(void);
+ void log_buf_vmcoreinfo_setup(void);
+@@ -236,6 +238,10 @@ static inline void wake_up_klogd(void)
+ {
+ }
+
++static void printk_bust_locks(void)
++{
++}
++
+ static inline char *log_buf_addr_get(void)
+ {
+ return NULL;
+--- a/kernel/printk/printk.c
++++ b/kernel/printk/printk.c
+@@ -1572,6 +1572,22 @@ static struct task_struct *console_owner
+ static bool console_waiter;
+
+ /**
++ * printk_bust_locks - forcibly reset all printk-related locks
++ *
++ * This function can be used after CPUs were stopped using NMI.
++ * It is especially useful in kdump_nmi_shootdown_cpus() that
++ * uses NMI but it does not modify the online CPU mask.
++ */
++void printk_bust_locks(void)
++{
++ debug_locks_off();
++ raw_spin_lock_init(&logbuf_lock);
++ raw_spin_lock_init(&console_owner_lock);
++ console_owner = NULL;
++ console_waiter = false;
++}
++
++/**
+ * console_lock_spinning_enable - mark beginning of code where another
+ * thread might safely busy wait
+ *
+--- a/arch/x86/kernel/crash.c
++++ b/arch/x86/kernel/crash.c
+@@ -137,6 +137,7 @@ static void kdump_nmi_callback(int cpu,
+ void kdump_nmi_shootdown_cpus(void)
+ {
+ nmi_shootdown_cpus(kdump_nmi_callback);
++ printk_bust_locks();
+
+ disable_local_APIC();
+ }
diff --git a/patches.suse/suse-hv-PCI-hv-Detect-and-fix-Hyper-V-PCI-domain-number-coll.patch b/patches.suse/suse-hv-PCI-hv-Detect-and-fix-Hyper-V-PCI-domain-number-coll.patch
new file mode 100644
index 0000000000..ce1ff8c61e
--- /dev/null
+++ b/patches.suse/suse-hv-PCI-hv-Detect-and-fix-Hyper-V-PCI-domain-number-coll.patch
@@ -0,0 +1,173 @@
+From: Haiyang Zhang <haiyangz@microsoft.com>
+Date: Thu, 15 Aug 2019 17:01:37 +0000
+Patch-mainline: v5.4-rc1
+Subject: PCI: hv: Detect and fix Hyper-V PCI domain number collision
+Git-commit: be700103efd1050808db1cf00e52c3a2837bf802
+References: bsc#1150423
+
+Currently in Azure cloud, for passthrough devices, the host sets the
+device instance ID's bytes 8 - 15 to a value derived from the host HWID,
+which is the same on all devices in a VM. So, the device instance ID's
+bytes 8 and 9 provided by the host are no longer unique. This affects
+all Azure hosts since July 2018, and can cause device passthrough to VMs
+to fail because the bytes 8 and 9 are used as PCI domain number.
+Collision of domain numbers will cause the second device with the same
+domain number fail to load.
+
+In the cases of collision, we will detect and find another number that is
+not in use.
+
+Suggested-by: Michael Kelley <mikelley@microsoft.com>
+Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
+Signed-off-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
+Acked-by: Sasha Levin <sashal@kernel.org>
+Acked-by: Olaf Hering <ohering@suse.de>
+---
+ drivers/pci/host/pci-hyperv.c | 92 +++++++++++++++++++++++++++++++------
+ 1 file changed, 79 insertions(+), 13 deletions(-)
+
+diff --git a/drivers/pci/host/pci-hyperv.c b/drivers/pci/host/pci-hyperv.c
+--- a/drivers/pci/host/pci-hyperv.c
++++ b/drivers/pci/host/pci-hyperv.c
+@@ -2510,6 +2510,48 @@ static void put_hvpcibus(struct hv_pcibus_device *hbus)
+ complete(&hbus->remove_event);
+ }
+
++#define HVPCI_DOM_MAP_SIZE (64 * 1024)
++static DECLARE_BITMAP(hvpci_dom_map, HVPCI_DOM_MAP_SIZE);
++
++/*
++ * PCI domain number 0 is used by emulated devices on Gen1 VMs, so define 0
++ * as invalid for passthrough PCI devices of this driver.
++ */
++#define HVPCI_DOM_INVALID 0
++
++/**
++ * hv_get_dom_num() - Get a valid PCI domain number
++ * Check if the PCI domain number is in use, and return another number if
++ * it is in use.
++ *
++ * @dom: Requested domain number
++ *
++ * return: domain number on success, HVPCI_DOM_INVALID on failure
++ */
++static u16 hv_get_dom_num(u16 dom)
++{
++ unsigned int i;
++
++ if (test_and_set_bit(dom, hvpci_dom_map) == 0)
++ return dom;
++
++ for_each_clear_bit(i, hvpci_dom_map, HVPCI_DOM_MAP_SIZE) {
++ if (test_and_set_bit(i, hvpci_dom_map) == 0)
++ return i;
++ }
++
++ return HVPCI_DOM_INVALID;
++}
++
++/**
++ * hv_put_dom_num() - Mark the PCI domain number as free
++ * @dom: Domain number to be freed
++ */
++static void hv_put_dom_num(u16 dom)
++{
++ clear_bit(dom, hvpci_dom_map);
++}
++
+ /**
+ * hv_pci_probe() - New VMBus channel probe, for a root PCI bus
+ * @hdev: VMBus's tracking struct for this root PCI bus
+@@ -2521,6 +2563,7 @@ static int hv_pci_probe(struct hv_device *hdev,
+ const struct hv_vmbus_device_id *dev_id)
+ {
+ struct hv_pcibus_device *hbus;
++ u16 dom_req, dom;
+ int ret;
+
+ /*
+@@ -2535,19 +2578,34 @@ static int hv_pci_probe(struct hv_device *hdev,
+ hbus->state = hv_pcibus_init;
+
+ /*
+- * The PCI bus "domain" is what is called "segment" in ACPI and
+- * other specs. Pull it from the instance ID, to get something
+- * unique. Bytes 8 and 9 are what is used in Windows guests, so
+- * do the same thing for consistency. Note that, since this code
+- * only runs in a Hyper-V VM, Hyper-V can (and does) guarantee
+- * that (1) the only domain in use for something that looks like
+- * a physical PCI bus (which is actually emulated by the
+- * hypervisor) is domain 0 and (2) there will be no overlap
+- * between domains derived from these instance IDs in the same
+- * VM.
++ * The PCI bus "domain" is what is called "segment" in ACPI and other
++ * specs. Pull it from the instance ID, to get something usually
++ * unique. In rare cases of collision, we will find out another number
++ * not in use.
++ *
++ * Note that, since this code only runs in a Hyper-V VM, Hyper-V
++ * together with this guest driver can guarantee that (1) The only
++ * domain used by Gen1 VMs for something that looks like a physical
++ * PCI bus (which is actually emulated by the hypervisor) is domain 0.
++ * (2) There will be no overlap between domains (after fixing possible
++ * collisions) in the same VM.
+ */
+- hbus->sysdata.domain = hdev->dev_instance.b[9] |
+- hdev->dev_instance.b[8] << 8;
++ dom_req = hdev->dev_instance.b[8] << 8 | hdev->dev_instance.b[9];
++ dom = hv_get_dom_num(dom_req);
++
++ if (dom == HVPCI_DOM_INVALID) {
++ dev_err(&hdev->device,
++ "Unable to use dom# 0x%hx or other numbers", dom_req);
++ ret = -EINVAL;
++ goto free_bus;
++ }
++
++ if (dom != dom_req)
++ dev_info(&hdev->device,
++ "PCI dom# 0x%hx has collision, using 0x%hx",
++ dom_req, dom);
++
++ hbus->sysdata.domain = dom;
+
+ hbus->hdev = hdev;
+ refcount_set(&hbus->remove_lock, 1);
+@@ -2562,7 +2620,7 @@ static int hv_pci_probe(struct hv_device *hdev,
+ hbus->sysdata.domain);
+ if (!hbus->wq) {
+ ret = -ENOMEM;
+- goto free_bus;
++ goto free_dom;
+ }
+
+ ret = vmbus_open(hdev->channel, pci_ring_size, pci_ring_size, NULL, 0,
+@@ -2639,6 +2697,8 @@ close:
+ vmbus_close(hdev->channel);
+ destroy_wq:
+ destroy_workqueue(hbus->wq);
++free_dom:
++ hv_put_dom_num(hbus->sysdata.domain);
+ free_bus:
+ free_page((unsigned long)hbus);
+ return ret;
+@@ -2720,6 +2780,9 @@ static int hv_pci_remove(struct hv_device *hdev)
+ put_hvpcibus(hbus);
+ wait_for_completion(&hbus->remove_event);
+ destroy_workqueue(hbus->wq);
++
++ hv_put_dom_num(hbus->sysdata.domain);
++
+ free_page((unsigned long)hbus);
+ return 0;
+ }
+@@ -2747,6 +2810,9 @@ static void __exit exit_hv_pci_drv(void)
+
+ static int __init init_hv_pci_drv(void)
+ {
++ /* Set the invalid domain number's bit, so it will not be used */
++ set_bit(HVPCI_DOM_INVALID, hvpci_dom_map);
++
+ return vmbus_driver_register(&hv_pci_drv);
+ }
+
diff --git a/series.conf b/series.conf
index 7288e79d96..f83aed14e3 100644
--- a/series.conf
+++ b/series.conf
@@ -20252,6 +20252,7 @@
patches.suse/spi-bcm-qspi-switch-back-to-reading-flash-using-smal.patch
patches.suse/spi-sh-msiof-fix-deferred-probing.patch
patches.suse/spi-bcm63xx-hsspi-keep-pll-clk-enabled.patch
+ patches.suse/0001-mmc-sdhci-of-arasan-Do-now-show-error-message-in-cas.patch
patches.suse/mmc-sdhci-pci-o2micro-Add-quirk-for-O2-Micro-dev-0x8.patch
patches.suse/pinctrl-ssbi-gpio-Fix-pm8xxx_pin_config_get-to-be-co.patch
patches.suse/pinctrl-spmi-mpp-Fix-pmic_mpp_config_get-to-be-compl.patch
@@ -21540,6 +21541,8 @@
patches.suse/powerpc-Fix-HMIs-on-big-endian-with-CONFIG_RELOCATAB.patch
patches.suse/pstore-ram-Do-not-treat-empty-buffers-as-valid.patch
patches.suse/pstore-ram-Avoid-NULL-deref-in-ftrace-merging-failur.patch
+ patches.suse/panic-avoid-deadlocks-in-re-entrant-console-drivers.patch
+ patches.suse/printk-fix-printk_time-race.patch
patches.suse/selinux-always-allow-mounting-submounts.patch
patches.suse/e1000e-allow-non-monotonic-SYSTIM-readings.patch
patches.suse/net-bcmgenet-return-correct-value-ret-from-bcmgenet_.patch
@@ -24447,6 +24450,7 @@
patches.suse/USB-serial-ftdi_sio-add-ID-for-isodebug-v1.patch
patches.suse/usb-Handle-USB3-remote-wakeup-for-LPM-enabled-device.patch
patches.suse/memstick-Fix-error-cleanup-path-of-memstick_init.patch
+ patches.suse/0001-mmc-sdhci-msm-fix-mutex-while-in-spinlock.patch
patches.suse/nilfs2-do-not-use-unexported-cpu_to_le32-le32_to_cpu.patch
patches.suse/0001-ocfs2-add-last-unlock-times-in-locking_state.patch
patches.suse/0002-ocfs2-add-locking-filter-debugfs-file.patch
@@ -24942,6 +24946,7 @@
patches.suse/clk-sunxi-ng-v3s-add-the-missing-PLL_DDR1.patch
patches.suse/clk-sunxi-ng-v3s-add-missing-clock-slices-for-MMC2-m.patch
patches.suse/clk-at91-fix-update-bit-maps-on-CFG_MOR-write.patch
+ patches.suse/printk-Do-not-lose-last-line-in-kmsg-buffer-dump.patch
patches.suse/scsi-qla2xxx-Remove-unnecessary-null-check.patch
patches.suse/scsi-qla2xxx-Replace-vmalloc-memset-with-vzalloc.patch
patches.suse/scsi-cxlflash-Mark-expected-switch-fall-throughs.patch
@@ -25047,6 +25052,7 @@
patches.suse/power-supply-Init-device-wakeup-after-device_add.patch
patches.suse/power-reset-gpio-restart-Fix-typo-when-gpio-reset-is.patch
patches.suse/livepatch-nullify-obj-mod-in-klp_module_coming-s-error-path.patch
+ patches.suse/suse-hv-PCI-hv-Detect-and-fix-Hyper-V-PCI-domain-number-coll.patch
# jejb/scsi for-next
patches.suse/scsi-qla2xxx-Fix-Nport-ID-display-value.patch
@@ -25104,6 +25110,7 @@
patches.suse/0001-ACPICA-Increase-total-number-of-possible-Owner-IDs.patch
patches.suse/cifs-handle-netapp-error-codes.patch
patches.suse/scsi-qla2xxx-Remove-WARN_ON_ONCE-in-qla2x00_status_c.patch
+ patches.suse/0001-b2c2-flexcop-usb-add-sanity-checking.patch
########################################################
# end of sorted patches
@@ -25545,7 +25552,7 @@
# printk
########################################################
patches.suse/printk-console-Correctly-mark-console-that-is-used-w.patch
- patches.suse/panic-avoid-deadlocks-in-re-entrant-console-drivers.patch
+ patches.suse/printk-panic-Avoid-deadlock-in-printk-after-stopping-CPUs-by-NMI.patch
########################################################
# Other driver fixes