On Thu, Apr 23, 2015 at 6:34 AM, Edgar E. Iglesias <edgar.igles...@gmail.com
> wrote:

> On Thu, Apr 23, 2015 at 12:28:43PM +0100, Peter Maydell wrote:
> > On 23 April 2015 at 12:24, Edgar E. Iglesias <edgar.igles...@gmail.com>
> wrote:
> > > Maybe we can consider YIELD instead of NOP when has_work() is true as
> a WFI
> > > is probably a good hint from guests to reschedule QEMU CPUs.
> >
> > That I'm not convinced about. If we have a pending interrupt then
> > our best bet is probably to take it immediately on this CPU, not
> > yield to another CPU and take the interrupt when we eventually
> > get control back.
>
> Yeah, true. It's actually a very bad YIELD point when has_work() is true
> for a WFI.
>
> For WFE too I guess, when interrupts are unmasked.
>
> Good point.
>
> Cheers,
> Edgar
>


Good catch Edgar, we shouldn't trap if we are "going into a low-power
state".

It sounds like we arrived at the following:

wfi-  check has_work before taking either the UDEF or HLT exception hereby
making it a noop.

wfe - Never trap, making it always a noop.  This includes undoing the
existing YIELD exception.

Sound right?

Reply via email to