xen/arm: cmpxchg: Add missing memory barriers in __cmpxchg_mb_timeout()
authorJulien Grall <jgrall@amazon.com>
Wed, 29 Jul 2020 13:50:37 +0000 (14:50 +0100)
committerJulien Grall <jgrall@amazon.com>
Fri, 14 Aug 2020 19:21:23 +0000 (20:21 +0100)
commitd501ef90ae7f2a79130ea89acb3d6d1792972934
tree74b65a1f4779ad38aa591c7b3b60573cf8876fee
parent2404e59b1d934fedc3fd3bd92b3d5d2a981cd433
xen/arm: cmpxchg: Add missing memory barriers in __cmpxchg_mb_timeout()

The function __cmpxchg_mb_timeout() was intended to have the same
semantics as __cmpxchg_mb(). Unfortunately, the memory barriers were
not added when first implemented.

There is no known issue with the existing callers, but the barriers are
added given this is the expected semantics in Xen.

The issue was introduced by XSA-295.

Backport: 4.8+
Fixes: 86b0bc958373 ("xen/arm: cmpxchg: Provide a new helper that can timeout")
Signed-off-by: Julien Grall <jgrall@amazon.com>
Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
Reviewed-by: Bertrand Marquis <bertrand.marquis@arm.com>
xen/include/asm-arm/arm32/cmpxchg.h
xen/include/asm-arm/arm64/cmpxchg.h