[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH] Don't enable a HPET timer if HPET is disabled
From: |
Paolo Bonzini |
Subject: |
Re: [Qemu-devel] [PATCH] Don't enable a HPET timer if HPET is disabled |
Date: |
Sat, 22 Feb 2014 11:55:25 +0100 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.2.0 |
Il 22/02/2014 10:03, Alex Bligh ha scritto:
> I am unfamiliar with the HPET code but symmetry suggests perhaps the 'else'
> condition should be changed too:
>
> } else if (deactivating_bit(old_val, new_val, HPET_TN_ENABLE) ||
> !hpet_enabled(s)) {
> hpet_del_timer(timer);
> }
>
> --
I thought the same, but there is no need for that. When the enabled bit goes
from set to clear, all timers are disabled:
} else if (deactivating_bit(old_val, new_val, HPET_CFG_ENABLE)) {
/* Halt main counter and disable interrupt generation. */
s->hpet_counter = hpet_get_ticks(s);
for (i = 0; i < s->num_timers; i++) {
hpet_del_timer(&s->timer[i]);
}
}
So hpet_del_timer would be a nop if !hpet_enabled(s).
Paolo