SeaBIOS Git Change Log

Age Message
24 days 1 hour make SeaBios compatible with Xen vTPM.

Signed-off-by: Quan Xu <>
2 months 1 day Support for BIOS interrupt handler

This patch implements the TCG BIOS interrupt handler 1ah. It is for
example used by trusted grub.

This patch adds an implementation of SHA1 (following NIST specs., IETF RFC 3147
and Wikipedia) for speeding up measurements of code. Trusted Grub for example
makes use of this interface and measures (calculates SHA1) of the Linux kernel
and initrd. Those files can be rather large and hunting their bytes through
the TIS interface as part of the int handler commands invoked by trusted grub
does take quite some time due to the many vmexits the interface is creating
(one per byte).

There is also a threshold for the size of data to hash (100k) below which
the TPM is used and above the internal faster SHA1 algorithm is used.

This patch for example enables trusted grub to interact with the TPM
and take additional measurements.

Signed-off-by: Stefan Berger <>
Signed-off-by: Kevin O'Connor <>
Commit 5aa2a75463e2518de56fccb178b6c62b4fe377d9, by Stefan Berger
2 months 1 day Implementation of the TCG BIOS extensions

This patch implements the main part of the TCG BIOS extensions. It provides
the following functionality:

- initialization of the TCPA ACPI table used for logging of measurements
- initialization of the TPM by sending a sequence of commands to it
- proper setup of the TPM before the BIOS hands over control to the bootloader
- support for S3 resume; BIOS sends TPM_Startup(ST_STATE) to TPM
- enable configuration of SeaBIOS to be built with TCGBIOS extensions
All TCG BIOS extensions are activated with CONFIG_TCGBIOS.

Structures that are needed in subsequent patches are also included in
tcgbios.h at this point.

The effect of this patch is that it initialized the TPM upon VM start
and S3 resume.

Signed-off-by: Stefan Berger <>
Commit b310dfa59913149bcb728176fd0fcb52731a97d8, by Stefan Berger
2 months 1 day Add an implementation of a TPM TIS driver

This patch adds an implementation of a TPM TIS driver for the TPM TIS
emulation supported by QEMU. The driver is broken up into several
small functions that have to be called in proper sequence. The driver is
cleanly separated from the rest of the code through an interface holding
pointers to the driver's functions.
A client using this driver first probes whether the TPM TIS
interface is available (probe function) and then invokes the interface
function to initialze the interface and send requests and receive responses.

Possible future extensions *could* include a virtio interface for the TPM
with a corresponding driver here.

Signed-off-by: Stefan Berger <>
Commit dfbc885d622871f8f671b3f07374f922df4d0ec4, by Stefan Berger
5 days 8 hours Link rom.o with -N option.

This option tells linker not to align sections in a way optimied for OS.

ls -lh out/bios.bin.elf
-rwxr-xr-x 1 phcoder phcoder 90K Mai 19 20:38 out/bios.bin.elf

Signed-off-by: Vladimir Serbinenko <>
Commit 3752bf44be8931f86523ed538555b170a52d09dc, by Vladimir Serbinenko
6 days 12 hours ahci: Ignore max_ports.

At least AHCI on Intel on some machines claim to support only 6 ports
while in fact higher port numbers are present and work.
This is needed to access CD-ROM on PackardBell MS2290.
Both GRUB and Linux have a similar workaround.

Signed-off-by: Vladimir Serbinenko <>
Commit 40dfc0ee947c35f31e935ec290622e7780bb52b8, by Vladimir Serbinenko
18 days 14 hours smm: ignore bits 16,18-31 of SMM revision ID

Bits 16-31 of the SMM revision ID are feature bits. We only need to
check that SMBASE relocation is supported, but do not care about other
features. In particular, this allows the SMM I/O instruction restart
feature to be present.

Signed-off-by: Paolo Bonzini <>
Commit 92f9b9189eb00da42a8bfcf26c664f48ee8d2868, by Paolo Bonzini
1 month 7 days checkstack: Minor - continue if not a regular asm line

Signed-off-by: Kevin O'Connor <>
1 month 15 days vgabios: Emulate "leal" instruction

Emulate the "leal" instruction so that the vgabios can run on older
versions of x86emu. (This removes the previous "leal" trap.)

Signed-off-by: Kevin O'Connor <>
1 month 15 days vgabios: Add config option for assembler fixups

Add a kconfig build option (CONFIG_VGA_FIXUP_ASM) to allow users to
build the vgabios without the complex assembler fixups that work
around emulator bugs.

Signed-off-by: Kevin O'Connor <>
1 month 15 days vgabios: Don't use "smsww" instruction - it confuses x86emu

