Message ID | 1404989882-17362-2-git-send-email-Bharat.Bhushan@freescale.com |
---|---|
State | New |
Headers | show |
On 10 July 2014 11:57, Bharat Bhushan <Bharat.Bhushan@freescale.com> 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> > --- > v5->v6 > - no change > > target-ppc/kvm.c | 4 ++++ > 1 file changed, 4 insertions(+) > > diff --git a/target-ppc/kvm.c b/target-ppc/kvm.c > index 2d87108..4df23dd 100644 > --- a/target-ppc/kvm.c > +++ b/target-ppc/kvm.c > @@ -72,6 +72,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 > @@ -436,6 +438,8 @@ int kvm_arch_init_vcpu(CPUState *cs) > break; > } > > + kvm_get_one_reg(cs, KVM_REG_PPC_DEBUG_INST, &debug_inst_opcode); > + Presumably the kernel guarantees that this is always the same value for every CPU in the system? thanks -- PMM
On 10.07.14 16:07, Peter Maydell wrote: > On 10 July 2014 11:57, Bharat Bhushan <Bharat.Bhushan@freescale.com> 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> >> --- >> v5->v6 >> - no change >> >> target-ppc/kvm.c | 4 ++++ >> 1 file changed, 4 insertions(+) >> >> diff --git a/target-ppc/kvm.c b/target-ppc/kvm.c >> index 2d87108..4df23dd 100644 >> --- a/target-ppc/kvm.c >> +++ b/target-ppc/kvm.c >> @@ -72,6 +72,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 >> @@ -436,6 +438,8 @@ int kvm_arch_init_vcpu(CPUState *cs) >> break; >> } >> >> + kvm_get_one_reg(cs, KVM_REG_PPC_DEBUG_INST, &debug_inst_opcode); >> + > Presumably the kernel guarantees that this is always the > same value for every CPU in the system? Yes :) Alex
diff --git a/target-ppc/kvm.c b/target-ppc/kvm.c index 2d87108..4df23dd 100644 --- a/target-ppc/kvm.c +++ b/target-ppc/kvm.c @@ -72,6 +72,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 @@ -436,6 +438,8 @@ int kvm_arch_init_vcpu(CPUState *cs) break; } + kvm_get_one_reg(cs, KVM_REG_PPC_DEBUG_INST, &debug_inst_opcode); + return ret; }
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> --- v5->v6 - no change target-ppc/kvm.c | 4 ++++ 1 file changed, 4 insertions(+)