]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
4.4-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 30 May 2018 08:39:40 +0000 (10:39 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 30 May 2018 08:39:40 +0000 (10:39 +0200)
added patches:
arm64-lse-add-early-clobbers-to-some-input-output-asm-operands.patch
powerpc-64s-clear-pcr-on-boot.patch
usb-serial-cp210x-use-tcflag_t-to-fix-incompatible-pointer-type.patch

queue-4.4/arm64-lse-add-early-clobbers-to-some-input-output-asm-operands.patch [new file with mode: 0644]
queue-4.4/powerpc-64s-clear-pcr-on-boot.patch [new file with mode: 0644]
queue-4.4/series
queue-4.4/usb-serial-cp210x-use-tcflag_t-to-fix-incompatible-pointer-type.patch [new file with mode: 0644]

diff --git a/queue-4.4/arm64-lse-add-early-clobbers-to-some-input-output-asm-operands.patch b/queue-4.4/arm64-lse-add-early-clobbers-to-some-input-output-asm-operands.patch
new file mode 100644 (file)
index 0000000..5d13c29
--- /dev/null
@@ -0,0 +1,104 @@
+From 32c3fa7cdf0c4a3eb8405fc3e13398de019e828b Mon Sep 17 00:00:00 2001
+From: Will Deacon <will.deacon@arm.com>
+Date: Mon, 21 May 2018 17:44:57 +0100
+Subject: arm64: lse: Add early clobbers to some input/output asm operands
+
+From: Will Deacon <will.deacon@arm.com>
+
+commit 32c3fa7cdf0c4a3eb8405fc3e13398de019e828b upstream.
+
+For LSE atomics that read and write a register operand, we need to
+ensure that these operands are annotated as "early clobber" if the
+register is written before all of the input operands have been consumed.
+Failure to do so can result in the compiler allocating the same register
+to both operands, leading to splats such as:
+
+ Unable to handle kernel paging request at virtual address 11111122222221
+ [...]
+ x1 : 1111111122222222 x0 : 1111111122222221
+ Process swapper/0 (pid: 1, stack limit = 0x000000008209f908)
+ Call trace:
+  test_atomic64+0x1360/0x155c
+
+where x0 has been allocated as both the value to be stored and also the
+atomic_t pointer.
+
+This patch adds the missing clobbers.
+
+Cc: <stable@vger.kernel.org>
+Cc: Dave Martin <dave.martin@arm.com>
+Cc: Robin Murphy <robin.murphy@arm.com>
+Reported-by: Mark Salter <msalter@redhat.com>
+Signed-off-by: Will Deacon <will.deacon@arm.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+
+---
+ arch/arm64/include/asm/atomic_lse.h |   14 +++++++-------
+ 1 file changed, 7 insertions(+), 7 deletions(-)
+
+--- a/arch/arm64/include/asm/atomic_lse.h
++++ b/arch/arm64/include/asm/atomic_lse.h
+@@ -114,7 +114,7 @@ static inline void atomic_and(int i, ato
+       /* LSE atomics */
+       "       mvn     %w[i], %w[i]\n"
+       "       stclr   %w[i], %[v]")
+-      : [i] "+r" (w0), [v] "+Q" (v->counter)
++      : [i] "+&r" (w0), [v] "+Q" (v->counter)
+       : "r" (x1)
+       : "x30");
+ }
+@@ -131,7 +131,7 @@ static inline void atomic_sub(int i, ato
+       /* LSE atomics */
+       "       neg     %w[i], %w[i]\n"
+       "       stadd   %w[i], %[v]")
+-      : [i] "+r" (w0), [v] "+Q" (v->counter)
++      : [i] "+&r" (w0), [v] "+Q" (v->counter)
+       : "r" (x1)
+       : "x30");
+ }
+@@ -151,7 +151,7 @@ static inline int atomic_sub_return##nam
+       "       neg     %w[i], %w[i]\n"                                 \
+       "       ldadd" #mb "    %w[i], w30, %[v]\n"                     \
+       "       add     %w[i], %w[i], w30")                             \
+-      : [i] "+r" (w0), [v] "+Q" (v->counter)                          \
++      : [i] "+&r" (w0), [v] "+Q" (v->counter)                         \
+       : "r" (x1)                                                      \
+       : "x30" , ##cl);                                                \
+                                                                       \
+@@ -255,7 +255,7 @@ static inline void atomic64_and(long i,
+       /* LSE atomics */
+       "       mvn     %[i], %[i]\n"
+       "       stclr   %[i], %[v]")
+-      : [i] "+r" (x0), [v] "+Q" (v->counter)
++      : [i] "+&r" (x0), [v] "+Q" (v->counter)
+       : "r" (x1)
+       : "x30");
+ }
+@@ -272,7 +272,7 @@ static inline void atomic64_sub(long i,
+       /* LSE atomics */
+       "       neg     %[i], %[i]\n"
+       "       stadd   %[i], %[v]")
+-      : [i] "+r" (x0), [v] "+Q" (v->counter)
++      : [i] "+&r" (x0), [v] "+Q" (v->counter)
+       : "r" (x1)
+       : "x30");
+ }
+@@ -292,7 +292,7 @@ static inline long atomic64_sub_return##
+       "       neg     %[i], %[i]\n"                                   \
+       "       ldadd" #mb "    %[i], x30, %[v]\n"                      \
+       "       add     %[i], %[i], x30")                               \
+-      : [i] "+r" (x0), [v] "+Q" (v->counter)                          \
++      : [i] "+&r" (x0), [v] "+Q" (v->counter)                         \
+       : "r" (x1)                                                      \
+       : "x30" , ##cl);                                                \
+                                                                       \
+@@ -412,7 +412,7 @@ static inline long __cmpxchg_double##nam
+       "       eor     %[old1], %[old1], %[oldval1]\n"                 \
+       "       eor     %[old2], %[old2], %[oldval2]\n"                 \
+       "       orr     %[old1], %[old1], %[old2]")                     \
+-      : [old1] "+r" (x0), [old2] "+r" (x1),                           \
++      : [old1] "+&r" (x0), [old2] "+&r" (x1),                         \
+         [v] "+Q" (*(unsigned long *)ptr)                              \
+       : [new1] "r" (x2), [new2] "r" (x3), [ptr] "r" (x4),             \
+         [oldval1] "r" (oldval1), [oldval2] "r" (oldval2)              \
diff --git a/queue-4.4/powerpc-64s-clear-pcr-on-boot.patch b/queue-4.4/powerpc-64s-clear-pcr-on-boot.patch
new file mode 100644 (file)
index 0000000..52933a8
--- /dev/null
@@ -0,0 +1,61 @@
+From faf37c44a105f3608115785f17cbbf3500f8bc71 Mon Sep 17 00:00:00 2001
+From: Michael Neuling <mikey@neuling.org>
+Date: Fri, 18 May 2018 11:37:42 +1000
+Subject: powerpc/64s: Clear PCR on boot
+
+From: Michael Neuling <mikey@neuling.org>
+
+commit faf37c44a105f3608115785f17cbbf3500f8bc71 upstream.
+
+Clear the PCR (Processor Compatibility Register) on boot to ensure we
+are not running in a compatibility mode.
+
+We've seen this cause problems when a crash (and kdump) occurs while
+running compat mode guests. The kdump kernel then runs with the PCR
+set and causes problems. The symptom in the kdump kernel (also seen in
+petitboot after fast-reboot) is early userspace programs taking
+sigills on newer instructions (seen in libc).
+
+Signed-off-by: Michael Neuling <mikey@neuling.org>
+Cc: stable@vger.kernel.org
+Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ arch/powerpc/kernel/cpu_setup_power.S |    4 ++++
+ 1 file changed, 4 insertions(+)
+
+--- a/arch/powerpc/kernel/cpu_setup_power.S
++++ b/arch/powerpc/kernel/cpu_setup_power.S
+@@ -27,6 +27,7 @@ _GLOBAL(__setup_cpu_power7)
+       beqlr
+       li      r0,0
+       mtspr   SPRN_LPID,r0
++      mtspr   SPRN_PCR,r0
+       mfspr   r3,SPRN_LPCR
+       bl      __init_LPCR
+       bl      __init_tlb_power7
+@@ -40,6 +41,7 @@ _GLOBAL(__restore_cpu_power7)
+       beqlr
+       li      r0,0
+       mtspr   SPRN_LPID,r0
++      mtspr   SPRN_PCR,r0
+       mfspr   r3,SPRN_LPCR
+       bl      __init_LPCR
+       bl      __init_tlb_power7
+@@ -55,6 +57,7 @@ _GLOBAL(__setup_cpu_power8)
+       beqlr
+       li      r0,0
+       mtspr   SPRN_LPID,r0
++      mtspr   SPRN_PCR,r0
+       mfspr   r3,SPRN_LPCR
+       ori     r3, r3, LPCR_PECEDH
+       bl      __init_LPCR
+@@ -74,6 +77,7 @@ _GLOBAL(__restore_cpu_power8)
+       beqlr
+       li      r0,0
+       mtspr   SPRN_LPID,r0
++      mtspr   SPRN_PCR,r0
+       mfspr   r3,SPRN_LPCR
+       ori     r3, r3, LPCR_PECEDH
+       bl      __init_LPCR
index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..ca01d23541da87df6214ceab36fda5eb175edb1f 100644 (file)
@@ -0,0 +1,3 @@
+arm64-lse-add-early-clobbers-to-some-input-output-asm-operands.patch
+powerpc-64s-clear-pcr-on-boot.patch
+usb-serial-cp210x-use-tcflag_t-to-fix-incompatible-pointer-type.patch
diff --git a/queue-4.4/usb-serial-cp210x-use-tcflag_t-to-fix-incompatible-pointer-type.patch b/queue-4.4/usb-serial-cp210x-use-tcflag_t-to-fix-incompatible-pointer-type.patch
new file mode 100644 (file)
index 0000000..2c1e03d
--- /dev/null
@@ -0,0 +1,64 @@
+From 009615ab7fd4e43b82a38e4e6adc5e23c1ee567f Mon Sep 17 00:00:00 2001
+From: Geert Uytterhoeven <geert@linux-m68k.org>
+Date: Mon, 21 Nov 2016 13:19:31 +0100
+Subject: USB: serial: cp210x: use tcflag_t to fix incompatible pointer type
+
+From: Geert Uytterhoeven <geert@linux-m68k.org>
+
+commit 009615ab7fd4e43b82a38e4e6adc5e23c1ee567f upstream.
+
+On sparc32, tcflag_t is unsigned long, unlike all other architectures:
+
+    drivers/usb/serial/cp210x.c: In function 'cp210x_get_termios':
+    drivers/usb/serial/cp210x.c:717:3: warning: passing argument 2 of 'cp210x_get_termios_port' from incompatible pointer type
+       cp210x_get_termios_port(tty->driver_data,
+       ^
+    drivers/usb/serial/cp210x.c:35:13: note: expected 'unsigned int *' but argument is of type 'tcflag_t *'
+     static void cp210x_get_termios_port(struct usb_serial_port *port,
+                ^
+
+Consistently use tcflag_t to fix this.
+
+Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
+Signed-off-by: Johan Hovold <johan@kernel.org>
+Cc: Guenter Roeck <linux@roeck-us.net>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/usb/serial/cp210x.c |    9 +++++----
+ 1 file changed, 5 insertions(+), 4 deletions(-)
+
+--- a/drivers/usb/serial/cp210x.c
++++ b/drivers/usb/serial/cp210x.c
+@@ -33,7 +33,7 @@ static int cp210x_open(struct tty_struct
+ static void cp210x_close(struct usb_serial_port *);
+ static void cp210x_get_termios(struct tty_struct *, struct usb_serial_port *);
+ static void cp210x_get_termios_port(struct usb_serial_port *port,
+-      unsigned int *cflagp, unsigned int *baudp);
++      tcflag_t *cflagp, unsigned int *baudp);
+ static void cp210x_change_speed(struct tty_struct *, struct usb_serial_port *,
+                                                       struct ktermios *);
+ static void cp210x_set_termios(struct tty_struct *, struct usb_serial_port *,
+@@ -515,7 +515,7 @@ static void cp210x_get_termios(struct tt
+                       &tty->termios.c_cflag, &baud);
+               tty_encode_baud_rate(tty, baud, baud);
+       } else {
+-              unsigned int cflag;
++              tcflag_t cflag;
+               cflag = 0;
+               cp210x_get_termios_port(port, &cflag, &baud);
+       }
+@@ -526,10 +526,11 @@ static void cp210x_get_termios(struct tt
+  * This is the heart of cp210x_get_termios which always uses a &usb_serial_port.
+  */
+ static void cp210x_get_termios_port(struct usb_serial_port *port,
+-      unsigned int *cflagp, unsigned int *baudp)
++      tcflag_t *cflagp, unsigned int *baudp)
+ {
+       struct device *dev = &port->dev;
+-      unsigned int cflag, modem_ctl[4];
++      tcflag_t cflag;
++      unsigned int modem_ctl[4];
+       unsigned int baud;
+       unsigned int bits;