Commit 251e2638 introduced the "smsww" instruction to the vgabios.
Unfortunately, it appears at least some versions of x86emu crash when
executing that instruction (eg, FC13 installer crashes). That
instruction wasn't required to work around the problem fixed in
251e2638, so just avoid it.

Signed-off-by: Kevin O'Connor <>
1 month 15 days smbios: Use integer signature instead of string signature

Change the smbios structure to use a 4 byte u32 signature field
instead of a 4 byte character string field. In practice, this allows
the compiler to place the signature in the initialize code segment and
thus makes it less likely the signature would be found in the
f-segment. (If the smbios signature is found in the f-segment it can
confuse some table scans.)

Reviewed-by: Bruce Rogers <>
Tested-by: Bruce Rogers <>
Signed-off-by: Kevin O'Connor <>
2 months 5 days checkrom: Fix typo in error message

increate -> increase

Signed-off-by: Andreas Färber <>
Commit b4581224824871ad2909f84fc4a9e067cda663f2, by Andreas Färber
2 months 5 days checkstack: Prefer passing "function" class instead of function address

Signed-off-by: Kevin O'Connor <>
2 months 5 days checkstack: Simplify yield calculations

Signed-off-by: Kevin O'Connor <>
2 months 5 days checkstack: Replace function information tuple with class

Replace the six-tuple storing information on each parsed function with
a class. This makes the code more readable.

Signed-off-by: Kevin O'Connor <>
2 months 6 days docs: Clarify that pci-optionrom-exec doesn't apply to roms in cbfs

Signed-off-by: Kevin O'Connor <>
2 months 7 days vgabios: Don't use extra stack if it appears a modern OS is in use

If the last mode set (while not in vm86 mode) was done from a VBE mode
set call then disable the extra stack. This works under the premise
that only a modern OS would invoke the VBE mode changing facilities
and a modern OS would always call the vgabios with sufficient stack

This is an ugly hack to work around a problem Windows Vista (and
possibly later Windows releases) has with the VGA BIOS using a stack
in the e-segment.

Reported-by: Richard Laager <>
Signed-off-by: Kevin O'Connor <>
2 months 7 days vgabios: On bda_save_restore() the saved vbe_mode also has flags in it

When restoring a saved state, make sure to remove any flags from the
video mode prior to searching for that mode.

Signed-off-by: Kevin O'Connor <>
2 months 8 days docs: Note release date of 1.8.1

Signed-off-by: Kevin O'Connor <>
2 months 12 days boot: switch default menu key to ESC

On some platforms, F12 may be hard to access; for example, on OS X
machines F9-F12 have been intercepted by the OS for a long time, and
on newer OS X releases function keys are basically gone for good.

Which keys are and are not available depends on the client, not on
the server, but only function keys are usually trapped by terminals.
Hence, using ESC for the boot menu avoids the problems associated
with F12.

Signed-off-by: Paolo Bonzini <>
Commit a1ac8861049a5ffefc26ca294293ad666954fcc8, by Paolo Bonzini
2 months 12 days boot.c: delay exiting boot if menu key is ESC

If the menu key is ESC, do not restart boot unless
1.5 seconds have passed. Otherwise users (trained by years of
repeatedly hitting keys to enter the BIOS) will end up hitting ESC
multiple times and immediately booting the primary boot device.

Suggested-by: Matt DeVillier <>
Signed-off-by: Paolo Bonzini <>
Commit 80aae26c9ef060bde15aebd84d0cc79a978706a9, by Paolo Bonzini
2 months 13 days smp: Fix smp race introduced in 0673b787

In 0673b787 the QEMU SMP init code was changed to run in 32bit mode.
Unfortunately, the transition32 assembler function is not
multi-processor safe, because it modifies the global RTC index
register. This race condition led to sporadic failures when emulating
machines with a large number of processors.

This patch changes the entry_smp code to use a variant of transition32
that does not touch the RTC registers.

Signed-off-by: Kevin O'Connor <>
3 months 8 days fw/pci: map memory and IO regions for multiple pci root buses

For resource sizing and mapping purposes treat devices on extra root
buses as if they are on the default root bus (bus 0).

Signed-off-by: Kevin O'Connor <>
Signed-off-by: Marcel Apfelbaum <>
Signed-off-by: Gerd Hoffmann <>
Commit 0fe4c9ee7af5f6bb3a1fcbf1d39116a894600c90, by Marcel Apfelbaum
3 months 8 days fw/pci: scan all buses if extraroots romfile is present

If there are extra primary root buses, scanning the bus's 0
subtree is not enough. Scan all the range.

Signed-off-by: Marcel Apfelbaum <>
Signed-off-by: Gerd Hoffmann <>
Commit 5cc7eece39721f20b417770374a4112c454be801, by Marcel Apfelbaum