[PATCH 4/6] KVM: PPC: BOOKE : Emulate rfdi instruction

2014-07-11 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| 17 + 2 files changed, 18 insertions(+) diff --git a/arch/powerpc

[PATCH 0/6] Guest debug emulation

2014-07-11 Thread Bharat Bhushan
This patchset adds debug register and interrupt emulation support for guest, which enables running gdb/kgdb etc in guest. This also have couple of bux fixes Bharat Bhushan (6): KVM: PPC: BOOKE: No need to set DBCR0_EDM in guest visible register KVM: PPC: BOOKE: Force MSR_DE in rfci if guest is

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

2014-07-11 Thread Bharat Bhushan
When userspace is debugging guest then MSR_DE is always set and MSRP_DEP is set so that guest cannot change MSR_DE. Guest debug resources are not yet emulated, So there seems no reason we should stop guest controlling MSR_DE. Also a followup patch will enable debug emulation and that requires guest

[PATCH 3/6] KVM: PPC: BOOKE: allow debug interrupt at "debug level"

2014-07-11 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 6/6] KVM: PPC: BOOKE: Emulate debug registers and exception

2014-07-11 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 1/6] KVM: PPC: BOOKE: No need to set DBCR0_EDM in guest visible register

2014-07-11 Thread Bharat Bhushan
This is not used and even I do not remember why this was added in first place. Signed-off-by: Bharat Bhushan --- arch/powerpc/kvm/booke.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/arch/powerpc/kvm/booke.c b/arch/powerpc/kvm/booke.c index ab62109..a5ee42c 100644 --- a/arch/powerpc/kvm

[PATCH 2/6] KVM: PPC: BOOKE: Force MSR_DE in rfci if guest is under debug

2014-07-11 Thread Bharat Bhushan
When userspace (QEMU) is using the debug resource to debug guest then we want MSR_DE to be always set. This patch adds missing MSR_DE setting in "rfci" instruction. Signed-off-by: Bharat Bhushan --- arch/powerpc/kvm/booke_emulate.c | 6 +- 1 file changed, 5 insertions(+), 1 deletion(-) diff