Age | Commit message (Collapse) | Author | Files | Lines |
|
IASL stores it's revision in each table header it generates.
That's a problem since guests see a change each time
they move between hypervisors.
We generally fill our own info for tables,
but we forgot to do this for the built-in DSDT.
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
|
|
Load files through romfile loader and use for acpi tables.
We need the RSDP pointer to hang the rest of the tables off it,
to detect that we simply scan all memory in FSEG.
Add an option to disable this feature (useful for old QEMU versions).
This saves about 1Kbytes.
enabled:
Total size: 134932 Fixed: 61571 Free: 127212 (used 51.5% of 256KiB rom)
disabled:
Total size: 133836 Fixed: 61563 Free: 128308 (used 51.1% of 256KiB rom)
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
|
|
Add ability for a ROM file to point to
it's image in memory. When file is in memory,
add utility that can patch it, storing
pointers to one file within another file.
This is not a lot of code: together with the follow-up patch to load
ACPI tables from ROM, it's about 1K extra.
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
|
|
Will be used when it's loaded from QEMU.
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
|
|
In the interim of moving ACPI tables out of
seabios, developers should get the config from
QEMU tree to keep things in sync.
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
|
|
You are getting this mail because you might have contributed code to one
of the files in seabios that we want to reuse in QEMU,
when this file was under GPLv3 or LGPLv3.
QEMU is GPLv2 at the moment, so as a step in the process of moving acpi
tables to qemu, we need to make sure the code we'll be moving is GPLv2
compatible.
The code was originally LGPLv2 in bochs so these bits are OK.
QEMU generally prefers GPLv2 or later, so this is what this
patch does. The plan is therefore:
- collect acks from everyone
- copy code to QEMU and apply this patch to QEMU copy only
If you allow the use of your contribution in QEMU under the
terms of GPLv2 or later as proposed by this patch,
please respond to this mail including the line:
Acked-by: Name <email address>
in the message body.
Thanks!
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
|
|
Recent git versions place the submodule git repos into the
.git/modules directory of the toplevel repo. In that case
.git of the seabios tree isn't a directory, but a regular
file, saying where the gitdir is.
Extent the git check to also allow .git being a regular file,
so buildversion.sh works correctly when called within the qemu
submodule.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
|
|
$subject says all. Support for usb3 streams is not implemented yet,
otherwise it is fully functional. Tested all usb devices supported
by qemu (keyboard, storage, usb hubs), except for usb attached scsi
in usb3 mode (which needs streams).
Tested on qemu only, tagged with QEMU_HARDWARE because of that.
Testing with physical hardware to be done.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
|
|
Preparation for better xhci support: allows to notify host controllers
instead of going through a free+alloc cycle.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
|
|
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
|
|
Add a qemu_preinit() call to csm initialization,
so PF_QEMU gets set when running on qemu.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
|
|
Not needed any more, the new qemu_detect() function
does the job instead.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
|
|
This patch adds support for detecting whenever SeaBIOS runs on qemu
or not. This is done by looking at the northbridge (pci device 00:00.0)
and check the subsystem id. Most pci devices emulated by qemu -- the
two northbridges i440fx and q35 included -- have a subsystem id of
"1af4:1100".
In case the subsystem ID matches set PF_QEMU, log a message (including
the northbridge found while being at it) and also check for kvm.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
|
|
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
Make sure dependency file import works with new hw/ and fw/
sub-directories.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
The segoff_s definition is used by a number of header files that would
not otherwise need farptr.h, so move it to a more central location.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
Also, sort the order of include files in the c files.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
Perform a compile check on each individual C file of the vgabios code
similar to the way that the main bios code does individual C compile
tests.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
Looking at the output of other VGA BIOS implementations, it appears
that the number of available video pages reported is always between 1
and 127.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
Invert the values returned by stdvga_bpp_factor and rename it.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
|
|
Triggerable by creating a virtual machine with
*lots* of ahci controllers and disks.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
|
|
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
Move many C files from the src/ directory to the new src/fw/ directory.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
Move many C files from the src/ directory to the new src/hw/ directory.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
Update kconfig (from Linux v2.6.38-rc2) to the latest version (from
Linux v3.11-rc6).
This is a copy of kconfig from Linux with only the changes necessary
to work with the SeaBIOS build (the equivalent of the earlier SeaBIOS
0da7bfdf commit) and the changes necessary to always emit symbols
(SeaBIOS b623e7c5 commit).
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
It's common for other projects (eg, QEMU, Linux) to put build scripts
into a "scripts/" directory. There's no reason for SeaBIOS to be
different, so rename the "tools/" directory to "scripts/".
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
Internal "low memory" allocations are currently placed in the UMB
region (0xc0000-0xf0000). However, there have been reports of some
real machines that do not support DMA to this area of memory. So, add
a compile time config option (off by default) to support placing all
internal low-memory allocations at the end of the 640K real-memory
area (0x90000-0xa0000).
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
Use size prefixes on assembler instructions.
Split the relocation smm handler into a separate section from the main
runtime smm handler.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
Qemu commit 9ee59f3 removed the bochs bios apm interface emulation at
port 0x8900. That broke poweroff via APM. Fix it by powering off the
machine using the acpi pm control register.
Old code is left in, so seabios wil try both poweroff methods. Cleaning
that eventually up is left for another patch, after checking it isn't
needed. Qemu never implemented "Standby" and "Suspend", only
"Shutdown", so it looks like there might be non-qemu use cases (bochs
probably).
Easiest way to test this is the syslinux poweroff module; modern linux
distros usually have CONFIG_APM turned off.
Reported-by: Sebastian Herbszt <herbszt@gmx.de>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
|
|
commit 2b568ebb20b08c7881d976b5bc9f59a425bae5e6
acpi_extract: detect DeviceOp
added new directives to acpi_extract.py, but didn't
document them.
Add documentation at top of file.
Cc: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
|
|
Allow configuration of the boot menu prompt and boot menu key (via the
romfile interface). Some machines don't have an F12 key, so make this
configurable.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
The file walking code was incorrectly using the uncompressed file size
when searching for the next file.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
It looks like when mathcp_setup() got moved from interface_init() to
platform_hardware_setup() in 3a735baa the corresponding change was not
made to the CSM code. Update it now.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
It looks like MSDOS 6 wants the UMB area to be read-only in order for
it to use it. FreeDOS doesn't care, but it always maps a page from
high mem when it does use the area. So, add an option to control
whether unused UMB ram is marked read-only and default it to read-only
as that seems to be more compatible.
This also fixes an off-by-one bug in the shadow range checking code.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
These two functions both need to add in extra high bits to their
timers, and this code is the bulk of these functions. Factor out the
duplicate code.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
Split timer_setup() - put the tsc calibration code in its own
function.
Group all the timer setup functions together.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
Rename the check_tsc() function to timer_check(). The CPU TSC is
often not the basis of the timer, so use a more appropriate name.
Convert all callers that were using u64 for the timers to use u32.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
Rename functions to be more consistent and so they are not confused
with the normal timer functions.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
The time-stamp-counter has a higher accuracy than is needed in
SeaBIOS. Down shift it to ensure it safely fits in a 32bit variable.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
The TICKS_PER_DAY setting is a bios standard and needs to be 1573040
for compatibility. However, there are actually ~1573042.24 ticks in a
day. So, only use TICKS_PER_DAY when working with the BDA
timer_counter - not when calculating any internal times.
The PIT hz is actually 143181800 / 12 (~1193181.667). This can be
accurately encoded as PMTIMER hz / 3. Because the PIT hz is usually
multiplied and divided by other numbers, we can use the PMTIMER hz and
defer the division by 3 to improve accuracy.
When doing division for delay time calculations, always round up the
division so the delay is never less than the requested time.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
Add ticks_to_ms() and ticks_from_ms() helpers.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
The following commits updated the FADT flags for PIIX4:
commit c7be281b3be0f2013aa4b5d5f400981a1adb6e63
Drop FIX_RTC flag from FADT.
commit a4e2b9adbba95c2d783761e84444bbb3c8d6107b
enable USE_PLATFORM_CLOCK bit in FADT flags
Q35 support was originally written before these commits in seabios, PIIX
got updated, Q35 didn't. QEMU uses the same clock for both so there's
no reason for these bits to differ. Sync them up.
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
|
|
Preface PIC functions with a pic_ to provide a more consistent
naming.
Convert the irqmask code to a more consistent
pic_irqmask_read/write/mask form.
Move code from pic.h to pic.c.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
|
|
Add support for logging to the coreboot cbmem console.
Limitation: only supported in 32bit mode. Use 'cbmem -c'
to see the logs (coreboot and seabios) after bootup.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
|
|
Make sure the PCI device list is ordered in bus order.
Don't iterate past the end of the list when detecting EHCI devices.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
Although the previous patch does fix hlist_for_each_entry_safe for the
common case, it doesn't work correctly when deleting the current
node. To fix this, introduce two macros - hlist_for_each_entry_safe
for iterating through a list that can be modified, and
hlist_for_each_entry_pprev for those users that only need access to
the "pprev" pointer.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
Gets qemu features like direct kernel boot and boot
ordering going when seabios runs on coreboot.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
I have patches for coreboot in the queue adding q35 support there,
which will change the mainboard names (adding the detected chipset).
Make SeaBIOS check the mainboard name starts with "QEMU" instead of
doing a full string match to handle this.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
|
|
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
Fix broken macro - it did not work correctly at all.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
This reverts commit aab42152881dc62b37f1833e79cbdb3dfa51603b.
|
|
|
|
Make DEBUG_IO depend on QEMU_HARDWARE instead of QEMU, so
it can be enabled for seabios builds running indirectly
(coreboot, csm) on qemu.
Add runtime check for PF_QEMU to debug port console to make
sure we don't poke on random ports on physical hardware.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
|
|
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
Just code movement - no actual code changes.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
Move the "pmm_malloc" code closer to the low level alloc functions it
calls.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
pvpanic device is used to notify host(qemu) when guest panic happens.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Hu Tao <hutao@cn.fujitsu.com>
|
|
Audit the ACPI code and ensure that all multi-byte fields do proper
byte swabbing.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
Remove dead code from acpi table definitions - the ACPI specification
is the best place to get descriptions of the fields and tables anyway.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
Create cbfs and fw_cfg specific romfile_s wrappers instead of using
private variables directly in romfile_s.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
The QEMU_CFG_NUMA fw_cfg entry is actually two separate tables in one
fw_cfg entry - a table for cpu affinity and a table for the memory
map. Create two romfile entries to make that more clear.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
Since commit f7e4dd6c18ccfbaf6cd2f5eaaed2b77cabc8a406 QEMU loads its
own copy of DSDT, so let's not build in PIIX. This makes building in
the DSDT an option, default to on (built-in). If no one complains for a
while, we'll be able to switch it off and then maybe remove altogether.
With CONFIG_ACPI_DSDT = y
Total size: 127348 Fixed: 58892 Free: 3724 (used 97.2% of 128KiB rom)
With CONFIG_ACPI_DSDT = n
Total size: 122844 Fixed: 58884 Free: 8228 (used 93.7% of 128KiB rom)
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
|
|
As QEMU gains PCI bridge and PCIe root port support, we won't always
find the VGA device on the root bus. We therefore need to add support
to find and enable a VGA device and the path to it through the VGA
Enable support in the PCI bridge control register.
Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
|
|
The ACPI code has a hardcoded list of PCI interrupts. Use that same
list in the mptable code generation. This will ensure that both
tables are in synch - it may also make the mptable easier to generate
from QEMU.
Also, move the irq0_override lookup outside of the irq loop.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
It should not be necessary to describe PCI-to-PCI bridges in the
mptable. (The mptable was designed to fit in ROM, so it seems
unlikely that it would be used for bridges that could be dynamically
added.) Describing only the root bus should make it easier to port
this content into QEMU.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
Set the ZF flag to make sure the keyboard interrupt is actively
clearing it on a key event. This fixes a hang when CONFIG_BOOTMENU is
on and CONFIG_KEYBOARD is off.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
Rebuild targets if these scripts change.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
Device needs the exact size of these data structure. Prevent padding.
This fixes guest hang when booting seabios + tcm_vhost.
Signed-off-by: Asias He <asias@redhat.com>
|
|
Before we start scsi target scanning, we need to set the
VIRTIO_CONFIG_S_DRIVER_OK flag so the device can do setup properly.
This fix a bug when booting tcm_vhost with seabios.
Signed-off-by: Asias He <asias@redhat.com>
Acked-by: Paolo Bonzini <pbonzini@redhat.com>
|
|
Make sure to check for the case where there are no NUMA nodes passed
in from QEMU.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
The cirrus_clear_vram() code wasn't actually doing anything because of
a u8 overflow. Fix that.
Fill with 0xff when performing a legacy cirrus mode switch (WinXP has
been observed to incorrectly render dialog boxes if the memory is
filled to 0). This was the behavior of the original LGPL vgabios
code. To support this, add mechanism (MF_LEGACY) to allow vga drivers
to detect if the mode switch is from vesa or int10.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
Fix conversion error that resulted in
stdvga_perform_gray_scale_summing not actually writing the new results
back.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
Enable the recently added build check on global variables that are (or
contain) pointers to memory allocated by malloc_tmp(). This helps
detect cases where temporary memory is accessed after POST.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
Add a build check to verify certain variables are only reachable via
the 32bit "init" code. This can be used as a mechanism to enforce
certain data (and code that accesses that data) as only available
during POST.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
The smm_setup() call is invoked from resume. The PCIDevices list is
only valid during POST. Cache the necessary PCI BDF ids so that
PCIDevices isn't needed.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
The make_bios_readonly() call is invoked from resume. The PCIDevices
list is only valid during POST. Cache the necessary PCI BDF ids so
that PCIDevices isn't needed.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
Avoid referencing __FILE__ - that value changes depending on the
user's build setting of OUT. The function and line number are
sufficient.
Also, use panic() instead of looping forever.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
Generate dependencies on pre-processed ASL files. This ensures that a
change to an imported dsdt file will cause iasl to be called.
Make .config depend on Kconfig files.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
The "BDAT" construct is the only ACPI mechanism that relies on SeaBIOS
reserved memory. Replace it with the SSDT based template system.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
Memory allocated with malloc_tmp() can't be used after the POST phase.
So, access boot-fail-wait in post phase and store it for the boot
phase to use. This fixes the regression introduced by commit
59d6ca52.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Signed-off-by: Amos Kong <akong@redhat.com>
|
|
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
Check for lower capacity media in the floppy drive and set the
corresponding controller data rate for it.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
The controller can be busy on a response without it being an error.
Don't spin infinitely if status isn't what is expected.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
Move some prep and error checking into floppy_cmd() from its callers.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
Don't run the Check Interrupt Status command from the floppy hardware
interrupt handler. Instead, run it where it is needed - after
controller startup and after a recalibration command. Also, use
floppy_pio() to issue the command instead of open coding it.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
Rename FRS_TIMEOUT to FRS_IRQ - the flag indicates that an irq has
been received - it isn't directly related to timeouts.
On a timeout event, disable the floppy controller instead of doing a
full reset. Also, perform the disable directly in floppy_wait_irq().
Always wait for the floppy irq after enabling the controller and after
a recalibrate command.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
Populate a struct for the PIO operations and move the PIO manipulation
done in floppy_cmd() to floppy_pio().
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
Using the internal stack reduces the amount of space that SeaBIOS uses
on the caller's stack. This is known to help some very old operating
systems (like DOS 1.0). However, there is a possibility that this
will break any operating systems that calls a legacy 16bit irq in
16bit protected mode (no OSes have yet to be identified as doing
this), so make the ability config dependent.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
The PCI-BIOS entry point can be called in 16bit protected mode, so
separate its entry code from the legacy 0x1a code.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
There have been various kvm bugs that prevent reboots from working
properly. Generalize the existing test for a failed reboot to better
catch these cases.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
|
|
I'm about to make it do more than just the pmtimer...
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
|
|
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
|
|
This should never get called, but if we somehow get a new chipset
that fails to implement their own pci_slot_get_irq function, fail
gracefully and add a debug log message.
Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
|
|
q35/ich9 doesn't use the same interrupt mapping function as
i440fx/piix. PIRQA:D and PIRQE:H are programmed identically, but we
start at index 0, not index -1. Slots 25 through 31 are also
programmed independently.
When running qemu w/o this patch, a device at address 0:6.0 will have
its PCI interrupt line register programmed with irq 10 (as seen by
info pci), but it actually uses irq 11 (as reported the guest). Half
of the interrupt lines are misprogrammedi like this. Functionally, a
fully emulated qemu guest doesn't care much, but when we try to use
device assignment, we really need to know the correct irqs.
Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
|
|
Rename remaining "build" settings in config.h that used the CONFIG_
prefix to use a BUILD_ prefix.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
The BiosTableSpace variable was used to ensure there was sufficient
space in the f-segment for malloc_fseg() calls. However, it added 2K
to the final image size to reserve that space.
Update the build to determine where to put the f-segment allocations.
In most cases (when code relocation is enabled) allocations can be
done in the space free'd from the "init" sections and no additional
space needs to be reserved in the final image. This also has the
benefit of not fragmenting the f-segment allocation space.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
Calculate a LegacyRamSize directly from the e820 map for use by
handle_1588() and handle_15e801() (the only two external interfaces
that require "RamSize"). All other users of the existing RamSize (and
RamSizeOver4G) variables are specific to QEMU, so move the
declarations to paravirt.c.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
This reduces some duplicate code between malloc_preinit() and
csm_malloc_preinit().
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
Since the final location of the "varlow" variables are known at build
time, link the final locations into the binary during the build. The
16bit code was already done at link time - update the build so the
32bit code is also done at link time.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
Convert all users of the alternative variable exports to VARFSEG.
There isn't a significant distinction between the existing types of
exports, so it's simpler to just use one type going forward.
The new VARFSEG declaration is only emitting when in 32bit mode, so
update and move some variables as needed.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
Introduce a variable declaration that will force variables (that are
compiled in 32bit mode) to be emitted into the f-segment.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
We seem to use the IRQEN bit of the PIRQn registers interchangeably
to select APIC mode or to disable an IRQ. I can't decide if we're
intending to disable the IRQ or select APIC mode here, but in either
case it prevents PIC mode assigned devices from working. When seabios
writes IRQEN to these registers, qemu interprets that as APIC mode,
so while the boot ROM driver is waiting for an interrupt on ISA
compatible IRQ 10 or 11, KVM is injecting interrupts to APIC pins
16 - 23. Devices on the root bus use PIRQE:H while the root ports
use PIRQA:D. Enable them all so we don't limit where we support boot
ROMs. The guest will later disable unused IRQs with the ACPI _DIS
method.
Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
|
|
This reduces the size of the CSM binary by a few bytes.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
|
|
Update test-build.sh to report if it can't run the c compiler at all.
Without this test, a totally non-working build environment will yield
an "invalid LD" message which can be confusing.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
Rename datalow_base (and similar) to zonelow_base, and datalow_start
(and similar) to varlow_start. This helps distinguish between the
bounds for the runtime dynamic memory pool and the compile time global
variables.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
Some old DOS programs can also use f-segment space as Upper Memory
Blocks (UMB), so also report on what space is available in debug
messages.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
Rename rom_get_top and try to make the difference between it and
rom_get_last more clear.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
Remove references to "../" and "out/" from the build so that "make
OUT=/a/b/c/" will work.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
This patch does the same for Cirrus as David's following patch for bochs,
originally posted under
<http://www.seabios.org/pipermail/seabios/2013-February/005434.html>:
Enable VGA output when settings bochs-specific mode
When used from OVMF+CSM, we got no video output. It appears that we were
never enabling the display output except when configuring a text mode.
Which never happens, in the OVMF+CSM case.
In my testing on RHEL-6.3 with OVMF -D CSM_ENABLE / CONFIG_CSM bios.bin /
CONFIG_QEMU vgabios.bin, using Cirrus, VESA mode 0x115 is selected (Direct
Color, 800x600x24).
According to <http://www.osdever.net/FreeVGA/vga/attrreg.htm>,
cirrus_switch_mode()
stdvga_attr_mask()
currently keeps/sets the "Attribute Controller Graphics Enable" bit set in
the "Attribute Mode Control Register". When invoked from OVMF+CSM, that is
not enough however, so let's do the same as for Bochs:
stdvga_attrindex_write(0x20);
which corresponds to setting the "Palette Address Source" bit in the
"Attribute Address Register":
"This bit is set to 0 to load color values to the registers in the
internal palette. It is set to 1 for normal operation of the attribute
controller. [...]"
clext_set_mode()
stdvga_set_mode() -- for regular modes
stdvga_attrindex_write() -- existing call
cirrus_switch_mode() -- for Cirrus modes
stdvga_attrindex_write() -- call added by this patch
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
|
|
When used from OVMF+CSM, we got no video output. It appears that we were
never enabling the display output except when configuring a text mode.
Which never happens, in the OVMF+CSM case.
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
|
|
Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com>
|
|
Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com>
|
|
Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com>
|
|
Framebuffer setup has nothing to do with dc_setup(..) so
move it to geodevga_init(..).
Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com>
|
|
Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com>
|
|
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
|
|
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
|
|
Potentially we could even kill it off completely, since it only works
with old versions of Qemu. But it can stay for now as long as it doesn't
offend me in the CSM build...
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
|
|
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
cntl->regs should not be accessed before initializing it.
Signed-off-by: Avik Sil <aviksil@linux.vnet.ibm.com>
|
|
The Cirrus, Standard VGA, and Bochs VGA should depend on CONFIG_QEMU
and not CONFIG_COREBOOT.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
Now that only qemu_romfile_init() uses the fw_cfg interface, it only
needs to be detected in that function.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
This allows us to keep the entry_csm code simple, and ensures that we
consistently do things like saving the PIC mask (and later setting
UmbStart) on the way back to UEFI.
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
|
|
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
|
|
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
|
|
We don't have the ordering dependency with timer_setup() any more.
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
|
|
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
|
|
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
|
|
The latest iasl release produces "lst" output with "number: " instead
of "number....". Update the tool to support both formats.
Reported-by: Bo Yang <boyang@suse.com>
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
There's no real gain to starting the device_hardware_setup in the
middle of the platform setup. Always start it just prior to the VGA
rom.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
The SMP setup initializes MTRRs on extra CPUs and populates the
CountCPUs variable. On coreboot the CPUs should already be
initialized and the CountCPUs variable isn't used anywhere.
There have also been reports of the SIPI does not work on some real
machines. So, it's best not to invoke one if it isn't needed.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
Make the KVM detection code use the same format as the QEMU/Xen
detection code.
Also, log when KVM is detected.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
CONFIG_QEMU means compile to start from QEMU (and possibly
Xen/KVM/Bochs) and definitely running under QEMU (or Xen/KVM/Bochs).
CONFIG_COREBOOT means compile for coreboot and definitely running
under coreboot. Places that used CONFIG_COREBOOT to mean "running on
real hardware" have been changed to use !CONFIG_QEMU.
CONFIG_QEMU_HARDWARE enables support for some virtual hardware devices
even if QEMU didn't start SeaBIOS.
usingXen() is replaced by runningOnXen().
runningOnQEMU() is added to hardware devices that are only safe to
access when we are sure we are running under QEMU (or Xen/KVM/Bochs).
Neither the coreboot nor the csm code currently enable runningOnQEMU,
but future patches may.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
Introduce standard for performing and inspecting the run-time
detection of para-virtualized environments.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
CONFIG_THREAD_OPTIONROMS depends on CONFIG_THREADS, so the code can
assume that the two are always on when CONFIG_THREAD_OPTIONROMS is on.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
Avoid reading/writing to cmos at runtime to get the QEMU century
information. Instead, read it at startup and cache the info.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
|
|
With CSM (and maybe coreboot) we'll want to find the pmtimer from the ACPI
tables, instead of knowing where it is and *putting* it into the ACPI
tables.
Extract the first part of the existing find_resume_vector() function into
a find_fadt() function, and use it from both find_resume_vector() and our
new find_pmtimer().
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
|
|
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
|
|
Xen invokes SeaBIOS via entry_post, not entry_elf. As a result commit
6ca0460f broke Xen. This change effectively undoes that commit.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
The CPU cache is enabled and DMA is disabled on all real-world POST
entry situations, so no need to do this in the low-level "pre-init"
phase. Instead, move it to the platform hardware setup stage.
Also, move the setting of the reboot flags (which control reset-vector
entry point handling) to ivt_init().
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
Unlocking ram in handle_post() is tricky and only needed under qemu.
Separate out that logic from the coreboot/xen paths by invoking
handle_elf_post separately. This simplifies both the qemu and
non-qemu code paths.
Also, organize all the "pre-init" functions into one section of the
file.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|