Re: [PATCH 2/2] target/arm: Implement FEAT WFxT and enable for '-cpu max'

2024-05-31 Thread Peter Maydell
On Tue, 30 Apr 2024 at 15:00, Peter Maydell wrote: > > FEAT_WFxT introduces new instructions WFIT and WFET, which are like > the existing WFI and WFE but allow the guest to pass a timeout value > in a register. The instructions will wait for an interrupt/event as > usual, but will also stop waiti

Re: [PATCH 2/2] target/arm: Implement FEAT WFxT and enable for '-cpu max'

2024-04-30 Thread Peter Maydell
On Tue, 30 Apr 2024 at 18:31, Richard Henderson wrote: > > On 4/30/24 07:00, Peter Maydell wrote: > > +if (uadd64_overflow(timeout, offset, &nexttick)) { > > +nexttick = UINT64_MAX; > > +} > > +if (nexttick > INT64_MAX / gt_cntfrq_period_ns(cpu)) { > > +/* > > +

Re: [PATCH 2/2] target/arm: Implement FEAT WFxT and enable for '-cpu max'

2024-04-30 Thread Richard Henderson
On 4/30/24 07:00, Peter Maydell wrote: +if (uadd64_overflow(timeout, offset, &nexttick)) { +nexttick = UINT64_MAX; +} +if (nexttick > INT64_MAX / gt_cntfrq_period_ns(cpu)) { +/* + * If the timeout is too long for the signed 64-bit range + * of a QEMUTim

[PATCH 2/2] target/arm: Implement FEAT WFxT and enable for '-cpu max'

2024-04-30 Thread Peter Maydell
FEAT_WFxT introduces new instructions WFIT and WFET, which are like the existing WFI and WFE but allow the guest to pass a timeout value in a register. The instructions will wait for an interrupt/event as usual, but will also stop waiting when the value of CNTVCT_EL0 is greater than or equal to th