Age | Commit message (Collapse) | Author | Files | Lines |
|
Report the port state on a port status change notification. Clear the
change bits so further change notifications are delivered.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
Some USB3 controllers (and/or devices) need additional time after the
device is detected to place the port in an enabled state. Wait for
the controller to report enabled before proceeding. This fixes
several reports of devices that showed a "stall" error (cc 4) during
set address.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
PCIe downstream ports (Root Ports and switches Downstream Ports) appear
to firmware as PCI-PCI bridges and a 4K IO space is allocated for them
even if there is no device behind them requesting IO space,
all that for hotplug purpose.
However, PCIe devices can work without IO, so there is no need
to allocate IO space for hotplug.
Acked-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Marcel Apfelbaum <marcel@redhat.com>
|
|
This patch adds an new menu entry to the main menu. This menu item enables
the user to enter a TPM control menu which allows control of those aspects
of the TPM's state that can only be controlled while in the firmware
and while physical presence can be asserted.
If the machine has a TPM, the boot menu will look as follows, with
the new menu item accessible by pressing the 't' key.
Select boot device:
1. ata0-1: QEMU HARDDISK ATA-7 Hard-Disk (6144 MiBytes)
2. Legacy option rom
3. iPXE (PCI 00:03.0)
t. TPM Menu
Upon pressing t the TPM submenu will be shown:
The Trusted Platform Module (TPM) is a hardware device in this machine.
It can help verify the integrity of system software.
The current state of the TPM is:
Enabled and active
Ownership has not been taken
A user can take ownership of the TPM
Available options are:
d. Disable the TPM
v. Deactivate the TPM
p. Prevent installation of an owner
If no change is desired or if this menu was reached by mistake, press ESC to
reboot the machine.
The TPM menu only shows those options that are currently accessible considering
the state of the TPM.
The patch adds several functions for sending those messages to the TPM
required for supporting those menu items.
Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
|
|
Check the length parameter that indicates the length of the array
for whether it has a minimum value of 0x200.
Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
|
|
Remove the check for a working TPM from the TPM interrupt handler. This then
allows the individual API calls to return information even if the TPM was not
working correctly. Some API calls will still run into the check.
Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
|
|
Merge tpm_extend() into tpm_log_extend_event(). Also, the spec states
that a log entry should only be added if the extend succeeds, so
attempt the extend prior to adding to the log.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
Merge tpm_extend_acpi_log() and tpm_log_event(). Move error checking
and handling to callers. Don't shutdown the TPM on a failure from the
16bit BIOS interface.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
There are no longer any callers to transmit() that use multiple
buffers. Simplify transmit() so that it takes a single request
buffer.
The pass_through_to_tpm() wrapper around transmit() is no longer
needed. Remove the function and have all callers use transmit()
directly.
Now that tpm_extend() function calls transmit directly, it can use
TPM_DURATION_TYPE_SHORT duration.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
Setup the tpm hardware request in a linear area of memory.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
The event_length field is already in pcpes->eventdatasize.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
Instead of calculating the hash in hash_log_event(), create a new
function (tpm_fill_hash) that will create the hash, and update all
callers to use tpm_fill_hash() before calling hash_log_event(). This
reduce the number of parameters to hash_log_event().
Rename hash_log_event() and hash_log_extent_event() to tpm_log_event()
and tpm_log_extend_event() now that these functions no longer
implement the hashing.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
The pcrindex is already in pcpes->pcrindex, so no need to pass it as a
parameter.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
Now that entry_count is in a global variable there is no need to pass
it around as function parameters.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
The event field can be of an arbitrary length.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
The switch statement in tpm_add_bootdevice() corresponds with its call
sites - just perform the appropriate action in each caller.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
Make the only caller of tpm_add_measurement() with EV_SEPARATOR
directly call tpm_add_measurement_to_log(). Rename to
tpm_add_action() and change all callers with EV_ACTION to use this
function.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
The only three callers of tpm_ipl() exactly correlate with the three
switch branches in tpm_ipl(), so just move the appropriate code into
the callers.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
Move tpm state checking and error handling from tpm_extend_acpi_log()
to its only caller hash_log_event(). This makes tpm_extend_acpi_log()
specific to just ACPI table handling.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
Move like functions near each other. Reduce forward function
declarations. This is only code movement - no code changes.
This groups the code into six sections: TPM state tracking, TPM
hardware interface, ACPI TCPA table interface, Helper functions, Setup
and Measurements, BIOS interface.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
Rename all remaining functions called directly by the BIOS interrupt
by adding the suffix '_int' to them.
Add the check for whether the preboot interface is shut down
where missing.
Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
|
|
Refactor the signature of the pass_through_to_tpm function to take
individual pointers as parameters and introduce pass_through_to_tpm_int
as a function to be called with the parameters passed from the BIOS
interrupt.
Refactor existing callers that now do not have to build up the data
structure expected by the BIOS interface.
Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
|
|
Move the tpm_state to RAM area and add all log related pointers
to it so they can be cached. Remove functions that previously
determined these pointers by searching for the TCPA ACPI table
and walking the log.
Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
|
|
Fix the timeouts and durations -- they are provided in microseconds.
Adapt the TPM driver for it.
Get TPM specific timeout and duration values earlier from the device.
Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
|
|
Drop the code that is using the TPM for sha1 calculations.
Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
|
|
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
Tested-by: Stefan Berger <stefanb@us.ibm.com>
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
gcc v3.4 shows a warning due to "comparison is always false due to
limited range of data type". This patch fixes it.
Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
|
|
Refactor the signature of the hash_log_extend_event to take individual
pointers as parameters and introduce hash_log_extend_event_int as a
function to be called with the parameters passed from the BIOS interrupt.
Refactor existing callers to hash_log_extend_event that now do not
have to build up the data structure expected by the BIOS interface.
Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
|
|
Refactor the signature of hash_log_event to take individual pointers
as parameters and introduce hash_log_event_int as an function to
be called with the parameters passed from the BIOS interrupt.
Refactor existing callers to hash_log_event that now do not
have to build up the data structures expected by the BIOS interface.
Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
|
|
Refactor the parameters being passed to tpm_extend_acpi_log in such
a way that the header of the logged event is passed in separate
from the 'body'.
Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
|
|
Refactor the function building TPM commands to get rid of one of
the buffers it uses for building a command. To do that, have it use
the iovec also for the 'append' array that's being passed to the
function.
Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
|
|
Temporarily deactivate the TPM in case of failure of TPM commands
and failure to log measurements. Introduce the tpm_set_failure()
function replacing occurrences of 'tpm_state.tpm_working = 0' and
invoke it in error paths.
Temporarily deactivating the TPM means that it will be active again
upon reboot.
Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
|
|
The iasl program is no longer used on a default build. Do not require
it to be installed.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
The SSDT files are rarely modified - recent QEMU versions don't use
them at all and adding features to them in SeaBIOS has been
deprecated. It no longer makes sense to generate them on every build.
The content will remain (for use on old machine types in QEMU) in
static files committed to the SeaBIOS git repo. If the contents do
need to be generated a new build target (make iasl) is available.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
Add a comment to the top of the generated file indicating that is is
an automatically generated file. Compress output so that up to eight
hex values are placed on a single line.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
On a timeout, report what register failed to update.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
The block_size field is 16bits and only 16bit writes should be used
with it.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
The SDHCI v1 spec only defines the first 9 error_irq_enable bits and
reserves other bits in the field. Don't enable the 10th bit (which
was defined in the v2 spec) as it's not needed anyway.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
Some XHCI controllers register super-speed devices on high-speed ports
and then disconnect them when the super-speed detection completes.
Make sure to recognize these disconnect events during the reset
process.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
Several users have reported devices that take more than 100ms to
announce their presence on a USB port. Allow the sigatt timeout to be
specified at runtime as a way to extend the default timeout.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
Add ability to output debug messages from the buildversion.py build
script.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
Don't require python2.7 in buildversion.py. Also, ignore only those
exceptions that are known to be possible.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
MMIO register space was off by 4 bytes, bottom bits of
PCI BAR registers are not part of the address.
Test boot on real hardware:
PCI device 00:14.7 (vd=3D1022:7813 c=3D0805)
Searching bootorder for: /pci@i0cf8/*@14,7
sdhci@0xfeb25500 ver=3D1001 cap=3D31fe3fb2 2570
sdcard_set_frequency 63 400 8000
sdcard_pio command stop (code=3D1)
sdcard_set_frequency 63 25000 200
Found sdcard at 0xfeb25500: SD card SD01G 982MiB
Registering bootable: SD card SD01G 982MiB (type:2 prio:103 data:f46e0)
Signed-off-by: Kyösti Mälkki <kyosti.malkki@gmail.com>
|
|
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|