[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-ppc] [PATCH 1/2] ppc: tcg: add nap insn support
From: |
Alexander Graf |
Subject: |
Re: [Qemu-ppc] [PATCH 1/2] ppc: tcg: add nap insn support |
Date: |
Mon, 20 Jan 2014 15:51:10 +0100 |
On 15.01.2014, at 03:22, Liu Ping Fan <address@hidden> wrote:
> Add the emulation of insn "nap" for hypervisor
>
> Signed-off-by: Liu Ping Fan <address@hidden>
> ---
> target-ppc/excp_helper.c | 4 ++++
> target-ppc/helper.h | 1 +
> target-ppc/translate.c | 6 ++++++
> 3 files changed, 11 insertions(+)
>
> diff --git a/target-ppc/excp_helper.c b/target-ppc/excp_helper.c
> index c959460..a9712bc 100644
> --- a/target-ppc/excp_helper.c
> +++ b/target-ppc/excp_helper.c
> @@ -889,6 +889,10 @@ void helper_hrfid(CPUPPCState *env)
> do_rfi(env, env->spr[SPR_HSRR0], env->spr[SPR_HSRR1],
> ~((target_ulong)0x783F0000), 0);
> }
> +
> +void helper_nap(CPUPPCState *env)
> +{
> +}
> #endif
>
> /*****************************************************************************/
> diff --git a/target-ppc/helper.h b/target-ppc/helper.h
> index 6d282bb..87873db 100644
> --- a/target-ppc/helper.h
> +++ b/target-ppc/helper.h
> @@ -17,6 +17,7 @@ DEF_HELPER_1(rfmci, void, env)
> #if defined(TARGET_PPC64)
> DEF_HELPER_1(rfid, void, env)
> DEF_HELPER_1(hrfid, void, env)
> +DEF_HELPER_1(nap, void, env)
> #endif
> #endif
>
> diff --git a/target-ppc/translate.c b/target-ppc/translate.c
> index 66c7771..ce63783 100644
> --- a/target-ppc/translate.c
> +++ b/target-ppc/translate.c
> @@ -3798,6 +3798,11 @@ static void gen_hrfid(DisasContext *ctx)
> gen_sync_exception(ctx);
> #endif
> }
> +
> +static void gen_nap(DisasContext *ctx)
> +{
> + gen_helper_nap(cpu_env);
The instruction is hypervisor privileged, thus should check for MSR_HV. Please
keep in mind that we don't actually support MSR_HV anywhere really yet - for
the most part QEMU only emulates guest mode.
Also, please always CC address@hidden in parallel to qemu-ppc.
Alex