From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=32850 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1ONrBS-0003kM-Sc for qemu-devel@nongnu.org; Sun, 13 Jun 2010 13:41:23 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1ONrBR-0005In-DP for qemu-devel@nongnu.org; Sun, 13 Jun 2010 13:41:22 -0400 Received: from fmmailgate01.web.de ([217.72.192.221]:47756) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1ONrBQ-0005IE-HF for qemu-devel@nongnu.org; Sun, 13 Jun 2010 13:41:21 -0400 Message-ID: <4C15183A.5030609@web.de> Date: Sun, 13 Jun 2010 19:41:14 +0200 From: Jan Kiszka MIME-Version: 1.0 References: <20100613144315.GB6292@redhat.com> <4C150DC5.6020802@web.de> <20100613171915.GA13238@redhat.com> In-Reply-To: <20100613171915.GA13238@redhat.com> Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="------------enig49DBE7F03961F1F129D318BE" Sender: jan.kiszka@web.de Subject: [Qemu-devel] Re: [PATCH] pass info about hpets to seabios. List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Gleb Natapov Cc: qemu-devel@nongnu.org This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enig49DBE7F03961F1F129D318BE Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable 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 actua= lly >>> created hpet device. This may confuse some guests that don't check th= at >>> 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 hpe= t=20 >>> 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 :) >=20 >>> Signed-off-by: Gleb Natapov >>> 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; >>> =20 >>> +struct hpet_fw_config hpet_cfg =3D {.valid =3D 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 =3D 1; >>> + hpet_cfg.hpet.event_timer_block_id =3D (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). >=20 >> And I think we can move the capability setup into init. But this is no= t >> 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 ye= t. 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 --------------enig49DBE7F03961F1F129D318BE Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.9 (GNU/Linux) Comment: Using GnuPG with SUSE - http://enigmail.mozdev.org iEYEARECAAYFAkwVGD4ACgkQitSsb3rl5xR3mwCg2HbJeDxCoMJEcasblS02bpce /ecAoI1XzrrUJBUY1PDkDWzgmWYXUpwc =ehlr -----END PGP SIGNATURE----- --------------enig49DBE7F03961F1F129D318BE--