Received: from eggs.gnu.org ([140.186.70.92]:45488) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QUhjD-0000yk-NA for qemu-devel@nongnu.org; Thu, 09 Jun 2011 12:05:05 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QUhjC-0008FE-18 for qemu-devel@nongnu.org; Thu, 09 Jun 2011 12:05:03 -0400 Received: from mx1.redhat.com ([209.132.183.28]:23146) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QUhjB-0008Eo-Ko for qemu-devel@nongnu.org; Thu, 09 Jun 2011 12:05:01 -0400 From: Markus Armbruster References: <4DEF2F25.5070104@redhat.com> <1307559319-16183-1-git-send-email-andreas.faerber@web.de> <1307559319-16183-2-git-send-email-andreas.faerber@web.de> <1307559319-16183-3-git-send-email-andreas.faerber@web.de> <1307559319-16183-4-git-send-email-andreas.faerber@web.de> <4DF0A2E2.90501@redhat.com> <1F0A98AD-E9C7-42BB-8DFE-2427C27074B6@web.de> <4DF0BB4E.9080507@redhat.com> Date: Thu, 09 Jun 2011 18:04:58 +0200 In-Reply-To: ("Andreas =?utf-8?Q?F=C3=A4rber=22's?= message of "Thu, 9 Jun 2011 16:07:28 +0200") Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [RFC v4 03/12] isa: Provide set_state callback List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Andreas =?utf-8?Q?F=C3=A4rber?= Cc: Juan Quintela , hpoussin@reactos.org, Gerd Hoffmann , qemu-devel@nongnu.org Andreas F=C3=A4rber writes: > Hi, > > Am 09.06.2011 um 14:23 schrieb Gerd Hoffmann: > >>>> I get the feeling that doing all this in the pc87312 emulation is >>>> easier as it needs to have this logic anyway for config register >>>> writes and you can probably reuse the code for loadvm pre- and >>>> postprocessing. >>> >>> Well, I wasn't looking for the easiest way but for the proper way. I >>> don't want to let pc87312-internal state get out-of-sync with that of >>> the aggregated devices. So we still need the qdev getters, and we >>> still >>> need each device to handle enabling/disabling itself. >> >> Do we? The pc87312 is the only instance which changes those >> settings at runtime, so they should not get out-of-sync even if they >> are write-only for the pc87312. > > The devices need to register the I/O ports for sure. No one else knows > what functions to use. > So we either need your generic set_state callback or my explicit > helper functions to invoke that. > >>> Are you okay with >>> those parts if we move just the VMState to pc87312? That feels wrong. >> >> I'd keep everything (iobase, irq, enabled state) in pc87312, so the >> isa vmstate doesn't need any updates. The pc87312 actually applies >> the configuration, so this doesn't feel wrong to me ... Feels weird to me. A device on a real ISA bus decodes whatever addresses it likes, and raises whatever interrupt lines it likes. Of course, the thing within the Super I/O isn't a real ISA bus, it just looks like one to software. Not that there's much to look at with ISA. >>> Do we have any ordering guarantee that the isa devices were loaded >>> prior >>> to the pc87312 post hook? >> >> I don't think so. Juan? > > In that case it won't work (out-of-sync) and we shouldn't introduce > VMState for pc87312 at all imo. In theory we'd probably need a > pc87312-=20 > owned bus to put the devices on but then I don't see how to reuse the > existing isa devices. Err, which device provides your ISA bus if not pc87312? >>> How do BIOS config changes work on a PC? Which qdev would be >>> responsible >>> for saving their state? >> >> They are not re-configurable at runtime. I think even on real >> hardware you usually can only enable/disable devices, not change the >> configuration. > > I'm positive they are configurable by the BIOS, that's why I called it > "ISA reconfigurability" (not "Weird workarounds for PReP") and thought > about VMState in the first place. Yes, software-configurable ISA devices are fairly common. [...]