qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Alexander Graf <agraf@suse.de>
To: Bharat Bhushan <Bharat.Bhushan@freescale.com>
Cc: maddy@linux.vnet.ibm.com, qemu-ppc@nongnu.org, qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH 2/6 v6] ppc: Add interface to inject interrupt to guest
Date: Thu, 10 Jul 2014 13:12:45 +0200	[thread overview]
Message-ID: <53BE752D.8040701@suse.de> (raw)
In-Reply-To: <1404989882-17362-3-git-send-email-Bharat.Bhushan@freescale.com>


On 10.07.14 12:57, Bharat Bhushan wrote:
> This patch adds interface to inject interrupt to guest.
> Currently a void program check exception function added.
> Follow up patch will use this interface to inject program
> check exception to guest
>
> Signed-off-by: Bharat Bhushan <Bharat.Bhushan@freescale.com>
> ---
> v5->v6
>   - replace debug with program interrupt
>
>   target-ppc/cpu.h |  1 +
>   target-ppc/kvm.c | 23 +++++++++++++++++++++++
>   2 files changed, 24 insertions(+)
>
> diff --git a/target-ppc/cpu.h b/target-ppc/cpu.h
> index b64c652..e60fc40 100644
> --- a/target-ppc/cpu.h
> +++ b/target-ppc/cpu.h
> @@ -2144,6 +2144,7 @@ enum {
>       PPC_INTERRUPT_CDOORBELL,      /* Critical doorbell interrupt          */
>       PPC_INTERRUPT_DOORBELL,       /* Doorbell interrupt                   */
>       PPC_INTERRUPT_PERFM,          /* Performance monitor interrupt        */
> +    PPC_INTERRUPT_PROGRAM,        /* Program check exception              */
>   };
>   
>   /* Processor Compatibility mask (PCR) */
> diff --git a/target-ppc/kvm.c b/target-ppc/kvm.c
> index 4df23dd..673c369 100644
> --- a/target-ppc/kvm.c
> +++ b/target-ppc/kvm.c
> @@ -761,6 +761,25 @@ static int kvm_put_vpa(CPUState *cs)
>   }
>   #endif /* TARGET_PPC64 */
>   
> +static int kvmppc_inject_program_exception(CPUState *cs)
> +{
> +    return 0;
> +}
> +
> +static void kvmppc_inject_exception(CPUState *cs)
> +{
> +    PowerPCCPU *cpu = POWERPC_CPU(cs);
> +    CPUPPCState *env = &cpu->env;
> +
> +    if (env->pending_interrupts & (1 << PPC_INTERRUPT_PROGRAM)) {
> +        if (kvmppc_inject_program_exception(cs)) {
> +            fprintf(stderr, "%s: PROGRAM exception injection failed\n", __func__);
> +            return;
> +        }
> +        env->pending_interrupts &= ~(1 << PPC_INTERRUPT_PROGRAM);

Do we really need to jump through these hoops? We could just directly 
call the injection, no?


Alex

> +    }
> +}
> +
>   int kvm_arch_put_registers(CPUState *cs, int level)
>   {
>       PowerPCCPU *cpu = POWERPC_CPU(cs);
> @@ -774,6 +793,10 @@ int kvm_arch_put_registers(CPUState *cs, int level)
>           return ret;
>       }
>   
> +    if (env->pending_interrupts) {
> +        kvmppc_inject_exception(cs);
> +    }
> +
>       regs.ctr = env->ctr;
>       regs.lr  = env->lr;
>       regs.xer = cpu_read_xer(env);

  reply	other threads:[~2014-07-10 11:13 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-07-10 10:57 [Qemu-devel] [PATCH 0/6 v6] ppc: Add debug stub support Bharat Bhushan
2014-07-10 10:57 ` [Qemu-devel] [PATCH 1/6 v6] ppc: debug stub: Get trap instruction opcode from KVM Bharat Bhushan
2014-07-10 14:07   ` Peter Maydell
2014-07-10 14:08     ` Alexander Graf
2014-07-10 10:57 ` [Qemu-devel] [PATCH 2/6 v6] ppc: Add interface to inject interrupt to guest Bharat Bhushan
2014-07-10 11:12   ` Alexander Graf [this message]
2014-07-10 10:57 ` [Qemu-devel] [PATCH 3/6 v6] ppc: synchronize excp_vectors for injecting exception Bharat Bhushan
2014-07-10 11:15   ` Alexander Graf
2014-07-10 10:58 ` [Qemu-devel] [PATCH 4/6 v6] ppc: Add program exception injection handler Bharat Bhushan
2014-07-10 10:58 ` [Qemu-devel] [PATCH 5/6 v6] ppc: Add software breakpoint support Bharat Bhushan
2014-07-10 11:18   ` Alexander Graf
2014-07-10 10:58 ` [Qemu-devel] [PATCH 6/6 v6] ppc: Add hw breakpoint watchpoint support Bharat Bhushan
2014-07-10 11:20   ` 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=53BE752D.8040701@suse.de \
    --to=agraf@suse.de \
    --cc=Bharat.Bhushan@freescale.com \
    --cc=maddy@linux.vnet.ibm.com \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-ppc@nongnu.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).