qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Philippe Mathieu-Daudé" <philmd@linaro.org>
To: Richard Henderson <richard.henderson@linaro.org>, qemu-devel@nongnu.org
Cc: Thomas Huth <thuth@redhat.com>
Subject: Re: [PATCH for-8.1] tcg: Use HAVE_CMPXCHG128 instead of CONFIG_CMPXCHG128
Date: Thu, 13 Jul 2023 23:36:13 +0200	[thread overview]
Message-ID: <c99ad0cb-a5b6-3a6b-a256-32aa9028eb2a@linaro.org> (raw)
In-Reply-To: <20230713202327.12662-1-richard.henderson@linaro.org>

Hi Richard,

On 13/7/23 22:23, Richard Henderson wrote:
> We adjust CONFIG_ATOMIC128 and CONFIG_CMPXCHG128 with
> CONFIG_ATOMIC128_OPT in atomic128.h.  It is difficult
> to tell when those changes have been applied with the
> ifdef we must use with CONFIG_CMPXCHG128.  So instead
> use HAVE_CMPXCHG128, which triggers -Werror-undef when
> the proper header has not been included.
> 
> Improves tcg_gen_atomic_cmpxchg_i128 for s390x host, which
> requires CONFIG_ATOMIC128_OPT.  Without this we fall back
> to EXCP_ATOMIC to single-step 128-bit atomics, which is
> slow enough to cause some tests to time out.
> 
> Reported-by: Thomas Huth <thuth@redhat.com>
> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
> ---
> 
> Thomas, this issue does not quite match the one you bisected, but
> other than the cmpxchg, I don't see any see any qemu_{ld,st}_i128
> being used in BootLinuxS390X.test_s390_ccw_virtio_tcg.
> 
> As far as I can see, this wasn't broken by the addition of
> CONFIG_ATOMIC128_OPT, rather that fix didn't go far enough.
> 
> Anyway, test_s390_ccw_virtio_tcg now passes in 159s on our host.

IIUC:

If we have CONFIG_ATOMIC128, we use qatomic_cmpxchg__nocheck;
else if we have CONFIG_CMPXCHG128 we use __sync_val_compare_and_swap_16;
in both cases we set HAVE_CMPXCHG128;
otherwise we can not use atomic128 cmpxchg().

(I'm trying to figure why we need both CONFIGs).


  reply	other threads:[~2023-07-13 21:37 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-07-13 20:23 [PATCH for-8.1] tcg: Use HAVE_CMPXCHG128 instead of CONFIG_CMPXCHG128 Richard Henderson
2023-07-13 21:36 ` Philippe Mathieu-Daudé [this message]
2023-07-14  6:18   ` Richard Henderson
2023-07-14  9:12 ` Thomas Huth

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=c99ad0cb-a5b6-3a6b-a256-32aa9028eb2a@linaro.org \
    --to=philmd@linaro.org \
    --cc=qemu-devel@nongnu.org \
    --cc=richard.henderson@linaro.org \
    --cc=thuth@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).