Patchwork [5/5] kvmppc: guest debug init

login
register
mail settings
Submitter Liu Yu-B13201
Date Aug. 4, 2009, 9:36 a.m.
Message ID <1249378568-18008-6-git-send-email-yu.liu@freescale.com>
Download mbox | patch
Permalink /patch/30718/
State Superseded
Headers show

Comments

Liu Yu-B13201 - Aug. 4, 2009, 9:36 a.m.
440(BOOKE) supports 4 hardware breakpoints,
while e500 supports 2.

Signed-off-by: Liu Yu <yu.liu@freescale.com>
---
 target-ppc/kvm.c |   10 ++++++++++
 1 files changed, 10 insertions(+), 0 deletions(-)

Patch

diff --git a/target-ppc/kvm.c b/target-ppc/kvm.c
index 97a0737..82e7897 100644
--- a/target-ppc/kvm.c
+++ b/target-ppc/kvm.c
@@ -42,6 +42,10 @@ 
     do { } while (0)
 #endif
 
+#ifdef KVM_CAP_SET_GUEST_DEBUG
+static void kvmppc_debug_init(int, int);
+#endif
+
 int kvm_arch_init(KVMState *s, int smp_cpus)
 {
     return 0;
@@ -55,6 +59,12 @@  int kvm_arch_init_vcpu(CPUState *cenv)
     sregs.pvr = cenv->spr[SPR_PVR];
     ret = kvm_vcpu_ioctl(cenv, KVM_SET_SREGS, &sregs);
 
+#ifdef KVM_CAP_SET_GUEST_DEBUG
+    if (strcmp(cenv->cpu_model_str, "405"))
+        kvmppc_debug_init(4, 2);
+    if (strcmp(cenv->cpu_model_str, "e500v2_v30"))
+        kvmppc_debug_init(2, 2);   /* E500v2 doesn't support IAC3,IAC4 */
+#endif
     return ret;
 }