[PATCH 5/5] kvmppc: guest debug init

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



440(BOOKE) supports 4 hardware breakpoints,
while e500 supports 2.

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

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;
 }
 
-- 
1.5.4

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

[Index of Archives]     [KVM Development]     [KVM ARM]     [KVM ia64]     [Linux Virtualization]     [Linux USB Devel]     [Linux Video]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Big List of Linux Books]

  Powered by Linux