* FAILED: patch "[PATCH] parisc: Fix double-word compare and exchange in LWS code on" failed to apply to 3.18-stable tree
@ 2017-10-23 12:47 gregkh
2017-10-23 17:45 ` Helge Deller
0 siblings, 1 reply; 3+ messages in thread
From: gregkh @ 2017-10-23 12:47 UTC (permalink / raw)
To: dave.anglin, debian.axhn, deller; +Cc: stable
The patch below does not apply to the 3.18-stable tree.
If someone wants it applied there, or to any other stable or longterm
tree, then please email the backport, including the original git commit
id to <stable@vger.kernel.org>.
thanks,
greg k-h
------------------ original commit in Linus's tree ------------------
>From 374b3bf8e8b519f61eb9775888074c6e46b3bf0c Mon Sep 17 00:00:00 2001
From: John David Anglin <dave.anglin@bell.net>
Date: Sat, 30 Sep 2017 17:24:23 -0400
Subject: [PATCH] parisc: Fix double-word compare and exchange in LWS code on
32-bit kernels
As discussed on the debian-hppa list, double-wordcompare and exchange
operations fail on 32-bit kernels. Looking at the code, I realized that
the ",ma" completer does the wrong thing in the "ldw,ma 4(%r26), %r29"
instruction. This increments %r26 and causes the following store to
write to the wrong location.
Note by Helge Deller:
The patch applies cleanly to stable kernel series if this upstream
commit is merged in advance:
f4125cfdb300 ("parisc: Avoid trashing sr2 and sr3 in LWS code").
Signed-off-by: John David Anglin <dave.anglin@bell.net>
Tested-by: Christoph Biedl <debian.axhn@manchmal.in-ulm.de>
Fixes: 89206491201c ("parisc: Implement new LWS CAS supporting 64 bit operations.")
Cc: stable@vger.kernel.org # 3.13+
Signed-off-by: Helge Deller <deller@gmx.de>
diff --git a/arch/parisc/kernel/syscall.S b/arch/parisc/kernel/syscall.S
index 23de307c3052..41e60a9c7db2 100644
--- a/arch/parisc/kernel/syscall.S
+++ b/arch/parisc/kernel/syscall.S
@@ -742,7 +742,7 @@ lws_compare_and_swap_2:
10: ldd 0(%r25), %r25
11: ldd 0(%r24), %r24
#else
- /* Load new value into r22/r23 - high/low */
+ /* Load old value into r22/r23 - high/low */
10: ldw 0(%r25), %r22
11: ldw 4(%r25), %r23
/* Load new value into fr4 for atomic store later */
@@ -834,11 +834,11 @@ cas2_action:
copy %r0, %r28
#else
/* Compare first word */
-19: ldw,ma 0(%r26), %r29
+19: ldw 0(%r26), %r29
sub,= %r29, %r22, %r0
b,n cas2_end
/* Compare second word */
-20: ldw,ma 4(%r26), %r29
+20: ldw 4(%r26), %r29
sub,= %r29, %r23, %r0
b,n cas2_end
/* Perform the store */
^ permalink raw reply related [flat|nested] 3+ messages in thread* Re: FAILED: patch "[PATCH] parisc: Fix double-word compare and exchange in LWS code on" failed to apply to 3.18-stable tree
2017-10-23 12:47 FAILED: patch "[PATCH] parisc: Fix double-word compare and exchange in LWS code on" failed to apply to 3.18-stable tree gregkh
@ 2017-10-23 17:45 ` Helge Deller
2017-10-24 10:25 ` Greg KH
0 siblings, 1 reply; 3+ messages in thread
From: Helge Deller @ 2017-10-23 17:45 UTC (permalink / raw)
To: gregkh, dave.anglin, debian.axhn; +Cc: stable
Hi Greg,
On 23.10.2017 14:47, gregkh@linuxfoundation.org wrote:
> The patch below does not apply to the 3.18-stable tree.
> If someone wants it applied there, or to any other stable or longterm
> tree, then please email the backport, including the original git commit
> id to <stable@vger.kernel.org>.
Please pull in this trivial commit first:
f4125cfdb300 ("parisc: Avoid trashing sr2 and sr3 in LWS code").
Then this patch here applies cleanly.
Thanks,
Helge
>
> thanks,
>
> greg k-h
>
> ------------------ original commit in Linus's tree ------------------
>
> From 374b3bf8e8b519f61eb9775888074c6e46b3bf0c Mon Sep 17 00:00:00 2001
> From: John David Anglin <dave.anglin@bell.net>
> Date: Sat, 30 Sep 2017 17:24:23 -0400
> Subject: [PATCH] parisc: Fix double-word compare and exchange in LWS code on
> 32-bit kernels
>
> As discussed on the debian-hppa list, double-wordcompare and exchange
> operations fail on 32-bit kernels. Looking at the code, I realized that
> the ",ma" completer does the wrong thing in the "ldw,ma 4(%r26), %r29"
> instruction. This increments %r26 and causes the following store to
> write to the wrong location.
>
> Note by Helge Deller:
> The patch applies cleanly to stable kernel series if this upstream
> commit is merged in advance:
> f4125cfdb300 ("parisc: Avoid trashing sr2 and sr3 in LWS code").
>
> Signed-off-by: John David Anglin <dave.anglin@bell.net>
> Tested-by: Christoph Biedl <debian.axhn@manchmal.in-ulm.de>
> Fixes: 89206491201c ("parisc: Implement new LWS CAS supporting 64 bit operations.")
> Cc: stable@vger.kernel.org # 3.13+
> Signed-off-by: Helge Deller <deller@gmx.de>
>
> diff --git a/arch/parisc/kernel/syscall.S b/arch/parisc/kernel/syscall.S
> index 23de307c3052..41e60a9c7db2 100644
> --- a/arch/parisc/kernel/syscall.S
> +++ b/arch/parisc/kernel/syscall.S
> @@ -742,7 +742,7 @@ lws_compare_and_swap_2:
> 10: ldd 0(%r25), %r25
> 11: ldd 0(%r24), %r24
> #else
> - /* Load new value into r22/r23 - high/low */
> + /* Load old value into r22/r23 - high/low */
> 10: ldw 0(%r25), %r22
> 11: ldw 4(%r25), %r23
> /* Load new value into fr4 for atomic store later */
> @@ -834,11 +834,11 @@ cas2_action:
> copy %r0, %r28
> #else
> /* Compare first word */
> -19: ldw,ma 0(%r26), %r29
> +19: ldw 0(%r26), %r29
> sub,= %r29, %r22, %r0
> b,n cas2_end
> /* Compare second word */
> -20: ldw,ma 4(%r26), %r29
> +20: ldw 4(%r26), %r29
> sub,= %r29, %r23, %r0
> b,n cas2_end
> /* Perform the store */
>
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: FAILED: patch "[PATCH] parisc: Fix double-word compare and exchange in LWS code on" failed to apply to 3.18-stable tree
2017-10-23 17:45 ` Helge Deller
@ 2017-10-24 10:25 ` Greg KH
0 siblings, 0 replies; 3+ messages in thread
From: Greg KH @ 2017-10-24 10:25 UTC (permalink / raw)
To: Helge Deller; +Cc: dave.anglin, debian.axhn, stable
On Mon, Oct 23, 2017 at 07:45:58PM +0200, Helge Deller wrote:
> Hi Greg,
>
> On 23.10.2017 14:47, gregkh@linuxfoundation.org wrote:
> > The patch below does not apply to the 3.18-stable tree.
> > If someone wants it applied there, or to any other stable or longterm
> > tree, then please email the backport, including the original git commit
> > id to <stable@vger.kernel.org>.
>
> Please pull in this trivial commit first:
> f4125cfdb300 ("parisc: Avoid trashing sr2 and sr3 in LWS code").
>
> Then this patch here applies cleanly.
Ah, thanks, now done for 4.4 as well.
greg k-h
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2017-10-24 10:24 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-10-23 12:47 FAILED: patch "[PATCH] parisc: Fix double-word compare and exchange in LWS code on" failed to apply to 3.18-stable tree gregkh
2017-10-23 17:45 ` Helge Deller
2017-10-24 10:25 ` Greg KH
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).