aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2017-02-21romfile-loader: Switch to using named structsBen Warren2-37/+37
This is a little cleaner and matches how the command structures are defined in QEMU. Signed-off-by: Ben Warren <ben@skyportsystems.com> Reviewed-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Igor Mammedov <imammedo@redhat.com>
2017-02-21QEMU DMA: Add DMA write capabilityBen Warren2-0/+52
This allows BIOS to write data back to QEMU using the DMA interface and provides a higher-level abstraction to write to a fw_cfg file Signed-off-by: Ben Warren <ben@skyportsystems.com> Reviewed-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Igor Mammedov <imammedo@redhat.com>
2017-02-20block: add NVMe boot supportJulian Stecklina8-1/+884
This patch enables SeaBIOS to boot from NVMe. Finding namespaces and basic I/O works. Testing has been done in qemu and so far it works with Grub, syslinux, and the FreeBSD loader. You need a recent Qemu (>= 2.7.0), because older versions have buggy NVMe support. The NVMe code is currently only enabled on Qemu due to lack of testing on real hardware. Signed-off-by: Julian Stecklina <jsteckli@amazon.de>
2017-02-11ps2port: Disable keyboard/mouse prior to resetting ps2 controllerKevin O'Connor1-1/+12
If one of the ps2 ports is enabled prior to the ps2 controller reset then it is possible a device event (eg, key press or mouse move) could be mistaken for the controller reset response code. This would result in a failure and the keyboard would be disabled during the boot. Always disabling the keyboard and mouse prior to reset ensures that the controller reset return code can be read properly. Tested-by: Paul Menzel <paulepanter@users.sourceforge.net> Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2017-01-29vgasrc: Increase debug levelPaul Menzel1-1/+1
You only want this information for debugging. As it also slows down the boot considerably, as, for example, for every character of the GRUB menu, something is sent over the serial console. Therefore, increase the debugging level to 9. Signed-off-by: Paul Menzel <pmenzel@molgen.mpg.de>
2017-01-17ahci: Set upper 32-bit registers to zeroLadi Prosek1-0/+5
If the HBA supports 64-bit addressing, the registers may contain non-zero values, for example after reboot as a leftover from the OS driving the adapter. Reviewed-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Ladi Prosek <lprosek@redhat.com>
2016-12-30serialio: Support for mmap serial portsRicardo Ribalda Delgado2-10/+47
Some chipsets have memory mapped serial ports. The protocol is the same as an standard uart, but with memory read/write instead of inb/outb. Tested-by: Ricardo Ribalda Delgado <ricardo.ribalda@gmail.com> Signed-off-by: Ricardo Ribalda Delgado <ricardo.ribalda@gmail.com> Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2016-11-27tpm: Log TPM 2 digest structure in little endian formatStefan Berger1-7/+18
The parameters for extending the PCRs of a TPM 2 are written in big endian format when sent to the TPM. However, the log needs to be written in little endian format, so we cannot just copy the structure into the log as-is. To support the little endian format in the log, we extend the function writing the TPM 2 digest structure with a parameter that allows us to choose the endianess of a few parameters. We then rewrite the digest structure in little endian format for the log. Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
2016-11-27tpm: Rework tpm_build_and_send_cmd() into tpm_simple_cmd()Kevin O'Connor2-109/+53
Instead of passing an arbitrary buffer as a parameter to tpm_build_and_send_cmd(), just support the simpler case of a parameter that is only 0, 1, or 2 bytes in length. This allows the callers to pass the parameter directly and not worry about the big-endian encoding. Rename the function to tpm_simple_cmd(). Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2016-11-27tpm: Don't call tpm_build_and_send_cmd() from tpm20_stirrandom()Kevin O'Connor2-5/+12
Instead call tpmhw_transmit() directly. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2016-11-27acpi: Generalize find_fadt() and find_tcpa_by_rsdp() into find_acpi_table()Kevin O'Connor4-49/+11
The find_fadt() and find_tcpa_by_rsdp() functions are very similar. Create a new find_acpi_table() function and replace the two functions with this new function. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2016-11-27tpm: Move code around in tcgbios.c to keep like code togetherKevin O'Connor1-207/+210
No code changes; just code movement. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2016-11-27tpm: Don't call tpm_set_failure() from tpm12_get_capability()Kevin O'Connor1-5/+1
In the event of a failure in the low-level tpm12_get_capability() code, just return an error code. The caller can shutdown the TPM if needed - the only place where that is needed is during a failure in tpm12_determine_timeouts(). Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2016-11-27tpm: Add comment banners to tcg.c separating major parts of specKevin O'Connor1-101/+91
No code changes; just code movement. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2016-11-21drop "etc/boot-cpus" fw_cfg file and reuse legacy QEMU_CFG_NB_CPUSIgor Mammedov3-33/+7
since QEMU_CFG_NB_CPUS not going away anytime soon and serves the same purpose as just added "etc/boot-cpus" fw_cfg drop support for "etc/boot-cpus" while this code is not in use yet (i.e. QEMU with "etc/boot-cpus" hasn't been released) and reuse QEMU_CFG_NB_CPUS instead of it. Signed-off-by: Igor Mammedov <imammedo@redhat.com>
2016-10-26usb: Make usb_time_sigatt variable staticKevin O'Connor1-1/+1
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2016-10-26docs: Note v1.10.0 releaserel-1.10.0Kevin O'Connor1-0/+11
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2016-10-26build: Add -fno-pie to the gcc flags when availableKevin O'Connor1-0/+1
Reported-by: Paul Menzel <paulepanter@users.sourceforge.net> Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2016-10-25support booting with more than 255 CPUsIgor Mammedov2-4/+21
SDM[*1] says that if there are CPUs with APIC ID greater than 254, BIOS is to pass control to OS in x2APIC mode. Use the fact that QEMU passes in "etc/max-cpus" max possible "APIC ID + 1" to detect need for x2APIC mode. Also instead of CMOS_BIOS_SMP_COUNT which is limited to 256 CPUs use a new rom file "etc/boot-cpus" that QEMU supporting more than 256 CPUs will provide. *1) SDM: Volume 3: EXTENDED XAPIC (X2APIC): Initialization by System Software Signed-off-by: Igor Mammedov <imammedo@redhat.com>
2016-10-25add helpers to read etc/boot-cpus at resume timeIgor Mammedov3-5/+47
Signed-off-by: Igor Mammedov <imammedo@redhat.com>
2016-10-25smp: consolidate CPU APIC ID detection and accountingKevin O'Connor1-10/+15
Signed-off-by: "Kevin O'Connor" <kevin@koconnor.net> Signed-off-by: Igor Mammedov <imammedo@redhat.com>
2016-10-25paravirt: disable legacy bios tables in case of more than 255 CPUsIgor Mammedov1-2/+4
MPTable doesn't support more than 255 CPUs and QEMU supplies an alternative MADT table which guest will use instead of it. So do not install legacy tables if more than 254 CPUs are provided Signed-off-by: Igor Mammedov <imammedo@redhat.com> Acked-by: Michael S. Tsirkin <mst@redhat.com>
2016-10-21build: Be sure to also include out/*.d in MakefileKevin O'Connor1-1/+1
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2016-10-18docs: fix various typos and inconsistencyPiotr Król2-7/+7
Signed-off-by: Piotr Król <piotr.krol@3mdeb.com>
2016-09-16virtio: fix virtio-pciGerd Hoffmann1-2/+2
virtio-pci calls pci_enable_{io,mem}bar with the bar number, but the functions expect the bar base register offset. Reported-by: Igor Mammedov <imammedo@redhat.com> Tested-by: Igor Mammedov <imammedo@redhat.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2016-09-15kbd: Move extended and release events out of special key detection switchKevin O'Connor1-40/+25
Move checking for extended scancodes and key release to the top of __process_key(). Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2016-09-12post: Map int 0x05 to entry pointKevin O'Connor1-0/+1
int 0x05 was not assigned in the interrupt table - fix that. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2016-09-12kbd: Generate interrupt events for SysReq, PrtScr, and BreakKevin O'Connor2-5/+52
Generate the appropriate interrupt events for the given keys. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2016-09-12usb-hid: Generate Ctrl+Break and Alt+SysReq keysKevin O'Connor1-20/+30
Detect the sequences for generating Ctrl+Break and Alt+SysReq on USB keyboards and produce the appropriate legacy scancodes. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2016-09-12kbd: Ignore fake shift keysKevin O'Connor1-0/+6
AT keyboards can produce "fake" shift keys on some extended events. It's not necessary to process these artificial events as the actual extended keys are detected directly. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2016-09-12kbd: Move checking for special keys in __process_keys() into switchKevin O'Connor1-65/+71
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2016-09-12kbd: Extract out shift flag setting into new functionKevin O'Connor1-62/+43
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2016-09-12kbd: Merge bda->kbd_flag0 and bda->kbd_flag1Kevin O'Connor2-59/+54
Merge the two consecutive u8 fields into a single u16 field. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2016-09-12kbd: Suppress keys without mappingsKevin O'Connor1-3/+2
Don't warn if a key without a mapping is pressed - it's known that some keys aren't mapped to keycodes. Suppress these keys instead of sending 0x0000 to the keyboard buffer - as 0x0000 can confuse some programs. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2016-09-12kbd: Implement extended keycode mappings for keypad-enter and keypad-/Kevin O'Connor1-0/+15
On a 101-key keyboard the keypad enter and keypad '/' keys have unique BIOS keycodes that are distinct from the main keyboard enter and '/' keys. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2016-09-12kbd: Implement 101-key keyboard keycode mappingKevin O'Connor1-28/+40
The current keyboard code only supports the keycode mappings for 83-key keyboards (plus handling for alt-esc and f11/f12). Add a more complete mapping of keycodes for 101-key keyboards. This adds more alt key and ctrl key mappings. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2016-08-26pic: The default hardware interrupt handlers should not take a parameterKevin O'Connor1-2/+2
Hardware interrupt handlers don't take a parameter. Remove the incorrect (and unused) parameter from handle_hwpic1/2(). Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
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-10checkstack: Handle conditional checks at start of functionsKevin O'Connor1-0/+5
Recent versions of gcc will sometimes place conditional checks in the code prior to setting up the function's stack frame. Handle this case correctly. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
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'Connor3-5/+6
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2016-08-05vgautil: Move definitions from cbvga.h and clext.h to vgautil.hKevin O'Connor7-46/+30
These files only need to export simple function definitions - move them to vgautil.h. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2016-08-05vgautil: Move generic definitions from stdvga.h to vgautil.hKevin O'Connor6-33/+37
Don't use stdvga.h for function definitions of code in stdvgamodes.c and stdvgaio.c. Move them to vgautil.h. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2016-08-05vgautil: Add new header file with misc function and variable definitionsKevin O'Connor13-37/+57
Move the generic function and variable definitions from vgabios.h to a new file vgautil.h. This reduces the size and complexity of vgabios.h. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>