From: Richard Henderson <richard.henderson@linaro.org>
To: Peter Maydell <peter.maydell@linaro.org>, qemu-devel@nongnu.org
Cc: Paolo Bonzini <pbonzini@redhat.com>
Subject: Re: [PATCH for-9.2] accel/tcg: Remove dead code from rr_cpu_thread_fn()
Date: Fri, 16 Aug 2024 08:13:24 +1000 [thread overview]
Message-ID: <a0927867-1a5b-4e9a-8236-33f528c2c19c@linaro.org> (raw)
In-Reply-To: <20240815143634.3413679-1-peter.maydell@linaro.org>
On 8/16/24 00:36, Peter Maydell wrote:
> The main loop in rr_cpu_thread_fn() can never terminate, so the
> code at the end of the function to clean up the RCU subsystem is
> dead code. Replace it with g_assert_not_reached().
>
> (This is different from the other cpu_thread_fn for e.g. MTTCG or
> for the KVM accelerator -- those can exit, if the vCPU they
> are responsible for is unplugged. But the RR cpu thread fn
> handles all CPUs in the system in a round-robin way, so even
> if one is unplugged it keeps looping.)
>
> Resolves: Coverity CID 1547782
> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
> ---
> accel/tcg/tcg-accel-ops-rr.c | 4 +---
> 1 file changed, 1 insertion(+), 3 deletions(-)
>
> diff --git a/accel/tcg/tcg-accel-ops-rr.c b/accel/tcg/tcg-accel-ops-rr.c
> index 48c38714bd6..38ab16244e3 100644
> --- a/accel/tcg/tcg-accel-ops-rr.c
> +++ b/accel/tcg/tcg-accel-ops-rr.c
> @@ -302,9 +302,7 @@ static void *rr_cpu_thread_fn(void *arg)
> rr_deal_with_unplugged_cpus();
> }
>
> - rcu_remove_force_rcu_notifier(&force_rcu);
> - rcu_unregister_thread();
> - return NULL;
> + g_assert_not_reached();
> }
>
> void rr_start_vcpu_thread(CPUState *cpu)
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
r~
prev parent reply other threads:[~2024-08-15 22:14 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-08-15 14:36 [PATCH for-9.2] accel/tcg: Remove dead code from rr_cpu_thread_fn() Peter Maydell
2024-08-15 22:13 ` Richard Henderson [this message]
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=a0927867-1a5b-4e9a-8236-33f528c2c19c@linaro.org \
--to=richard.henderson@linaro.org \
--cc=pbonzini@redhat.com \
--cc=peter.maydell@linaro.org \
--cc=qemu-devel@nongnu.org \
/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).