From: "Alex Bennée" <alex.bennee@linaro.org>
To: Richard Henderson <richard.henderson@linaro.org>
Cc: qemu-devel@nongnu.org
Subject: Re: [PATCH 3/5] target/arm: trigger timer recalc on SCR:ECVEN change
Date: Wed, 10 Jun 2026 13:56:06 +0100 [thread overview]
Message-ID: <87wlw6ftax.fsf@draig.linaro.org> (raw)
In-Reply-To: <7914fe09-fdb4-4f5b-a283-aa364d0c4525@linaro.org> (Richard Henderson's message of "Tue, 9 Jun 2026 10:46:27 -0700")
Richard Henderson <richard.henderson@linaro.org> writes:
> On 6/9/26 07:00, Alex Bennée wrote:
>> Toggling the ECVEN state affects the offset calculated in
>> gt_phys_raw_cnt_offset so we should trigger a re-calculation on its
>> change.
>> Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
>> ---
>> target/arm/helper.c | 9 +++++++++
>> 1 file changed, 9 insertions(+)
>> diff --git a/target/arm/helper.c b/target/arm/helper.c
>> index 5c640853060..22f5117ee54 100644
>> --- a/target/arm/helper.c
>> +++ b/target/arm/helper.c
>> @@ -37,6 +37,9 @@
>> #include "qemu/plugin.h"
>> static void switch_mode(CPUARMState *env, int mode);
>> +#ifndef CONFIG_USER_ONLY
>> +static void gt_recalc_timer(ARMCPU *cpu, int timeridx);
>> +#endif
>> int compare_u64(const void *a, const void *b)
>> {
>> @@ -821,6 +824,12 @@ static void scr_write(CPUARMState *env, const ARMCPRegInfo *ri, uint64_t value)
>> changed = env->cp15.scr_el3 ^ value;
>> env->cp15.scr_el3 = value;
>> +#ifndef CONFIG_USER_ONLY
>> + if (changed & SCR_ECVEN) {
>> + gt_recalc_timer(cpu, GTIMER_PHYS);
>> + }
>> +#endif
>> +
>> /*
>> * If SCR_EL3.{NS,NSE} changes, i.e. change of security state,
>> * we must invalidate all TLBs below EL3.
>
> Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
>
> As an aside, gt_phys_raw_cnt_offset is missing a check on EL3
> existing, before the check for ECVEn set.
Not many of the references to cp15.scr_el3 seem to have those checks
(although I guess that may be inferred from higher up the call chain).
I can add a arm_feature(env, ARM_FEATURE_EL3) in front or maybe we want
something similar to arm_is_el2_enabled?
>
>
> r~
--
Alex Bennée
Virtualisation Tech Lead @ Linaro
next prev parent reply other threads:[~2026-06-10 12:57 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-06-09 14:00 [PATCH 0/5] target/arm: a few timer fixes while checking FEAT_ECV_POFF Alex Bennée
2026-06-09 14:00 ` [PATCH 1/5] target/arm: split evaluation of CNTHCTL timer IRQ masks Alex Bennée
2026-06-09 17:45 ` Richard Henderson
2026-06-09 14:00 ` [PATCH 2/5] target/arm: trigger timer recalculation when toggling CNTHCTL:ECV Alex Bennée
2026-06-09 17:45 ` Richard Henderson
2026-06-09 14:00 ` [PATCH 3/5] target/arm: trigger timer recalc on SCR:ECVEN change Alex Bennée
2026-06-09 17:46 ` Richard Henderson
2026-06-10 12:56 ` Alex Bennée [this message]
2026-06-10 17:26 ` Richard Henderson
2026-06-09 14:00 ` [PATCH 4/5] target/arm: trigger timer recalc on HCR:(E2H|TGE) changes Alex Bennée
2026-06-09 17:41 ` Richard Henderson
2026-06-09 14:00 ` [PATCH 5/5] docs/system: add FEAT_ECV_POFF to the emulation list Alex Bennée
2026-06-09 17:47 ` Richard Henderson
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=87wlw6ftax.fsf@draig.linaro.org \
--to=alex.bennee@linaro.org \
--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.