]> xenbits.xensource.com Git - seabios.git/log
seabios.git
6 years agossdt: Fix building of legacy acpi tables on current iasl compiler 1.11-stable upstream/1.11-stable
Kevin O'Connor [Sun, 15 Jul 2018 14:05:14 +0000 (10:05 -0400)]
ssdt: Fix building of legacy acpi tables on current iasl compiler

Recent versions of the iasl compiler raise an error if the table id is
longer than 8 characters.  Older versions of iasl would silently
truncate the table id to 8 characters.  Change the ssdt-misc and
ssdt-pcihp files to use an 8 character id - this should not directly
impact the generated aml code as the table id was already being
truncated - but may help those wishing to manually compile the tables.

Reported by Michael Tokarev, Vivia Nikolaidou, and several others.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
(cherry picked from commit 8c3f57ea1217ea0c80a72898bc35baa0e14af0e0)

6 years agocbvga_set_mode: refine clear display logic rel-1.11.2
Gerd Hoffmann [Fri, 22 Jun 2018 06:43:04 +0000 (08:43 +0200)]
cbvga_set_mode: refine clear display logic

There is no need to skip text mode clearing.
Clearing the framebuffer should be safe on legacy calls too.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
(cherry picked from commit 69ea6dabeba4e080fc916a6bc9a2d53ffb4f916c)

6 years agoqemu: add qemu ramfb support
Gerd Hoffmann [Wed, 15 Nov 2017 13:43:10 +0000 (14:43 +0100)]
qemu: add qemu ramfb support

Add support for qemu ramfb.  This is a simple boot framebuffer device,
with normal ram being used to back the framebuffer and fw_cfg being used
to configure the device.

Use case (on x86): boot display for vgpu devices (which neither emulate
vga nor have a vgabios).

Sharing fw_cfg code with seabios turned out to be difficuilt due to
various dependencies the code has on infrastructure which only seabios
has.  So include a copy of the code here, with those dependencies
removed and also stripped down because we don't need a non-dma fallback
here.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
(cherry picked from commit d9a8b867a3af8090290b69b8f94b24e7fba9e504)

6 years agovgasrc: add allocate_pmm()
Gerd Hoffmann [Fri, 15 Jun 2018 05:55:47 +0000 (07:55 +0200)]
vgasrc: add allocate_pmm()

Factor out pmm allocation function from stack allocator.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
(cherry picked from commit e1a9579acd66fb9c393c014ed26f569f20a1a4f1)

6 years agopmm: use tmp zone on oom
Gerd Hoffmann [Fri, 15 Jun 2018 10:07:34 +0000 (12:07 +0200)]
pmm: use tmp zone on oom

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
(cherry picked from commit a638acfa4cc772b42093c8bfe55669829a641293)

6 years agobochs_display_setup: return error on failure
Gerd Hoffmann [Fri, 15 Jun 2018 06:18:45 +0000 (08:18 +0200)]
bochs_display_setup: return error on failure

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
(cherry picked from commit 7bf9ffff1a6ac6a554ddb508fe468c0a88235c8f)

6 years agocbvga_set_mode: disable clearmem in windows x86 emulator.
Gerd Hoffmann [Wed, 30 May 2018 21:57:06 +0000 (23:57 +0200)]
cbvga_set_mode: disable clearmem in windows x86 emulator.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
(cherry picked from commit ddbb6da35099f99edaad3ddad2a187591387925c)

6 years agocbvga_list_modes: don't list current mode twice
Gerd Hoffmann [Wed, 30 May 2018 14:19:02 +0000 (16:19 +0200)]
cbvga_list_modes: don't list current mode twice

In case we've already added the framebuffer video mode
to the list do not add number 0x140.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
(cherry picked from commit 0c2b3b1d95cf35d1a08c5dab6579acbb1f20e2c1)

6 years agocbvga_setup_modes: use real mode number instead of 0x140
Gerd Hoffmann [Wed, 30 May 2018 20:52:04 +0000 (22:52 +0200)]
cbvga_setup_modes: use real mode number instead of 0x140

In case the framebuffer size matches one of the cbvga video modes
just use that mode number instead of 0x140.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
(cherry picked from commit 902bacb5f00b72efaf55865c665a4bb4c0f46459)

