Introduce the new --enable-tcg-ldst-excl configure option to enable the LL/SC operations only for those backends that support them.
Suggested-by: Jani Kokkonen <jani.kokko...@huawei.com> Suggested-by: Claudio Fontana <claudio.font...@huawei.com> Signed-off-by: Alvise Rigo <a.r...@virtualopensystems.com> --- configure | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/configure b/configure index 33b9455..c3ea3db 100755 --- a/configure +++ b/configure @@ -264,6 +264,7 @@ debug_tcg="no" debug="no" strip_opt="yes" tcg_interpreter="no" +tcg_use_ldst_excl="no" bigendian="no" mingw32="no" gcov="no" @@ -934,6 +935,10 @@ for opt do ;; --enable-tcg-interpreter) tcg_interpreter="yes" ;; + --disable-tcg-ldst-excl) tcg_use_ldst_excl="no" + ;; + --enable-tcg-ldst-excl) tcg_use_ldst_excl="yes" + ;; --disable-cap-ng) cap_ng="no" ;; --enable-cap-ng) cap_ng="yes" @@ -1392,6 +1397,18 @@ if test "$ARCH" = "unknown"; then fi fi +# Check if the slow-path for atomic instructions is supported by the +# TCG backend. +case $cpu in + i386|x86_64|arm|aarch64) + ;; + *) + if test "$tcg_use_ldst_excl" = "yes"; then + error_exit "Load and store exclusive not supported for $cpu hosts" + fi + ;; +esac + # Consult white-list to determine whether to enable werror # by default. Only enable by default for git builds z_version=`cut -f3 -d. $source_path/VERSION` @@ -4526,6 +4543,7 @@ echo "Install blobs $blobs" echo "KVM support $kvm" echo "RDMA support $rdma" echo "TCG interpreter $tcg_interpreter" +echo "use ld/st excl $tcg_use_ldst_excl" echo "fdt support $fdt" echo "preadv support $preadv" echo "fdatasync $fdatasync" @@ -4903,6 +4921,9 @@ fi if test "$tcg_interpreter" = "yes" ; then echo "CONFIG_TCG_INTERPRETER=y" >> $config_host_mak fi +if test "$tcg_use_ldst_excl" = "yes" ; then + echo "CONFIG_TCG_USE_LDST_EXCL=y" >> $config_host_mak +fi if test "$fdatasync" = "yes" ; then echo "CONFIG_FDATASYNC=y" >> $config_host_mak fi -- 2.5.0