qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [RFC v4 03/12] isa: Provide set_state callback


From: Andreas Färber
Subject: Re: [Qemu-devel] [RFC v4 03/12] isa: Provide set_state callback
Date: Thu, 9 Jun 2011 16:07:28 +0200

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 ...

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- owned bus to put the devices on but then I don't see how to reuse the existing isa devices.

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.

SystemSoft MobilePRO BIOS, PhoenixBIOS, AMI BIOS, Award BIOS all allow to reconfigure I/O base (same also IRQ) of both serial ports and parallel port. fdc and ide however I've seen nowhere before. Some newer ones have an "Auto" setting that hides this, and when choosing "Enabled" a new field shows up.
Configuration options are a set of fixed options, similar to pc87312.

DOS, Windows and Linux were able to apply such driver configuration changes after a reboot iirc. For example, ISA SoundBlaster or NE2000 cards. I also remember 3Com having special DOS boot discs with a tool to change on-card config for some ISA network cards.

Andreas



reply via email to

[Prev in Thread] Current Thread [Next in Thread]