]> xenbits.xensource.com Git - seabios.git/log
seabios.git
8 years agosrc: Minor - remove tab characters that slipped into SeaBIOS C code
Kevin O'Connor [Wed, 3 May 2017 00:02:01 +0000 (20:02 -0400)]
src: Minor - remove tab characters that slipped into SeaBIOS C code

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
8 years agolsi-scsi: try to enumerate luns with REPORT LUNS
Roman Kagan [Wed, 26 Apr 2017 14:18:09 +0000 (17:18 +0300)]
lsi-scsi: try to enumerate luns with REPORT LUNS

Enumerate active luns with REPORT LUNS and, if that fails[*], fall back
to sequentially enumerating them up to (arbitrarily chosen) #8 [**].

[*] in current QEMU, REPORT LUNS does fail in lsi53c895a because the
returned data is smaller than the allocation length which is (wrongly)
considered an underflow

[**] in current QEMU, luns above 0 are not supported in lsi53c895a, so
this patch is here only for completeness.

Signed-off-by: Roman Kagan <rkagan@virtuozzo.com>
8 years agolsi-scsi: reset in case of a serious problem
Roman Kagan [Wed, 26 Apr 2017 14:18:08 +0000 (17:18 +0300)]
lsi-scsi: reset in case of a serious problem

When the device reports a serious problem via SIST[01] registers, it
needs to be reset, otherwise the following requests will most likely
fail, too.

In particular, REPORT LUNS which fails (wrongly) with underflow in QEMU
makes all the following requests fail, too, rendering the device
unusable.

Signed-off-by: Roman Kagan <rkagan@virtuozzo.com>
8 years agompt-scsi: try to enumerate luns with REPORT LUNS
Roman Kagan [Wed, 26 Apr 2017 14:18:07 +0000 (17:18 +0300)]
mpt-scsi: try to enumerate luns with REPORT LUNS

Enumerate active luns with REPORT LUNS and, if that fails[*], fall back
to sequentially enumerating them up to (arbitrarily chosen) #8.

Note that this patch also makes mpt_scsi_cmd accept luns other than 0;
I've no idea what was the original motivation not to, and what can break
due to this change (nothing broke in my basic tests with QEMU).

[*] in current QEMU, REPORT LUNS does fail in mptsas1068 because the
returned data is smaller than the allocation length which is (wrongly)
considered an underflow.

Signed-off-by: Roman Kagan <rkagan@virtuozzo.com>
8 years agopvscsi: fix the comment about lun enumeration
Roman Kagan [Wed, 26 Apr 2017 14:18:06 +0000 (17:18 +0300)]
pvscsi: fix the comment about lun enumeration

The comment in pvscsi_scan_target (presumably c&p-ed from another
driver) reads that REPORTS LUNS should better be used to enumerate the
luns on the target.

However, according to the Linux driver, the device supports no more than
a single lun per target.

So adjust the comment to tell exactly that.

Signed-off-by: Roman Kagan <rkagan@virtuozzo.com>
8 years agousb-uas: enumerate luns with REPORT LUNS
Roman Kagan [Wed, 26 Apr 2017 14:18:05 +0000 (17:18 +0300)]
usb-uas: enumerate luns with REPORT LUNS

Signed-off-by: Roman Kagan <rkagan@virtuozzo.com>
8 years agoesp-scsi: enumerate luns with REPORT LUNS
Roman Kagan [Wed, 26 Apr 2017 14:18:04 +0000 (17:18 +0300)]
esp-scsi: enumerate luns with REPORT LUNS

Signed-off-by: Roman Kagan <rkagan@virtuozzo.com>
8 years agovirtio-scsi: enumerate luns with REPORT LUNS
Roman Kagan [Wed, 26 Apr 2017 14:18:03 +0000 (17:18 +0300)]
virtio-scsi: enumerate luns with REPORT LUNS

Signed-off-by: Roman Kagan <rkagan@virtuozzo.com>
8 years agoblockcmd: generic SCSI luns enumeration
Roman Kagan [Wed, 26 Apr 2017 14:18:02 +0000 (17:18 +0300)]
blockcmd: generic SCSI luns enumeration

