aboutsummaryrefslogtreecommitdiff
path: root/src
AgeCommit message (Collapse)AuthorFilesLines
2016-08-14ps2: Remove stale check for timeout warning on resetKevin O'Connor1-3/+1
Commit 4ce5d207 removed the code to wait for a possible second byte from a keyboard reset command, but it did not remove the extra check when warning in ps2_recvbyte(). Remove the now stale code in ps2_recvbyte(). Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2016-08-11tpm: Append to TPM2 log the hashes used for PCR extensionKevin O'Connor2-93/+103
Modify the function that writes the TPM logs to take the same digest passed to tpm_extend. Update the tpm2 acpi log header to describe the digest format. Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com> Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2016-08-10tpm: Extend tpm20_extend to support extending to multiple PCR banksStefan Berger2-23/+171
Extend the tpm20_extend function to support extending a hash to multiple PCR banks. The sha1 hash that's being extended into the sha256 bank for example, will be filled with zero-bytes to the size of a sha256 hash. Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com> Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2016-08-10tpm: Refactor tpml_digest_values_sha1 structureStefan Berger2-11/+15
Refactor the tpml_digest_values_sha1 structure so we can later cast it to the more general tpml_digest_values structure. Move the count member into this structure. Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
2016-08-10tpm: Restructure tpm20_extend to use buffer and take hash as parameterStefan Berger2-10/+13
Restructure the tpm20_extend function to use a buffer for the command to send to the TPM. The size of the buffer is calculated from the size of tpm2_req_extend structure and the appended SHA1 hash. Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
2016-08-10tpm: Retrieve the PCR Bank configurationStefan Berger2-0/+88
Implement tpm20_get_capability and retrieve the PCR Bank configuration from the TPM using this function. Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
2016-08-05pvscsi: Use high memory for ringsDana Rubin1-4/+4
Avoid using the scarce ZoneLow memory. This limits max number of pvscsi controllers. As driver runs in 32bit mode, use ZoneHigh allocation instead. Signed-off-by: Dana Rubin <dana.rubin@ravellosystems.com> Signed-off-by: Shmulik Ladkani <shmulik.ladkani@ravellosystems.com>
2016-08-05pvscsi: Fix incorrect arguments order in call to memalign_lowDana Rubin1-1/+1
First argument should be 'align' and second 'size'. Signed-off-by: <dana.rubin@ravellosystems.com> Signed-off-by: <shmulik.ladkani@ravellosystems.com>
2016-08-05version: Update header files now that version.c is not auto generatedKevin O'Connor1-4/+3
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2016-08-04blockcmd: CMD_SCSI op is only used in 32bit modeKevin O'Connor1-1/+6
Reduce the size of the 16bit code slightly by recognizing that CMD_SCSI is only used in 32bit mode. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2016-07-07smp: restore MSRs on S3 resumePaolo Bonzini3-14/+38
Currently the MTRRs and MSR_IA32_FEATURE_CONTROL are not restored on S3 resume. Because these have to be applied to all processors, SMP setup has to be added to S3 resume. There are two differences between the boot and resume paths. First, romfile_* is not usable in the resume paths so we separate out the remaining common code to a new smp_scan function. Second, smp_msr has to be walked on the BSP as well, so we extract that out of handle_smp and into a new function smp_write_msrs. Then, resume can call smp_write_msrs on the BSP followed by smp_scan to initialize the APs. Reported-by: Laszlo Ersek <lersek@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2016-07-01fw/msr_feature_control: add support to set MSR_IA32_FEATURE_CONTROLHaozhong Zhang2-11/+21
OS usually expects BIOS to set certain bits in MSR_IA32_FEATURE_CONTROL for some features (e.g. VMX and LMCE). QEMU provides a fw_cfg file "etc/msr_feature_control" to advise bits that should be set in MSR_IA32_FEATURE_CONTROL. If this file exists, SeaBIOS will set the advised bits in that MSR. Signed-off-by: Haozhong Zhang <haozhong.zhang@intel.com> Reviewed-by: Paolo Bonzini <pbonzini@redhat.com> Message-id: 20160622065324.23812-1-haozhong.zhang@intel.com Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2016-06-20virtio: pci cfg accessGerd Hoffmann2-25/+178
virtio regions can also be accessed using a window in pci cfg space. Add support for it. Enable it in case the virtio regions are mapped high (above 4g), so direct mmio access doesn't work for us even in 32bit mode. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2016-06-20virtio: uninline _vp_{read,write}Gerd Hoffmann2-78/+81
Next patch makes it larger, and I don't think it makes sense to continue inlining it. Uninline and move from header to c file. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2016-06-02splash: Skip the RGB555 modeZheng Bao1-1/+2
Current JPEG decoding uses the RGB888 or RGB565. So we need to skip RGB555 mode. Signed-off-by: Zheng Bao <fishbaozi@gmail.com> Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2016-06-01fw/pci: Add support for mapping Intel IGD via QEMUAlex Williamson1-0/+48
QEMU provides two fw_cfg files to support IGD. The first holds the OpRegion data which holds the Video BIOS Table (VBT). This needs to be copied into reserved memory and the address stored in the ASL Storage register of the device at 0xFC offset in PCI config space. The OpRegion is generally 8KB. This file is named "etc/igd-opregion". The second file tells us the required size of the stolen memory space for the device. This space requires 1MB alignment and is generally either 1MB to 8MB depending on hardware config, but may be hundreds of MB for user specified stolen memory. The base address of the reserved memory allocated for this is written back to the Base Data of Stolen Memory register (BDSM) at PCI config offset 0x5C on the device. This file is named "etc/igd-bdsm-size". QEMU documents these fw_cfg entries in docs/igd-assign.txt. Signed-off-by: Alex Williamson <alex.williamson@redhat.com> Message-id: 20160517203151.6996.95545.stgit@gimli.home Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2016-05-16tcgbios: Remove unused const variableKevin O'Connor1-1/+0
Remove the unused array `PhysicalPresence_CMD_DISABLE` to fix GCC 6 warnings. Signed-off-by: Paul Menzel <paulepanter@users.sourceforge.net> Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2016-05-16usb-xhci: Remove unused const variablesKevin O'Connor1-14/+0
Remove the unused arrays `eptype_to_xhci_in` and `eptype_to_xhci_out` to fix GCC 6 warnings. Signed-off-by: Paul Menzel <paulepanter@users.sourceforge.net> Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2016-04-06scsi: Launch a thread when scanning for drives in the scsi driversKevin O'Connor5-29/+25
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2016-04-06virtio: Use threads when scanning for virtio devicesKevin O'Connor2-4/+8
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2016-04-06shadow: Batch PCI config writesKevin O'Connor1-17/+38
Enabling and disabling shadow ram on QEMU is slow. Batch the PCI writes to reduce the number of memory changes QEMU must implement. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2016-04-06optionroms: Drop support for CONFIG_OPTIONROMS_DEPLOYEDKevin O'Connor4-63/+23
No modern software uses this option and it complicates the code. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2016-03-31disk: Avoid stack_hop() path if already on the extra stackKevin O'Connor2-11/+11
If CONFIG_ENTRY_EXTRASTACK is set (enabled by default) then the 16bit disk interface code is already running on the extra stack and it is not necessary to support stack switching on each disk request. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2016-03-31block: Move send_disk_op() from block.c to disk.cKevin O'Connor3-34/+33
The send_disk_op() function is only called from the 16bit handlers found in disk.c. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2016-03-30mpt-scsi: Declare 'int i' outside of for loop for older compilersKevin O'Connor1-1/+2
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2016-03-29Support for booting from LSI Logic LSI53C1030, SAS1068, SAS1068eDon Slutz5-0/+328
Also known as Fusion MPT disk; this controller model is supported by VirtualBox and VMware, and QEMU support patches have been posted. Signed-off-by: Don Slutz <Don.Slutz@Gmail.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2016-03-21sdcard: skip detection of PCI sdhci controllers if etc/sdcard usedMatt DeVillier1-0/+5
Some BayTrail ChromeOS devices have the eMMC controller hidden (thus requiring the use of etc/sdcard), while others do not, making it problematic to have a single payload which serves all devices properly. Therefore, if the CBFS contains etc/sdcard entries, skip detection of any visible PCI sdhci controllers in order to avoid duplicate entries in the boot menu. Signed-off-by: Matt DeVillier <matt.devillier@gmail.com> Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2016-03-07fw/pci: add Q35 S3 supportMarcel Apfelbaum1-17/+56
Following the i440fx example, save the LPC, SMBUS and PCIEXBAR bdfs between OS sleeps and use them to re-configure the corresponding registers. Tested-by: Gal Hammer <ghammer@redhat.com> Reviewed-by: Laszlo Ersek <lersek@redhat.com> Signed-off-by: Marcel Apfelbaum <marcel@redhat.com>
2016-02-29ahci: set transfer mode according to the capabilities of connected driveGerd Hoffmann2-0/+62
Use case: cf cards behind sata-ide bridge, which might not support the default transfer mode. Based on a patch by Werner Zeh <werner.zeh@siemens.com>, with some minor tweaks applied. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2016-02-29tpm: Write logs in TPM 2 formatKevin O'Connor2-13/+109
Add support for the TPM 2 format of log messages. Write the logs in the format that is appropriate for the version of the host's TPM. For TPM 1.2 write it in the 'pcpes' structure's format, for TPM 2 in the new TPM 2 format. By using this method we can keep the API interface on systems with a TPM 2 even though applications pass in the 'pcpes' structures directly. The log will still be written in the appropriate format. The TPM 2 log contains a TPM 1.2 type of entry of event type EV_NO_ACTION and entry of type TCG_EfiSpeIdEventStruct as the first entry. This is described in the EFI specification (section 5.3): Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com> Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2016-02-19tpm: Unify tpm_fill_hash()/tpm_log_extend_event() and use in BIOS interfaceKevin O'Connor1-41/+36
Don't call tpm_fill_hash() or tpm_log_extend_event() from any internal code (ie, tpm_add_measurement_to_log). The internal code does not require the additional checks that these functions provide. Unify the tpm_fill_hash() and tpm_log_extend_event() into a new function hash_log_extend(), and use this function only in the 16bit BIOS interface code. With the code now specific to the BIOS interface it can more easily return a BIOS specific error return code. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2016-02-05tpm: Filter TPM commands in passthrough APIStefan Berger2-1/+20
Filter TPM commands in the passthrough API call by matching the type of tag in the header with the version of the underlying TPM. Return an error code if the tag indicates that the command is for the wrong TPM version. Fix a size check on the way. Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
2016-02-05tpm: Implement TPM 2's tpm_set_failure partStefan Berger2-1/+46
Implement TPM 2's tpm_set_failure part. We follow this specification: TCG PC Client Specific Platform Firmware Profile for TPM 2.0 Systems Revision 1.0 Version 21 It can be found on this page: http://www.trustedcomputinggroup.org/resources/specifications_in_public_review Make the TPM unavailable for OS-present applications following 6.2 item 2.d.i . Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
2016-02-05tpm: Implement tpm20_menuStefan Berger2-1/+133
In the TPM 2 menu we currently only allow to run the TPM2_Clear operation. For this we follow the TCG Physical Presence Interface Specification to be found here: http://www.trustedcomputinggroup.org/resources/tcg_physical_presence_interface_specification Table 3 shows the 'Clear' operation and the sequence of commands to send. Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
2016-02-05tpm: Implement tpm20_extendStefan Berger2-2/+49
Implement the tpm20_extend function. We use it with only SHA1. Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
2016-02-05tpm: Implement tpm20_prepbootStefan Berger2-2/+153
Implement tpm20_preboot. Here we set the platform password to a random password that prevents higher layers (OS) to get this password. This avoids bad things like users clearing the TPM, erasing EK (primary key) certificates, changing the primary key etc. The clearing of the TPM will still be possible through the TPM 2 menu. Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
2016-02-05tpm: Implement tpm20_set_timeoutsStefan Berger2-0/+37
The TIS timeouts for TPM 2 are different than for TPM 1.2. Also the timeouts indicating a failed TPM 2 command are different. Further, the command durations and timeouts cannot be read from the device. We take the command timeout values for short, medium, and long running commands from table 15 of the following specification: TCG PC Client Platform TPM Profile (PTP) Specification http://www.trustedcomputinggroup.org/resources/pc_client_platform_tpm_profile_ptp_specification The values should work for all physical TPMs. The tricky thing with virtualized environments is that the values may need to be longer for a system where a vTPM cannot get sufficient cycles. So a future patch _may_ need to multiply those values here with some factor. Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
2016-02-05tpm: Implement tpm20_startup and tpm20_s3_resumeStefan Berger2-6/+105
Implement tpm20_startup and tpm20_s3_resume and their dependencies. We follow this specification: TCG PC Client Specific Platform Firmware Profile for TPM 2.0 Systems Revision 1.0 Version 21 It can be found on this page: http://www.trustedcomputinggroup.org/resources/specifications_in_public_review Power on: Figure 7 & 7.3.2 item 4. S3: Figure 9 & 7.3.2 item 4. Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
2016-02-05tpm: Prepare code for TPM 2 functionsStefan Berger1-112/+185
This patch prepares the tcgbios.c file for extension with TPM 2 specific code by: o prefixing all TPM 1.2 specific functions with tpm12_ o where necessary, introduce switch statements in tpm_ - prefixed functions; here we branch into TPM versions specific code o introduce tpm_ - prefixed functions where necessary; mostly in those cases where tpm12_ functions are too large and where the tpm_ function then only holds the switch statement o leave FIXMEs where we need to write TPM 2 specific code; subsequent patches will replace those FIXMEs Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
2016-02-05tpm: Factor out tpm_extendStefan Berger1-4/+14
In preparation for TPM 2 code support, factor out the TPM 1.2 specific code from tpm_log_extend_event and put it into tpm_extend(). Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
2016-02-05tpm: Extend TPM TIS with TPM 2 support.Stefan Berger3-8/+51
Extend the probing of the interface with TPM 2 specifics. Use the new interface ID register of the TIS to check whether a TPM 1.2 or a TPM 2 is underneath. We select the TIS if possible and lock it so we can issue commands during S3 for example and prevent the OS from changing to CRB type of interface. The register is described in table 13 here: http://www.trustedcomputinggroup.org/resources/pc_client_platform_tpm_profile_ptp_specification Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
2016-02-04block: Move drive setup to new function block_setup()Kevin O'Connor3-21/+19
Move the list of drive setup calls from post.c to a new function in block.c. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2016-02-03scsi: Always use MAXDESCSIZE when building drive descriptionKevin O'Connor4-4/+5
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2016-02-03pci: Split low-level pci code from higher-level 'struct pci_device' codeKevin O'Connor31-313/+341
Split pci.c into pci.c and pcidevice.c. The low-level code that interacts directly with the PCI devices remains in pci.c, while functions dealing with the higher level pci_device cache move to pcidevice.c. Only pci.c is needed in 16bit mode. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2016-02-03pci: Move code in pci.c that is specific to pciinit.c to pciinit.cKevin O'Connor5-42/+39
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2016-02-03pci: Implement '%pP' printf handler for 'struct pci_device' pointersKevin O'Connor16-113/+74
Handle '%pP' format descriptions as a pointer to a 'struct pci_device' and display it in bus:device.function (%02x:%02x.%x) format. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2016-02-02pci: Consistently set pci->have_drivers for devices with internal driversKevin O'Connor2-1/+3
Set the pci->have_drivers flag for any device that calls pci_enable_x() to ensure that the flag is consistently set on any device with an internal driver. Setting this flag prevents an option rom on the device from being executed. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2016-02-02virtio: Convert to new PCI BAR helper functionsKevin O'Connor2-30/+38
Use the pci_enable_x() functions. This patch also converts cap->addr from a 'u32' to a union storing a 'u32' or a 'void*'. This makes it more clear when the address is a virtual memory address. The virtio controller code will now explicitly set PCI_COMMAND_MEMORY and/or PCI_COMMAND_IO instead of assuming it has already been enabled. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2016-02-02xhci: Convert to new PCI BAR helper functionsKevin O'Connor1-13/+14
Use the pci_enable_x() functions. The xhci 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-02uhci: Convert to new PCI BAR helper functionsKevin O'Connor1-7/+9
Use the pci_enable_x() functions. The uhci 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>