qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Benjamin Herrenschmidt <benh@kernel.crashing.org>
To: "Philippe Mathieu-Daudé" <philmd@linaro.org>, qemu-devel@nongnu.org
Cc: Bernhard Beschow <shentey@gmail.com>,
	Nicholas Piggin <npiggin@gmail.com>,
	bharata.rao@gmail.com, Chinmay Rath <rathc@linux.ibm.com>,
	qemu-ppc@nongnu.org
Subject: Re: [PATCH 2/3] target/ppc: Have gen_pause() actually pause vCPUs
Date: Mon, 29 Sep 2025 14:28:57 +1000	[thread overview]
Message-ID: <4b0138bc76c60385de71c26eb55a4aecd8d1786d.camel@kernel.crashing.org> (raw)
In-Reply-To: <20250924173028.53658-3-philmd@linaro.org>

On Wed, 2025-09-24 at 19:30 +0200, Philippe Mathieu-Daudé wrote:
> gen_pause() sets CPUState::halted = 0, effectively unhalting
> (a.k.a. "running") the cpu. Correct by setting the '1' value
> to really halt the cpu.

What will resume it though ? The smt_low() case isn't meant to *halt*
the CPUs permanently. smt_*() levels are about SMT thread priorities.
Using a "pause" that just gets out of TCG (and back in), is a way to 
"yield" to another thread, thus enabling more forward progress when a
thread is spinning on an smt_low() loop. This happens in firmware and
in some spinlock cases.

This isn't about stopping until some external event resumes it.

Cheers,
Ben.



  parent reply	other threads:[~2025-09-29  4:32 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-09-24 17:30 [PATCH 0/3] target/ppc: Have gen_pause() actually pause vCPUs Philippe Mathieu-Daudé
2025-09-24 17:30 ` [PATCH 1/3] hw/ppc: Do not open-code cpu_resume() in spin_kick() Philippe Mathieu-Daudé
2025-09-24 17:58   ` Richard Henderson
2025-09-24 17:30 ` [PATCH 2/3] target/ppc: Have gen_pause() actually pause vCPUs Philippe Mathieu-Daudé
2025-09-24 17:58   ` Richard Henderson
2025-09-29  4:28   ` Benjamin Herrenschmidt [this message]
2025-09-29  7:51     ` Philippe Mathieu-Daudé
2025-09-29 22:59       ` Benjamin Herrenschmidt
2025-09-30  3:00         ` Philippe Mathieu-Daudé
2025-09-24 17:30 ` [PATCH 3/3] target/ppc: Re-use gen_pause() in gen_wait() Philippe Mathieu-Daudé
2025-09-24 18:05   ` Richard Henderson
2025-10-07  8:21 ` [PATCH 0/3] target/ppc: Have gen_pause() actually pause vCPUs 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=4b0138bc76c60385de71c26eb55a4aecd8d1786d.camel@kernel.crashing.org \
    --to=benh@kernel.crashing.org \
    --cc=bharata.rao@gmail.com \
    --cc=npiggin@gmail.com \
    --cc=philmd@linaro.org \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-ppc@nongnu.org \
    --cc=rathc@linux.ibm.com \
    --cc=shentey@gmail.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).