aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2016-02-02pvscsi: Convert to new PCI BAR helper functionsKevin O'Connor1-9/+8
Use the pci_enable_x() functions. The pvscsi controller code will now explicitly set PCI_COMMAND_MEMORY instead of assuming it has already been enabled. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2016-02-02megasas: Convert to new PCI BAR helper functionsKevin O'Connor1-10/+8
Use the pci_enable_x() functions. After this change, the megasas driver will no longer enable PCI_COMMAND_MEMORY accesses, as the megasas driver doesn't actually map any BARs as memory. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2016-02-02lsi-scsi: Convert to new PCI BAR helper functionsKevin O'Connor1-7/+6
Use the pci_enable_x() functions. The lsi-scsi controller code will now explicitly set PCI_COMMAND_IO instead of assuming it has already been enabled. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2016-02-02esp-scsi: Convert to new PCI BAR helper functionsKevin O'Connor1-7/+6
Use the pci_enable_x() functions. The esp-scsi controller code will now explicitly set PCI_COMMAND_IO instead of assuming it has already been enabled. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2016-02-02ata: Convert to new PCI BAR helper functionsKevin O'Connor1-13/+12
Use the pci_enable_x() functions. The ATA controller code will now explicitly set PCI_COMMAND_IO instead of assuming it has already been enabled. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2016-02-02ahci: Convert to new PCI BAR helper functionsKevin O'Connor2-21/+17
Use the pci_enable_x() functions. This patch also converts cntl->iobase from a 'u32' to a 'void*' so that it is clear that the address is a virtual memory address. After this change, the AHCI driver will no longer enable PCI_COMMAND_IO io accesses, as the AHCI driver doesn't actually attempt IO accesses to the device. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2016-02-02pci: Add helper functions for internal driver BAR handlingKevin O'Connor2-0/+61
Add functions to verify and obtain PCI BARs (Base Address Registers). These new functions check that the requested BAR is of the right type and appears valid. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2016-02-02usb: Eliminate USB controller setup threadKevin O'Connor5-15/+5
There are no longer any sleep or yield calls during the usb controller device scans, so there is no need to run these device scans in a separate thread. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2016-02-02ehci: Only delay UHCI/OHCI port scan until after EHCI setup completesKevin O'Connor4-3/+15
EHCI controller setup needs to occur prior to checking any UHCI or OHCI ports to ensure a high speed device is not mistakenly configured on a full speed "companion" controller. However, only the UHCI/OHCI port scan needs to be delayed, not the full UHCI/OHCI controller init. This change moves back the ehci controller setup check until port scan in UHCI/OHCI. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2016-02-01Fix comment typoCao jin2-3/+3
Signed-off-by: Cao jin <caoj.fnst@cn.fujitsu.com>
2016-01-15biostables: Support SMBIOS 2.6+ UUID formatCole Robinson1-11/+36
SMBIOS 2.6+ stores the UUID in a different format, with the first 3 fields in little endian format. This is what modern qemu delivers and what dmidecode also handles, so let's follow suit too. Signed-off-by: Cole Robinson <crobinso@redhat.com>
2016-01-14kbd: Refactor capslock and numlock handlingKevin O'Connor1-101/+96
Simplify the scan_to_keycode[] table by implementing numlock and capslock checking in the code. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2016-01-14kbd: Don't treat scancode and asciicode as separate valuesKevin O'Connor1-38/+26
The scancode/asciicode pair can be more easily handled as a single 16bit value. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2016-01-12post: Always set HaveRunPost prior to setting any other global variableKevin O'Connor5-4/+21
The HaveRunPost flag controls whether post or reboot handling is entered on a reset signal. The flag needs to be set before any other global variable because an external reboot signal could occur at any time. (If any global variable is modified prior to setting HaveRunPost then the code might enter post with global variables in a dirty state.) Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2016-01-12resume: Make KVM soft reboot loop detection more flexibleKevin O'Connor2-11/+13
Move the check for soft reboot loops from resume.c to shadow.c and directly check for the case where the copy of the BIOS in flash appears to be a memory alias instead. This prevents a hang if an external reboot request occurs during the BIOS memcpy. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2016-01-12coreboot: Check for unaligned cbfs headerKevin O'Connor1-0/+4
If the CBFS header is invalid and points to 0xffffffff it could cause SeaBIOS to read past the 4GB boundary and cause an exception. Check the alignment of the header pointer before attempting to access fields within the header. Reported-by: "Alex G." <mr.nuke.me@gmail.com> Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2016-01-07tpm: Do not set TPM in failure mode if menu command failsStefan Berger1-34/+9
Since we may detect that HW physical presence is enabled but we do not detect whether it is actually asserted, we may fail on the TPM menu commands that require the assertion of physical presence. We therefore cannot set the TPM into failure mode if we hit this case. Failure should never occur in these cases if SW physical presence has been asserted. Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
2016-01-07tpm: Remove usage of PP_CMD_ENABLE from all but one placeStefan Berger1-31/+10
Remove the usage of PhysicalPresence_CMD_ENABLE from all but the assert_physical_presence function. Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
2016-01-07tpm: Rework the assertion of physical presenceStefan Berger3-20/+17
Rework the assertion of physical presence by calling assert_physical_presence in tpm_setup. This call will assert physical presence if SW assertion is possible or by checking whether HW physical presence is enabled. The TPM menu will only be shown if physical presence is asserted or HW physical presence is enabled after this call. Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
2016-01-07tpm: Add support for harware physical presenceStefan Berger2-51/+29
Extend assert_physical_presence with checks for hardware physical presence support. If hardware physical presence is enabled, we return 0. Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
2016-01-07tpm: Move assert_physical_presence and dependenciesStefan Berger1-75/+75
Move assert_physical_presence and dependencies in front of tpm_startup so that the next patches can assert physical presence after TPM_ORD_Startup ran. Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
2016-01-07tpm: Copy digest into HashLogExentEvent responseStefan Berger1-0/+1
Copy the digest into the response of a HashLogExtendEvent API call. Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
2016-01-07usb: Remove usbdev->slotid fieldKevin O'Connor2-3/+4
The usbdev->slotid field is xhci specific and on xhci it is always reachable from usbdev->defpipe->slotid. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2016-01-05tpm: Don't use 16bit BIOS return codes in TPM menu functionsKevin O'Connor1-132/+99
Don't use the return codes from the 16bit BIOS spec in the internal menu functions. Only the 16bit BIOS interface code should need to handle the details of that spec. For functions that need to return the TIS command status, return those codes directly instead of via a pointer parameter. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2016-01-05tpm: Don't use 16bit BIOS return codes in tpmhw_* functionsKevin O'Connor3-22/+24
Don't use the return codes from the 16bit BIOS spec in the internal tpmhw functions. Only the 16bit BIOS interface code should need to handle the details of that spec. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2016-01-05tpm: Don't use 16bit BIOS return codes in tpm_log_event()Kevin O'Connor1-17/+21
Don't use the return codes from the 16bit BIOS spec in the internal tpm_log_event() and tpm_log_extend_event() functions. Only the 16bit BIOS interface code should need to handle the details of that spec. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2016-01-05tpm: Don't use 16bit BIOS return codes in build_and_send_cmd()Kevin O'Connor1-143/+73
Don't use the return codes from the 16bit BIOS spec in the internal function build_and_send_cmd(). Instead, return the TIS command status code of the command or -1 if there was a command transmission failure. This eliminates the need for a returnCode pointer parameter. Also, implement debugging dprintf() in build_and_send_cmd() instead of in every caller. This replaces the command name with the integer command id, but it does make the debugging more consistent. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2016-01-05tpm: Don't call tpm_set_failure() from tpm_log_extend_event()Kevin O'Connor1-12/+9
The 16bit BIOS interface shouldn't be able to shutdown the TPM. Move the check for tpm_is_working() and tpm_set_failure() to the only caller of tpm_log_extend_event() that may shutdown the TPM. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2016-01-05tpm: No need to check the return status of measurementsKevin O'Connor1-81/+40
The low-level measurement functions already handle error conditions, there is no need to check for the errors in the high level measurement functions. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2016-01-05tpm: Don't return a status from external bios measurement functionsKevin O'Connor2-34/+32
The callers of the measurements don't care what happens, so no need to return a status. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2016-01-05tpm: Eliminate response buffer parameter from build_and_send_cmd()Kevin O'Connor1-28/+17
There are no longer any callers that use the response buffer. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2016-01-05tpm: Introduce tpm_get_capability() helper functionKevin O'Connor2-140/+61
Introduce helper function to call the TPM_ORD_GetCapability command. Update all get capability callers to use this helper. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2016-01-05tpm: Simplify tcpa probeKevin O'Connor1-96/+45
The TPM ACPI tables are only scanned once at startup and the code can rely on that. Merge find_tcpa_table() into find_tcpa_by_rsdp(), merge get_lasa_base_ptr() into reset_acpi_log(), and merge tpm_acpi_init() into tpm_setup(). The tpm_state structure is now only used for TCPA tracking. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2016-01-05tpm: Rework TPM interface shutdown supportKevin O'Connor1-52/+11
The 16bit BIOS interface should only shutdown on request from that interface - errors from the tcp or acpi log setup should not shutdown the interface. (Errors from those functions will cause the TPM to be in a "not working" state which will cause all the 16bit interface functions to fail.) Centralize the checking for the interface shutdown condition in tpm_interrupt_handler32(). Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2016-01-05tpm: Move TPM hardware functions from tcgbios.c to hw/tpm_drivers.cKevin O'Connor3-98/+102
Move the hardware interface functions (tpmhw_probe, tpmhw_is_present, tpmhw_transmit, and tpmhw_set_timeouts) to tpm_drivers.c code, and only export those functions. This simplifies the hardware interface. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2016-01-05tpm: Add wrapper function tpmhw_set_timeouts()Kevin O'Connor1-3/+8
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2016-01-05tpm: Simplify hardware probe and detection checksKevin O'Connor1-84/+36
Perform the hardware probe once during setup instead of checking if the probe has been completed on each measurement event. Don't probe for hardware during BIOS interface detection. Just check if the previous probe found the hardware. Unify has_working_tpm() with similar tpm_is_working(). Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2015-12-29tpm: Avoid macro expansion of tpm request / response structsKevin O'Connor2-29/+22
Avoid macros and use regular struct definitions for the request and response headers. This simplifies the header and reduces the need for casts in the code. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2015-12-29tpm: Add banner separating the TCG bios interface code from TCG menu codeKevin O'Connor1-0/+5
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2015-12-28build: fix typo in buildversion.pyRoger Pau Monne1-1/+1
Fixes the following build error: Building ld scripts Traceback (most recent call last): File "./scripts/buildversion.py", line 134, in <module> main() File "./scripts/buildversion.py", line 114, in main cleanbuild, toolstr = tool_versions(options.tools) File "./scripts/buildversion.py", line 90, in tool_versions vers[isbinutils] = "mixed" NameError: global name 'vers' is not defined Makefile:160: recipe for target 'out/romlayout16.lds' failed Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
2015-12-28block: Report drive->sectors using "%u" instead of "%d"Kevin O'Connor2-2/+2
The sector count is a 64bit number that is often reported as a 32bit number (due to limitations in dprintf). Consistently use "%u" reporting to avoid confusing negative numbers. Reported-by: Tobias Diedrich <tobiasdiedrich@gmail.com> Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2015-12-28scsi: Do not call printf() from scsi_is_ready()Kevin O'Connor1-1/+1
The scsi_is_ready() function may be called from a thread, and it is not valid to call printf() from a thread. Convert printf() to dprintf() to avoid this possibility. This does mean that cdrom detection (from cdrom_boot() ) may not give notification of slow cdrom drives to a user. However, the extra medium detection time is unlikely to be large anyway. Reported-by: Tobias Diedrich <tobiasdiedrich@gmail.com> Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2015-12-28nmi: Don't try to switch onto extra stack in NMI handlerKevin O'Connor1-1/+4
The NMI could occur when already on the extra stack, which would corrupt it. Always use the current stack on an NMI to avoid this. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2015-12-20xhci: Disable slot on failed set_address commandKevin O'Connor1-3/+8
If the set_address command fails, attempt to free up the slot resource associated with the attempt. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2015-12-20xhci: Improve port status change debuggingKevin O'Connor1-3/+9
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>
2015-12-20xhci: Wait for port enable even for USB3 devicesKevin O'Connor1-22/+21
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>
2015-12-20fw/pci: do not automatically allocate IO region for PCIe bridgesMarcel Apfelbaum1-4/+5
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>
2015-12-20tpm: Add a menu for TPM configurationStefan Berger5-1/+698
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>
2015-12-20tpm: Check length parameter of the arrayStefan Berger1-0/+3
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>
2015-12-20tpm: Remove check for working TPM from TPM interrupt handlerStefan Berger1-5/+0
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>