• Will Deacon's avatar
    arm64: lse: Add early clobbers to some input/output asm operands · 32c3fa7c
    Will Deacon authored
    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: default avatarMark Salter <msalter@redhat.com>
    Signed-off-by: default avatarWill Deacon <will.deacon@arm.com>
    32c3fa7c
atomic_lse.h 14.8 KB