Add two generic functions to discover active LUNs on a SCSI target.

The functions take a temporary drive descriptor on the target, and a
callback to create a new drive descriptor with a new LUN using the
temporary one as a template.

One of the functions performs REPORT LUNS on the temporary drive to
obtain the list of candidate luns; the other sequentially iterates the
lun numbers up to the given maximum, and is meant as a fallback.  Both
functions return the number of successfully created drive descriptors,
or a negative number if an error occured.

This will allow to lift the limitation of most of the SCSI drivers that
support booting off the LUN #0 only.

Signed-off-by: Roman Kagan <rkagan@virtuozzo.com>
8 years agoblockcmd: accept only disks and CD-ROMs
Roman Kagan [Wed, 26 Apr 2017 14:18:01 +0000 (17:18 +0300)]
blockcmd: accept only disks and CD-ROMs

Luns that report to INQUIRY with a type other than CD-ROM are considered
disks.  This isn't necessarily the case; working with such luns as disks
may lead to unpredictable results.

So bail out if the lun is neither CD-ROM nor disk.

Signed-off-by: Roman Kagan <rkagan@virtuozzo.com>
8 years agoboot: Increase description size in boot menu
Kevin O'Connor [Tue, 25 Apr 2017 17:04:41 +0000 (13:04 -0400)]
boot: Increase description size in boot menu

Increase the boot menu description size so that menu items up to 80
characters display without truncation.

Reported-by: Rene Shuster <rene.shuster@bcsemail.org>
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
8 years agocoreboot: Adapt to upstream CBMEM console changes
Julius Werner [Wed, 19 Apr 2017 22:36:09 +0000 (15:36 -0700)]
coreboot: Adapt to upstream CBMEM console changes

coreboot's CBMEM console format changed with
https://review.coreboot.org/#/c/18301. This patch adapts the SeaBIOS
implementation to support the new format. (SeaBIOS versions with this
patch will continue to work fine with older version of coreboot. SeaBIOS
versions without this patch may fail to log messages to the CBMEM
console if run with newer versions of coreboot, but should not
experience any more serious issues than that.)

Signed-off-by: Julius Werner <jwerner@chromium.org>
8 years agoconfig: Add function to check if fw_cfg exists
Petr Berky [Tue, 28 Mar 2017 21:03:53 +0000 (23:03 +0200)]
config: Add function to check if fw_cfg exists

It was found qemu_get_present_cpus_count may return impossible
number of cpus because of not checking if fw_cfg exists before
using it. That may lead to undefined behavior of emulator,
in particular Bochs that freezes.

Signed-off-by: Petr Berky <petr.berky@email.cz>
8 years agoresume: Don't attempt to use generic reboot mechanisms on QEMU
Kevin O'Connor [Fri, 3 Mar 2017 15:48:45 +0000 (10:48 -0500)]
resume: Don't attempt to use generic reboot mechanisms on QEMU

On QEMU it's necessary to manually reset the BIOS memory region
between 0xc0000-0x100000 on a reboot.  After this manual memory reset
is completed, it's not valid to use the generic reset mechanisms.
Rename qemu_prep_reset() to qemu_reboot() and change the function to
immediately reboot after the code memcpy.

This fixes a bug that could cause code corruption on reboots - calling
the udelay() function (as invoked by i8042_reboot and/or pci_reboot)
was not valid after the BIOS was memcpy'd.

Reported-by: "Dr. David Alan Gilbert" <dgilbert@redhat.com>
Tested-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
8 years agonvme: fix copy-paste mistake in comment
Daniel Verkamp [Fri, 24 Feb 2017 06:27:57 +0000 (23:27 -0700)]
nvme: fix copy-paste mistake in comment

Signed-off-by: Daniel Verkamp <daniel@drv.nu>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
8 years agonvme: fix extraction of status code bits
Daniel Verkamp [Fri, 24 Feb 2017 06:27:56 +0000 (23:27 -0700)]
nvme: fix extraction of status code bits

