xen: Introduce cmpxchg64() and guest_cmpxchg64()
authorJulien Grall <jgrall@amazon.com>
Fri, 11 Sep 2020 16:06:22 +0000 (17:06 +0100)
committerJulien Grall <jgrall@amazon.com>
Fri, 18 Sep 2020 16:33:01 +0000 (17:33 +0100)
commitc729d54331ffb05abe93ed2349377092f134fdbd
treed96a2a69bba3f67c04e64e9c05b89acc78f2049e
parent5a15c8a65f871d2d8bf4f0c01389f8fbb86455d3
xen: Introduce cmpxchg64() and guest_cmpxchg64()

The IOREQ code is using cmpxchg() with 64-bit value. At the moment, this
is x86 code, but there is plan to make it common.

To cater 32-bit arch, introduce two new helpers to deal with 64-bit
cmpxchg().

The Arm 32-bit implementation of cmpxchg64() is based on the __cmpxchg64
in Linux v5.8 (arch/arm/include/asm/cmpxchg.h).

Note that only guest_cmpxchg64() is introduced on x86 so far.

Signed-off-by: Julien Grall <jgrall@amazon.com>
Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
Acked-by: Jan Beulich <jbeulich@suse.com>
xen/include/asm-arm/arm32/cmpxchg.h
xen/include/asm-arm/arm64/cmpxchg.h
xen/include/asm-arm/guest_atomics.h
xen/include/asm-x86/guest_atomics.h