From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55267) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Wuhqf-0006pR-25 for qemu-devel@nongnu.org; Wed, 11 Jun 2014 08:41:59 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WuhqT-0002Dv-IP for qemu-devel@nongnu.org; Wed, 11 Jun 2014 08:41:49 -0400 Message-ID: <53984E7F.30601@suse.de> Date: Wed, 11 Jun 2014 14:41:35 +0200 From: Alexander Graf MIME-Version: 1.0 References: <1402412796-17299-1-git-send-email-Bharat.Bhushan@freescale.com> <1402412796-17299-2-git-send-email-Bharat.Bhushan@freescale.com> In-Reply-To: <1402412796-17299-2-git-send-email-Bharat.Bhushan@freescale.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 1/3] ppc debug stub: Get trap instruction opcode from KVM List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Bharat Bhushan Cc: qemu-ppc@nongnu.org, qemu-devel@nongnu.org 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 > --- > 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, ®); > + if (ret) { > + return ret; > + } How about kvm_get_one_reg()? :) Alex