From: Paolo Bonzini <pbonzini@redhat.com>
To: Alex Bligh <alex@alex.org.uk>
Cc: QEMU Developers <qemu-devel@nongnu.org>, Matt Lupfer <mlupfer@ddn.com>
Subject: Re: [Qemu-devel] [PATCH] Don't enable a HPET timer if HPET is disabled
Date: Sat, 22 Feb 2014 15:39:59 +0100 [thread overview]
Message-ID: <5308B6BF.3030503@redhat.com> (raw)
In-Reply-To: <44106FFA-013B-4B20-8457-19862B6005FA@alex.org.uk>
Il 22/02/2014 13:25, Alex Bligh ha scritto:
> Paolo,
>
> On 22 Feb 2014, at 10:55, Paolo Bonzini wrote:
>
>> 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).
>
> Thanks. I didn't know whether HPET_CFG_ENABLE and HPET_TN_ENABLE were equivalent.
No, they are not, but HPET_CFG_ENABLE is equivalent to hpet_enabled.
Paolo
next prev parent reply other threads:[~2014-02-22 14:40 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-02-22 4:37 [Qemu-devel] [PATCH] Don't enable a HPET timer if HPET is disabled Matt Lupfer
2014-02-22 9:01 ` Paolo Bonzini
2014-03-26 20:20 ` Matt Lupfer
2014-03-27 12:17 ` Paolo Bonzini
2014-02-22 9:03 ` Alex Bligh
2014-02-22 10:55 ` Paolo Bonzini
2014-02-22 12:25 ` Alex Bligh
2014-02-22 14:39 ` Paolo Bonzini [this message]
2014-03-27 12:19 ` Michael S. Tsirkin
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=5308B6BF.3030503@redhat.com \
--to=pbonzini@redhat.com \
--cc=alex@alex.org.uk \
--cc=mlupfer@ddn.com \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).