Files
qemu/hw
Max Filippov 4f61927a41 hpet: fix infinite loop in qemu_run_timers with -icount enabled
hpet_timer timer callback rearms itself based on difference between
current HPET tick counter and comparator value. Difference calculated by
the hpet_calculate_diff function is limited to non-negative values.

cur_tick is calculated via hpet_get_ticks that uses qemu_get_clock_ns(vm_clock).

With -icount enabled vm_clock doesn't advance during qemu_run_timers
loop thus once difference is zero, qemu_run_timers loops forever
handling hpet_timer.

Limit hpet_calculate_diff results to positive only values to avoid that
infinite loop.

This fixes the following qemu-system-x86_64 hang when it reaches
timer_irq_works() in the linux bootup:

[    0.000000] Fast TSC calibration using PIT
[    0.000000] Detected 1000.054 MHz processor.
[    0.000031] Calibrating delay loop (skipped), value calculated using timer frequency.. 2000.10 BogoMIPS (lpj=10000540)
[    0.000404] pid_max: default: 32768 minimum: 301
[    0.001138] Mount-cache hash table entries: 256
[    0.003883] Initializing cgroup subsys ns
[    0.004035] Initializing cgroup subsys cpuacct
[    0.004280] Initializing cgroup subsys freezer
[    0.004790] Performance Events: AMD PMU driver.
[    0.004985] ... version:                0
[    0.005134] ... bit width:              48
[    0.005285] ... generic registers:      4
[    0.005437] ... value mask:             0000ffffffffffff
[    0.005625] ... max period:             00007fffffffffff
[    0.005807] ... fixed-purpose events:   0
[    0.005957] ... event mask:             000000000000000f
[    0.006275] SMP alternatives: switching to UP code

Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2011-11-09 12:06:20 -06:00
..
2011-11-01 16:52:07 -05:00
2011-07-23 11:26:12 -05:00
2011-04-10 14:00:14 +02:00
2011-09-23 13:42:33 -05:00
2011-04-22 14:41:40 -05:00
2011-07-23 11:26:12 -05:00
2011-08-22 10:20:39 -05:00
2011-08-22 10:20:40 -05:00
2011-09-04 17:46:50 +03:00
2011-08-22 10:20:10 -05:00
2011-09-04 17:46:50 +03:00
2011-10-26 14:14:19 +01:00
2011-08-22 10:17:44 -05:00
2011-07-24 14:48:57 +00:00
2011-07-23 11:26:12 -05:00
2011-09-23 10:55:33 -05:00
2011-10-17 15:59:18 +02:00
2011-10-09 19:04:16 +04:00
2011-10-06 09:48:07 +02:00
2011-10-17 15:59:18 +02:00
2011-07-23 11:26:12 -05:00
2011-09-04 17:46:51 +03:00
2011-11-01 16:52:07 -05:00
2011-11-01 16:52:07 -05:00
2011-08-08 10:22:29 -05:00
2011-10-28 19:25:51 +02:00
2011-10-21 17:34:13 +02:00
2011-10-21 17:34:13 +02:00
2011-10-11 15:57:10 +02:00
2011-09-10 14:49:51 +00:00
2011-09-25 14:58:36 +03:00
2011-10-16 11:11:55 +00:00
2011-08-08 10:22:29 -05:00
2011-11-02 07:51:58 -05:00
2011-08-22 14:37:03 -05:00
2011-10-16 11:10:48 +00:00
2011-09-23 11:51:05 -05:00
2011-09-23 11:51:05 -05:00
2011-10-16 11:10:48 +00:00
2011-09-15 16:39:32 -03:00
2011-11-01 16:52:09 -05:00
2011-09-04 17:46:51 +03:00
2011-03-07 13:42:36 +01:00
2011-03-07 13:42:36 +01:00
2011-10-23 14:08:30 +00:00
2011-10-21 18:14:29 +02:00
2011-10-21 18:14:29 +02:00
2011-04-22 14:41:43 -05:00
2011-09-04 17:46:51 +03:00
2011-10-03 12:44:22 +02:00
2011-09-10 16:50:46 +00:00
2011-09-10 16:50:46 +00:00
2011-08-22 10:20:10 -05:00
2011-07-12 20:00:28 +00:00
2011-08-08 10:22:30 -05:00
2011-08-08 10:22:29 -05:00
2011-09-23 09:44:38 +00:00
2011-09-23 09:54:56 +00:00
2011-09-23 09:44:38 +00:00
2011-09-23 09:44:38 +00:00
2011-08-28 16:37:12 +00:00
2011-10-10 15:29:28 +02:00
2011-10-21 17:34:13 +02:00
2011-10-23 14:05:46 +00:00
2011-09-21 14:32:20 +02:00
2011-10-27 11:48:47 -02:00
2011-10-27 11:48:47 -02:00
2011-08-22 10:22:03 -05:00
2011-08-22 10:22:03 -05:00
2011-08-24 15:52:54 +03:00
2011-09-25 14:58:37 +03:00
2011-11-01 16:52:09 -05:00
2011-11-01 16:52:09 -05:00
2011-11-01 16:52:09 -05:00
2011-07-23 11:26:12 -05:00
2011-07-23 11:26:12 -05:00
2011-08-17 23:01:47 +00:00
2011-07-23 11:26:12 -05:00
2011-07-23 11:26:12 -05:00
2011-07-23 11:26:12 -05:00
2011-10-06 09:48:09 +02:00
2011-08-22 10:47:42 -05:00
2011-10-06 09:48:09 +02:00
2011-10-17 15:59:16 +02:00
2011-10-30 20:03:26 +01:00
2011-10-06 09:48:09 +02:00
2011-10-06 09:47:52 +02:00
2011-11-01 16:52:05 -05:00
2011-07-23 11:26:12 -05:00
2011-07-23 11:26:12 -05:00
2011-10-17 15:59:17 +02:00
2011-10-16 11:11:51 +00:00
2011-10-28 19:25:51 +02:00
2011-09-07 09:20:09 +02:00
2011-11-07 10:57:37 -06:00
2011-11-01 12:11:53 +01:00
2011-10-17 15:59:17 +02:00
2011-08-22 10:20:10 -05:00
2011-11-01 16:52:06 -05:00
2011-06-07 13:52:30 -05:00
2011-10-17 15:59:18 +02:00
2011-07-23 11:26:12 -05:00
2011-11-01 16:52:05 -05:00
2011-10-28 19:25:51 +02:00
2011-10-31 04:53:01 +01:00
2011-10-31 04:53:01 +01:00
2011-10-17 15:59:18 +02:00
2011-07-23 11:26:12 -05:00
2011-07-23 11:26:12 -05:00
2011-07-23 11:26:12 -05:00
2011-09-04 17:46:50 +03:00
2011-10-17 15:59:18 +02:00
2011-10-17 15:59:18 +02:00
2011-10-17 15:59:18 +02:00
2011-10-17 15:59:18 +02:00
2011-04-22 14:41:40 -05:00
2011-04-22 14:41:40 -05:00
2011-10-17 15:59:18 +02:00
2011-11-01 06:23:48 +00:00
2011-10-17 15:59:18 +02:00
2011-10-17 15:59:18 +02:00
2011-10-17 15:59:18 +02:00
2011-09-07 09:58:27 +02:00
2011-08-04 15:51:22 +02:00
2011-09-07 09:58:26 +02:00
2011-09-07 09:58:26 +02:00
2011-08-04 15:51:22 +02:00
2011-09-07 09:58:27 +02:00
2011-08-04 15:51:22 +02:00
2011-10-13 12:58:51 +02:00
2011-10-13 12:58:51 +02:00
2011-10-27 11:48:47 -02:00
2011-10-12 19:11:23 +05:30
2011-03-22 07:44:15 +01:00
2011-09-21 10:49:16 +01:00
2011-07-26 06:43:11 +02:00
2011-04-08 11:32:21 +02:00