From: "Sebastian Herbszt" <herbszt@gmx.de>
To: Gleb Natapov <gleb@redhat.com>
Cc: Kevin O'Connor <kevin@koconnor.net>, qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] Re: POST failure (loop) with isapc and seabios
Date: Mon, 30 Nov 2009 21:34:58 +0100 [thread overview]
Message-ID: <FD53C72630904837BB570AC76E248617@FSCPC> (raw)
In-Reply-To: <20091129082024.GA30150@redhat.com>
Gleb Natapov wrote:
> On Fri, Nov 27, 2009 at 09:42:19PM +0100, Sebastian Herbszt wrote:
>> Gleb Natapov wrote:
>> >On Thu, Nov 26, 2009 at 09:55:28PM +0100, Sebastian Herbszt wrote:
>> >>Gleb Natapov wrote:
>> >>>On Wed, Nov 25, 2009 at 11:04:20PM +0100, Sebastian Herbszt wrote:
>> >>>>Gleb Natapov wrote:
>> >>>>>On Wed, Nov 25, 2009 at 06:09:51AM +0000, Jamie Lokier wrote:
>> >>>>>>Gleb Natapov wrote:
>> >>>>>>> > But QEMU is used to run old OSes too.
>> >>>>>>> > > That's OK. I don't expect BIOS to be reloaded if OS
>> >>>>>>restart by jumping
>> >>>>>>> to BIOS reset code.
>> >>>>>>
>> >>>>>>That's good then.
>> >>>>>>
>> >>>>>>What about DOS and DOS-extender programs which do a soft reset by
>> >>>>>>triple-faulting the CPU (see Sebastian's notes on i440FX behaviour),
>> >>>>>>and asking the keyboard controller?
>> >>>>>>
>> >>>>>>Both of those methods are used by DOS and DOS-extender programs to
>> >>>>>>switch from protected mode to real mode. Keyboard controller was used
>> >>>>>>originally, but then someone figured out that triple fault can be used
>> >>>>>>(on most PCs) and is faster.
>> >>>>>>
>> >>>>>>The switch to real mode is done by writing somewhere the BIOS checks,
>> >>>>>>so the BIOS just branches back to the application.
>> >>>>>>
>> >>>>>If offset 0x0f in CMOS contains 0x0a then BIOS jumps to address stored
>> >>>>>in memory address 0x467.
>> >>>>>
>> >>>>>>I think that may imply it has to be a "soft reset" as described by
>> >>>>>>Sebastian in the i440FX description, and I would think the BIOS must
>> >>>>>>not be reloaded.
>> >>>>>Reading ich9 spec I see that on this chipset it is possible to configure
>> >>>>>what kind of reset triple fault generates. Make it not very reliable. Was
>> >>>>>this triple fault trick only needed on 286 anyway?
>> >>>>
>> >>>>It seems to be INIT# vs. PLTRST# (Platform Reset). On the latter all devices
>> >>>>are reset. Table 5-40 is pretty descriptive and there seem to be way too many
>> >>>>ways to trigger a reset. I think PLTRST# is used when a reset is triggered by
>> >>>>the ACPI method. Fortunatelly we don't have to implement this (yet) since
>> >>>>it's not available on the 440fx.
>> >>>>
>> >>>>Using triple fault to reset is used on 286+.
>> >>>>
>> >>>Triple fault use as a reset is widely used today. Use of triple fault to
>> >>>switch from protected mode to real mode was specific for 286.
>> >>
>> >>Whether triple fault is used just for a reset or to switch from protected mode to real
>> >>mode is irrelevant, because from the hardware point of view this is exactly the same
>> >>reset. And old applications can still use this method on new CPUs.
>> >>
>> >If triple fault is used just for a reset we can do hard reset like we do
>> >now. It may violate HW spec but it works.
>>
>> Bad things might happen tho, because some of the hardware state is reset even if it should
>> not be. If some OS does program the PIIX3 PIRQx route control registers and then uses
>> triple fault to return from protected mode and qemu does reset those registers back to
>> default values, the OS might not like it when the BIOS resumes it.
>>
> We already concluded that "return to PM by triple fault" is not something
> we want to support. It was needed only on 286 and QEMU doesn't even
> support 286 cpu emulation.
I don't think you can conclude this because it's not an optional feature. Whether qemu
emulates a 286 cpu is irrelevant in this case because the hardware qemu emulates has
to be backward compatible.
>> >>>>>>
>> >>>>>>But the BIOS must be reloaded from ROM, I'm guessing, if the keyboard
>> >>>>>>controller method is used and the word asking for a branch back to the
>> >>>>>>application has not been set. Because that's how a modern OS (if not
>> >>>>>>using ACPI) asks for a system reset.
>> >>>>>>
>> >>>>>>Do you think the above is (a) correct, and (b) what's implemented?
>> >>>>>>
>> >>>>>Do different things during reset depending on CMOS values doesn't sound
>> >>>>>right to me. I don't know what is implemented right now. I thought that
>> >>>>>we reload BIOS on reset.
>> >>>>
>> >>>>Currently the BIOS seems to be only loaded once and not reloaded during the life
>> >>>>time of a VM.
>> >>>>I don't think there is a notion of BIOS reload on real hardware. CPU access to it is
>> >>>>either directed to the rom (power-up configuration, all those fancy reset conditions)
>> >>>>or to ram.
>> >>>Reloading BIOS in QEMU is needed for a reason not present on real HW. Think
>> >>>about migration from old QEMU to new QEMU. Suppose old BIOS can't
>> >>>properly initialize new QEMU. Then next reboot after migration will fail
>> >>>since old BIOS will be used.
>> >>
>> >>Do you mean live migration between different QEMU versions? That doesn't sound safe,
>> >>especially if the hardware changes on reboot. Does the competition support this?
>> >>
>> >Of course. The ability to upgrade cluster transparently is a major
>> >feature. So migration from older version to newer one is must to have.
>>
>> I am wondering how this works on VMware. A VM has a virtualHW.version assigned, so the
>> hardware doesn't automagically change on software upgrades. You have to power off the VM
>> and request an upgrade for it to change. They also likely have a fairly stable BIOS version.
>> If a VM is created on ESX 3.5 with virtualHW.version 4 and live migrated to ESX 4.0, which also
>> supports virtualHW.version 7, i would assume it still has the same hardware on a hard reset and even
>> if you shutdown and restart it, since no hardware upgrade was requested by the user. If the hardware
>> has been upgraded it can't be migrated back to the ESX 3.5 host. The BIOS might be special tho. It does
>> likely support both hardware versions. If the VM got migrated, the old BIOS should be run and reloaded
>> as long as the VM has not been destroyed / stopped. This should happen even if the VM has been hard reset.
>> Now if the VM is shutdown and recreated on the new host it might be ok to load the new BIOS even if the
>> hardware version was not upgraded. But it is more (?) reasonable to keep loading the old BIOS until the
>> hardware is upgraded and leave the choice to the user.
>>
> You are talking about major HW upgrades and I am not talking about that
> at all. You can't migrate from i440FX to ich9 obviously. I am talking
> about bug fixes in existing HW. For instance currently LINT0 is
> configured to virtual wire mode by KVM itself, but it should be done by
> a BIOS. Suppose new version of KVM fixes this bug, code that did this is
> removed from KVM module and LINT0 configuration is added to a BIOS. Now
> you migrate old guest to the new QEMU/KVM and do reboot. If old BIOS
> will be executed it will not put LINT0 to virtual wire mode and new KVM
> will not do that too. OS boot will fail as a result. That is only one
> example from real life and I have more.
This is unfortunate. Updating the BIOS of a running VM might not be the best idea; tho i don't have a better one.
An unfriendly solution would be to disallow live migration between broken and fixed versions.
- Sebastian
next prev parent reply other threads:[~2009-11-30 20:37 UTC|newest]
Thread overview: 61+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-11-19 21:30 [Qemu-devel] POST failure (loop) with isapc and seabios Sebastian Herbszt
2009-11-20 22:51 ` [Qemu-devel] " Kevin O'Connor
2009-11-21 14:37 ` Sebastian Herbszt
2009-11-22 12:35 ` Gleb Natapov
2009-11-22 15:07 ` Sebastian Herbszt
2009-11-22 15:10 ` Gleb Natapov
2009-11-22 15:31 ` Sebastian Herbszt
2009-11-22 15:38 ` Gleb Natapov
2009-11-22 17:40 ` Kevin O'Connor
2009-11-22 21:15 ` Sebastian Herbszt
2009-11-22 22:04 ` Sebastian Herbszt
2009-11-23 11:14 ` Gleb Natapov
2009-11-23 11:17 ` Gleb Natapov
2009-11-22 20:01 ` Sebastian Herbszt
2009-11-23 11:11 ` Gleb Natapov
2009-11-23 19:19 ` Sebastian Herbszt
2009-11-23 19:43 ` Gleb Natapov
2009-11-23 21:30 ` Sebastian Herbszt
2009-11-24 6:28 ` Gleb Natapov
2009-11-24 14:38 ` Jamie Lokier
2009-11-24 14:40 ` Gleb Natapov
2009-11-25 6:09 ` Jamie Lokier
2009-11-25 12:20 ` Gleb Natapov
2009-11-25 15:31 ` Kevin O'Connor
2009-11-25 16:42 ` Gleb Natapov
2009-11-25 22:11 ` Sebastian Herbszt
2009-11-27 3:00 ` Jamie Lokier
2009-11-27 19:13 ` Sebastian Herbszt
2009-11-25 22:04 ` Sebastian Herbszt
2009-11-25 22:53 ` Kevin O'Connor
2009-11-26 6:49 ` Gleb Natapov
2009-11-26 7:15 ` Kevin O'Connor
2009-11-26 7:20 ` Gleb Natapov
2009-11-26 7:48 ` Kevin O'Connor
2009-11-26 7:56 ` Gleb Natapov
2009-11-26 8:12 ` Kevin O'Connor
2009-11-26 8:19 ` Gleb Natapov
2009-11-26 16:03 ` Kevin O'Connor
2009-11-26 22:35 ` Sebastian Herbszt
2009-11-27 5:39 ` Kevin O'Connor
2009-11-26 6:45 ` Gleb Natapov
2009-11-26 20:55 ` Sebastian Herbszt
2009-11-27 7:44 ` Gleb Natapov
2009-11-27 20:42 ` Sebastian Herbszt
2009-11-29 8:20 ` Gleb Natapov
2009-11-29 22:53 ` Natalia Portillo
2009-11-30 7:12 ` Gleb Natapov
2009-11-30 20:53 ` Jamie Lokier
2009-11-30 21:02 ` Natalia Portillo
2009-12-01 2:16 ` Kevin O'Connor
2009-11-30 20:34 ` Sebastian Herbszt [this message]
2009-12-01 9:37 ` Gleb Natapov
2009-11-25 21:08 ` Sebastian Herbszt
2009-11-24 23:27 ` Sebastian Herbszt
2009-11-25 10:48 ` Gleb Natapov
2009-11-22 15:38 ` Kevin O'Connor
2009-11-23 11:16 ` Gleb Natapov
2009-11-23 17:57 ` Sebastian Herbszt
2009-11-23 18:07 ` Gleb Natapov
2009-11-23 19:12 ` Sebastian Herbszt
2009-11-23 19: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=FD53C72630904837BB570AC76E248617@FSCPC \
--to=herbszt@gmx.de \
--cc=gleb@redhat.com \
--cc=kevin@koconnor.net \
--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).