[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v2 9/9] target-arm: Add WFx instruction trap sup
From: |
Edgar E. Iglesias |
Subject: |
Re: [Qemu-devel] [PATCH v2 9/9] target-arm: Add WFx instruction trap support |
Date: |
Thu, 23 Apr 2015 21:24:49 +1000 |
User-agent: |
Mutt/1.5.21 (2010-09-15) |
On Thu, Apr 23, 2015 at 11:57:10AM +0100, Peter Maydell wrote:
> On 23 April 2015 at 11:39, Edgar E. Iglesias <address@hidden> wrote:
> >
> > On 23/04/2015 6:00 pm, "Peter Maydell" <address@hidden> wrote:
> >> In theory you could maybe check has_work() for the WFI case,
> >> since doing an EXCP_HLT really should cause us to stop until
> >> has_work is true, but it seems a bit fragile -- could we really
> >> guarantee that nothing would change between this point and
> >> when we went back through the main loop that would change
> >> whether has_work evaluates true or not? I think that it's better
> >> there too to just always take the trap: setting EXCP_HLT is our
> >> "going into a low power state" and so we should take the trap
> >> if we would otherwise have done that.
> >
> > I think functional wise we are OK.
> > The implementation can AFAIK always choose to nop for whatever reason (e.g
> > has_work()). Only when we choose to enter low power, the trap comes into
> > play.
>
> Ah, so in helper_wfi() do something like
>
> if (!has_work()) {
> if (trapping wfi) {
> EXCP_UDEF code;
> } else {
> EXCP_HALT code;
> }
> }
> /* otherwise just return, making this WFI a nop */
>
> ?
>
> I think that would work.
Yes.
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.
>
> > Maybe wfe is the most problematic one because it fires more frequently and
> > often when has_work() is true?
>
> Yes, I think we should start by not trapping on WFE and then look
> at how good/bad perf is.
Sounds good to me.
Thanks!
Edgar
- [Qemu-devel] [PATCH v2 6/9] target-arm: Add TTBR regime function and use, (continued)
- [Qemu-devel] [PATCH v2 6/9] target-arm: Add TTBR regime function and use, Greg Bellows, 2015/04/22
- [Qemu-devel] [PATCH v2 5/9] target-arm: Extend FP checks to use an EL, Greg Bellows, 2015/04/22
- [Qemu-devel] [PATCH v2 7/9] target-arm: Add EL3 and EL2 TCR checking, Greg Bellows, 2015/04/22
- [Qemu-devel] [PATCH v2 9/9] target-arm: Add WFx instruction trap support, Greg Bellows, 2015/04/22
- Re: [Qemu-devel] [PATCH v2 9/9] target-arm: Add WFx instruction trap support, Edgar E. Iglesias, 2015/04/22
- Re: [Qemu-devel] [PATCH v2 9/9] target-arm: Add WFx instruction trap support, Peter Maydell, 2015/04/23
- Re: [Qemu-devel] [PATCH v2 9/9] target-arm: Add WFx instruction trap support, Edgar E. Iglesias, 2015/04/23
- Re: [Qemu-devel] [PATCH v2 9/9] target-arm: Add WFx instruction trap support, Peter Maydell, 2015/04/23
- Re: [Qemu-devel] [PATCH v2 9/9] target-arm: Add WFx instruction trap support,
Edgar E. Iglesias <=
- Re: [Qemu-devel] [PATCH v2 9/9] target-arm: Add WFx instruction trap support, Peter Maydell, 2015/04/23
- Re: [Qemu-devel] [PATCH v2 9/9] target-arm: Add WFx instruction trap support, Edgar E. Iglesias, 2015/04/23
- Re: [Qemu-devel] [PATCH v2 9/9] target-arm: Add WFx instruction trap support, Greg Bellows, 2015/04/23
- Re: [Qemu-devel] [PATCH v2 9/9] target-arm: Add WFx instruction trap support, Peter Maydell, 2015/04/23
- Re: [Qemu-devel] [PATCH v2 9/9] target-arm: Add WFx instruction trap support, Greg Bellows, 2015/04/23
- Re: [Qemu-devel] [PATCH v2 9/9] target-arm: Add WFx instruction trap support, Peter Maydell, 2015/04/23
- Re: [Qemu-devel] [PATCH v2 9/9] target-arm: Add WFx instruction trap support, Greg Bellows, 2015/04/23
- Re: [Qemu-devel] [PATCH v2 9/9] target-arm: Add WFx instruction trap support, Peter Maydell, 2015/04/23
[Qemu-devel] [PATCH v2 8/9] target-arm: Add WFx syndrome function, Greg Bellows, 2015/04/22
Re: [Qemu-devel] [PATCH v2 0/9] target-arm: EL3 trap support, Edgar E. Iglesias, 2015/04/22