6 years agoqemu: add bochs-display support
Gerd Hoffmann [Wed, 15 Nov 2017 13:43:10 +0000 (14:43 +0100)]
qemu: add bochs-display support

Use coreboot text mode emulation to also support the qemu bochs-display
device.  This is a new display device supporting simple linear
framebuffers, using the bochs register interface.  No support for legacy
vga (text modes, planar modes, cga modes, 8bpp palette modes all
dropped).  The bochs interface is compatible with the qemu stdvga.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
(cherry picked from commit 77404b450d30a1d7860e717e98762b8a4745341d)

6 years agocbvga: factor out cbvga_setup_modes()
Gerd Hoffmann [Wed, 30 May 2018 20:50:42 +0000 (22:50 +0200)]
cbvga: factor out cbvga_setup_modes()

Factor out generic data structure setup code from cbvga_setup().

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
(cherry picked from commit 4d70b24b86012e382cf551ce72c2dd6c92a6d1fa)

6 years agooptionrom: enable non-vga display devices
Gerd Hoffmann [Wed, 30 May 2018 11:49:06 +0000 (13:49 +0200)]
optionrom: enable non-vga display devices

In case no VGA device was found look for other display devices.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
(cherry picked from commit e28e0bb39b6a8cca7da196491ad80f1b96d1c806)

7 years agoparavirt: Only enable sercon in NOGRAPHIC mode if no other console specified rel-1.11.1
Kevin O'Connor [Fri, 10 Nov 2017 17:20:35 +0000 (12:20 -0500)]
paravirt: Only enable sercon in NOGRAPHIC mode if no other console specified

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
(cherry picked from commit 0541f2f0f246e77d7c726926976920e8072d1119)

7 years agopci: fix 'io hints' capability for RedHat PCI bridges
Marcel Apfelbaum [Thu, 11 Jan 2018 20:15:12 +0000 (22:15 +0200)]
pci: fix 'io hints' capability for RedHat PCI bridges

Commit ec6cb17f (pci: enable RedHat PCI bridges to reserve additional
                 resources on PCI init)
added a new vendor specific PCI capability for RedHat PCI bridges
allowing them to reserve additional buses and/or IO/MEM space.

When adding the IO hints PCI capability to the pcie-root-port
without specifying a value for bus reservation, the subordinate bus
computation is wrong and the guest kernel gets messed up.

Fix it by returning to prev code if the value for bus
reservation is not set.

Removed also a wrong debug print "PCI: invalid QEMU resource reserve
cap offset" which appears if the 'IO hints' capability is not present.

Acked-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Marcel Apfelbaum <marcel@redhat.com>
(cherry picked from commit 14d91c353e19b7085fdbb7b2dcc43f3355665670)

7 years agoshadow: Don't invoke a shutdown on reboot unless in a reboot loop
Kevin O'Connor [Fri, 23 Feb 2018 01:29:27 +0000 (20:29 -0500)]
shadow: Don't invoke a shutdown on reboot unless in a reboot loop

Old versions of KVM would map the same writable copy of the BIOS at
both 0x000f0000 and 0xffff0000.  As a result, a reboot on these
machines would result in a reboot loop.  So, the code attempts to
check for that situation and invoke a shutdown instead.

Commit b837e68d changed the check to run prior to the first reboot.
However, this broke reboots on the QEMU isapc machine type.  Change
the reboot loop check to only be invoked after at least one reboot has
been attempted.

Reported-by: Daniel P. Berrangé <berrange@redhat.com>
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
(cherry picked from commit 42812e062a77b27b0544c8e0d46d206afc3b2fae)

7 years agobuild: Use git describe --always
Kevin O'Connor [Tue, 27 Feb 2018 16:27:59 +0000 (11:27 -0500)]
build: Use git describe --always

Add --always flag to "git describe" command to get a build identifier
even if one checks out the repo with a depth parameter that prunes out
the last tagged version.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
(cherry picked from commit a3c93bd81df628a218b9363f13188367417baaec)

