From: "Alex Bennée" <alex.bennee@linaro.org>
To: "Philippe Mathieu-Daudé" <philmd@linaro.org>
Cc: qemu-devel@nongnu.org,
Marcel Apfelbaum <marcel.apfelbaum@gmail.com>,
qemu-riscv@nongnu.org, Bin Meng <bin.meng@windriver.com>,
Daniel Henrique Barboza <dbarboza@ventanamicro.com>,
Richard Henderson <richard.henderson@linaro.org>,
Yanan Wang <wangyanan55@huawei.com>,
Alistair Francis <alistair.francis@wdc.com>,
Paolo Bonzini <pbonzini@redhat.com>,
Weiwei Li <liweiwei@iscas.ac.cn>,
Palmer Dabbelt <palmer@dabbelt.com>,
Eduardo Habkost <eduardo@habkost.net>,
Liu Zhiwei <zhiwei_liu@linux.alibaba.com>
Subject: Re: [PATCH 1/2] target/riscv: Check for CF_PARALLEL instead of qemu_tcg_mttcg_enabled
Date: Thu, 29 Jun 2023 17:26:59 +0100 [thread overview]
Message-ID: <87jzvmxmfh.fsf@linaro.org> (raw)
In-Reply-To: <20230629120255.85581-2-philmd@linaro.org>
Philippe Mathieu-Daudé <philmd@linaro.org> writes:
> A CPU knows whether MTTCG is enabled or not because it is
> reflected in its TCG flags via the CF_PARALLEL bit.
>
> Suggested-by: Alex Bennée <alex.bennee@linaro.org>
> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
> ---
> target/riscv/cpu.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/target/riscv/cpu.c b/target/riscv/cpu.c
> index 4035fe0e62..4dfa64af6a 100644
> --- a/target/riscv/cpu.c
> +++ b/target/riscv/cpu.c
> @@ -473,7 +473,7 @@ static void rv64_veyron_v1_cpu_init(Object *obj)
>
> static void rv128_base_cpu_init(Object *obj)
> {
> - if (qemu_tcg_mttcg_enabled()) {
> + if (CPU(obj)->tcg_cflags & CF_PARALLEL) {
Hmm have you checked that tcg_cpu_init_cflags() has executed by this point?
> /* Missing 128-bit aligned atomics */
> error_report("128-bit RISC-V currently does not work with Multi "
> "Threaded TCG. Please use: -accel tcg,thread=single");
Not that we can do anything about it but in linux-user we start with
CF_PARALLEL unset and only set it at the point we spawn a new thread.
--
Alex Bennée
Virtualisation Tech Lead @ Linaro
next prev parent reply other threads:[~2023-06-29 16:28 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-06-29 12:02 [PATCH 0/2] accel/tcg: Remove qemu_tcg_mttcg_enabled() Philippe Mathieu-Daudé
2023-06-29 12:02 ` [PATCH 1/2] target/riscv: Check for CF_PARALLEL instead of qemu_tcg_mttcg_enabled Philippe Mathieu-Daudé
2023-06-29 16:26 ` Alex Bennée [this message]
2023-06-29 21:12 ` Philippe Mathieu-Daudé
2023-06-29 12:02 ` [PATCH 2/2] accel/tcg: Replace qemu_tcg_mttcg_enabled() by mttcg_enabled Philippe Mathieu-Daudé
2023-06-29 12:03 ` Philippe Mathieu-Daudé
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=87jzvmxmfh.fsf@linaro.org \
--to=alex.bennee@linaro.org \
--cc=alistair.francis@wdc.com \
--cc=bin.meng@windriver.com \
--cc=dbarboza@ventanamicro.com \
--cc=eduardo@habkost.net \
--cc=liweiwei@iscas.ac.cn \
--cc=marcel.apfelbaum@gmail.com \
--cc=palmer@dabbelt.com \
--cc=pbonzini@redhat.com \
--cc=philmd@linaro.org \
--cc=qemu-devel@nongnu.org \
--cc=qemu-riscv@nongnu.org \
--cc=richard.henderson@linaro.org \
--cc=wangyanan55@huawei.com \
--cc=zhiwei_liu@linux.alibaba.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.