The status code field is 8 bits wide starting at bit 1; the previous
code would truncate the top bit.

Signed-off-by: Daniel Verkamp <daniel@drv.nu>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
8 years agonvme: fix reversed loop condition in cmd_readwrite
Daniel Verkamp [Fri, 24 Feb 2017 06:27:55 +0000 (23:27 -0700)]
nvme: fix reversed loop condition in cmd_readwrite

It looks like the intent was to exit the loop if a command failed, but
the current code would actually continue looping in that case.

Signed-off-by: Daniel Verkamp <daniel@drv.nu>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
8 years agonvme: extend command timeout to 5 seconds
Daniel Verkamp [Fri, 24 Feb 2017 06:27:54 +0000 (23:27 -0700)]
nvme: extend command timeout to 5 seconds

500 ms is not sufficient for the admin commands used during
initialization on some real hardware.

Signed-off-by: Daniel Verkamp <daniel@drv.nu>
8 years agonvme: support NVMe 1.0 controllers
Daniel Verkamp [Fri, 24 Feb 2017 06:27:53 +0000 (23:27 -0700)]
nvme: support NVMe 1.0 controllers

Rather than using the Identify command with CNS 01b (GET_NS_LIST), which
was added in NVMe 1.1, we can just enumerate all of the possible
namespace IDs.

The relevant part of the NVMe spec reads:

  Namespaces shall be allocated in order (starting with 1) and packed
  sequentially.

Since the previously-used GET_NS_LIST only returns active namespaces, we
also need a check in nvme_probe_ns() to ensure that inactive namespaces
are not reported as boot devices.  This can be accomplished by checking
for non-zero block count - the spec indicates that Identify Namespace
for an inactive namespace ID will return all zeroes.

This should have no impact on the QEMU NVMe device model, since it
always reports exactly one namespace (NSID 1).

Signed-off-by: Daniel Verkamp <daniel@drv.nu>
8 years agodocs: Note release dates for 1.10.1 and 1.10.2
Kevin O'Connor [Thu, 2 Mar 2017 14:25:12 +0000 (09:25 -0500)]
docs: Note release dates for 1.10.1 and 1.10.2

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
8 years agoQEMU fw_cfg: Write fw_cfg back on S3 resume
Ben Warren [Tue, 21 Feb 2017 03:56:19 +0000 (19:56 -0800)]
QEMU fw_cfg: Write fw_cfg back on S3 resume

Any pointers to BIOS-allocated memory that were written back to QEMU
fw_cfg files are replayed when resuming from S3 sleep.

Signed-off-by: Ben Warren <ben@skyportsystems.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Igor Mammedov <imammedo@redhat.com>
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
8 years agoQEMU fw_cfg: Add functions for accessing files by key
Ben Warren [Tue, 21 Feb 2017 03:56:18 +0000 (19:56 -0800)]
QEMU fw_cfg: Add functions for accessing files by key

Due to memory contraints, when resuming from S3 the fw_cfg "files" API
isn't available.  This adds a simple API to get a file 'key', and to
write to the file using the key as a reference.

Signed-off-by: Ben Warren <ben@skyportsystems.com>
Reviewed-by: Igor Mammedov <imammedo@redhat.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
8 years agoQEMU fw_cfg: Add command to write back address of file
Ben Warren [Tue, 21 Feb 2017 03:56:17 +0000 (19:56 -0800)]
QEMU fw_cfg: Add command to write back address of file

This command is similar to ADD_POINTER, but instead of patching
memory, it writes the pointer back to QEMU over the DMA interface.

