Revision c6a94ba5 target-ppc/kvm.c

b/target-ppc/kvm.c
37 37
    do { } while (0)
38 38
#endif
39 39

  
40
/* XXX For some odd reason we sometimes hang inside KVM forever. I'd guess it's
41
 *     a race condition where we actually have a level triggered interrupt, but
42
 *     the infrastructure can't expose that yet, so the guest ACKs it, goes to
43
 *     sleep and never gets notified that there's still an interrupt pending.
44
 *
45
 *     As a quick workaround, let's just wake up every 500 ms. That way we can
46
 *     assure that we're always reinjecting interrupts in time.
47
 */
48
static QEMUTimer *idle_timer;
49

  
50
static void do_nothing(void *opaque)
51
{
52
    qemu_mod_timer(idle_timer, qemu_get_clock(vm_clock) +
53
                   (get_ticks_per_sec() / 2));
54
}
55

  
40 56
int kvm_arch_init(KVMState *s, int smp_cpus)
41 57
{
42 58
    return 0;
......
173 189
    int r;
174 190
    unsigned irq;
175 191

  
192
    if (!idle_timer) {
193
        idle_timer = qemu_new_timer(vm_clock, do_nothing, NULL);
194
        qemu_mod_timer(idle_timer, qemu_get_clock(vm_clock) +
195
                       (get_ticks_per_sec() / 2));
196
    }
197

  
176 198
    /* PowerPC Qemu tracks the various core input pins (interrupt, critical
177 199
     * interrupt, reset, etc) in PPC-specific env->irq_input_state. */
178 200
    if (run->ready_for_interrupt_injection &&

Also available in: Unified diff