• John David Anglin's avatar
    parisc: Fix validity check of pointer size argument in new CAS implementation · c7311af0
    John David Anglin authored
    commit 05f016d2 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: default avatarJohn David Anglin <dave.anglin@bell.net>
    Signed-off-by: default avatarHelge Deller <deller@gmx.de>
    Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
    c7311af0
Name
Last commit
Last update
..
boot Loading commit data...
configs Loading commit data...
include Loading commit data...
kernel Loading commit data...
lib Loading commit data...
math-emu Loading commit data...
mm Loading commit data...
oprofile Loading commit data...
Kconfig Loading commit data...
Kconfig.debug Loading commit data...
Makefile Loading commit data...
defpalo.conf Loading commit data...
install.sh Loading commit data...
nm Loading commit data...