Signed-off-by: Ben Warren <ben@skyportsystems.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Igor Mammedov <imammedo@redhat.com>
8 years agoromfile-loader: Switch to using named structs
Ben Warren [Tue, 21 Feb 2017 03:56:16 +0000 (19:56 -0800)]
romfile-loader: Switch to using named structs

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>
8 years agoQEMU DMA: Add DMA write capability
Ben Warren [Tue, 21 Feb 2017 03:56:15 +0000 (19:56 -0800)]
QEMU DMA: Add DMA write capability

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>
8 years agoblock: add NVMe boot support
Julian Stecklina [Mon, 13 Feb 2017 09:03:59 +0000 (10:03 +0100)]
block: add NVMe boot support

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>
8 years agops2port: Disable keyboard/mouse prior to resetting ps2 controller
Kevin O'Connor [Sat, 11 Feb 2017 17:13:03 +0000 (12:13 -0500)]
ps2port: Disable keyboard/mouse prior to resetting ps2 controller

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>
8 years agovgasrc: Increase debug level
Paul Menzel [Fri, 20 Jan 2017 15:52:44 +0000 (16:52 +0100)]
vgasrc: Increase debug level

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>
8 years agoahci: Set upper 32-bit registers to zero
Ladi Prosek [Fri, 13 Jan 2017 09:48:29 +0000 (10:48 +0100)]
ahci: Set upper 32-bit registers to zero

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>
8 years agoserialio: Support for mmap serial ports
Ricardo Ribalda Delgado [Tue, 20 Dec 2016 18:03:58 +0000 (19:03 +0100)]
serialio: Support for mmap serial ports

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>
8 years agotpm: Log TPM 2 digest structure in little endian format
Stefan Berger [Wed, 23 Nov 2016 16:19:43 +0000 (11:19 -0500)]
tpm: Log TPM 2 digest structure in little endian format

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>
8 years agotpm: Rework tpm_build_and_send_cmd() into tpm_simple_cmd()
Kevin O'Connor [Wed, 10 Aug 2016 22:15:13 +0000 (18:15 -0400)]
tpm: Rework tpm_build_and_send_cmd() into tpm_simple_cmd()

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>
8 years agotpm: Don't call tpm_build_and_send_cmd() from tpm20_stirrandom()
Kevin O'Connor [Wed, 10 Aug 2016 21:45:05 +0000 (17:45 -0400)]
tpm: Don't call tpm_build_and_send_cmd() from tpm20_stirrandom()

Instead call tpmhw_transmit() directly.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
8 years agoacpi: Generalize find_fadt() and find_tcpa_by_rsdp() into find_acpi_table()
Kevin O'Connor [Sun, 10 Jan 2016 15:53:24 +0000 (10:53 -0500)]
acpi: Generalize find_fadt() and find_tcpa_by_rsdp() into find_acpi_table()

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>
8 years agotpm: Move code around in tcgbios.c to keep like code together
Kevin O'Connor [Wed, 10 Aug 2016 20:15:43 +0000 (16:15 -0400)]
tpm: Move code around in tcgbios.c to keep like code together

No code changes; just code movement.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
8 years agotpm: Don't call tpm_set_failure() from tpm12_get_capability()
Kevin O'Connor [Wed, 10 Aug 2016 20:23:02 +0000 (16:23 -0400)]
tpm: Don't call tpm_set_failure() from tpm12_get_capability()

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>
8 years agotpm: Add comment banners to tcg.c separating major parts of spec
Kevin O'Connor [Wed, 10 Aug 2016 19:25:28 +0000 (15:25 -0400)]
tpm: Add comment banners to tcg.c separating major parts of spec

No code changes; just code movement.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
8 years agodrop "etc/boot-cpus" fw_cfg file and reuse legacy QEMU_CFG_NB_CPUS
Igor Mammedov [Fri, 11 Nov 2016 15:35:15 +0000 (16:35 +0100)]
drop "etc/boot-cpus" fw_cfg file and reuse legacy QEMU_CFG_NB_CPUS

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>
8 years agousb: Make usb_time_sigatt variable static
Kevin O'Connor [Wed, 26 Oct 2016 16:43:12 +0000 (12:43 -0400)]
usb: Make usb_time_sigatt variable static

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
8 years agodocs: Note v1.10.0 release rel-1.10.0
Kevin O'Connor [Wed, 26 Oct 2016 15:17:34 +0000 (11:17 -0400)]
docs: Note v1.10.0 release

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
8 years agobuild: Add -fno-pie to the gcc flags when available
Kevin O'Connor [Tue, 25 Oct 2016 16:09:41 +0000 (12:09 -0400)]
build: Add -fno-pie to the gcc flags when available

