summaryrefslogtreecommitdiff
path: root/src/cpu
diff options
context:
space:
mode:
authorAndreas Sandberg <andreas@sandberg.pp.se>2013-06-03 13:38:59 +0200
committerAndreas Sandberg <andreas@sandberg.pp.se>2013-06-03 13:38:59 +0200
commit15f81b6ed9a2bc9821c90a4058b7b528e001a10f (patch)
tree58d6aa25eb6edef0b794ffd310790ec0844ebad9 /src/cpu
parent743f80712e08f02f7b3a9a286550e2635104f714 (diff)
downloadgem5-15f81b6ed9a2bc9821c90a4058b7b528e001a10f.tar.xz
kvm: Add handling of EAGAIN when creating timers
timer_create can apparently return -1 and set errno to EAGAIN if the kernel suffered a temporary failure when allocating a timer. This happens from time to time, so we need to handle it.
Diffstat (limited to 'src/cpu')
-rw-r--r--src/cpu/kvm/timer.cc7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/cpu/kvm/timer.cc b/src/cpu/kvm/timer.cc
index e1f74a552..03cdea6fb 100644
--- a/src/cpu/kvm/timer.cc
+++ b/src/cpu/kvm/timer.cc
@@ -59,8 +59,11 @@ PosixKvmTimer::PosixKvmTimer(int signo, clockid_t clockID,
sev.sigev_notify = SIGEV_SIGNAL;
sev.sigev_signo = signo;
sev.sigev_value.sival_ptr = NULL;
- if (timer_create(clockID, &sev, &timer) == -1)
- panic("timer_create");
+
+ while (timer_create(clockID, &sev, &timer) == -1) {
+ if (errno != EAGAIN)
+ panic("timer_create: %i", errno);
+ }
}
PosixKvmTimer::~PosixKvmTimer()