SeaBIOS

SeaBIOS Git Change Log

Age Message
29 days 11 hours tpm: Request access to locality 0

The CRB driver has to request access to locality 0. Our QEMU
CRB model will enforce that as well.

Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
Commit d1343e6863dd287ce7d4fcb5169c9cff568f9d1b, by Stefan Berger
1 month 7 days tpm: when CRB is active, select, lock it, and check addresses

Do not just indicate that the probing for the CRB interface was successful
if we find it active. Instead, select it, lock it, and test the addresses
for whether they can be used (must be 32 bit).

Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
Commit 4922d6cb391b8ea48a35a73c46e484cf5f1a9b1a, by Stefan Berger
1 month 7 days tpm: revert return values for successful/failed CRB probing

The return values for successful/failed CRB probing were reverted.
Fix it.

Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
Commit 8bd306e10ff6abfed6188ec0f6c2157002a52d66, by Stefan Berger
1 month 7 days tpm: Wait for tpmRegValidSts flag on CRB interface before probing

Wait for the tpmRegValidSts flag on the TPM_LOC_STATE_x register to
be set; we expect the locAssigned flag to not be set.

Real hardware seems to set the tpmRegValidSts flag without for
example requesting access to a locality.

Tested-by: Stephen Douthit <stephend@silicom-usa.com>
Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
Commit 408630ef19499ed9ca5a7e90721271adf599c975, by Stefan Berger
1 month 30 days tpm: Handle unimplemented TIS_REG_IFACE_ID in tis_get_tpm_version()

If a device reports 0xf in the InterfaceType field of the TPM_INTERFACE_ID,
then the rest of the fields are invalid, and the InterfaceVersion field of
the TPM_INTF_CAPABILITY register must be checked instead.

Signed-off-by: Stephen Douthit <stephend@silicom-usa.com>
Tested-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
Reviewed-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
Commit 5adc8bdea6a77bdb457d9cbca9a49a7d01cc25cd, by Stephen Douthit
1 month 30 days tpm: Wait for interface startup when probing

This is based on wait_startup() from the Linux tpm_tis driver.

Signed-off-by: Stephen Douthit <stephend@silicom-usa.com>
Tested-by: Stephen Douthit <stephend@silicom-usa.com>
Reviewed-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
Commit 96060ad1c38a3e90125aa4676b30828be126a4d5, by Stephen Douthit
1 month 30 days tpm: Refactor duplicated wait code in tis_wait_sts() & crb_wait_reg()

Signed-off-by: Stephen Douthit <stephend@silicom-usa.com>
Tested-by: Stephen Douthit <stephend@silicom-usa.com>
Reviewed-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
Commit 559b3e2ba43c80ac02a67903d57ae1acad5dfff1, by Stephen Douthit
2 months 17 hours tpm: add TPM CRB device support

The CRB device was introduced with TPM 2.0 to be physical-bus agnostic
and defined in TCG PC Client Platform TPM Profile (PTP) Specification
Family “2.0” Level 00 Revision 01.03 v22

It seems to be required with Windows 10. It is also a simpler device
than FIFO/TIS.

This patch only support locality 0 since also the CRB device in QEMU
only supports this locality.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
Tested-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
Commit 9c6e73b5ebf1f184f96e9ed498a8d1a51512e807, by Marc-André Lureau
2 months 17 hours tpm: use get_tpm_version() callback

As originally intended.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
Tested-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
Commit a197e204cadd70758de3ea94cfb6d647e88ada95, by Marc-André Lureau
2 months 17 hours tpm: generalize init_timeout()

It seems both TIS & CRB devices share the same timeout. Make
initialization function generic now.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
Tested-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
Commit c75d45a9712f9a0b4aa203d780e0bf01375699c9, by Marc-André Lureau
2 months 17 hours x86: add readq()

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
Tested-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
Commit 8694c3bc847c12857edfb7dbb4e24e97b1e1861b, by Marc-André Lureau
1 month 30 days build: Use git describe --always

Add --always flag to "git describe" command to get a build identifier
even if one checks out the repo with a depth parameter that prunes out
the last tagged version.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2 months 4 days shadow: Don't invoke a shutdown on reboot unless in a reboot loop

Old versions of KVM would map the same writable copy of the BIOS at
both 0x000f0000 and 0xffff0000. As a result, a reboot on these
machines would result in a reboot loop. So, the code attempts to
check for that situation and invoke a shutdown instead.

Commit b837e68d changed the check to run prior to the first reboot.
However, this broke reboots on the QEMU isapc machine type. Change
the reboot loop check to only be invoked after at least one reboot has
been attempted.

Reported-by: Daniel P. Berrangé <berrange@redhat.com>
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2 months 16 days floppy: Send 4 sense interrupt commands during controller initialization

During initialization, real floppy controllers need 4 sense interrupt commands
to clear the interrupt status (this represents the transition from "not ready"
to "ready" for each of the four virtual floppy drives), instead of just one.

This is described in detail in section 7.4 - Drive Polling of the Intel 82077AA
datasheet.

Signed-off-by: Nikolay Nikolov <nickysn@users.sourceforge.net>
Commit af0daeb2687ad2595482b8a71b02a082a5672ceb, by Nikolay Nikolov
2 months 16 days floppy: Wait for the floppy motor to reach a stable speed, after starting

When starting up the floppy motor, wait for a certain amount of time, so
that it can spin up and reach a stable speed. This delay is skipped, if the
motor was already running (which can happen, since the floppy motor is
intentionally kept spinning for 2 seconds after the previous floppy
operation completes).

