[SeaBIOS] [PATCH 1/3] Add generic qemu detection

Gerd Hoffmann kraxel at redhat.com
Mon Sep 16 15:14:45 CEST 2013


On Mo, 2013-09-16 at 15:34 +0300, Gleb Natapov wrote:
> On Mon, Sep 16, 2013 at 02:27:37PM +0200, Gerd Hoffmann wrote:
> > On Mo, 2013-09-16 at 14:10 +0300, Gleb Natapov wrote:
> > > On Mon, Sep 16, 2013 at 12:36:28PM +0200, Gerd Hoffmann wrote:
> > > > This patch adds support for detecting whenever SeaBIOS runs on qemu
> > > > or not.  This is done by looking at the northbridge (pci device 00:00.0)
> > > > and check the subsystem id.  Most pci devices emulated by qemu -- the
> > > > two northbridges i440fx and q35 included -- have a subsystem id of
> > > > "1af4:1100".
> > > > 
> > > > In case the subsystem ID matches set PF_QEMU, log a message (including
> > > > the northbridge found while being at it) and also check for kvm.
> > > > 
> > > What if other userspace will want to write enough support to run Seabios
> > > as a guest? Why kvm detection depends on QEMU?
> > 
> > What other userspace?  There is none today.  And if that changes some
> > day we'll just call kvm_detect() in the init code for $otheruserspace.
> > 
> Why seabios code has to be changed at all to support other device model
> emulator (assuming it will emulate same chipset)?

That is a purely theoretical thing.  In practice seabios mist likely has
to be changed for one or another reason.  

Note that the detection behavior isn't new, current seabios code does
kvm detection for CONFIG_QEMU builds only.

Also note that in theory seabios should not need to care at all whenever
it runs on kvm or tcg.  In practice qemu has slightly different behavior
with kvm enabled and seabios needs adapt to that.  That alone is reason
enougth that supporting other kvm userspace very likely needs adaptions
in seabios, unless your theoretical[1] other userspace is bug compatible
with qemu here.  

cheers,
  Gerd

[1] Or do you know something you don't wanna tell me?




More information about the SeaBIOS mailing list