On Fri, 19 Jun 2026 at 14:05, Alex Bennée <[email protected]> wrote:
>
> We don't want to just use it for timeouts as we will calculate which
> will comes first. Remove the wxft feature test in favour of the
> broader architecture checks.
>
> Signed-off-by: Alex Bennée <[email protected]>
>
> ---
> v8
>   - new commit
> ---
>  target/arm/cpu.h | 2 +-
>  target/arm/cpu.c | 9 ++++++++-
>  2 files changed, 9 insertions(+), 2 deletions(-)
>
> diff --git a/target/arm/cpu.h b/target/arm/cpu.h
> index 31a5567c951..8aa7437a397 100644
> --- a/target/arm/cpu.h
> +++ b/target/arm/cpu.h
> @@ -966,7 +966,7 @@ struct ArchCPU {
>       * pmu_op_finish() - it does not need other handling during migration
>       */
>      QEMUTimer *pmu_timer;
> -    /* Timer used for WFxT timeouts */
> +    /* Timer used for WFxT timeouts OR event stream events */
>      QEMUTimer *wfxt_timer;
>
>      /* GPIO outputs for generic timer */
> diff --git a/target/arm/cpu.c b/target/arm/cpu.c
> index 597e0626e7f..61945b6e6cc 100644
> --- a/target/arm/cpu.c
> +++ b/target/arm/cpu.c
> @@ -2269,7 +2269,14 @@ static void arm_cpu_realizefn(DeviceState *dev, Error 
> **errp)
>      }
>
>  #ifndef CONFIG_USER_ONLY
> -    if (tcg_enabled() && cpu_isar_feature(aa64_wfxt, cpu)) {
> +    /*
> +     * We use the wfxt_timer for timeouts and event stream so we
> +     * enable from V6K up. There is no event stream on M-profile.
> +     */
> +    if (tcg_enabled() &&
> +        (arm_feature(env, ARM_FEATURE_V6K) ||
> +         arm_feature(env, ARM_FEATURE_V7) ||
> +         arm_feature(env, ARM_FEATURE_V8))) {

This code runs after arm_cpu_propagate_feature_implications()
(which happens at end of instance-init), so you can rely on
the usual "feature X implies feature Y" stuff being true, and
just check ARM_FEATURE_V6K -- that is set for anything A or R
profile that's v6k and up.

>          cpu->wfxt_timer = timer_new_ns(QEMU_CLOCK_VIRTUAL,
>                                         arm_wfxt_timer_cb, cpu);
>      }
> --
> 2.47.3

-- PMM

Reply via email to