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

Kevin O'Connor kevin at koconnor.net
Fri Sep 6 02:45:32 CEST 2013


On Wed, Sep 04, 2013 at 08:13:56AM +0200, Gerd Hoffmann wrote:
> On Di, 2013-09-03 at 21:28 -0400, Kevin O'Connor wrote:
> > On Tue, Sep 03, 2013 at 02:37:41PM +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 general, it looks sane to me.  It does mix the "preinit" phase (on
> > coreboot/qemu) with the "init" phase (on csm).
> 
> There is no preinit on csm ...

"preinit" is code run before code relocation.  It's handle_csm_0000()
for csm.

> > Can the detect just be
> > done in qemu_cfg_init (perhaps renaming it to qemu_init) and that way
> > this detection doesn't need to be done in the preinit phase.
> 
> I'd like to do this as early as possible, because one of the things this
> enables is logging via qemu debug port (CONFIG_DEBUG_IO).

Good point.

> Also note that preinit has a runningOnKvm() call, and we'll better do
> the checks for qemu and kvm beforehand.

Maybe call qemu_preinit() from handle_csm_0000()?

-Kevin



More information about the SeaBIOS mailing list