From: "Alex Bennée" <alex.bennee@linaro.org>
To: "Philippe Mathieu-Daudé" <philmd@oss.qualcomm.com>
Cc: Peter Maydell <peter.maydell@linaro.org>,
qemu-devel@nongnu.org,
Richard Henderson <richard.henderson@linaro.org>
Subject: Re: [PULL 20/71] target/arm: teach arm_cpu_has_work about halting reasons
Date: Wed, 22 Jul 2026 14:25:28 +0100 [thread overview]
Message-ID: <87a4rjrwaf.fsf@draig.linaro.org> (raw)
In-Reply-To: <90bbd0b0-dce4-4945-8ad9-96c895e712ed@oss.qualcomm.com> ("Philippe Mathieu-Daudé"'s message of "Wed, 22 Jul 2026 13:07:29 +0200")
Philippe Mathieu-Daudé <philmd@oss.qualcomm.com> writes:
> Hi,
>
> On 10/6/26 18:11, Peter Maydell wrote:
>> From: Alex Bennée <alex.bennee@linaro.org>
>> With the advent of WFE and WFI we need to pay closer attention to
>> the
>> reason why the vCPU may be sleeping to figure out if we should wake
>> it up.
>> Create env->halt_reason to track this and then re-order the tests so
>> we:
>> - ignore everything is the vCPU is powered off
>> - wake up if the event_register is set and we were in a WFE
>> - otherwise any IRQ event does wake the vCPU up.
>> Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
>> Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
>> Message-id: 20260529082948.363931-3-alex.bennee@linaro.org
>> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
>> ---
>> target/arm/arm-powerctl.c | 6 +++---
>> target/arm/cpu.c | 40 +++++++++++++++++++++++++++-----------
>> target/arm/cpu.h | 16 +++++++++++++++
>> target/arm/internals.h | 11 +++++++++++
>> target/arm/kvm.c | 5 +++--
>> target/arm/machine.c | 2 +-
>> target/arm/tcg/op_helper.c | 3 +++
>> 7 files changed, 66 insertions(+), 17 deletions(-)
>
> This patch updated TCG and KVM but missed HVF and WHPX:
>
> - target/arm/hvf/hvf.c
> - target/arm/whpx/whpx-all.c
Do they need it if they implement cpus_accel->cpu_thread_is_idle?
>
>
>> diff --git a/target/arm/internals.h b/target/arm/internals.h
>> index 21cbd2b1db..b2035b9417 100644
>> --- a/target/arm/internals.h
>> +++ b/target/arm/internals.h
>> @@ -2063,4 +2063,15 @@ bool arm_cpu_match_cpreg_mig_tolerance(ARMCPU *cpu, uint64_t kvmidx,
>> ARMCPRegMigToleranceType type);
>> +/**
>> + * arm_set_cpu_power_state() - set power state synced with halt_reason
>> + */
>> +static inline void arm_set_cpu_power_state(ARMCPU *cpu, ARMPSCIState state)
>> +{
>> + CPUARMState *env = &cpu->env;
>> +
>> + cpu->power_state = state;
>> + env->halt_reason = state == PSCI_OFF ? HALT_PSCI : NOT_HALTED;
>> +}
>> +
>> #endif
> Why not add/use a getter()?
How do you mean? Add it as a CPUClass API? Seems overkill for what is
currently handled internally by Arm.
--
Alex Bennée
Virtualisation Tech Lead @ Linaro
next prev parent reply other threads:[~2026-07-22 13:26 UTC|newest]
Thread overview: 78+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-06-10 16:10 [PULL 00/71] target-arm queue Peter Maydell
2026-06-10 16:10 ` [PULL 01/71] hw/core/qdev-clock: Fix potential null pointer dereference Peter Maydell
2026-06-10 16:10 ` [PULL 02/71] target/arm: implement MTE_PERM Peter Maydell
2026-06-10 16:10 ` [PULL 03/71] target/arm: add TCSO bitmasks to SCTLR Peter Maydell
2026-06-10 16:10 ` [PULL 04/71] target/arm: mte_check unemitted on STORE_ONLY load Peter Maydell
2026-06-10 16:10 ` [PULL 05/71] linux-user: add MTE_STORE_ONLY to prctl Peter Maydell
2026-06-10 16:10 ` [PULL 06/71] target/arm: emit tag check when MTX without TBI Peter Maydell
2026-06-10 16:10 ` [PULL 07/71] target/arm: add MTX to MTEDESC and DisasContext Peter Maydell
2026-06-10 16:10 ` [PULL 08/71] target/arm: add canonical tag check helper Peter Maydell
2026-06-10 16:11 ` [PULL 09/71] target/arm: add canonical MTE check logic Peter Maydell
2026-06-10 16:11 ` [PULL 10/71] target/arm: load on canonical tag loads ext bits Peter Maydell
2026-06-10 16:11 ` [PULL 11/71] target/arm: fault on tag store to canonical tag Peter Maydell
2026-06-10 16:11 ` [PULL 12/71] target/arm: skip tag bit bounds check if MTX is on Peter Maydell
2026-06-10 16:11 ` [PULL 13/71] target/arm: tag is not a part of PAuth with MTX Peter Maydell
2026-06-10 16:11 ` [PULL 14/71] docs: add MTE4 features to docs Peter Maydell
2026-06-10 16:11 ` [PULL 15/71] tests/tcg: add test for MTE FAR Peter Maydell
2026-06-10 16:11 ` [PULL 16/71] tests/tcg: add test for MTE_STORE_ONLY Peter Maydell
2026-06-10 16:11 ` [PULL 17/71] hw/usb/hcd-ohci: Assert isochronous TDs are never deferred Peter Maydell
2026-06-10 16:11 ` [PULL 18/71] hw/usb/hcd-ohci: Clean up USBPacket before freeing ISO TD packet Peter Maydell
2026-06-10 16:11 ` [PULL 19/71] target/arm: fix WFET typo in syndrome Peter Maydell
2026-06-10 16:11 ` [PULL 20/71] target/arm: teach arm_cpu_has_work about halting reasons Peter Maydell
2026-07-21 17:06 ` Peter Maydell
2026-07-22 17:29 ` Peter Maydell
2026-07-22 21:03 ` Michael Tokarev
2026-07-22 11:07 ` Philippe Mathieu-Daudé
2026-07-22 13:25 ` Alex Bennée [this message]
2026-06-10 16:11 ` [PULL 21/71] target/arm: redefine event stream fields Peter Maydell
2026-06-10 16:11 ` [PULL 22/71] target/arm: ensure aarch64 DISAS_WFE will exit Peter Maydell
2026-06-10 16:11 ` [PULL 23/71] hw/intc/exynos4210_combiner: Avoid hw_error for guest errors Peter Maydell
2026-06-10 16:11 ` [PULL 24/71] hw/dma/pl080: Don't use hw_error() for unimplemented features Peter Maydell
2026-06-10 16:11 ` [PULL 25/71] fpu: Handle all rounding modes in partsN_uncanon_normal Peter Maydell
2026-06-10 16:11 ` [PULL 26/71] fpu: Handle all rounding modes in partsN_round_to_int_normal Peter Maydell
2026-06-10 16:11 ` [PULL 27/71] target/arm: Use FloatParts64 in bfdotadd_ebf Peter Maydell
2026-06-10 16:11 ` [PULL 28/71] target/arm: Drop oddstatus from is_ebf and bfdotadd_ebf Peter Maydell
2026-06-10 16:11 ` [PULL 29/71] target/arm: Use FloatParts64 in f16_dotadd Peter Maydell
2026-06-10 16:11 ` [PULL 30/71] target/arm: Generalize TRANS_FEAT_STREAMING_SME2 Peter Maydell
2026-06-10 16:11 ` [PULL 31/71] target/arm: Introduce arm_init_fp_status Peter Maydell
2026-06-10 16:11 ` [PULL 32/71] target/arm: Set e4m3_nan_is_snan Peter Maydell
2026-06-10 16:11 ` [PULL 33/71] target/arm: Implement BF1CVTL, BF1CVTL2, BF2CVTL, BF2CVTL2 for AdvSIMD Peter Maydell
2026-06-10 16:11 ` [PULL 34/71] target/arm: Implement BF1CVT, BF1CVTLT, BF2CVT, BF2CVTLT for SVE Peter Maydell
2026-06-10 16:11 ` [PULL 35/71] target/arm: Rename SME BFCVT patterns to BFCVT_hs Peter Maydell
2026-06-10 16:11 ` [PULL 36/71] target/arm: Implement BF1CVT, BF1CVTL, BF2CVT, BF2CVTL for SME Peter Maydell
2026-06-10 16:11 ` [PULL 37/71] target/arm: Implement F1CVTL, F1CVTL2, F2CVTL, F2CVTL2 for AdvSIMD Peter Maydell
2026-06-10 16:11 ` [PULL 38/71] target/arm: Implement F1CVT, F1CVTLT, F2CVT, F2CVTLT for SVE Peter Maydell
2026-06-10 16:11 ` [PULL 39/71] target/arm: Implement F1CVT, F1CVTL, F2CVT, F2CVTL for SME Peter Maydell
2026-06-10 16:11 ` [PULL 40/71] target/arm: Implement BFCVTN for SVE Peter Maydell
2026-06-10 16:11 ` [PULL 41/71] target/arm: Implement FCVTN (16- to 8-bit fp) for AdvSIMD Peter Maydell
2026-06-10 16:11 ` [PULL 42/71] target/arm: Implement FCVTN, FCVTN2 (32- " Peter Maydell
2026-06-10 16:11 ` [PULL 43/71] target/arm: Implement FCVTN (16- to 8-bit fp) for SVE Peter Maydell
2026-06-10 16:11 ` [PULL 44/71] target/arm: Implement FCVTNB, FCVTNT " Peter Maydell
2026-06-10 16:11 ` [PULL 45/71] target/arm: Implement FCVT (FP16 to FP8) for SME Peter Maydell
2026-06-10 16:11 ` [PULL 46/71] target/arm: Implement FCVT, FCVTN (FP32 " Peter Maydell
2026-06-10 16:11 ` [PULL 47/71] target/arm: Implement LUTI2, LUTI4 for AdvSIMD Peter Maydell
2026-06-10 16:11 ` [PULL 48/71] target/arm: Implement LUTI2, LUTI4 for SVE Peter Maydell
2026-06-10 16:11 ` [PULL 49/71] target/arm: Enable FEAT_LUT for -cpu max Peter Maydell
2026-06-10 16:11 ` [PULL 50/71] target/arm: Enable FEAT_FP8 " Peter Maydell
2026-06-10 16:11 ` [PULL 51/71] target/arm: Update ID_AA64SMFR0_EL1 fields to ARM M.b Peter Maydell
2026-06-10 16:11 ` [PULL 52/71] target/arm: Implement MOVT (vector to table) Peter Maydell
2026-06-10 16:11 ` [PULL 53/71] target/arm: Implement LUTI4 (four registers, 8-bit) Peter Maydell
2026-06-10 16:11 ` [PULL 54/71] target/arm: Enable FEAT_SME_LUTv2 for -cpu max Peter Maydell
2026-06-10 16:11 ` [PULL 55/71] target/arm: Implement FMLALB, FMLALT for AdvSIMD Peter Maydell
2026-06-10 16:11 ` [PULL 56/71] target/arm: Implement FMLALB, FMLALT (FP8 to FP16) for SVE Peter Maydell
2026-06-10 16:11 ` [PULL 57/71] target/arm: Implement FMLALL{BB, BT, TB, TT} for AdvSIMD Peter Maydell
2026-06-10 16:11 ` [PULL 58/71] target/arm: Implement FMLALL{BB,BT,TB,TT} for SVE Peter Maydell
2026-06-10 16:11 ` [PULL 59/71] target/arm: Enable FEAT_FP8FMA, FEAT_SSVE_FP8FMA for -cpu max Peter Maydell
2026-06-10 16:11 ` [PULL 60/71] target/arm: Implement FDOT (FP8 to FP32) for AdvSIMD Peter Maydell
2026-06-10 16:11 ` [PULL 61/71] target/arm: Implement FDOT (FP8 to FP32) for SVE Peter Maydell
2026-06-10 16:11 ` [PULL 62/71] target/arm: Enable FEAT_FP8DOT4, FEAT_SSVE_FP8DOT4 for -cpu max Peter Maydell
2026-06-10 16:11 ` [PULL 63/71] target/arm: Implement FDOT (FP8 to FP16) for AdvSIMD Peter Maydell
2026-06-10 16:11 ` [PULL 64/71] target/arm: Implement FDOT (FP8 to FP16) for SVE Peter Maydell
2026-06-10 16:11 ` [PULL 65/71] target/arm: Enable FEAT_FP8DOT2, FEAT_SSVE_FP8DOT2 for -cpu max Peter Maydell
2026-06-10 16:11 ` [PULL 66/71] target/arm: Implement FMMLA (FP8 to FP32) for AdvSIMD Peter Maydell
2026-06-10 16:11 ` [PULL 67/71] target/arm: Implement FMMLA (FP8 to FP32) for SVE Peter Maydell
2026-06-10 16:11 ` [PULL 68/71] target/arm: Enable FEAT_F8F32MM for -cpu max Peter Maydell
2026-06-10 16:12 ` [PULL 69/71] target/arm: Implement FMMLA (FP8 to FP16) for AdvSIMD Peter Maydell
2026-06-10 16:12 ` [PULL 70/71] target/arm: Implement FMMLA (FP8 to FP16) for SVE Peter Maydell
2026-06-10 16:12 ` [PULL 71/71] target/arm: Enable FEAT_F8F16MM for -cpu max Peter Maydell
2026-06-11 19:16 ` [PULL 00/71] target-arm queue Stefan Hajnoczi
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=87a4rjrwaf.fsf@draig.linaro.org \
--to=alex.bennee@linaro.org \
--cc=peter.maydell@linaro.org \
--cc=philmd@oss.qualcomm.com \
--cc=qemu-devel@nongnu.org \
--cc=richard.henderson@linaro.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 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.