qemu-ppc
[Top][All Lists]
Advanced

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

Re: [Qemu-ppc] [PATCH 1/3] ppc debug stub: Get trap instruction opcode f


From: Alexander Graf
Subject: Re: [Qemu-ppc] [PATCH 1/3] ppc debug stub: Get trap instruction opcode from KVM
Date: Wed, 11 Jun 2014 14:41:35 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130910 Thunderbird/17.0.9

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 <address@hidden>
---
  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 via email to

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