> -----Original Message-----
> From: Alexander Graf [mailto:ag...@suse.de]
> Sent: Thursday, January 31, 2013 11:23 PM
> To: Bhushan Bharat-R65777
> Cc: kvm-ppc@vger.kernel.org; k...@vger.kernel.org
> Subject: Re: [PATCH 4/8] Added ONE_REG interface for debug instruction
> 
> 
> On 31.01.2013, at 18:44, Bhushan Bharat-R65777 wrote:
> 
> >
> >
> >> -----Original Message-----
> >> From: Alexander Graf [mailto:ag...@suse.de]
> >> Sent: Friday, January 25, 2013 5:18 PM
> >> To: Bhushan Bharat-R65777
> >> Cc: kvm-ppc@vger.kernel.org; k...@vger.kernel.org; Bhushan
> >> Bharat-R65777
> >> Subject: Re: [PATCH 4/8] Added ONE_REG interface for debug
> >> instruction
> >>
> >>
> >> On 16.01.2013, at 09:24, Bharat Bhushan wrote:
> >>
> >>> This patch adds the one_reg interface to get the special instruction
> >>> to be used for setting software breakpoint from userspace.
> >>>
> >>> Signed-off-by: Bharat Bhushan <bharat.bhus...@freescale.com>
> >>> ---
> >>> Documentation/virtual/kvm/api.txt   |    1 +
> >>> arch/powerpc/include/asm/kvm_ppc.h  |    1 +
> >>> arch/powerpc/include/uapi/asm/kvm.h |    3 +++
> >>> arch/powerpc/kvm/44x.c              |    5 +++++
> >>> arch/powerpc/kvm/booke.c            |   10 ++++++++++
> >>> arch/powerpc/kvm/e500.c             |    5 +++++
> >>> arch/powerpc/kvm/e500.h             |    9 +++++++++
> >>> arch/powerpc/kvm/e500mc.c           |    5 +++++
> >>> 8 files changed, 39 insertions(+), 0 deletions(-)
> >>>
> >>> diff --git a/Documentation/virtual/kvm/api.txt
> >>> b/Documentation/virtual/kvm/api.txt
> >>> index 09905cb..7e8be9e 100644
> >>> --- a/Documentation/virtual/kvm/api.txt
> >>> +++ b/Documentation/virtual/kvm/api.txt
> >>> @@ -1775,6 +1775,7 @@ registers, find a list below:
> >>>  PPC   | KVM_REG_PPC_VPA_DTL   | 128
> >>>  PPC   | KVM_REG_PPC_EPCR | 32
> >>>  PPC   | KVM_REG_PPC_EPR  | 32
> >>> +  PPC   | KVM_REG_PPC_DEBUG_INST| 32
> >>>
> >>> 4.69 KVM_GET_ONE_REG
> >>>
> >>> diff --git a/arch/powerpc/include/asm/kvm_ppc.h
> >>> b/arch/powerpc/include/asm/kvm_ppc.h
> >>> index 44a657a..b3c481e 100644
> >>> --- a/arch/powerpc/include/asm/kvm_ppc.h
> >>> +++ b/arch/powerpc/include/asm/kvm_ppc.h
> >>> @@ -235,6 +235,7 @@ union kvmppc_one_reg {
> >>>
> >>> void kvmppc_core_get_sregs(struct kvm_vcpu *vcpu, struct kvm_sregs
> >>> *sregs); int kvmppc_core_set_sregs(struct kvm_vcpu *vcpu, struct
> >>> kvm_sregs *sregs);
> >>> +u32 kvmppc_core_debug_inst_op(void);
> >>>
> >>> void kvmppc_get_sregs_ivor(struct kvm_vcpu *vcpu, struct kvm_sregs
> >>> *sregs); int kvmppc_set_sregs_ivor(struct kvm_vcpu *vcpu, struct
> >>> kvm_sregs *sregs); diff --git a/arch/powerpc/include/uapi/asm/kvm.h
> >>> b/arch/powerpc/include/uapi/asm/kvm.h
> >>> index 16064d0..e81ae5b 100644
> >>> --- a/arch/powerpc/include/uapi/asm/kvm.h
> >>> +++ b/arch/powerpc/include/uapi/asm/kvm.h
> >>> @@ -417,4 +417,7 @@ struct kvm_get_htab_header {
> >>> #define KVM_REG_PPC_EPCR  (KVM_REG_PPC | KVM_REG_SIZE_U32 | 0x85)
> >>> #define KVM_REG_PPC_EPR           (KVM_REG_PPC | KVM_REG_SIZE_U32 | 0x86)
> >>>
> >>> +/* Debugging: Special instruction for software breakpoint */
> >>> +#define KVM_REG_PPC_DEBUG_INST (KVM_REG_PPC | KVM_REG_SIZE_U32 |
> >>> +0x87)
> >>> +
> >>> #endif /* __LINUX_KVM_POWERPC_H */
> >>> diff --git a/arch/powerpc/kvm/44x.c b/arch/powerpc/kvm/44x.c index
> >>> 3d7fd21..41501be 100644
> >>> --- a/arch/powerpc/kvm/44x.c
> >>> +++ b/arch/powerpc/kvm/44x.c
> >>> @@ -114,6 +114,11 @@ int kvmppc_core_vcpu_translate(struct kvm_vcpu *vcpu,
> >>>   return 0;
> >>> }
> >>>
> >>> +u32 kvmppc_core_debug_inst_op(void) {
> >>> + return -1;
> 
> The way you handle it here this needs to be an  int
> kvmppc_core_debug_inst_op(u32 *inst) so you can return an error for 440. I 
> don't
> think it's worth to worry about a case where we don't know about the inst
> though. Just return the same as what we use on e500v2 here.
> 
> >>> +}
> >>> +
> >>> void kvmppc_core_get_sregs(struct kvm_vcpu *vcpu, struct kvm_sregs
> >>> *sregs) {
> >>>   kvmppc_get_sregs_ivor(vcpu, sregs); diff --git
> >>> a/arch/powerpc/kvm/booke.c b/arch/powerpc/kvm/booke.c index
> >>> d2f502d..453a10f 100644
> >>> --- a/arch/powerpc/kvm/booke.c
> >>> +++ b/arch/powerpc/kvm/booke.c
> >>
> >> Please provide the DEBUG_INST on a more global level - across all ppc
> subarchs.
> >
> > Do you mean defining in powerpc.c ?
> >
> > We are using one_reg for DEBUG_INST and one_reg_ioctl and defined in
> respective subarchs (booke and books have their separate handler). So how you
> want this to be defined in more common way for all subarchs?
> 
> Just add it to all subarch's one_reg handlers.

And what book3s etc should return?

-1 ? 

Thanks
-Bharat

--
To unsubscribe from this list: send the line "unsubscribe kvm-ppc" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to