From 8ea40470d15de47aa3bd6004fc5783f94535e00d Mon Sep 17 00:00:00 2001
From: Roger Pau Monne <roger.pau@citrix.com>
Date: Mon, 17 Feb 2014 16:08:58 +0100
Subject: [PATCH] xen: debug Xen PV timer

---
 sys/dev/xen/timer/timer.c |    8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/sys/dev/xen/timer/timer.c b/sys/dev/xen/timer/timer.c
index 354085b..a31343b 100644
--- a/sys/dev/xen/timer/timer.c
+++ b/sys/dev/xen/timer/timer.c
@@ -76,6 +76,8 @@ static devclass_t xentimer_devclass;
 
 #define	XENTIMER_QUALITY	950
 
+#define NUM_RETRIES	60
+
 struct xentimer_pcpu_data {
 	uint64_t timer;
 	uint64_t last_processed;
@@ -413,8 +415,10 @@ xentimer_et_start(struct eventtimer *et,
 	 *     equipped to deal with start failures.
 	 */
 	do {
-		if (++i == 60)
-			panic("can't schedule timer");
+		if (++i == NUM_RETRIES) {
+			panic("can't schedule timer on vCPU#%d, interval: %" PRIu64 "ns",
+			    cpu, first_in_ns);
+		}
 		next_time = xen_fetch_vcpu_time() + first_in_ns;
 		error = xentimer_vcpu_start_timer(cpu, next_time);
 	} while (error == -ETIME);
-- 
1.7.7.5 (Apple Git-26)

