public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] KVM: PowerPC: Disarm old guest debug interface
@ 2008-12-19 17:13 Jan Kiszka
  2008-12-24 11:48 ` Avi Kivity
  0 siblings, 1 reply; 6+ messages in thread
From: Jan Kiszka @ 2008-12-19 17:13 UTC (permalink / raw)
  To: kvm-devel; +Cc: Avi Kivity, Hollis Blanchard, Christian Ehrhardt

[Take this as a band-aid, I guess the PowerPC people can do better.]

Until PowerPC is updated to the new guest debugging interface, we have
to remove the current implementation. This should also unbreak the
build.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
---

 arch/powerpc/kvm/44x.c     |   20 --------------------
 arch/powerpc/kvm/powerpc.c |   20 +-------------------
 2 files changed, 1 insertions(+), 39 deletions(-)

diff --git a/arch/powerpc/kvm/44x.c b/arch/powerpc/kvm/44x.c
index a66bec5..20b9be0 100644
--- a/arch/powerpc/kvm/44x.c
+++ b/arch/powerpc/kvm/44x.c
@@ -55,7 +55,6 @@ void kvmppc_core_load_host_debugstate(struct kvm_vcpu *vcpu)
 
 void kvmppc_core_load_guest_debugstate(struct kvm_vcpu *vcpu)
 {
-	struct kvm_guest_debug *dbg = &vcpu->guest_debug;
 	u32 dbcr0 = 0;
 
 	vcpu->arch.host_msr = mfmsr();
@@ -70,25 +69,6 @@ void kvmppc_core_load_guest_debugstate(struct kvm_vcpu *vcpu)
 	vcpu->arch.host_dbcr1 = mfspr(SPRN_DBCR1);
 	vcpu->arch.host_dbcr2 = mfspr(SPRN_DBCR2);
 
-	/* set registers up for guest */
-
-	if (dbg->bp[0]) {
-		mtspr(SPRN_IAC1, dbg->bp[0]);
-		dbcr0 |= DBCR0_IAC1 | DBCR0_IDM;
-	}
-	if (dbg->bp[1]) {
-		mtspr(SPRN_IAC2, dbg->bp[1]);
-		dbcr0 |= DBCR0_IAC2 | DBCR0_IDM;
-	}
-	if (dbg->bp[2]) {
-		mtspr(SPRN_IAC3, dbg->bp[2]);
-		dbcr0 |= DBCR0_IAC3 | DBCR0_IDM;
-	}
-	if (dbg->bp[3]) {
-		mtspr(SPRN_IAC4, dbg->bp[3]);
-		dbcr0 |= DBCR0_IAC4 | DBCR0_IDM;
-	}
-
 	mtspr(SPRN_DBCR0, dbcr0);
 	mtspr(SPRN_DBCR1, 0);
 	mtspr(SPRN_DBCR2, 0);
diff --git a/arch/powerpc/kvm/powerpc.c b/arch/powerpc/kvm/powerpc.c
index 74b576a..ed6669c 100644
--- a/arch/powerpc/kvm/powerpc.c
+++ b/arch/powerpc/kvm/powerpc.c
@@ -216,36 +216,18 @@ void kvm_arch_vcpu_uninit(struct kvm_vcpu *vcpu)
 
 void kvm_arch_vcpu_load(struct kvm_vcpu *vcpu, int cpu)
 {
-	if (vcpu->guest_debug.enabled)
-		kvmppc_core_load_guest_debugstate(vcpu);
-
 	kvmppc_core_vcpu_load(vcpu, cpu);
 }
 
 void kvm_arch_vcpu_put(struct kvm_vcpu *vcpu)
 {
-	if (vcpu->guest_debug.enabled)
-		kvmppc_core_load_host_debugstate(vcpu);
-
 	kvmppc_core_vcpu_put(vcpu);
 }
 
 int kvm_arch_vcpu_ioctl_set_guest_debug(struct kvm_vcpu *vcpu,
 					struct kvm_guest_debug *dbg)
 {
-	int i;
-
-	vcpu->guest_debug.enabled = dbg->enabled;
-	if (vcpu->guest_debug.enabled) {
-		for (i=0; i < ARRAY_SIZE(vcpu->guest_debug.bp); i++) {
-			if (dbg->breakpoints[i].enabled)
-				vcpu->guest_debug.bp[i] = dbg->breakpoints[i].address;
-			else
-				vcpu->guest_debug.bp[i] = 0;
-		}
-	}
-
-	return 0;
+	return -EINVAL;
 }
 
 static void kvmppc_complete_dcr_load(struct kvm_vcpu *vcpu,

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH] KVM: PowerPC: Disarm old guest debug interface
  2008-12-19 17:13 [PATCH] KVM: PowerPC: Disarm old guest debug interface Jan Kiszka
@ 2008-12-24 11:48 ` Avi Kivity
  2009-01-03 19:57   ` Hollis Blanchard
  0 siblings, 1 reply; 6+ messages in thread
From: Avi Kivity @ 2008-12-24 11:48 UTC (permalink / raw)
  To: Hollis Blanchard; +Cc: Jan Kiszka, kvm-devel, Christian Ehrhardt

Jan Kiszka wrote:
> [Take this as a band-aid, I guess the PowerPC people can do better.]
>
> Until PowerPC is updated to the new guest debugging interface, we have
> to remove the current implementation. This should also unbreak the
> build.
>
>   

Hollis? Want this or a real fix?

-- 
error compiling committee.c: too many arguments to function


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] KVM: PowerPC: Disarm old guest debug interface
  2008-12-24 11:48 ` Avi Kivity
