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: qemu-ppc@nongnu.org, qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH 1/3] ppc debug stub: Get trap instruction opcode from KVM
Date: Wed, 11 Jun 2014 14:41:35 +0200	[thread overview]
Message-ID: <53984E7F.30601@suse.de> (raw)
In-Reply-To: <1402412796-17299-2-git-send-email-Bharat.Bhushan@freescale.com>

On 06/10/2014 05:06 PM, Bharat Bhushan wrote:
> Get trap instruction opcode from KVM and this opcode will
> be used for setting software breakpoint in following patch
>
> Signed-off-by: Bharat Bhushan <Bharat.Bhushan@freescale.com>
> ---
>   target-ppc/kvm.c | 11 +++++++++++
>   1 file changed, 11 insertions(+)
>
> diff --git a/target-ppc/kvm.c b/target-ppc/kvm.c
> index dfa5a26..4fc005f 100644
> --- a/target-ppc/kvm.c
> +++ b/target-ppc/kvm.c
> @@ -71,6 +71,8 @@ static int cap_papr;
>   static int cap_htab_fd;
>   static int cap_fixup_hcalls;
>   
> +static uint32_t debug_inst_opcode;
> +
>   /* XXX We have a race condition where we actually have a level triggered
>    *     interrupt, but the infrastructure can't expose that yet, so the guest
>    *     takes but ignores it, goes to sleep and never gets notified that there's
> @@ -412,6 +414,7 @@ int kvm_arch_init_vcpu(CPUState *cs)
>   {
>       PowerPCCPU *cpu = POWERPC_CPU(cs);
>       CPUPPCState *cenv = &cpu->env;
> +    struct kvm_one_reg reg;
>       int ret;
>   
>       /* Gather server mmu info from KVM and update the CPU state */
> @@ -434,6 +437,14 @@ int kvm_arch_init_vcpu(CPUState *cs)
>           break;
>       }
>   
> +    reg.id = KVM_REG_PPC_DEBUG_INST,
> +    reg.addr = (uintptr_t) &debug_inst_opcode,
> +
> +    ret = kvm_vcpu_ioctl(cs, KVM_GET_ONE_REG, &reg);
> +    if (ret) {
> +        return ret;
> +    }

How about kvm_get_one_reg()? :)


Alex

       reply	other threads:[~2014-06-11 12:41 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <1402412796-17299-1-git-send-email-Bharat.Bhushan@freescale.com>
     [not found] ` <1402412796-17299-2-git-send-email-Bharat.Bhushan@freescale.com>
2014-06-11 12:41   ` Alexander Graf [this message]
     [not found] ` <1402412796-17299-4-git-send-email-Bharat.Bhushan@freescale.com>
2014-06-11 13:04   ` [Qemu-devel] [PATCH 3/3] ppc debug: Add debug stub support Alexander Graf
2014-06-12  7:05     ` Bharat.Bhushan
2014-06-13 11:24       ` Alexander Graf
2014-06-16  4:27         ` Bharat.Bhushan
2014-06-16  9:04           ` 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=53984E7F.30601@suse.de \
    --to=agraf@suse.de \
    --cc=Bharat.Bhushan@freescale.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).