7 years agodocs: Note v1.11.0 release rel-1.11.0
Kevin O'Connor [Fri, 10 Nov 2017 16:49:19 +0000 (11:49 -0500)]
docs: Note v1.11.0 release

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
7 years agosercon: Disable ScreenAndDebug in case both serial console and serial debug are active
Gerd Hoffmann [Fri, 3 Nov 2017 07:40:57 +0000 (08:40 +0100)]
sercon: Disable ScreenAndDebug in case both serial console and serial debug are active

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
7 years agotimer: Avoid integer overflows in usec and nsec calculations
Kevin O'Connor [Thu, 2 Nov 2017 15:21:14 +0000 (11:21 -0400)]
timer: Avoid integer overflows in usec and nsec calculations

When timer_calc_usec() is used with large timeout values, such as 60s,
the integer math can overflow and produce different results than when
using timer_calc(time / 1000) for the same timeout.

Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
7 years agonvme: Use the Maximum Queue Entries Supported (MQES) to initialize I/O queues
Filippo Sironi [Wed, 11 Oct 2017 22:42:34 +0000 (00:42 +0200)]
nvme: Use the Maximum Queue Entries Supported (MQES) to initialize I/O queues

Use the Maximum Queue Entries Supported (MQES) to initialize I/O queues
depth rather than picking a fixed number (256) which might not be
supported by some NVMe controllers (the NVMe specification says that an
NVMe controller may support any number between 2 to 4096).

