From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55950) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YlI5e-0001UL-Rs for qemu-devel@nongnu.org; Thu, 23 Apr 2015 10:26:55 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YlI5b-0002uW-LE for qemu-devel@nongnu.org; Thu, 23 Apr 2015 10:26:54 -0400 Received: from mail-wi0-f177.google.com ([209.85.212.177]:35866) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YlI5b-0002uL-D7 for qemu-devel@nongnu.org; Thu, 23 Apr 2015 10:26:51 -0400 Received: by wizk4 with SMTP id k4so218169780wiz.1 for ; Thu, 23 Apr 2015 07:26:50 -0700 (PDT) MIME-Version: 1.0 In-Reply-To: <20150423113459.GU30629@toto> References: <1429722561-12651-1-git-send-email-greg.bellows@linaro.org> <1429722561-12651-10-git-send-email-greg.bellows@linaro.org> <20150423024929.GC17116@toto> <20150423112449.GT30629@toto> <20150423113459.GU30629@toto> Date: Thu, 23 Apr 2015 09:26:50 -0500 Message-ID: From: Greg Bellows Content-Type: multipart/alternative; boundary=047d7b4507e00e91920514651243 Subject: Re: [Qemu-devel] [PATCH v2 9/9] target-arm: Add WFx instruction trap support List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: "Edgar E. Iglesias" Cc: Peter Maydell , =?UTF-8?B?QWxleCBCZW5uw6ll?= , QEMU Developers , Sergey Fedorov --047d7b4507e00e91920514651243 Content-Type: text/plain; charset=UTF-8 On Thu, Apr 23, 2015 at 6:34 AM, Edgar E. Iglesias wrote: > On Thu, Apr 23, 2015 at 12:28:43PM +0100, Peter Maydell wrote: > > On 23 April 2015 at 12:24, Edgar E. Iglesias > 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? --047d7b4507e00e91920514651243 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable


On Thu, Apr 23, 2015 at 6:34 AM, Edgar E. Iglesias <= edgar.iglesias@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.iglesias@gmail.com> wrote:
> > Maybe we can consider YIELD instead of NOP when has_work() is tru= e 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<= br> > 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_w= ork() 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 &quo= t;going into a low-power state".

It sounds like w= e arrived at the following:

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

wfe - Never trap, making it always a noop.=C2=A0 This inc= ludes undoing the existing YIELD exception.

Sound righ= t?

--047d7b4507e00e91920514651243--