From: Jan Kiszka <jan.kiszka@web.de>
To: Gleb Natapov <gleb@redhat.com>
Cc: qemu-devel@nongnu.org
Subject: [Qemu-devel] Re: [PATCH] pass info about hpets to seabios.
Date: Sun, 13 Jun 2010 19:41:14 +0200 [thread overview]
Message-ID: <4C15183A.5030609@web.de> (raw)
In-Reply-To: <20100613171915.GA13238@redhat.com>
[-- Attachment #1: Type: text/plain, Size: 2343 bytes --]
Gleb Natapov wrote:
> On Sun, Jun 13, 2010 at 06:56:37PM +0200, Jan Kiszka wrote:
>> Gleb Natapov wrote:
>>> Currently HPET ACPI table is created regardless of whether qemu actually
>>> created hpet device. This may confuse some guests that don't check that
>>> hpet is functional before using it. Solve this by passing info about
>>> hpets in qemu to seabios via fw config interface. Additional benefit is
>>> that seabios no longer uses hard coded hpet configuration. Proposed
>>> interface supports up to 256 hpets. This is the number defined by hpet
>>> spec.
>> Nice, this lays the ground for adding hpets via -device.
>>
>> (But I think I read there can only be 8 hpets with a total sum of 256
>> timers.)
>>
> Ah, correct. I thought to myself 256 hpets should be to much :)
>
>>> Signed-off-by: Gleb Natapov <gleb@redhat.com>
>>> diff --git a/hw/hpet.c b/hw/hpet.c
>>> index 93fc399..f2a4514 100644
>>> --- a/hw/hpet.c
>>> +++ b/hw/hpet.c
>>> @@ -73,6 +73,8 @@ typedef struct HPETState {
>>> uint64_t hpet_counter; /* main counter */
>>> } HPETState;
>>>
>>> +struct hpet_fw_config hpet_cfg = {.valid = 1};
>>> +
>>> static uint32_t hpet_in_legacy_mode(HPETState *s)
>>> {
>>> return s->config & HPET_CFG_LEGACY;
>>> @@ -661,6 +663,9 @@ static void hpet_reset(DeviceState *d)
>>> */
>>> hpet_pit_enable();
>>> }
>>> + hpet_cfg.count = 1;
>>> + hpet_cfg.hpet.event_timer_block_id = (uint32_t)s->capability;
>> The number of timers, thus the content of capability can change on
>> vmload. So you need to update hpet_cfg there as well.
>>
> How it can change? User is required to run the same command line on src
> and dst, no?
Generally, yes. But there is no technical need to match the hpet props
so far, they are included in the vmstate (implicitly).
>
>> And I think we can move the capability setup into init. But this is not
>> directly related to this patch, would just avoid adding this hunk to
>> hpet_reset.
> I actually did that initially and tried to init hpet_cfg there too, but
> then noticed that mmio[0].addr below is not initialized at init time yet.
Indeed.
You may try sysbus_init_mmio_cb instead for a callback to be invoked
once the address was set. That handler could also be called on vmload.
Jan
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 257 bytes --]
next prev parent reply other threads:[~2010-06-13 17:41 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-06-13 14:43 [Qemu-devel] [PATCH] pass info about hpets to seabios Gleb Natapov
2010-06-13 16:56 ` [Qemu-devel] " Jan Kiszka
2010-06-13 17:19 ` Gleb Natapov
2010-06-13 17:41 ` Jan Kiszka [this message]
2010-06-13 19:02 ` Gleb Natapov
2010-06-13 19:55 ` Paul Brook
2010-06-14 5:18 ` Gleb Natapov
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=4C15183A.5030609@web.de \
--to=jan.kiszka@web.de \
--cc=gleb@redhat.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).