From: Alexander Graf <agraf@suse.de> To: Bharat Bhushan <r65777@freescale.com> Cc: <kvm-ppc@vger.kernel.org>, <kvm@vger.kernel.org>, <scottwood@freescale.com>, Bharat Bhushan <bharat.bhushan@freescale.com> Subject: Re: [PATCH 3/7] KVM: PPC: debug stub interface parameter defined Date: Thu, 7 Mar 2013 14:20:47 +0100 [thread overview] Message-ID: <E6586C32-8153-4D22-A690-ABF4006CD1C6@suse.de> (raw) In-Reply-To: <1362024796-4237-4-git-send-email-bharat.bhushan@freescale.com> On 28.02.2013, at 05:13, Bharat Bhushan wrote: > This patch defines the interface parameter for KVM_SET_GUEST_DEBUG > ioctl support. Follow up patches will use this for setting up > hardware breakpoints, watchpoints and software breakpoints. > > Also kvm_arch_vcpu_ioctl_set_guest_debug() is brought one level below. > This is because I am not sure what is required for book3s. So this ioctl > behaviour will not change for book3s. > > Signed-off-by: Bharat Bhushan <bharat.bhushan@freescale.com> > --- > arch/powerpc/include/uapi/asm/kvm.h | 23 +++++++++++++++++++++++ > arch/powerpc/kvm/book3s.c | 6 ++++++ > arch/powerpc/kvm/booke.c | 6 ++++++ > arch/powerpc/kvm/powerpc.c | 6 ------ > 4 files changed, 35 insertions(+), 6 deletions(-) > > diff --git a/arch/powerpc/include/uapi/asm/kvm.h b/arch/powerpc/include/uapi/asm/kvm.h > index c2ff99c..15f9a00 100644 > --- a/arch/powerpc/include/uapi/asm/kvm.h > +++ b/arch/powerpc/include/uapi/asm/kvm.h > @@ -272,8 +272,31 @@ struct kvm_debug_exit_arch { > > /* for KVM_SET_GUEST_DEBUG */ > struct kvm_guest_debug_arch { > + struct { > + /* H/W breakpoint/watchpoint address */ > + __u64 addr; > + /* > + * Type denotes h/w breakpoint, read watchpoint, write > + * watchpoint or watchpoint (both read and write). > + */ > +#define KVMPPC_DEBUG_NOTYPE 0x0 > +#define KVMPPC_DEBUG_BREAKPOINT (1UL << 1) > +#define KVMPPC_DEBUG_WATCH_WRITE (1UL << 2) > +#define KVMPPC_DEBUG_WATCH_READ (1UL << 3) > + __u32 type; > + __u32 reserved; > + } bp[16]; > }; > > +/* Debug related defines */ > +/* > + * kvm_guest_debug->control is a 32 bit field. The lower 16 bits are generic > + * and upper 16 bits are architecture specific. Architecture specific defines > + * that ioctl is for setting hardware breakpoint or software breakpoint. > + */ > +#define KVM_GUESTDBG_USE_SW_BP 0x00010000 > +#define KVM_GUESTDBG_USE_HW_BP 0x00020000 You only need #define KVM_GUESTDBG_HW_BP 0x00010000 In absence of the flag, it's a SW breakpoint. Alex > + > /* definition of registers in kvm_run */ > struct kvm_sync_regs { > }; > diff --git a/arch/powerpc/kvm/book3s.c b/arch/powerpc/kvm/book3s.c > index 975a401..cb85d73 100644 > --- a/arch/powerpc/kvm/book3s.c > +++ b/arch/powerpc/kvm/book3s.c > @@ -613,6 +613,12 @@ int kvm_arch_vcpu_ioctl_translate(struct kvm_vcpu *vcpu, > return 0; > } > > +int kvm_arch_vcpu_ioctl_set_guest_debug(struct kvm_vcpu *vcpu, > + struct kvm_guest_debug *dbg) > +{ > + return -EINVAL; > +} > + > void kvmppc_decrementer_func(unsigned long data) > { > struct kvm_vcpu *vcpu = (struct kvm_vcpu *)data; > diff --git a/arch/powerpc/kvm/booke.c b/arch/powerpc/kvm/booke.c > index a41cd6d..1de93a8 100644 > --- a/arch/powerpc/kvm/booke.c > +++ b/arch/powerpc/kvm/booke.c > @@ -1527,6 +1527,12 @@ int kvm_vcpu_ioctl_set_one_reg(struct kvm_vcpu *vcpu, struct kvm_one_reg *reg) > return r; > } > > +int kvm_arch_vcpu_ioctl_set_guest_debug(struct kvm_vcpu *vcpu, > + struct kvm_guest_debug *dbg) > +{ > + return -EINVAL; > +} > + > int kvm_arch_vcpu_ioctl_get_fpu(struct kvm_vcpu *vcpu, struct kvm_fpu *fpu) > { > return -ENOTSUPP; > diff --git a/arch/powerpc/kvm/powerpc.c b/arch/powerpc/kvm/powerpc.c > index 934413c..4c94ca9 100644 > --- a/arch/powerpc/kvm/powerpc.c > +++ b/arch/powerpc/kvm/powerpc.c > @@ -532,12 +532,6 @@ void kvm_arch_vcpu_put(struct kvm_vcpu *vcpu) > #endif > } > > -int kvm_arch_vcpu_ioctl_set_guest_debug(struct kvm_vcpu *vcpu, > - struct kvm_guest_debug *dbg) > -{ > - return -EINVAL; > -} > - > static void kvmppc_complete_dcr_load(struct kvm_vcpu *vcpu, > struct kvm_run *run) > { > -- > 1.7.0.4 > >
WARNING: multiple messages have this Message-ID (diff)
From: Alexander Graf <agraf@suse.de> To: Bharat Bhushan <r65777@freescale.com> Cc: kvm-ppc@vger.kernel.org, kvm@vger.kernel.org, scottwood@freescale.com, Bharat Bhushan <bharat.bhushan@freescale.com> Subject: Re: [PATCH 3/7] KVM: PPC: debug stub interface parameter defined Date: Thu, 07 Mar 2013 13:20:47 +0000 [thread overview] Message-ID: <E6586C32-8153-4D22-A690-ABF4006CD1C6@suse.de> (raw) In-Reply-To: <1362024796-4237-4-git-send-email-bharat.bhushan@freescale.com> On 28.02.2013, at 05:13, Bharat Bhushan wrote: > This patch defines the interface parameter for KVM_SET_GUEST_DEBUG > ioctl support. Follow up patches will use this for setting up > hardware breakpoints, watchpoints and software breakpoints. > > Also kvm_arch_vcpu_ioctl_set_guest_debug() is brought one level below. > This is because I am not sure what is required for book3s. So this ioctl > behaviour will not change for book3s. > > Signed-off-by: Bharat Bhushan <bharat.bhushan@freescale.com> > --- > arch/powerpc/include/uapi/asm/kvm.h | 23 +++++++++++++++++++++++ > arch/powerpc/kvm/book3s.c | 6 ++++++ > arch/powerpc/kvm/booke.c | 6 ++++++ > arch/powerpc/kvm/powerpc.c | 6 ------ > 4 files changed, 35 insertions(+), 6 deletions(-) > > diff --git a/arch/powerpc/include/uapi/asm/kvm.h b/arch/powerpc/include/uapi/asm/kvm.h > index c2ff99c..15f9a00 100644 > --- a/arch/powerpc/include/uapi/asm/kvm.h > +++ b/arch/powerpc/include/uapi/asm/kvm.h > @@ -272,8 +272,31 @@ struct kvm_debug_exit_arch { > > /* for KVM_SET_GUEST_DEBUG */ > struct kvm_guest_debug_arch { > + struct { > + /* H/W breakpoint/watchpoint address */ > + __u64 addr; > + /* > + * Type denotes h/w breakpoint, read watchpoint, write > + * watchpoint or watchpoint (both read and write). > + */ > +#define KVMPPC_DEBUG_NOTYPE 0x0 > +#define KVMPPC_DEBUG_BREAKPOINT (1UL << 1) > +#define KVMPPC_DEBUG_WATCH_WRITE (1UL << 2) > +#define KVMPPC_DEBUG_WATCH_READ (1UL << 3) > + __u32 type; > + __u32 reserved; > + } bp[16]; > }; > > +/* Debug related defines */ > +/* > + * kvm_guest_debug->control is a 32 bit field. The lower 16 bits are generic > + * and upper 16 bits are architecture specific. Architecture specific defines > + * that ioctl is for setting hardware breakpoint or software breakpoint. > + */ > +#define KVM_GUESTDBG_USE_SW_BP 0x00010000 > +#define KVM_GUESTDBG_USE_HW_BP 0x00020000 You only need #define KVM_GUESTDBG_HW_BP 0x00010000 In absence of the flag, it's a SW breakpoint. Alex > + > /* definition of registers in kvm_run */ > struct kvm_sync_regs { > }; > diff --git a/arch/powerpc/kvm/book3s.c b/arch/powerpc/kvm/book3s.c > index 975a401..cb85d73 100644 > --- a/arch/powerpc/kvm/book3s.c > +++ b/arch/powerpc/kvm/book3s.c > @@ -613,6 +613,12 @@ int kvm_arch_vcpu_ioctl_translate(struct kvm_vcpu *vcpu, > return 0; > } > > +int kvm_arch_vcpu_ioctl_set_guest_debug(struct kvm_vcpu *vcpu, > + struct kvm_guest_debug *dbg) > +{ > + return -EINVAL; > +} > + > void kvmppc_decrementer_func(unsigned long data) > { > struct kvm_vcpu *vcpu = (struct kvm_vcpu *)data; > diff --git a/arch/powerpc/kvm/booke.c b/arch/powerpc/kvm/booke.c > index a41cd6d..1de93a8 100644 > --- a/arch/powerpc/kvm/booke.c > +++ b/arch/powerpc/kvm/booke.c > @@ -1527,6 +1527,12 @@ int kvm_vcpu_ioctl_set_one_reg(struct kvm_vcpu *vcpu, struct kvm_one_reg *reg) > return r; > } > > +int kvm_arch_vcpu_ioctl_set_guest_debug(struct kvm_vcpu *vcpu, > + struct kvm_guest_debug *dbg) > +{ > + return -EINVAL; > +} > + > int kvm_arch_vcpu_ioctl_get_fpu(struct kvm_vcpu *vcpu, struct kvm_fpu *fpu) > { > return -ENOTSUPP; > diff --git a/arch/powerpc/kvm/powerpc.c b/arch/powerpc/kvm/powerpc.c > index 934413c..4c94ca9 100644 > --- a/arch/powerpc/kvm/powerpc.c > +++ b/arch/powerpc/kvm/powerpc.c > @@ -532,12 +532,6 @@ void kvm_arch_vcpu_put(struct kvm_vcpu *vcpu) > #endif > } > > -int kvm_arch_vcpu_ioctl_set_guest_debug(struct kvm_vcpu *vcpu, > - struct kvm_guest_debug *dbg) > -{ > - return -EINVAL; > -} > - > static void kvmppc_complete_dcr_load(struct kvm_vcpu *vcpu, > struct kvm_run *run) > { > -- > 1.7.0.4 > >
next prev parent reply other threads:[~2013-03-07 13:20 UTC|newest] Thread overview: 72+ messages / expand[flat|nested] mbox.gz Atom feed top 2013-02-28 4:13 [PATCH 0/7] KVM :PPC: Userspace Debug support Bharat Bhushan 2013-02-28 4:25 ` Bharat Bhushan 2013-02-28 4:13 ` [PATCH 1/7] KVM: PPC: booke: Added debug handler Bharat Bhushan 2013-02-28 4:25 ` Bharat Bhushan 2013-03-07 14:02 ` Alexander Graf 2013-03-07 14:02 ` Alexander Graf 2013-02-28 4:13 ` [PATCH 2/7] Added ONE_REG interface for debug instruction Bharat Bhushan 2013-02-28 4:25 ` Bharat Bhushan 2013-02-28 16:23 ` Scott Wood 2013-02-28 16:23 ` Scott Wood 2013-02-28 16:52 ` Alexander Graf 2013-02-28 16:52 ` Alexander Graf 2013-03-01 5:28 ` Bhushan Bharat-R65777 2013-03-01 5:28 ` Bhushan Bharat-R65777 2013-03-07 13:07 ` Alexander Graf 2013-03-07 13:07 ` Alexander Graf 2013-03-14 4:30 ` Bhushan Bharat-R65777 2013-03-14 11:56 ` Alexander Graf 2013-03-14 11:56 ` Alexander Graf 2013-02-28 4:13 ` [PATCH 3/7] KVM: PPC: debug stub interface parameter defined Bharat Bhushan 2013-02-28 4:25 ` Bharat Bhushan 2013-03-07 13:20 ` Alexander Graf [this message] 2013-03-07 13:20 ` Alexander Graf 2013-03-14 4:42 ` Bhushan Bharat-R65777 2013-03-14 11:54 ` Alexander Graf 2013-03-14 11:54 ` Alexander Graf 2013-03-14 11:57 ` Jan Kiszka 2013-03-14 11:57 ` Jan Kiszka 2013-03-14 12:09 ` Alexander Graf 2013-03-14 12:09 ` Alexander Graf 2013-03-14 12:13 ` Jan Kiszka 2013-03-14 12:13 ` Jan Kiszka 2013-03-14 12:19 ` Alexander Graf 2013-03-14 12:19 ` Alexander Graf 2013-03-14 12:22 ` Jan Kiszka 2013-03-14 12:22 ` Jan Kiszka 2013-03-14 12:28 ` Alexander Graf 2013-03-14 12:28 ` Alexander Graf 2013-02-28 4:13 ` [PATCH 4/7] booke: Save and restore debug registers on guest entry and exit Bharat Bhushan 2013-02-28 4:25 ` Bharat Bhushan 2013-03-07 13:25 ` Alexander Graf 2013-03-07 13:25 ` Alexander Graf 2013-03-14 4:50 ` Bhushan Bharat-R65777 2013-03-14 11:52 ` Alexander Graf 2013-03-14 11:52 ` Alexander Graf 2013-03-14 14:44 ` Bhushan Bharat-R65777 2013-02-28 4:13 ` [PATCH 5/7] bookehv: " Bharat Bhushan 2013-02-28 4:25 ` Bharat Bhushan 2013-02-28 4:13 ` [PATCH 6/7] Rename EMULATE_DO_PAPR to EMULATE_EXIT_USER Bharat Bhushan 2013-02-28 4:25 ` Bharat Bhushan 2013-02-28 16:31 ` Scott Wood 2013-02-28 16:31 ` Scott Wood 2013-02-28 16:51 ` Alexander Graf 2013-02-28 16:51 ` Alexander Graf 2013-02-28 16:53 ` Scott Wood 2013-02-28 16:53 ` Scott Wood 2013-03-07 10:47 ` Alexander Graf 2013-03-07 10:47 ` Alexander Graf 2013-03-14 5:59 ` Bhushan Bharat-R65777 2013-02-28 4:13 ` [PATCH 7/7] KVM: PPC: Add userspace debug stub support Bharat Bhushan 2013-02-28 4:25 ` Bharat Bhushan 2013-03-07 13:39 ` Alexander Graf 2013-03-07 13:39 ` Alexander Graf 2013-03-14 5:18 ` Bhushan Bharat-R65777 2013-03-14 5:18 ` Bhushan Bharat-R65777 2013-03-14 11:50 ` Alexander Graf 2013-03-14 11:50 ` Alexander Graf 2013-03-14 13:57 ` Bhushan Bharat-R65777 2013-03-14 13:57 ` Bhushan Bharat-R65777 2013-03-14 16:05 ` Scott Wood 2013-03-14 16:05 ` Scott Wood 2013-03-14 16:11 ` Bhushan Bharat-R65777
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=E6586C32-8153-4D22-A690-ABF4006CD1C6@suse.de \ --to=agraf@suse.de \ --cc=bharat.bhushan@freescale.com \ --cc=kvm-ppc@vger.kernel.org \ --cc=kvm@vger.kernel.org \ --cc=r65777@freescale.com \ --cc=scottwood@freescale.com \ /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: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.