Signed-off-by: Nikolay Nikolov <nickysn@users.sourceforge.net>
Commit 2611db472c0f0bad4987c20990a45c175342fc22, by Nikolay Nikolov
2 months 16 days floppy: Support up to 4 floppy drives when turning on the floppy motor

The previous version allowed for only two floppies.

Signed-off-by: Nikolay Nikolov <nickysn@users.sourceforge.net>
Commit 81f45a62e8692bd84276d570833fec2a77c25c8e, by Nikolay Nikolov
2 months 16 days floppy: Execute a SPECIFY command after sensing the media type

The SPECIFY command sets the Step Rate Time, Head Load Time, Head Unload Time
and the DMA enable/disable bit.

Signed-off-by: Nikolay Nikolov <nickysn@users.sourceforge.net>
Commit f9cc969b3e67010627b3de6e989752e01b333ce2, by Nikolay Nikolov
2 months 16 days floppy: hold the DOR reset bit low for 4 microseconds, when resetting

Signed-off-by: Nikolay Nikolov <nickysn@users.sourceforge.net>
Commit b00a03a49e28d518435deeb22d119bbd959e78a3, by Nikolay Nikolov
2 months 22 days floppy: Use timer_check() in floppy_wait_irq()

Use timer_check() instead of using floppy_motor_counter in BDA for the
timeout check in floppy_wait_irq().

The problem with using floppy_motor_counter was that, after it reaches
0, it immediately stops the floppy motors, which is not what is
supposed to happen on real hardware. Instead, after a timeout (like in
the end of every floppy operation, regardless of the result - success,
timeout or error), the floppy motors must be kept spinning for
additional 2 seconds (the FLOPPY_MOTOR_TICKS). So, now the
floppy_motor_counter is initialized to 255 (the max value) in the
beginning of the floppy operation. For IRQ timeouts, a different
timeout is used, specified by the new FLOPPY_IRQ_TIMEOUT constant
(currently set to 5 seconds - a fairly conservative value, but should
work reliably on most floppies).

After the floppy operation, floppy_drive_pio() resets the
floppy_motor_counter to 2 seconds (FLOPPY_MOTOR_TICKS).

This is also consistent with what other PC BIOSes do.

Signed-off-by: Nikolay Nikolov <nickysn@users.sourceforge.net>
Commit 4a6dbcea3e412fe12effa2f812f50dd7eae90955, by Nikolay Nikolov
2 months 22 days floppy: Reset the floppy motor count in floppy_drive_pio()

Reset the floppy motor count, so the motor keeps spinning 2 seconds
after a floppy operation, performed by floppy_drive_pio().

Signed-off-by: Nikolay Nikolov <nickysn@users.sourceforge.net>
Commit 488ede2297461af9d60dd21cff853a49afdc2c70, by Nikolay Nikolov
2 months 22 days floppy: Preserve motor and drive sel bits when resetting the floppy controller

In case of read or write errors, the floppy system is usually reset and the
operation is retried. In that case, the floppy motor state must be preserved
in order to avoid creating jitter and keep the floppy motor spinning smoothly
at a constant speed. Additionally, the drive select bits should probably also
be preserved, because some systems might need a small delay after selecting a
new drive. In that case, the operation would be retried, without changing
the currently selected drive.

In floppy_enable_controller(), the IRQ bit is now enabled first, before the
reset bit is set. I'm not completely sure whether this is necessary. It is
done just in case some hardware introduces a delay between setting this bit
and actually enabling the IRQ, which would cause us to miss the IRQ, sent by
the controller immediately after reset.

Signed-off-by: Nikolay Nikolov <nickysn@users.sourceforge.net>
Commit 53d82f0ee8eba571689f64b748bca8e9badda8b2, by Nikolay Nikolov
2 months 22 days floppy: Introduce FLOPPY_DOR_XXX constants

Signed-off-by: Nikolay Nikolov <nickysn@users.sourceforge.net>
Commit 53fc631307b2c4a403e183afcc5ffe27987349a6, by Nikolay Nikolov
2 months 22 days floppy: Introduce floppy_dor_mask()

Signed-off-by: Nikolay Nikolov <nickysn@users.sourceforge.net>
Commit 5157a7882de8b50c2365fd9166c5d91861a478a2, by Nikolay Nikolov
2 months 22 days floppy: Introduce the floppy_dor_read() function

Signed-off-by: Nikolay Nikolov <nickysn@users.sourceforge.net>
Commit 3ddb42f38f5054aa6eed7971f10da0adc076c74e, by Nikolay Nikolov
3 months 15 days pci: fix 'io hints' capability for RedHat PCI bridges

Commit ec6cb17f (pci: enable RedHat PCI bridges to reserve additional
resources on PCI init)
added a new vendor specific PCI capability for RedHat PCI bridges
allowing them to reserve additional buses and/or IO/MEM space.

When adding the IO hints PCI capability to the pcie-root-port
without specifying a value for bus reservation, the subordinate bus
computation is wrong and the guest kernel gets messed up.

Fix it by returning to prev code if the value for bus
reservation is not set.

Removed also a wrong debug print "PCI: invalid QEMU resource reserve
cap offset" which appears if the 'IO hints' capability is not present.

Acked-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Marcel Apfelbaum <marcel@redhat.com>
Commit 14d91c353e19b7085fdbb7b2dcc43f3355665670, by Marcel Apfelbaum