]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commit
arm64: lse: Add early clobbers to some input/output asm operands
authorWill Deacon <will.deacon@arm.com>
Mon, 21 May 2018 16:44:57 +0000 (17:44 +0100)
committerKleber Sacilotto de Souza <kleber.souza@canonical.com>
Mon, 27 Aug 2018 14:40:05 +0000 (16:40 +0200)
commitf01867b7a6afc1abf23171072fe85e4f6e288838
tree76fc334a2d2d45ce3dd494768036959788e51770
parent8df6fdbd920bafb25e37ed57c7b99f9dc268d8a5
arm64: lse: Add early clobbers to some input/output asm operands

BugLink: http://bugs.launchpad.net/bugs/1786352
commit 32c3fa7cdf0c4a3eb8405fc3e13398de019e828b upstream.

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: Mark Salter <msalter@redhat.com>
Signed-off-by: Will Deacon <will.deacon@arm.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Khalid Elmously <khalid.elmously@canonical.com>
arch/arm64/include/asm/atomic_lse.h