All of lore.kernel.org
 help / color / mirror / Atom feed
From: Alexander Graf <agraf@suse.de>
To: Alexey Kardashevskiy <aik@ozlabs.ru>
Cc: Paolo Bonzini <pbonzini@redhat.com>,
	qemu-ppc@nongnu.org, qemu-devel@nongnu.org,
	Thomas Huth <thuth@linux.vnet.ibm.com>
Subject: Re: [Qemu-devel] [PATCH v2 4/5] target-ppc: Implement nmi() callback
Date: Mon, 31 Mar 2014 14:41:51 +0200	[thread overview]
Message-ID: <5339628F.2020006@suse.de> (raw)
In-Reply-To: <1396011112-23559-5-git-send-email-aik@ozlabs.ru>

On 03/28/2014 01:51 PM, Alexey Kardashevskiy wrote:
> Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
> ---
>   target-ppc/cpu-qom.h        |  1 +
>   target-ppc/excp_helper.c    |  2 +-
>   target-ppc/translate_init.c | 18 ++++++++++++++++++
>   3 files changed, 20 insertions(+), 1 deletion(-)
>
> diff --git a/target-ppc/cpu-qom.h b/target-ppc/cpu-qom.h
> index 47dc8e6..b522664 100644
> --- a/target-ppc/cpu-qom.h
> +++ b/target-ppc/cpu-qom.h
> @@ -106,6 +106,7 @@ static inline PowerPCCPU *ppc_env_get_cpu(CPUPPCState *env)
>   PowerPCCPUClass *ppc_cpu_class_by_pvr(uint32_t pvr);
>   PowerPCCPUClass *ppc_cpu_class_by_pvr_mask(uint32_t pvr);
>   
> +void powerpc_excp(PowerPCCPU *cpu, int excp_model, int excp);
>   void ppc_cpu_do_interrupt(CPUState *cpu);
>   void ppc_cpu_dump_state(CPUState *cpu, FILE *f, fprintf_function cpu_fprintf,
>                           int flags);
> diff --git a/target-ppc/excp_helper.c b/target-ppc/excp_helper.c
> index 19bc6b6..e19a5f5 100644
> --- a/target-ppc/excp_helper.c
> +++ b/target-ppc/excp_helper.c
> @@ -68,7 +68,7 @@ static inline void dump_syscall(CPUPPCState *env)
>   /* Note that this function should be greatly optimized
>    * when called with a constant excp, from ppc_hw_interrupt
>    */
> -static inline void powerpc_excp(PowerPCCPU *cpu, int excp_model, int excp)
> +void powerpc_excp(PowerPCCPU *cpu, int excp_model, int excp)
>   {
>       CPUState *cs = CPU(cpu);
>       CPUPPCState *env = &cpu->env;
> diff --git a/target-ppc/translate_init.c b/target-ppc/translate_init.c
> index d07e186..faa9f21 100644
> --- a/target-ppc/translate_init.c
> +++ b/target-ppc/translate_init.c
> @@ -8455,6 +8455,23 @@ static void ppc_cpu_reset(CPUState *s)
>       tlb_flush(s, 1);
>   }
>   
> +static void ppc_cpu_do_nmi(void *arg)
> +{
> +    CPUState *cs = arg;
> +    PowerPCCPU *cpu = POWERPC_CPU(cs);
> +    CPUPPCState *env = &cpu->env;
> +
> +    cpu_synchronize_state(cs);
> +    powerpc_excp(cpu, env->excp_model, POWERPC_EXCP_RESET);

I'd prefer to keep powerpc_excp internal to excp_helper.c. Can't you 
just export a do_nmi function from excp_helper.c instead?


Alex

> +}
> +
> +static int ppc_cpu_nmi(CPUState *cs)
> +{
> +    async_run_on_cpu(cs, ppc_cpu_do_nmi, cs);
> +
> +    return 0;
> +}
> +
>   static void ppc_cpu_initfn(Object *obj)
>   {
>       CPUState *cs = CPU(obj);
> @@ -8516,6 +8533,7 @@ static void ppc_cpu_class_init(ObjectClass *oc, void *data)
>   
>       pcc->parent_reset = cc->reset;
>       cc->reset = ppc_cpu_reset;
> +    cc->nmi = ppc_cpu_nmi;
>   
>       cc->class_by_name = ppc_cpu_class_by_name;
>       cc->has_work = ppc_cpu_has_work;

  reply	other threads:[~2014-03-31 12:42 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-03-28 12:51 [Qemu-devel] [PATCH v2 0/5] nmi: add interface Alexey Kardashevskiy
2014-03-28 12:51 ` [Qemu-devel] [PATCH v2 1/5] cpu: Add NMI callback Alexey Kardashevskiy
2014-03-31 12:32   ` Alexander Graf
2014-03-28 12:51 ` [Qemu-devel] [PATCH v2 2/5] target-i386: Implement nmi() callback Alexey Kardashevskiy
2014-03-31  2:55   ` Alexey Kardashevskiy
2014-03-31  3:20     ` Richard Henderson
2014-03-31 12:33   ` Alexander Graf
2014-03-28 12:51 ` [Qemu-devel] [PATCH v2 3/5] target-s390: " Alexey Kardashevskiy
2014-03-28 12:51 ` [Qemu-devel] [PATCH v2 4/5] target-ppc: " Alexey Kardashevskiy
2014-03-31 12:41   ` Alexander Graf [this message]
2014-03-28 12:51 ` [Qemu-devel] [PATCH v2 5/5] cpus: Enable nmi() callback use Alexey Kardashevskiy
2014-03-31 12:47   ` Alexander Graf

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5339628F.2020006@suse.de \
    --to=agraf@suse.de \
    --cc=aik@ozlabs.ru \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-ppc@nongnu.org \
    --cc=thuth@linux.vnet.ibm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.