RE: [PATCH 5/5 v2] KVM: PPC: BOOKE: Emulate debug registers and exception

2014-08-04 Thread bharat.bhus...@freescale.com
> -Original Message- > From: Wood Scott-B07421 > Sent: Tuesday, August 05, 2014 4:23 AM > To: Bhushan Bharat-R65777 > Cc: ag...@suse.de; kvm-ppc@vger.kernel.org; k...@vger.kernel.org; Yoder > Stuart- > B08248 > Subject: Re: [PATCH 5/5 v2] KVM: PPC: BOOKE: Emulate debug registers and > ex

Re: [PATCH 4/5] KVM: PPC: BOOKE: Clear guest dbsr in userspace exit KVM_EXIT_DEBUG

2014-08-04 Thread Scott Wood
On Mon, 2014-08-04 at 22:33 -0500, Bhushan Bharat-R65777 wrote: > > > -Original Message- > > From: Wood Scott-B07421 > > Sent: Tuesday, August 05, 2014 4:17 AM > > To: Bhushan Bharat-R65777 > > Cc: ag...@suse.de; kvm-ppc@vger.kernel.org; k...@vger.kernel.org; Yoder > > Stuart- > > B08248

RE: [PATCH 4/5] KVM: PPC: BOOKE: Clear guest dbsr in userspace exit KVM_EXIT_DEBUG

2014-08-04 Thread bharat.bhus...@freescale.com
> -Original Message- > From: Wood Scott-B07421 > Sent: Tuesday, August 05, 2014 4:17 AM > To: Bhushan Bharat-R65777 > Cc: ag...@suse.de; kvm-ppc@vger.kernel.org; k...@vger.kernel.org; Yoder > Stuart- > B08248 > Subject: Re: [PATCH 4/5] KVM: PPC: BOOKE: Clear guest dbsr in userspace exit

Re: [PATCH 5/5 v2] KVM: PPC: BOOKE: Emulate debug registers and exception

2014-08-04 Thread Scott Wood
On Mon, 2014-08-04 at 13:32 +0530, Bharat Bhushan wrote: > @@ -735,7 +745,27 @@ static int kvmppc_handle_debug(struct kvm_run *run, > struct kvm_vcpu *vcpu) > struct debug_reg *dbg_reg = &(vcpu->arch.shadow_dbg_reg); > u32 dbsr = vcpu->arch.dbsr; > > - /* Clear guest dbsr (vcpu->

Re: [PATCH 4/5] KVM: PPC: BOOKE: Clear guest dbsr in userspace exit KVM_EXIT_DEBUG

2014-08-04 Thread Scott Wood
On Mon, 2014-08-04 at 13:22 +0530, Bharat Bhushan wrote: > Dbsr is not visible to userspace and we do not think any need to > expose this to userspace because: > Userspace cannot inject debug interrupt to guest (as this > does not know guest ability to handle debug interrupt), so > userspace

[PATCH 4/5 v2] KVM: PPC: BOOKE: Clear guest dbsr in userspace exit KVM_EXIT_DEBUG

2014-08-04 Thread Bharat Bhushan
Dbsr is not visible to userspace and we do not think any need to expose this to userspace because: Userspace cannot inject debug interrupt to guest (as this does not know guest ability to handle debug interrupt), so userspace will always clear DBSR. Now if userspace has to always clear DBSR

[PATCH 2/5 v2] KVM: PPC: BOOKE : Emulate rfdi instruction

2014-08-04 Thread Bharat Bhushan
This patch adds "rfdi" instruction emulation which is required for guest debug hander on BOOKE-HV Signed-off-by: Bharat Bhushan --- v1->v2 -msr update based on guest_debug done under _set_msr(); so removed same check here arch/powerpc/include/asm/kvm_host.h | 1 + arch/powerpc/kvm/booke_emu

[PATCH 1/5 v2] KVM: PPC: BOOKE: allow debug interrupt at "debug level"

2014-08-04 Thread Bharat Bhushan
Debug interrupt can be either "critical level" or "debug level". There are separate set of save/restore registers used for different level. Example: DSRR0/DSRR1 are used for "debug level" and CSRR0/CSRR1 are used for critical level debug interrupt. Using CPU_FTR_DEBUG_LVL_EXC to decide which inter

[PATCH 5/5 v2] KVM: PPC: BOOKE: Emulate debug registers and exception

2014-08-04 Thread Bharat Bhushan
This patch emulates debug registers and debug exception to support guest using debug resource. This enables running gdb/kgdb etc in guest. On BOOKE architecture we cannot share debug resources between QEMU and guest because: When QEMU is using debug resources then debug exception must be a

[PATCH 3/5 v2] KVM: PPC: BOOKE: Allow guest to change MSR_DE

2014-08-04 Thread Bharat Bhushan
This patch changes the default behavior of MSRP_DEP, that is guest is not allowed to change the MSR_DE, to guest can change MSR_DE. When userspace is debugging guest then it override the default behavior and set MSRP_DEP. This stops guest to change MSR_DE when userspace is debugging guest. Signed-

[PATCH 0/5 v2] Guest debug emulation

2014-08-04 Thread Bharat Bhushan
This patchset adds debug register and interrupt emulation support for guest, which enables running gdb/kgdb etc in guest. Bharat Bhushan (5): KVM: PPC: BOOKE: allow debug interrupt at "debug level" KVM: PPC: BOOKE : Emulate rfdi instruction KVM: PPC: BOOKE: Allow guest to change MSR_DE KVM

[PATCH 2/5] KVM: PPC: BOOKE : Emulate rfdi instruction

2014-08-04 Thread Bharat Bhushan
This patch adds "rfdi" instruction emulation which is required for guest debug hander on BOOKE-HV Signed-off-by: Bharat Bhushan --- arch/powerpc/include/asm/kvm_host.h | 1 + arch/powerpc/kvm/booke_emulate.c| 13 + 2 files changed, 14 insertions(+) diff --git a/arch/powerpc/inc

[PATCH 1/5] KVM: PPC: BOOKE: allow debug interrupt at "debug level"

2014-08-04 Thread Bharat Bhushan
Debug interrupt can be either "critical level" or "debug level". There are separate set of save/restore registers used for different level. Example: DSRR0/DSRR1 are used for "debug level" and CSRR0/CSRR1 are used for critical level debug interrupt. Using CPU_FTR_DEBUG_LVL_EXC to decide which inter

[PATCH 5/5] KVM: PPC: BOOKE: Emulate debug registers and exception

2014-08-04 Thread Bharat Bhushan
This patch emulates debug registers and debug exception to support guest using debug resource. This enables running gdb/kgdb etc in guest. On BOOKE architecture we cannot share debug resources between QEMU and guest because: When QEMU is using debug resources then debug exception must be a

[PATCH 3/5] KVM: PPC: BOOKE: Allow guest to change MSR_DE

2014-08-04 Thread Bharat Bhushan
This patch changes the default behavior of MSRP_DEP, that is guest is not allowed to change the MSR_DE, to guest can change MSR_DE. When userspace is debugging guest then it override the default behavior and set MSRP_DEP. This stops guest to change MSR_DE when userspace is debugging guest. Signed-

[PATCH 4/5] KVM: PPC: BOOKE: Clear guest dbsr in userspace exit KVM_EXIT_DEBUG

2014-08-04 Thread Bharat Bhushan
Dbsr is not visible to userspace and we do not think any need to expose this to userspace because: Userspace cannot inject debug interrupt to guest (as this does not know guest ability to handle debug interrupt), so userspace will always clear DBSR. Now if userspace has to always clear DBSR