• Heiko Carstens's avatar
    s390/cmpxchg: fix 1 and 2 byte memory accesses · bf3db853
    Heiko Carstens authored
    When accessing a 1 or 2 byte memory operand we cannot use the
    passed address since the compare and swap instruction only works
    for 4 byte aligned memory operands.
    Hence we calculate an aligned address so that compare and swap works
    correctly. However we don't pass the calculated address to the inline
    assembly. This results in incorrect memory accesses and in a
    specification exception if used on non 4 byte aligned memory operands.
    
    Since this didn't happen until now, there don't seem to be
    too many users of cmpxchg on unaligned addresses.
    Signed-off-by: default avatarHeiko Carstens <heiko.carstens@de.ibm.com>
    Signed-off-by: default avatarMartin Schwidefsky <schwidefsky@de.ibm.com>
    bf3db853
cmpxchg.h 5.19 KB