qemu-ppc
[Top][All Lists]
Advanced

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

Re: [Qemu-ppc] Implement instructions: yield, mdoio, mdoom


From: alarson
Subject: Re: [Qemu-ppc] Implement instructions: yield, mdoio, mdoom
Date: Fri, 24 Jun 2016 00:15:58 -0500

David Gibson <address@hidden> wrote on 06/23/2016 09:45:48 
PM:
On Thu, Jun 23, 2016 at 08:10:08PM -0500, address@hidden wrote:

AL> In target-ppc/translate.c, the gen_or() function now has the ability
AL> to pause the CPU via gen_pause().  However gen_or() does not implement
AL> the PPC instructions yield (rs,ra,rb=27), mdoio (29), or mdoom (30),
AL> which could be handled by simply calling gen_pause() for them.

DG> Uh.. having a glance at the description of these in the arch, I
DG> don't think treating them as pause is correct.  I don't see
DG> anything we can do with these in TCG that's better than the no-op
DG> we currently treat them as.

Perhaps I don't understand what gen_pause() does, but it appears to
only let other cores run, which I assume is what we'd want for
'yield'.  Otherwise what is the difference between gen_pause() and
gen_wait()?

I concur that the case for the mdoio or mdoom is less clear,
but if a guest core is indicating a desire to let something else
happen, then it seems that switching guest cores has the highest
likelihood of conserving host execution time.

The patch I was originally planning to submit for "yield" was the
following:

in gen_or()
        case 30:
            /* Let a different processor run */
            gen_update_nip(ctx, ctx->nip);
            gen_helper_yield(cpu_env);
            ctx->exception = POWERPC_EXCP_BRANCH;
            break;

void helper_yield(CPUPPCState *env)
{
    PowerPCCPU *cpu = ppc_env_get_cpu(env);
    CPUState *cs = CPU(cpu);

    /* Just let another CPU run.  */
    cs->exception_index = EXCP_INTERRUPT;
    cpu_loop_exit(cs);
}

But the solution for gen_pause() seemed cleaner to me.

In my environment pause() and the above yield() behave similarly.
However I still have an issue where I can't get gen_wait() to let the
host sleep, so perhaps that is clouding my results.



reply via email to

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