@ 2009-01-03 19:57   ` Hollis Blanchard
       [not found]     ` <1231012661.3501.4.camel-bi+AKbBUZKY6gyzm1THtWbp2dZbC/Bob@public.gmane.org>
  0 siblings, 1 reply; 6+ messages in thread
From: Hollis Blanchard @ 2009-01-03 19:57 UTC (permalink / raw)
  To: Avi Kivity; +Cc: Jan Kiszka, kvm-devel, kvm-ppc

On Wed, 2008-12-24 at 13:48 +0200, Avi Kivity wrote: 
> Jan Kiszka wrote:
> > [Take this as a band-aid, I guess the PowerPC people can do better.]
> >
> > Until PowerPC is updated to the new guest debugging interface, we have
> > to remove the current implementation. This should also unbreak the
> > build.
> >
> >   
> 
> Hollis? Want this or a real fix?

I was trying to come up with a real fix, but unfortunately I don't have
time to reimplement and retest features like this.




kvm: ppc: remove debug support broken by KVM debug rewrite

After the rewrite of KVM's debug support, this code doesn't even build any
more.

Signed-off-by: Hollis Blanchard <hollisb@us.ibm.com>

diff --git a/arch/powerpc/include/asm/kvm_host.h b/arch/powerpc/include/asm/kvm_host.h
--- a/arch/powerpc/include/asm/kvm_host.h
+++ b/arch/powerpc/include/asm/kvm_host.h
@@ -118,11 +118,6 @@ struct kvm_arch {
 struct kvm_vcpu_arch {
 	u32 host_stack;
 	u32 host_pid;
-	u32 host_dbcr0;
-	u32 host_dbcr1;
-	u32 host_dbcr2;
-	u32 host_iac[4];
-	u32 host_msr;
 
 	u64 fpr[32];
 	ulong gpr[32];
@@ -200,10 +195,4 @@ struct kvm_vcpu_arch {
 	unsigned long pending_exceptions;
 };
 
-struct kvm_guest_debug {
-	int enabled;
-	unsigned long bp[4];
-	int singlestep;
-};
-
 #endif /* __POWERPC_KVM_HOST_H__ */
diff --git a/arch/powerpc/include/asm/kvm_ppc.h b/arch/powerpc/include/asm/kvm_ppc.h
--- a/arch/powerpc/include/asm/kvm_ppc.h
+++ b/arch/powerpc/include/asm/kvm_ppc.h
@@ -71,9 +71,6 @@ extern int kvmppc_core_vcpu_translate(st
 extern void kvmppc_core_vcpu_load(struct kvm_vcpu *vcpu, int cpu);
 extern void kvmppc_core_vcpu_put(struct kvm_vcpu *vcpu);
 
-extern void kvmppc_core_load_guest_debugstate(struct kvm_vcpu *vcpu);
-extern void kvmppc_core_load_host_debugstate(struct kvm_vcpu *vcpu);
-
 extern void kvmppc_core_deliver_interrupts(struct kvm_vcpu *vcpu);
 extern int kvmppc_core_pending_dec(struct kvm_vcpu *vcpu);
 extern void kvmppc_core_queue_program(struct kvm_vcpu *vcpu);
diff --git a/arch/powerpc/kvm/44x.c b/arch/powerpc/kvm/44x.c
--- a/arch/powerpc/kvm/44x.c
+++ b/arch/powerpc/kvm/44x.c
@@ -28,72 +28,6 @@
 
 #include "44x_tlb.h"
 
-/* Note: clearing MSR[DE] just means that the debug interrupt will not be
- * delivered *immediately*. Instead, it simply sets the appropriate DBSR bits.
- * If those DBSR bits are still set when MSR[DE] is re-enabled, the interrupt
- * will be delivered as an "imprecise debug event" (which is indicated by
- * DBSR[IDE].
- */
-static void kvm44x_disable_debug_interrupts(void)
-{
-	mtmsr(mfmsr() & ~MSR_DE);
-}
-
-void kvmppc_core_load_host_debugstate(struct kvm_vcpu *vcpu)
-{
-	kvm44x_disable_debug_interrupts();
-
-	mtspr(SPRN_IAC1, vcpu->arch.host_iac[0]);
-	mtspr(SPRN_IAC2, vcpu->arch.host_iac[1]);
-	mtspr(SPRN_IAC3, vcpu->arch.host_iac[2]);
-	mtspr(SPRN_IAC4, vcpu->arch.host_iac[3]);
-	mtspr(SPRN_DBCR1, vcpu->arch.host_dbcr1);
-	mtspr(SPRN_DBCR2, vcpu->arch.host_dbcr2);
-	mtspr(SPRN_DBCR0, vcpu->arch.host_dbcr0);
-	mtmsr(vcpu->arch.host_msr);
-}
-
-void kvmppc_core_load_guest_debugstate(struct kvm_vcpu *vcpu)
-{
-	struct kvm_guest_debug *dbg = &vcpu->guest_debug;
-	u32 dbcr0 = 0;
-
-	vcpu->arch.host_msr = mfmsr();
-	kvm44x_disable_debug_interrupts();
-
-	/* Save host debug register state. */
-	vcpu->arch.host_iac[0] = mfspr(SPRN_IAC1);
-	vcpu->arch.host_iac[1] = mfspr(SPRN_IAC2);
-	vcpu->arch.host_iac[2] = mfspr(SPRN_IAC3);
-	vcpu->arch.host_iac[3] = mfspr(SPRN_IAC4);
-	vcpu->arch.host_dbcr0 = mfspr(SPRN_DBCR0);
-	vcpu->arch.host_dbcr1 = mfspr(SPRN_DBCR1);
-	vcpu->arch.host_dbcr2 = mfspr(SPRN_DBCR2);
-
-	/* set registers up for guest */
-
-	if (dbg->bp[0]) {
-		mtspr(SPRN_IAC1, dbg->bp[0]);
-		dbcr0 |= DBCR0_IAC1 | DBCR0_IDM;
-	}
-	if (dbg->bp[1]) {
-		mtspr(SPRN_IAC2, dbg->bp[1]);
-		dbcr0 |= DBCR0_IAC2 | DBCR0_IDM;
-	}
-	if (dbg->bp[2]) {
-		mtspr(SPRN_IAC3, dbg->bp[2]);
-		dbcr0 |= DBCR0_IAC3 | DBCR0_IDM;
-	}
-	if (dbg->bp[3]) {
-		mtspr(SPRN_IAC4, dbg->bp[3]);
-		dbcr0 |= DBCR0_IAC4 | DBCR0_IDM;
-	}
-
-	mtspr(SPRN_DBCR0, dbcr0);
-	mtspr(SPRN_DBCR1, 0);
-	mtspr(SPRN_DBCR2, 0);
-}
-
 void kvmppc_core_vcpu_load(struct kvm_vcpu *vcpu, int cpu)
 {
 	kvmppc_44x_tlb_load(vcpu);
diff --git a/arch/powerpc/kvm/powerpc.c b/arch/powerpc/kvm/powerpc.c
--- a/arch/powerpc/kvm/powerpc.c
+++ b/arch/powerpc/kvm/powerpc.c
@@ -216,36 +216,18 @@ void kvm_arch_vcpu_uninit(struct kvm_vcp
 
 void kvm_arch_vcpu_load(struct kvm_vcpu *vcpu, int cpu)
 {
-	if (vcpu->guest_debug.enabled)
-		kvmppc_core_load_guest_debugstate(vcpu);
-
 	kvmppc_core_vcpu_load(vcpu, cpu);
 }
 
 void kvm_arch_vcpu_put(struct kvm_vcpu *vcpu)
 {
-	if (vcpu->guest_debug.enabled)
-		kvmppc_core_load_host_debugstate(vcpu);
-
 	kvmppc_core_vcpu_put(vcpu);
 }
 
 int kvm_arch_vcpu_ioctl_set_guest_debug(struct kvm_vcpu *vcpu,
-					struct kvm_guest_debug *dbg)
+                                        struct kvm_guest_debug *dbg)
 {
-	int i;
-
-	vcpu->guest_debug.enabled = dbg->enabled;
-	if (vcpu->guest_debug.enabled) {
-		for (i=0; i < ARRAY_SIZE(vcpu->guest_debug.bp); i++) {
-			if (dbg->breakpoints[i].enabled)
-				vcpu->guest_debug.bp[i] = dbg->breakpoints[i].address;
-			else
-				vcpu->guest_debug.bp[i] = 0;
-		}
-	}
-
-	return 0;
+	return -EINVAL;
 }
 
 static void kvmppc_complete_dcr_load(struct kvm_vcpu *vcpu,


-- 
Hollis Blanchard
IBM Linux Technology Center


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] KVM: PowerPC: Disarm old guest debug interface
       [not found]     ` <1231012661.3501.4.camel-bi+AKbBUZKY6gyzm1THtWbp2dZbC/Bob@public.gmane.org>
@ 2009-01-04 10:54       ` Avi Kivity
  2009-01-04 19:51         ` [PATCH] [v2] " Hollis Blanchard
  0 siblings, 1 reply; 6+ messages in thread
From: Avi Kivity @ 2009-01-04 10:54 UTC (permalink / raw)
  To: Hollis Blanchard; +Cc: Jan Kiszka, kvm-devel, kvm-ppc

Hollis Blanchard wrote:
>
> kvm: ppc: remove debug support broken by KVM debug rewrite
>
> After the rewrite of KVM's debug support, this code doesn't even build any
> more.
>
> Signed-off-by: Hollis Blanchard <hollisb-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
>
> diff --git a/arch/powerpc/include/asm/kvm_host.h b/arch/powerpc/include/asm/kvm_host.h
> --- a/arch/powerpc/include/asm/kvm_host.h
> +++ b/arch/powerpc/include/asm/kvm_host.h
> @@ -118,11 +118,6 @@ struct kvm_arch {
>  struct kvm_vcpu_arch {
>  	u32 host_stack;
>  	u32 host_pid;
> -	u32 host_dbcr0;
> -	u32 host_dbcr1;
> -	u32 host_dbcr2;
> -	u32 host_iac[4];
> -	u32 host_msr;
>  
>  	u64 fpr[32];
>  	ulong gpr[32];
> @@ -200,10 +195,4 @@ struct kvm_vcpu_arch {
>  	unsigned long pending_exceptions;
>  };
>  
> -struct kvm_guest_debug {
> -	int enabled;
> -	unsigned long bp[4];
> -	int singlestep;
> -};
> -
>  #endif /* __POWERPC_KVM_HOST_H__ */
> diff --git a/arch/powerpc/include/asm/kvm_ppc.h b/arch/powerpc/include/asm/kvm_ppc.h
> --- a/arch/powerpc/include/asm/kvm_ppc.h
> +++ b/arch/powerpc/include/asm/kvm_ppc.h
> @@ -71,9 +71,6 @@ extern int kvmppc_core_vcpu_translate(st
>  extern void kvmppc_core_vcpu_load(struct kvm_vcpu *vcpu, int cpu);
>  extern void kvmppc_core_vcpu_put(struct kvm_vcpu *vcpu);
>  
> -extern void kvmppc_core_load_guest_debugstate(struct kvm_vcpu *vcpu);
> -extern void kvmppc_core_load_host_debugstate(struct kvm_vcpu *vcpu);
> -
>  extern void kvmppc_core_deliver_interrupts(struct kvm_vcpu *vcpu);
>  extern int kvmppc_core_pending_dec(struct kvm_vcpu *vcpu);
>  extern void kvmppc_core_queue_program(struct kvm_vcpu *vcpu);
> diff --git a/arch/powerpc/kvm/44x.c b/arch/powerpc/kvm/44x.c
> --- a/arch/powerpc/kvm/44x.c
> +++ b/arch/powerpc/kvm/44x.c
> @@ -28,72 +28,6 @@
>  
>  #include "44x_tlb.h"
>  
> -/* Note: clearing MSR[DE] just means that the debug interrupt will not be
> - * delivered *immediately*. Instead, it simply sets the appropriate DBSR bits.
> - * If those DBSR bits are still set when MSR[DE] is re-enabled, the interrupt
> - * will be delivered as an "imprecise debug event" (which is indicated by
> - * DBSR[IDE].
> - */
> -static void kvm44x_disable_debug_interrupts(void)
> -{
> -	mtmsr(mfmsr() & ~MSR_DE);
> -}
> -
> -void kvmppc_core_load_host_debugstate(struct kvm_vcpu *vcpu)
> -{
> -	kvm44x_disable_debug_interrupts();
> -
> -	mtspr(SPRN_IAC1, vcpu->arch.host_iac[0]);
> -	mtspr(SPRN_IAC2, vcpu->arch.host_iac[1]);
> -	mtspr(SPRN_IAC3, vcpu->arch.host_iac[2]);
> -	mtspr(SPRN_IAC4, vcpu->arch.host_iac[3]);
> -	mtspr(SPRN_DBCR1, vcpu->arch.host_dbcr1);
> -	mtspr(SPRN_DBCR2, vcpu->arch.host_dbcr2);
> -	mtspr(SPRN_DBCR0, vcpu->arch.host_dbcr0);
> -	mtmsr(vcpu->arch.host_msr);
> -}
> -
> -void kvmppc_core_load_guest_debugstate(struct kvm_vcpu *vcpu)
> -{
> -	struct kvm_guest_debug *dbg = &vcpu->guest_debug;
> -	u32 dbcr0 = 0;
> -
> -	vcpu->arch.host_msr = mfmsr();
> -	kvm44x_disable_debug_interrupts();
> -
> -	/* Save host debug register state. */
> -	vcpu->arch.host_iac[0] = mfspr(SPRN_IAC1);
> -	vcpu->arch.host_iac[1] = mfspr(SPRN_IAC2);
> -	vcpu->arch.host_iac[2] = mfspr(SPRN_IAC3);
> -	vcpu->arch.host_iac[3] = mfspr(SPRN_IAC4);
> -	vcpu->arch.host_dbcr0 = mfspr(SPRN_DBCR0);
> -	vcpu->arch.host_dbcr1 = mfspr(SPRN_DBCR1);
> -	vcpu->arch.host_dbcr2 = mfspr(SPRN_DBCR2);
> -
> -	/* set registers up for guest */
> -
> -	if (dbg->bp[0]) {
> -		mtspr(SPRN_IAC1, dbg->bp[0]);
> -		dbcr0 |= DBCR0_IAC1 | DBCR0_IDM;
> -	}
> -	if (dbg->bp[1]) {
> -		mtspr(SPRN_IAC2, dbg->bp[1]);
> -		dbcr0 |= DBCR0_IAC2 | DBCR0_IDM;
> -	}
> -	if (dbg->bp[2]) {
> -		mtspr(SPRN_IAC3, dbg->bp[2]);
> -		dbcr0 |= DBCR0_IAC3 | DBCR0_IDM;
> -	}
> -	if (dbg->bp[3]) {
> -		mtspr(SPRN_IAC4, dbg->bp[3]);
> -		dbcr0 |= DBCR0_IAC4 | DBCR0_IDM;
> -	}
> -
> -	mtspr(SPRN_DBCR0, dbcr0);
> -	mtspr(SPRN_DBCR1, 0);
> -	mtspr(SPRN_DBCR2, 0);
> -}
> -
>  void kvmppc_core_vcpu_load(struct kvm_vcpu *vcpu, int cpu)
>  {
>  	kvmppc_44x_tlb_load(vcpu);
> diff --git a/arch/powerpc/kvm/powerpc.c b/arch/powerpc/kvm/powerpc.c
> --- a/arch/powerpc/kvm/powerpc.c
> +++ b/arch/powerpc/kvm/powerpc.c
> @@ -216,36 +216,18 @@ void kvm_arch_vcpu_uninit(struct kvm_vcp
>  
>  void kvm_arch_vcpu_load(struct kvm_vcpu *vcpu, int cpu)
>  {
> -	if (vcpu->guest_debug.enabled)
> -		kvmppc_core_load_guest_debugstate(vcpu);
> -
>  	kvmppc_core_vcpu_load(vcpu, cpu);
>  }
>  
>  void kvm_arch_vcpu_put(struct kvm_vcpu *vcpu)
>  {
> -	if (vcpu->guest_debug.enabled)
> -		kvmppc_core_load_host_debugstate(vcpu);
> -
>  	kvmppc_core_vcpu_put(vcpu);
>  }
>  
>  int kvm_arch_vcpu_ioctl_set_guest_debug(struct kvm_vcpu *vcpu,
> -					struct kvm_guest_debug *dbg)
> +                                        struct kvm_guest_debug *dbg)
>  {
> -	int i;
> -
> -	vcpu->guest_debug.enabled = dbg->enabled;
> -	if (vcpu->guest_debug.enabled) {
> -		for (i=0; i < ARRAY_SIZE(vcpu->guest_debug.bp); i++) {
> -			if (dbg->breakpoints[i].enabled)
> -				vcpu->guest_debug.bp[i] = dbg->breakpoints[i].address;
> -			else
> -				vcpu->guest_debug.bp[i] = 0;
> -		}
> -	}
> -
> -	return 0;
> +	return -EINVAL;
>  }
>  
>  static void kvmppc_complete_dcr_load(struct kvm_vcpu *vcpu,
>
>   

This doesn't apply.  What was it diffed against?

-- 
error compiling committee.c: too many arguments to function

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

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH] [v2] KVM: PowerPC: Disarm old guest debug interface
  2009-01-04 10:54       ` Avi Kivity
@ 2009-01-04 19:51         ` Hollis Blanchard
       [not found]           ` <1231098669.7724.16.camel-bi+AKbBUZKY6gyzm1THtWbp2dZbC/Bob@public.gmane.org>
  0 siblings, 1 reply; 6+ messages in thread
From: Hollis Blanchard @ 2009-01-04 19:51 UTC (permalink / raw)
  To: Avi Kivity; +Cc: Jan Kiszka, kvm-devel, kvm-ppc

On Sun, 2009-01-04 at 12:54 +0200, Avi Kivity wrote:
> 
> This doesn't apply.  What was it diffed against?

Hmm, looks like a slightly older tree. This should apply.



kvm: ppc: remove debug support broken by KVM debug rewrite

After the rewrite of KVM's debug support, this code doesn't even build any
more.

Signed-off-by: Hollis Blanchard <hollisb@us.ibm.com>

diff --git a/arch/powerpc/include/asm/kvm_host.h b/arch/powerpc/include/asm/kvm_host.h
index 1c61876..dfdf13c 100644
--- a/arch/powerpc/include/asm/kvm_host.h
+++ b/arch/powerpc/include/asm/kvm_host.h
@@ -111,11 +111,6 @@ struct kvm_arch {
 struct kvm_vcpu_arch {
 	u32 host_stack;
 	u32 host_pid;
-	u32 host_dbcr0;
-	u32 host_dbcr1;
-	u32 host_dbcr2;
-	u32 host_iac[4];
-	u32 host_msr;
 
 	u64 fpr[32];
 	ulong gpr[32];
diff --git a/arch/powerpc/include/asm/kvm_ppc.h b/arch/powerpc/include/asm/kvm_ppc.h
index 6052779..2c6ee34 100644
--- a/arch/powerpc/include/asm/kvm_ppc.h
+++ b/arch/powerpc/include/asm/kvm_ppc.h
@@ -77,9 +77,6 @@ extern int kvmppc_core_vcpu_translate(struct kvm_vcpu *vcpu,
 extern void kvmppc_core_vcpu_load(struct kvm_vcpu *vcpu, int cpu);
 extern void kvmppc_core_vcpu_put(struct kvm_vcpu *vcpu);
 
-extern void kvmppc_core_load_guest_debugstate(struct kvm_vcpu *vcpu);
-extern void kvmppc_core_load_host_debugstate(struct kvm_vcpu *vcpu);
-
 extern void kvmppc_core_deliver_interrupts(struct kvm_vcpu *vcpu);
 extern int kvmppc_core_pending_dec(struct kvm_vcpu *vcpu);
 extern void kvmppc_core_queue_program(struct kvm_vcpu *vcpu);
diff --git a/arch/powerpc/kvm/44x.c b/arch/powerpc/kvm/44x.c
index 8383603..0cef809 100644
--- a/arch/powerpc/kvm/44x.c
+++ b/arch/powerpc/kvm/44x.c
@@ -28,72 +28,6 @@
 
 #include "44x_tlb.h"
 
-/* Note: clearing MSR[DE] just means that the debug interrupt will not be
- * delivered *immediately*. Instead, it simply sets the appropriate DBSR bits.
- * If those DBSR bits are still set when MSR[DE] is re-enabled, the interrupt
- * will be delivered as an "imprecise debug event" (which is indicated by
- * DBSR[IDE].
- */
-static void kvm44x_disable_debug_interrupts(void)
-{
-	mtmsr(mfmsr() & ~MSR_DE);
-}
-
-void kvmppc_core_load_host_debugstate(struct kvm_vcpu *vcpu)
-{
-	kvm44x_disable_debug_interrupts();
-
-	mtspr(SPRN_IAC1, vcpu->arch.host_iac[0]);
-	mtspr(SPRN_IAC2, vcpu->arch.host_iac[1]);
-	mtspr(SPRN_IAC3, vcpu->arch.host_iac[2]);
-	mtspr(SPRN_IAC4, vcpu->arch.host_iac[3]);
-	mtspr(SPRN_DBCR1, vcpu->arch.host_dbcr1);
-	mtspr(SPRN_DBCR2, vcpu->arch.host_dbcr2);
-	mtspr(SPRN_DBCR0, vcpu->arch.host_dbcr0);
-	mtmsr(vcpu->arch.host_msr);
-}
-
-void kvmppc_core_load_guest_debugstate(struct kvm_vcpu *vcpu)
-{
-	struct kvm_guest_debug *dbg = &vcpu->guest_debug;
-	u32 dbcr0 = 0;
-
-	vcpu->arch.host_msr = mfmsr();
-	kvm44x_disable_debug_interrupts();
-
-	/* Save host debug register state. */
-	vcpu->arch.host_iac[0] = mfspr(SPRN_IAC1);
-	vcpu->arch.host_iac[1] = mfspr(SPRN_IAC2);
-	vcpu->arch.host_iac[2] = mfspr(SPRN_IAC3);
-	vcpu->arch.host_iac[3] = mfspr(SPRN_IAC4);
-	vcpu->arch.host_dbcr0 = mfspr(SPRN_DBCR0);
-	vcpu->arch.host_dbcr1 = mfspr(SPRN_DBCR1);
-	vcpu->arch.host_dbcr2 = mfspr(SPRN_DBCR2);
-
-	/* set registers up for guest */
-
-	if (dbg->bp[0]) {
-		mtspr(SPRN_IAC1, dbg->bp[0]);
-		dbcr0 |= DBCR0_IAC1 | DBCR0_IDM;
-	}
-	if (dbg->bp[1]) {
-		mtspr(SPRN_IAC2, dbg->bp[1]);
-		dbcr0 |= DBCR0_IAC2 | DBCR0_IDM;
-	}
-	if (dbg->bp[2]) {
-		mtspr(SPRN_IAC3, dbg->bp[2]);
-		dbcr0 |= DBCR0_IAC3 | DBCR0_IDM;
-	}
-	if (dbg->bp[3]) {
-		mtspr(SPRN_IAC4, dbg->bp[3]);
-		dbcr0 |= DBCR0_IAC4 | DBCR0_IDM;
-	}
-
-	mtspr(SPRN_DBCR0, dbcr0);
-	mtspr(SPRN_DBCR1, 0);
-	mtspr(SPRN_DBCR2, 0);
-}
-
 void kvmppc_core_vcpu_load(struct kvm_vcpu *vcpu, int cpu)
 {
 	kvmppc_44x_tlb_load(vcpu);
diff --git a/arch/powerpc/kvm/powerpc.c b/arch/powerpc/kvm/powerpc.c
index 13226f1..2100c27 100644
--- a/arch/powerpc/kvm/powerpc.c
+++ b/arch/powerpc/kvm/powerpc.c
@@ -217,41 +217,18 @@ void kvm_arch_vcpu_uninit(struct kvm_vcpu *vcpu)
 
 void kvm_arch_vcpu_load(struct kvm_vcpu *vcpu, int cpu)
 {
-	if (vcpu->guest_debug.enabled)
-		kvmppc_core_load_guest_debugstate(vcpu);
-
 	kvmppc_core_vcpu_load(vcpu, cpu);
 }
 
 void kvm_arch_vcpu_put(struct kvm_vcpu *vcpu)
 {
-	if (vcpu->guest_debug.enabled)
-		kvmppc_core_load_host_debugstate(vcpu);
-
-	/* Don't leave guest TLB entries resident when being de-scheduled. */
-	/* XXX It would be nice to differentiate between heavyweight exit and
-	 * sched_out here, since we could avoid the TLB flush for heavyweight
-	 * exits. */
-	_tlbil_all();
 	kvmppc_core_vcpu_put(vcpu);
 }
 
 int kvm_arch_vcpu_ioctl_set_guest_debug(struct kvm_vcpu *vcpu,
-					struct kvm_guest_debug *dbg)
+                                        struct kvm_guest_debug *dbg)
 {
-	int i;
-
-	vcpu->guest_debug.enabled = dbg->enabled;
-	if (vcpu->guest_debug.enabled) {
-		for (i=0; i < ARRAY_SIZE(vcpu->guest_debug.bp); i++) {
-			if (dbg->breakpoints[i].enabled)
-				vcpu->guest_debug.bp[i] = dbg->breakpoints[i].address;
-			else
-				vcpu->guest_debug.bp[i] = 0;
-		}
-	}
-
-	return 0;
+	return -EINVAL;
 }
 
 static void kvmppc_complete_dcr_load(struct kvm_vcpu *vcpu,


-- 
Hollis Blanchard
IBM Linux Technology Center


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH] [v2] KVM: PowerPC: Disarm old guest debug interface
       [not found]           ` <1231098669.7724.16.camel-bi+AKbBUZKY6gyzm1THtWbp2dZbC/Bob@public.gmane.org>
@ 2009-01-05 13:32             ` Avi Kivity
  0 siblings, 0 replies; 6+ messages in thread
From: Avi Kivity @ 2009-01-05 13:32 UTC (permalink / raw)
  To: Hollis Blanchard; +Cc: Jan Kiszka, kvm-devel, kvm-ppc


>
> kvm: ppc: remove debug support broken by KVM debug rewrite
>
> After the rewrite of KVM's debug support, this code doesn't even build any
> more.
>   

Applied, thanks.

-- 
error compiling committee.c: too many arguments to function

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

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2009-01-05 13:32 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-12-19 17:13 [PATCH] KVM: PowerPC: Disarm old guest debug interface Jan Kiszka
2008-12-24 11:48 ` Avi Kivity
2009-01-03 19:57   ` Hollis Blanchard
     [not found]     ` <1231012661.3501.4.camel-bi+AKbBUZKY6gyzm1THtWbp2dZbC/Bob@public.gmane.org>
2009-01-04 10:54       ` Avi Kivity
2009-01-04 19:51         ` [PATCH] [v2] " Hollis Blanchard
     [not found]           ` <1231098669.7724.16.camel-bi+AKbBUZKY6gyzm1THtWbp2dZbC/Bob@public.gmane.org>
2009-01-05 13:32             ` Avi Kivity

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox