qemu-ppc
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-ppc] [PATCH 2/2] ppc: tcg: implement helper_nap


From: liu ping fan
Subject: Re: [Qemu-ppc] [PATCH 2/2] ppc: tcg: implement helper_nap
Date: Mon, 20 Jan 2014 09:05:20 +0800

Sorry, I do not receive the original email inside my mailbox,  so copy
to here and reply.

>> When nap, clear no persistent register as ISA spec says.
>>
>> Signed-off-by: Liu Ping Fan <address@hidden>
>> ---
>>  target-ppc/excp_helper.c | 14 ++++++++++++++
>>  1 file changed, 14 insertions(+)
>>
>> diff --git a/target-ppc/excp_helper.c b/target-ppc/excp_helper.c
>> index a9712bc..5dbb166 100644
>> --- a/target-ppc/excp_helper.c
>> +++ b/target-ppc/excp_helper.c
>> @@ -892,6 +892,20 @@ void helper_hrfid(CPUPPCState *env)
>>
>>  void helper_nap(CPUPPCState *env)
>>  {
>> +    int i;
>> +    for (i = 0; i < 32; i++) {
>> +        env->gpr[i] = 0;
>> +    }
>> +    env->lr = 0;
>> +    env->ctr = 0;
>> +    for (i = 0; i < 8; i++) {
>> +        env->crf[i] = 0;
>> +    }
>> +    env->msr = 0;
>> +    for (i = 0; i < 32; i++) {
>> +        env->fpr[i] = 0;
>> +    }
>> +
>>  }
>>  #endif
>>
>>
>
>The Power Saving Mode instructions (doze, nap, sleep, rvwinkle) all put the
>hardware thread into a suspended state, including the halting of subsequent
>instruction fetches.  I don't see how your patch achieves this; I suspect
>that QEMU will attempt to fetch whatever instruction immediately follows
>nap in the new context (MSR=0).  Can you elaborate?
>
I think, there should be qemu_event_wait() to put vcpu into sleep, and
it will fix the "halting of subsequent instruction fetches"

>Also, if you are going to add nap, why not also add doze, sleep and rvwinkle?

I am not sure about this implement, so try to start as little patches
as possible :)

Thanks and regards,
Ping Fan



reply via email to

[Prev in Thread] Current Thread [Next in Thread]