Still cap the I/O queues depth to 256 since, during my testing, SeaBIOS
was running out of memory when using something higher than 256 (4096 on
the NVMe controller that I've had a chance to try).

Signed-off-by: Filippo Sironi <sironi@amazon.de>
7 years agoxhci: Verify the device is still present in xhci_cmd_submit()
Kevin O'Connor [Tue, 3 Oct 2017 15:29:12 +0000 (11:29 -0400)]
xhci: Verify the device is still present in xhci_cmd_submit()

Make sure the USB device is still present before altering the xhci
"slot" for it.  It appears some controllers will hang if a request is
sent to a port no longer connected.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
7 years agonvme: fix out of memory behavior
Julian Stecklina [Tue, 3 Oct 2017 13:47:17 +0000 (15:47 +0200)]
nvme: fix out of memory behavior

If the allocation of I/O queues ran out of memory, the code would fail to detect
that and happily use these queues at address zero. For me this happens for
systems with more than 7 NVMe controllers.

Fix the out of memory handling to gracefully handle this case.

Signed-off-by: Julian Stecklina <jsteckli@amazon.de>
7 years agoxhci: Build TRBs directly in xhci_trb_queue()
Kevin O'Connor [Tue, 3 Oct 2017 14:45:24 +0000 (10:45 -0400)]
xhci: Build TRBs directly in xhci_trb_queue()

Use the logic for building a 'struct xhci_trb' that was in
xhci_xfer_queue() up so that command and ring TRBs can also use that
functionality.  This eliminates the need to manually generate the
xhci_trb struct from those code paths.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
7 years agovirtio: Allocate drive_s storage in low memory
Kevin O'Connor [Tue, 11 Jul 2017 16:30:26 +0000 (12:30 -0400)]
virtio: Allocate drive_s storage in low memory

Use the "low" memory segment instead of the f-segment for the drive_s
storage.  This can help avoid running out of memory in the f-segment.

Tested-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
7 years agoblock: Rename disk_op_s->drive_gf to drive_fl
Kevin O'Connor [Tue, 11 Jul 2017 16:24:50 +0000 (12:24 -0400)]
block: Rename disk_op_s->drive_gf to drive_fl

Now that the drive_s struct does not need to be in the f-segment,
rename references to drive_gf in the generic drive code to drive_fl.

This is just variable renames - no code changes.

Tested-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
7 years agodisk: Don't require the 'struct drive_s' to be in the f-segment
Kevin O'Connor [Tue, 11 Jul 2017 16:09:57 +0000 (12:09 -0400)]
disk: Don't require the 'struct drive_s' to be in the f-segment

Allow the 'struct drive_s' drive description structure to be in either
the "low" memory segment or the f-segment.

Tested-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
7 years agoboot: Rename drive_g to drive
Kevin O'Connor [Tue, 11 Jul 2017 15:55:49 +0000 (11:55 -0400)]
boot: Rename drive_g to drive

The 'struct drive_s' pointer is a 32bit pointer (and boot.c code is
only compiled in 32bit mode), so avoid using the "_g" suffix on the
pointer.

Tested-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
7 years agoadd serial console support
Gerd Hoffmann [Mon, 18 Sep 2017 08:47:23 +0000 (10:47 +0200)]
add serial console support

Redirect int10 calls to serial console output.
Parse serial input and queue key events.
The serial console can work both as primary display
and in parallel to another vga display (splitmode).

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
7 years agoparavirt: serial console configuration.
Gerd Hoffmann [Mon, 18 Sep 2017 08:47:22 +0000 (10:47 +0200)]
paravirt: serial console configuration.

Read QEMU_CFG_NOGRAPHIC, if set add etc/sercon-port
file to enable the serial console.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
7 years agoromfile: add support for constant files.
Gerd Hoffmann [Mon, 18 Sep 2017 08:47:21 +0000 (10:47 +0200)]
romfile: add support for constant files.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
7 years agokbd: make enqueue_key public, add ascii_to_keycode
Gerd Hoffmann [Mon, 18 Sep 2017 08:47:20 +0000 (10:47 +0200)]
kbd: make enqueue_key public, add ascii_to_keycode

serial console wants queue key events and needs to map ascii chars to
the keycode, so make enqueue_key public and also exports a helper
function so sercon can use the scan_to_keycode mapping table.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
7 years agostd: add cp437 to unicode map
Gerd Hoffmann [Mon, 18 Sep 2017 08:47:19 +0000 (10:47 +0200)]
std: add cp437 to unicode map

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
7 years agopci: enable RedHat PCI bridges to reserve additional resources on PCI init
Aleksandr Bezzubikov [Thu, 17 Aug 2017 23:33:21 +0000 (02:33 +0300)]
pci: enable RedHat PCI bridges to reserve additional resources on PCI init

In case of Red Hat Generic PCIE Root Port reserve additional buses
and/or IO/MEM/PREF space, which values are provided in a vendor-specific capability.

Signed-off-by: Aleksandr Bezzubikov <zuban32s@gmail.com>
Reviewed-by: Marcel Apfelbaum <marcel@redhat.com>
7 years agopci: add QEMU-specific PCI capability structure
Aleksandr Bezzubikov [Thu, 17 Aug 2017 23:33:20 +0000 (02:33 +0300)]
pci: add QEMU-specific PCI capability structure

On PCI init PCI bridge devices may need some
extra info about bus number to reserve, IO, memory and
prefetchable memory limits. QEMU can provide this
with special vendor-specific PCI capability.

This capability is intended to be used only
for Red Hat PCI bridges, i.e. QEMU cooperation.

Signed-off-by: Aleksandr Bezzubikov <zuban32s@gmail.com>
Reviewed-by: Marcel Apfelbaum <marcel@redhat.com>
7 years agopci: refactor pci_find_capapibilty to get bdf as the first argument instead of the...
Aleksandr Bezzubikov [Thu, 17 Aug 2017 23:33:19 +0000 (02:33 +0300)]
pci: refactor pci_find_capapibilty to get bdf as the first argument instead of the whole pci_device

Refactor pci_find_capability function to get bdf instead of
a whole pci_device* as the only necessary field for this function
is still bdf.

Signed-off-by: Aleksandr Bezzubikov <zuban32s@gmail.com>
Reviewed-by: Marcel Apfelbaum <marcel@redhat.com>
7 years agotcgbios: Fix use of unitialized variable
Kevin O'Connor [Sun, 3 Sep 2017 01:42:12 +0000 (21:42 -0400)]
tcgbios: Fix use of unitialized variable

Review-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
7 years agodocs: Fix typos in Memory_Model.md
Kevin O'Connor [Tue, 11 Jul 2017 17:35:40 +0000 (13:35 -0400)]
docs: Fix typos in Memory_Model.md

Reviewed-by: Paul Menzel <pmenzel@molgen.mpg.de>
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
7 years agovga: Fix bug in stdvga_get_linesize()
Kevin O'Connor [Tue, 29 Aug 2017 18:38:19 +0000 (14:38 -0400)]
vga: Fix bug in stdvga_get_linesize()

Add required GET_GLOBAL() macro to vmode_g access.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
7 years agousb-xhci: use hub portmap
Gerd Hoffmann [Tue, 18 Jul 2017 11:15:42 +0000 (13:15 +0200)]
usb-xhci: use hub portmap

xhci controllers have two virtual ports per (usb3 capable) physical
port, one for usb2 and one for usb3 devices.  Add a hub portmap callback
to map the virtual ports to physical ports.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
7 years agousb: add hub portmap
Gerd Hoffmann [Tue, 18 Jul 2017 11:15:25 +0000 (13:15 +0200)]
usb: add hub portmap

Allow usb hubs to map (software) ports to physical ports via op
callback.  This is needed to make bootorder work in case there
isn't a simple linear mapping.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
7 years agovirtio: IOMMU support
Jason Wang [Wed, 5 Jul 2017 07:49:51 +0000 (15:49 +0800)]
virtio: IOMMU support

Since we don't enable IOMMU at all, we can then simply enable the
IOMMU support by claiming the support of VIRITO_F_IOMMU_PLATFORM. This
fixes booting failure when iommu_platform is set from qemu cli.

Acked-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Jason Wang <jasowang@redhat.com>
7 years agoahci: Disable Native Command Queueing
Zeh, Werner [Fri, 23 Jun 2017 07:18:04 +0000 (07:18 +0000)]
ahci: Disable Native Command Queueing

The AHCI driver currently sets the NCQ bit for every command that is
issued to the SATA drive.  This is not needed as there is always only
one command active at a time and in turn can lead to a hanging AHCI
controller (true for Marvel 88SE9170). The following patch disables
the usage of NCQ completely. With this patch the Marvel AHCI
controller works just fine without any issues.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
7 years agonvme: Enable NVMe support for non-qemu hardware
Youness Alaoui [Tue, 13 Jun 2017 01:09:07 +0000 (21:09 -0400)]
nvme: Enable NVMe support for non-qemu hardware

NVMe support was tested on purism/librem13 laptops and SeaBIOS has
no problems in detecting and booting the drives.

This is a continuation of commit 235a8190 which was incomplete.

Signed-off-by: Youness Alaoui <youness.alaoui@puri.sm>
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
7 years agoSeaVGABios/cbvga: Advertise compatible VESA modes
Patrick Rudolph [Mon, 29 May 2017 17:25:14 +0000 (19:25 +0200)]
SeaVGABios/cbvga: Advertise compatible VESA modes

Advertise compatible VESA modes, that are smaller or equal to
coreboot's active framebuffer. Only modes that have the same Bpp
are advertise and can be selected.

Allows the Windows 7 bootloader NTLDR to show up in VESA mode.
Allows to show the Windows 7 boot logo.
Allows Windows to boot in safe mode and in normal boot using
VgaSave driver with resolution up to 1600x1200.

This fixes most likely other bootloader and operating systems as well,
in case the are relying on VESA framebuffer support.

Signed-off-by: Patrick Rudolph <siro@das-labor.org>
7 years agoSeaVGABios/cbvga: Use active mode to clear screen
Patrick Rudolph [Mon, 29 May 2017 17:25:13 +0000 (19:25 +0200)]
SeaVGABios/cbvga: Use active mode to clear screen

As coreboot framebuffer is immutable always use CBmodeinfo.

Signed-off-by: Patrick Rudolph <siro@das-labor.org>
7 years agoSeaVGABIOS/vbe: Query driver for scanline pitch v2
Patrick Rudolph [Mon, 29 May 2017 17:25:12 +0000 (19:25 +0200)]
SeaVGABIOS/vbe: Query driver for scanline pitch v2

Query the driver for the real scanline pitch in bytes.

As cbvga doesn't change the pitch on mode change, always
return the same pitch, that might exceed width times Bytes-per-pixel.

Report the default stdvga pitch for all other drivers.

Signed-off-by: Patrick Rudolph <siro@das-labor.org>
7 years agoSeaVGABios/cbvga: Advertise correct pixel format
Patrick Rudolph [Mon, 29 May 2017 17:25:10 +0000 (19:25 +0200)]
SeaVGABios/cbvga: Advertise correct pixel format

Accumulate the pixel format's bits instead relying on coreboot's
bits_per_pixel, which says nothing about the active pixel format.

Allows VBE to correctly advertise XRGB8 and BGRX8 framebuffer formats,
commonly used by coreboot.

Fixes at least Windows Bootloader and gfxboot.

Signed-off-by: Patrick Rudolph <siro@das-labor.org>
7 years agoRevert "lsi-scsi: reset in case of a serious problem"
Roman Kagan [Thu, 8 Jun 2017 09:58:08 +0000 (12:58 +0300)]
Revert "lsi-scsi: reset in case of a serious problem"

This reverts commit 11277846e819b9eef3db5ac833a6a47f95f5ef15.

It was originally introduced to deal with the case when REPORT_LUNS
caused an error in QEMU implementation of lsi53c895a and left it in a
"confused" state making further interaction impossible.

However the remedy was worse than the disease: the reset was
controller-wide causing all luns to reset, losing all in-flight requests;
upon that all luns lit up unit_attention condition, so that any
non-informational request would fail with check_condition status.  As a
result, the lun enumeration succeeded and I saw the respective entries
in the boot menu during my testing, but the read from those luns ended
with an error and booting failed, which I didn't bother to test.

So this reverts to the original error handling behavior.  The problem
with the failing REPORT_LUNS is addressed in the preceding patch, by
making it unlikely to fail.

Reported-by: Maciej Józefczyk <maciej.jozefczyk@corp.ovh.com>
Signed-off-by: Roman Kagan <rkagan@virtuozzo.com>
7 years agoblockcmd: start REPORT_LUNS with the smallest buffer
Roman Kagan [Thu, 8 Jun 2017 09:58:07 +0000 (12:58 +0300)]
blockcmd: start REPORT_LUNS with the smallest buffer

A number of emulated SCSI devices in QEMU incorrectly return an error
to REPORT_LUNS command when the size of the data returned is smaller
than the allocation length passed in.

To work it around, start with the smallest allocation length possible:
for 1 entry.  This is a slight pessimization because it would require
another REPORT_LUNS iteration if the target has more than a single LUN,
but this appears to have negligible impact on boot times, and makes
REPORT_LUNS enumeration work for more QEMU devices (lsi53c895a,
mptsas1068).

Reported-by: Maciej Józefczyk <maciej.jozefczyk@corp.ovh.com>
Signed-off-by: Roman Kagan <rkagan@virtuozzo.com>
7 years agostacks: There is no need to disable NMI if it is already disabled
Kevin O'Connor [Tue, 16 May 2017 15:59:10 +0000 (11:59 -0400)]
stacks: There is no need to disable NMI if it is already disabled

Don't write to the cmos index port on a mode switch if NMI is already
disabled.  This reduces the number of outb() calls.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
7 years agostacks: Don't update the A20 settings if they haven't changed
Kevin O'Connor [Tue, 16 May 2017 15:47:27 +0000 (11:47 -0400)]
stacks: Don't update the A20 settings if they haven't changed

The A20 setting is almost always enabled - only issue an outb() if the
A20 is actually changing.  This reduces the number of outb() calls.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
7 years agostacks: Make sure to initialize Call16Data
Kevin O'Connor [Tue, 16 May 2017 15:36:43 +0000 (11:36 -0400)]
stacks: Make sure to initialize Call16Data

Initialize the Call16Data at startup - otherwise some early yield()
calls may check for interrupts without using the preferred A20
setting.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
7 years agosmm: Backup and restore A20 on an SMI based mode switch
Kevin O'Connor [Tue, 16 May 2017 15:32:49 +0000 (11:32 -0400)]
smm: Backup and restore A20 on an SMI based mode switch

QEMU does not store the A20 setting in the SMM cpu environment area
(and it does not look like real CPUs do either).  So, manually backup
and restore A20 on a mode switch.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
7 years agoNVMe: Allow NVMe to be enabled on real hardware
Kevin O'Connor [Wed, 10 May 2017 20:14:39 +0000 (16:14 -0400)]
NVMe: Allow NVMe to be enabled on real hardware

A couple of users have reported success with the NVMe driver on real
hardware, so allow it to be enabled outside of QEMU.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
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>