Files
linux/arch/parisc/kernel
John David Anglin 03d1bba87a parisc: Fix validity check of pointer size argument in new CAS implementation
commit 05f016d2ca upstream.

As noted by Christoph Biedl, passing a pointer size of 4 in the new CAS
implementation causes a kernel crash.  The attached patch corrects the
off by one error in the argument validity check.

In reviewing the code, I noticed that we only perform word operations
with the pointer size argument.  The subi instruction intentionally uses
a word condition on 64-bit kernels.  Nullification was used instead of a
cmpib instruction as the branch should never be taken.  The shlw
pseudo-operation generates a depw,z instruction and it clears the target
before doing a shift left word deposit.  Thus, we don't need to clip the
upper 32 bits of this argument on 64-bit kernels.

Tested with a gcc testsuite run with a 64-bit kernel.  The gcc atomic
code in libgcc is the only direct user of the new CAS implementation
that I am aware of.

Signed-off-by: John David Anglin <dave.anglin@bell.net>
Signed-off-by: Helge Deller <deller@gmx.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-11-30 08:39:08 +00:00
..
2013-11-07 22:27:20 +01:00
2016-04-14 17:47:19 +02:00
2016-04-14 17:47:19 +02:00
2005-04-16 15:20:36 -07:00
2016-11-25 12:31:59 +01:00
2013-05-05 00:10:41 -04:00
2015-12-21 10:16:18 +01:00
2016-10-11 20:52:47 +02:00
2016-06-04 22:05:07 +02:00