On Wed, 30 Sept 2026 at 09:56, Michael Tokarev <[email protected]> wrote:
>
> [This has been applied to the master branch as 
> 998b6db69e3ec58fd52ddc7a06ece6cf286f3c77]
>
> On 9/21/26 10:44, Fuad Tabba wrote:
> > The WFIT and WFET helpers arm the wakeup timer at count == timeout +
> > offset, treating an overflow of that sum as "beyond the counter's
> > wrap" and arming at INT64_MAX. As in gt_recalc_timer(), that reading
> > is valid only when offset <= count: with a CNTVOFF_EL2 that puts the
> > virtual count ahead of the physical count, the sum overflows for
> > every timeout still in the future and the wrapped value was the
> > correct wakeup. The CPU then waits until an interrupt or event
> > instead of waking at its timeout. A Linux guest uses WFIT and WFET in
> > __delay() when FEAT_WFxT is present, which -cpu max advertises.
> >
> > Arm cntval + (timeout - cntvct) instead, so only a physical count past
> > 2^64 is "never", and add a tcg system test that issues WFIT and WFET
> > with such an offset, with a timer interrupt 1s out so a broken WFxT
> > still returns: before this change both wake at the interrupt, after
> > it at their timeout.
> >
> > Fixes: a96edb687e76 ("target/arm: Implement FEAT WFxT and enable for '-cpu 
> > max'")
> > Fixes: da9b86c35fa8 ("target/arm: implement WFET")
>
> Hi.
>
> For stable-10.0.x LTS series, which does not support WFET (commit
> da9b86c35fa8), I'm picking up just the first half of this patch,
> and half of the test.
>
> An alternative is to pick da9b86c35fa8 ("target/arm: implement WFET")
> for 10.0.x, which does not actually look bad.  It will probably require
> v11.0.0-332-g4575da5ecb7 "target/arm: report register in WFIT syndromes"
> too.

The WFET implementation relies on the preceding set of patches
which implement the event stream, SEV and SEVL (and on some
later patches that fix a bug or two). I think the feature as
a whole is a bit large to try to backport, especially since the
failure mode for "we forgot one of the bits it depends on" is
"the guest silently hangs because it doesn't get woken up from
the WFE when it should".

thanks
-- PMM

Reply via email to