Reported-by: Paul Menzel <paulepanter@users.sourceforge.net>
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
8 years agosupport booting with more than 255 CPUs
Igor Mammedov [Thu, 13 Oct 2016 12:38:28 +0000 (14:38 +0200)]
support booting with more than 255 CPUs

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>
8 years agoadd helpers to read etc/boot-cpus at resume time
Igor Mammedov [Thu, 13 Oct 2016 12:38:27 +0000 (14:38 +0200)]
add helpers to read etc/boot-cpus at resume time

Signed-off-by: Igor Mammedov <imammedo@redhat.com>
8 years agosmp: consolidate CPU APIC ID detection and accounting
Kevin O'Connor [Thu, 13 Oct 2016 12:38:26 +0000 (14:38 +0200)]
smp: consolidate CPU APIC ID detection and accounting

Signed-off-by: "Kevin O'Connor" <kevin@koconnor.net>
Signed-off-by: Igor Mammedov <imammedo@redhat.com>
8 years agoparavirt: disable legacy bios tables in case of more than 255 CPUs
Igor Mammedov [Thu, 13 Oct 2016 12:38:25 +0000 (14:38 +0200)]
paravirt: disable legacy bios tables in case of more than 255 CPUs

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>
8 years agobuild: Be sure to also include out/*.d in Makefile
Kevin O'Connor [Fri, 21 Oct 2016 16:05:23 +0000 (12:05 -0400)]
build: Be sure to also include out/*.d in Makefile

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
8 years agodocs: fix various typos and inconsistency
Piotr Król [Sun, 16 Oct 2016 20:31:46 +0000 (22:31 +0200)]
docs: fix various typos and inconsistency

Signed-off-by: Piotr Król <piotr.krol@3mdeb.com>
8 years agovirtio: fix virtio-pci
Gerd Hoffmann [Fri, 16 Sep 2016 11:01:46 +0000 (13:01 +0200)]
virtio: fix virtio-pci

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>
8 years agokbd: Move extended and release events out of special key detection switch
Kevin O'Connor [Mon, 12 Sep 2016 14:43:30 +0000 (10:43 -0400)]
kbd: Move extended and release events out of special key detection switch

Move checking for extended scancodes and key release to the top of
__process_key().

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
8 years agopost: Map int 0x05 to entry point
Kevin O'Connor [Mon, 5 Sep 2016 17:49:18 +0000 (13:49 -0400)]
post: Map int 0x05 to entry point

int 0x05 was not assigned in the interrupt table - fix that.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
8 years agokbd: Generate interrupt events for SysReq, PrtScr, and Break
Kevin O'Connor [Mon, 5 Sep 2016 17:38:26 +0000 (13:38 -0400)]
kbd: Generate interrupt events for SysReq, PrtScr, and Break

Generate the appropriate interrupt events for the given keys.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
8 years agousb-hid: Generate Ctrl+Break and Alt+SysReq keys
Kevin O'Connor [Mon, 5 Sep 2016 17:05:36 +0000 (13:05 -0400)]
usb-hid: Generate Ctrl+Break and Alt+SysReq keys

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>
8 years agokbd: Ignore fake shift keys
Kevin O'Connor [Mon, 5 Sep 2016 15:56:03 +0000 (11:56 -0400)]
kbd: Ignore fake shift keys

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>
8 years agokbd: Move checking for special keys in __process_keys() into switch
Kevin O'Connor [Sat, 3 Sep 2016 00:58:11 +0000 (20:58 -0400)]
kbd: Move checking for special keys in __process_keys() into switch

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
8 years agokbd: Extract out shift flag setting into new function
Kevin O'Connor [Fri, 2 Sep 2016 22:18:08 +0000 (18:18 -0400)]
kbd: Extract out shift flag setting into new function

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
8 years agokbd: Merge bda->kbd_flag0 and bda->kbd_flag1
Kevin O'Connor [Fri, 2 Sep 2016 20:45:08 +0000 (16:45 -0400)]
kbd: Merge bda->kbd_flag0 and bda->kbd_flag1

Merge the two consecutive u8 fields into a single u16 field.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
8 years agokbd: Suppress keys without mappings
Kevin O'Connor [Fri, 2 Sep 2016 20:18:53 +0000 (16:18 -0400)]
kbd: Suppress keys without mappings

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>
8 years agokbd: Implement extended keycode mappings for keypad-enter and keypad-/
Kevin O'Connor [Fri, 2 Sep 2016 20:17:14 +0000 (16:17 -0400)]
kbd: Implement extended keycode mappings for keypad-enter and keypad-/

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>
8 years agokbd: Implement 101-key keyboard keycode mapping
Kevin O'Connor [Fri, 2 Sep 2016 20:11:23 +0000 (16:11 -0400)]
kbd: Implement 101-key keyboard keycode mapping

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>
8 years agopic: The default hardware interrupt handlers should not take a parameter
Kevin O'Connor [Fri, 26 Aug 2016 14:52:13 +0000 (10:52 -0400)]
pic: The default hardware interrupt handlers should not take a parameter

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>
8 years agops2: Remove stale check for timeout warning on reset
Kevin O'Connor [Mon, 15 Aug 2016 02:07:19 +0000 (22:07 -0400)]
ps2: Remove stale check for timeout warning on reset

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>
8 years agotpm: Append to TPM2 log the hashes used for PCR extension
Kevin O'Connor [Tue, 9 Aug 2016 17:24:51 +0000 (13:24 -0400)]
tpm: Append to TPM2 log the hashes used for PCR extension

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>
8 years agotpm: Extend tpm20_extend to support extending to multiple PCR banks
Stefan Berger [Fri, 5 Aug 2016 15:07:11 +0000 (11:07 -0400)]
tpm: Extend tpm20_extend to support extending to multiple PCR banks

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>
8 years agotpm: Refactor tpml_digest_values_sha1 structure
Stefan Berger [Fri, 5 Aug 2016 15:07:10 +0000 (11:07 -0400)]
tpm: Refactor tpml_digest_values_sha1 structure

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>
8 years agotpm: Restructure tpm20_extend to use buffer and take hash as parameter
Stefan Berger [Fri, 5 Aug 2016 15:07:09 +0000 (11:07 -0400)]
tpm: Restructure tpm20_extend to use buffer and take hash as parameter

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>
8 years agotpm: Retrieve the PCR Bank configuration
Stefan Berger [Fri, 5 Aug 2016 15:07:08 +0000 (11:07 -0400)]
tpm: Retrieve the PCR Bank configuration

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>
8 years agocheckstack: Handle conditional checks at start of functions
Kevin O'Connor [Wed, 10 Aug 2016 14:52:12 +0000 (10:52 -0400)]
checkstack: Handle conditional checks at start of functions

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>
8 years agopvscsi: Use high memory for rings
Dana Rubin [Thu, 4 Aug 2016 11:22:31 +0000 (14:22 +0300)]
pvscsi: Use high memory for rings

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>
8 years agopvscsi: Fix incorrect arguments order in call to memalign_low
Dana Rubin [Thu, 4 Aug 2016 11:22:30 +0000 (14:22 +0300)]
pvscsi: Fix incorrect arguments order in call to memalign_low

First argument should be 'align' and second 'size'.

Signed-off-by: <dana.rubin@ravellosystems.com>
Signed-off-by: <shmulik.ladkani@ravellosystems.com>
8 years agoversion: Update header files now that version.c is not auto generated
Kevin O'Connor [Fri, 5 Aug 2016 17:44:12 +0000 (13:44 -0400)]
version: Update header files now that version.c is not auto generated

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
8 years agovgautil: Move definitions from cbvga.h and clext.h to vgautil.h
Kevin O'Connor [Fri, 5 Aug 2016 15:53:32 +0000 (11:53 -0400)]
vgautil: Move definitions from cbvga.h and clext.h to vgautil.h

These files only need to export simple function definitions - move
them to vgautil.h.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
8 years agovgautil: Move generic definitions from stdvga.h to vgautil.h
Kevin O'Connor [Fri, 5 Aug 2016 15:48:20 +0000 (11:48 -0400)]
vgautil: Move generic definitions from stdvga.h to vgautil.h

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>
8 years agovgautil: Add new header file with misc function and variable definitions
Kevin O'Connor [Fri, 5 Aug 2016 15:14:58 +0000 (11:14 -0400)]
vgautil: Add new header file with misc function and variable definitions

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>
8 years agovgainit: Move video param setup to stdvga_build_video_param()
Kevin O'Connor [Fri, 5 Aug 2016 14:58:24 +0000 (10:58 -0400)]
vgainit: Move video param setup to stdvga_build_video_param()

Move the full video_param_table[] setup (including the updating of the
BDA) to stdvga_build_video_param().

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
8 years agovgafb: Move header definitions from vgabios.h to new file vgafb.h
Kevin O'Connor [Thu, 4 Aug 2016 21:53:45 +0000 (17:53 -0400)]
vgafb: Move header definitions from vgabios.h to new file vgafb.h

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
8 years agoswcursor: Concentrate swcursor logic in swcursor.c
Kevin O'Connor [Thu, 4 Aug 2016 21:02:16 +0000 (17:02 -0400)]
swcursor: Concentrate swcursor logic in swcursor.c

The software cursor code is not frequently used (only the coreboot
framebuffer vga code uses it).  Move its logic out of the main code
and into swcursor.c.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
8 years agoswcursor: Move swcursor code from vgafb.c to new file swcursor.c
Kevin O'Connor [Thu, 4 Aug 2016 20:25:33 +0000 (16:25 -0400)]
swcursor: Move swcursor code from vgafb.c to new file swcursor.c

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
8 years agoblockcmd: CMD_SCSI op is only used in 32bit mode
Kevin O'Connor [Thu, 4 Aug 2016 13:51:10 +0000 (09:51 -0400)]
blockcmd: CMD_SCSI op is only used in 32bit mode

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>
8 years agovgabios: Simplify scroll logic
Kevin O'Connor [Fri, 15 Jul 2016 14:54:51 +0000 (10:54 -0400)]
vgabios: Simplify scroll logic

Introduce a new function vgafb_scroll() to scroll a window on the
screen and update vgabios.c to use only that function for scrolling.
This makes the low-level vgafb_move_chars() and vgafb_clear_chars()
local to vgafb.c, and it simplifies the callers.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
8 years agodocs: Note release date of 1.9.3
Kevin O'Connor [Wed, 13 Jul 2016 14:31:29 +0000 (10:31 -0400)]
docs: Note release date of 1.9.3

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
8 years agosmp: restore MSRs on S3 resume
Paolo Bonzini [Thu, 7 Jul 2016 14:00:40 +0000 (16:00 +0200)]
smp: restore MSRs on S3 resume

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>
8 years agovgabios: Simplify set_cursor_pos()
Kevin O'Connor [Mon, 4 Jul 2016 16:31:50 +0000 (12:31 -0400)]
vgabios: Simplify set_cursor_pos()

Rework set_cursor_pos() to be slightly simpler.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
8 years agovgabios: Don't check for special case of page==0xff on external calls
Kevin O'Connor [Mon, 4 Jul 2016 16:27:38 +0000 (12:27 -0400)]
vgabios: Don't check for special case of page==0xff on external calls

The original "lgpl vgabios" internally used page=0xff as a mechanism
for specifying the current page.  It also would allow int1013 calls to
externally specify bh==0xff for the current page.  However, there is
no documentation supporting this as an externally available feature.
SeaVGABIOS does not need the internal shortcut; this patch removes the
code.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
8 years agovgabios: Remove special case of dh==0xff in handle_1013()
Kevin O'Connor [Mon, 4 Jul 2016 16:20:48 +0000 (12:20 -0400)]
vgabios: Remove special case of dh==0xff in handle_1013()

The original "lgpl vgabios" had a special case for dh==0xff in its
int1013 (write string) code.  There does not appear to be any VGABIOS
documentation supporting this as an externally available feature.  It
appears this was for its own internal use when writing its strings to
the screen.  SeaVGABIOS doesn't use this hack; this patch removes it
from the code.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
8 years agofw/msr_feature_control: add support to set MSR_IA32_FEATURE_CONTROL
Haozhong Zhang [Wed, 22 Jun 2016 06:53:24 +0000 (14:53 +0800)]
fw/msr_feature_control: add support to set MSR_IA32_FEATURE_CONTROL

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>
8 years agovirtio: pci cfg access
Gerd Hoffmann [Fri, 3 Jul 2015 09:07:05 +0000 (11:07 +0200)]
virtio: pci cfg access

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>
8 years agovirtio: uninline _vp_{read,write}
Gerd Hoffmann [Fri, 17 Jun 2016 09:45:43 +0000 (11:45 +0200)]
virtio: uninline _vp_{read,write}

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>
8 years agosplash: Skip the RGB555 mode
Zheng Bao [Fri, 20 May 2016 15:26:32 +0000 (15:26 +0000)]
splash: Skip the RGB555 mode

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>
8 years agofw/pci: Add support for mapping Intel IGD via QEMU
Alex Williamson [Tue, 17 May 2016 20:44:32 +0000 (14:44 -0600)]
fw/pci: Add support for mapping Intel IGD via QEMU

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>
8 years agotcgbios: Remove unused const variable
Kevin O'Connor [Tue, 17 May 2016 00:51:17 +0000 (20:51 -0400)]
tcgbios: Remove unused const variable

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>
8 years agousb-xhci: Remove unused const variables
Kevin O'Connor [Tue, 17 May 2016 00:50:28 +0000 (20:50 -0400)]
usb-xhci: Remove unused const variables

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>
9 years agodocs: Note release date of 1.9.2
Kevin O'Connor [Fri, 22 Apr 2016 12:32:13 +0000 (08:32 -0400)]
docs: Note release date of 1.9.2

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
9 years agoscsi: Launch a thread when scanning for drives in the scsi drivers
Kevin O'Connor [Tue, 5 Apr 2016 17:04:07 +0000 (13:04 -0400)]
scsi: Launch a thread when scanning for drives in the scsi drivers

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
9 years agovirtio: Use threads when scanning for virtio devices
Kevin O'Connor [Sat, 2 Apr 2016 00:05:45 +0000 (20:05 -0400)]
virtio: Use threads when scanning for virtio devices

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
9 years agoshadow: Batch PCI config writes
Kevin O'Connor [Fri, 1 Apr 2016 19:45:29 +0000 (15:45 -0400)]
shadow: Batch PCI config writes

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>
9 years agooptionroms: Drop support for CONFIG_OPTIONROMS_DEPLOYED
Kevin O'Connor [Fri, 1 Apr 2016 18:23:36 +0000 (14:23 -0400)]
optionroms: Drop support for CONFIG_OPTIONROMS_DEPLOYED

No modern software uses this option and it complicates the code.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
9 years agodisk: Avoid stack_hop() path if already on the extra stack
Kevin O'Connor [Thu, 31 Mar 2016 18:29:07 +0000 (14:29 -0400)]
disk: Avoid stack_hop() path if already on the extra stack

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>
9 years agoblock: Move send_disk_op() from block.c to disk.c
Kevin O'Connor [Thu, 31 Mar 2016 18:20:30 +0000 (14:20 -0400)]
block: Move send_disk_op() from block.c to disk.c

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>
9 years agompt-scsi: Declare 'int i' outside of for loop for older compilers
Kevin O'Connor [Thu, 31 Mar 2016 01:38:56 +0000 (21:38 -0400)]
mpt-scsi: Declare 'int i' outside of for loop for older compilers

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
9 years agoSupport for booting from LSI Logic LSI53C1030, SAS1068, SAS1068e
Don Slutz [Fri, 25 Mar 2016 16:04:31 +0000 (17:04 +0100)]
Support for booting from LSI Logic LSI53C1030, SAS1068, SAS1068e

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>