Age | Commit message (Collapse) | Author | Files | Lines |
|
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>
(cherry picked from commit 20f83d5c7c0f9ae5f775b6701c205349abe003fb)
|
|
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>
(cherry picked from commit 04259c5817edc6d23f0aed76fd20ab220efcddc6)
|
|
Following the i440fx example, save the LPC, SMBUS and PCIEXBAR bdfs
between OS sleeps and use them to re-configure the
corresponding registers.
Tested-by: Gal Hammer <ghammer@redhat.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
Signed-off-by: Marcel Apfelbaum <marcel@redhat.com>
(cherry picked from commit dce99e01b6bfc51175bdf32612fd4f2738e5c3c8)
|
|
Some linkers verify that sections have a start address that is aligned
with the minimum alignment of that section. Add extra padding to the
".text" section to ensure it is always aligned with the maximum
alignment of any section placed in ".text".
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
Reported by: Ed Maste <emaste@FreeBSD.org>
(cherry picked from commit 3910de0dee216d5b5bf23cfa29bfc80d082b2ee7)
|
|
SMBIOS 2.6+ stores the UUID in a different format, with the first 3
fields in little endian format. This is what modern qemu delivers
and what dmidecode also handles, so let's follow suit too.
Signed-off-by: Cole Robinson <crobinso@redhat.com>
(cherry picked from commit 2e11d582b5e14759b3c1482d7e317b4a7257e77d)
|
|
PCIe downstream ports (Root Ports and switches Downstream Ports) appear
to firmware as PCI-PCI bridges and a 4K IO space is allocated for them
even if there is no device behind them requesting IO space,
all that for hotplug purpose.
However, PCIe devices can work without IO, so there is no need
to allocate IO space for hotplug.
Acked-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Marcel Apfelbaum <marcel@redhat.com>
(cherry picked from commit 76327b9f32a009245c215f4a3c5d58a01b5310ae)
|
|
If the CBFS header is invalid and points to 0xffffffff it could cause
SeaBIOS to read past the 4GB boundary and cause an exception. Check
the alignment of the header pointer before attempting to access fields
within the header.
Reported-by: "Alex G." <mr.nuke.me@gmail.com>
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
(cherry picked from commit 3e8d75f3bef0f36a807303d58523ef5eba4a386f)
|
|
The scsi_is_ready() function may be called from a thread, and it is
not valid to call printf() from a thread. Convert printf() to
dprintf() to avoid this possibility.
This does mean that cdrom detection (from cdrom_boot() ) may not give
notification of slow cdrom drives to a user. However, the extra
medium detection time is unlikely to be large anyway.
Reported-by: Tobias Diedrich <tobiasdiedrich@gmail.com>
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
(cherry picked from commit 82f327976865ba151153a04b584fc5d0a1fc5d9b)
|
|
The NMI could occur when already on the extra stack, which would
corrupt it. Always use the current stack on an NMI to avoid this.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
(cherry picked from commit 0c5a6077fc569d27aeadde690810f820b3256fbd)
|
|
The block_size field is 16bits and only 16bit writes should be used
with it.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
(cherry picked from commit 8f7dc5ab820beac980f0d40f3934a5ae04771349)
|
|
The SDHCI v1 spec only defines the first 9 error_irq_enable bits and
reserves other bits in the field. Don't enable the 10th bit (which
was defined in the v2 spec) as it's not needed anyway.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
(cherry picked from commit 460e9aac4e1ef88b14a7d44876c43ecfc94f8848)
|
|
Some USB3 controllers (and/or devices) need additional time after the
device is detected to place the port in an enabled state. Wait for
the controller to report enabled before proceeding. This fixes
several reports of devices that showed a "stall" error (cc 4) during
set address.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
(cherry picked from commit c01b41c5c68c197fe0124078261b48942f2919bd)
|
|
Some XHCI controllers register super-speed devices on high-speed ports
and then disconnect them when the super-speed detection completes.
Make sure to recognize these disconnect events during the reset
process.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
(cherry picked from commit aa34e4e52fb65abb4ef8539660f05b4d52fb1f6f)
|
|
Fixes the following build error:
Building ld scripts
Traceback (most recent call last):
File "./scripts/buildversion.py", line 134, in <module>
main()
File "./scripts/buildversion.py", line 114, in main
cleanbuild, toolstr = tool_versions(options.tools)
File "./scripts/buildversion.py", line 90, in tool_versions
vers[isbinutils] = "mixed"
NameError: global name 'vers' is not defined
Makefile:160: recipe for target 'out/romlayout16.lds' failed
Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
(cherry picked from commit 3b8c5378dfe24ca8dfeabbcc435c7eb9e2d8d769)
|
|
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
Add ability to output debug messages from the buildversion.py build
script.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
Don't require python2.7 in buildversion.py. Also, ignore only those
exceptions that are known to be possible.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
MMIO register space was off by 4 bytes, bottom bits of
PCI BAR registers are not part of the address.
Test boot on real hardware:
PCI device 00:14.7 (vd=3D1022:7813 c=3D0805)
Searching bootorder for: /pci@i0cf8/*@14,7
sdhci@0xfeb25500 ver=3D1001 cap=3D31fe3fb2 2570
sdcard_set_frequency 63 400 8000
sdcard_pio command stop (code=3D1)
sdcard_set_frequency 63 25000 200
Found sdcard at 0xfeb25500: SD card SD01G 982MiB
Registering bootable: SD card SD01G 982MiB (type:2 prio:103 data:f46e0)
Signed-off-by: Kyösti Mälkki <kyosti.malkki@gmail.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>
|
|
If building from an official tarball and EXTRAVERSION info is
provided, then consider the build to be "clean" (don't include
hostname/build timestamp). This is done on the expectation that
EXTRAVERSION will have enough information to allow developers to find
the builder and build environment should a defect be reported, and
therefore the hostname/timestamp is not necessary.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
Document the existence of the EXTRAVERSION field and the information
expected to be present in it. Document the use of tarball.sh in build
environments that lack git.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
There is some variation in version strings between various tool chain
builds. Make the version tool scan more permissive to attempt to
handle these variations.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
Add support for the new fw_cfg DMA interface. The protocol is explained in
QEMU documentation.
Signed-off-by: Marc Marí <markmb@redhat.com>
|
|
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
The C code only uses _cfuncX_ prefixes for parameters to the call32(),
stack_hop_back(), and call32_params() functions. It's simpler to use
macro wrappers around those functions which provide the required
prefix.
This also changes the parameter order of stack_hop() and
stack_hop_back() to use the more natural (func, params) ordering.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
If the build environment looks "clean" then don't add the build
hostname or build time to the version string. This makes the default
build string reproducible across builds.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
Attempt to extract the gcc and binutils versions. Report that
information in the debug log.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
Convert the script to generate the build version from a shell script
to a python script.
Remove the ability to override the version at build time via "make
VERSION=xyz". Replace it with ability to add extra version
information at build time via "make EXTRAVERSION=xyz".
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
Use a macro to define and obtain the value of a symbol introduced by
the linker scripts (scripts/layoutrom.py).
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
Consistently use 'u32' for physical addresses and pointers for virtual
addresses in the malloc code. Introduce and use memremap() where a
physical address needs to be converted to a virtual address. Use
virt_to_phys() for the inverse.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
Introduce helper for finding temp space to hold an "allocation detail
struct" and use it in both alloc_add() and _malloc().
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
Use the "alloc_" prefix for all the low-level allocation functions and
avoid camelCase naming.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
Move PAGE_SHIFT / virt_to_phys() to memmap.h and smp_[rw]mb() to
x86.h.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
Don't do phys_to_virt(virt_to_phys(vaddr)) for page alignment - page
alignment can be determined directly from the virtual address.
Use the ALIGN() macro to make the code more readable.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
Rename memmap.c to e820map.c as the code in that file only deals with
maintaining the e820 map. Move all the e820 definitions to new file
e820map.h and use a consistent "e820_" prefix on all exported
functions.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
The E820_HOLE definition is used internally in the e820 manipulation
code to remove entries from the e820 map. Introduce the e820_remove()
function so that the E820_HOLE definition does not need to be exported
from the memmap.c code.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
Signed-off-by: Stefan Weil <sw@weilnetz.de>
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
Always enable caching at start of 32bit code and always make sure the
paging flag is off. Because this alters the cr0 register, perform a
backup and restore of it when using call32().
Also, rename get/setcr0() to cr0_read/write() to more closely match
other register access functions.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
Introduce code16_override() for cases where call16() should not
restore the previous 16bit state. All callers now use call16_back()
to invoke 16bit code, so rename call16_back() to call16().
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
The call32() and call16_back() functions will always disable NMI and
enable a20 (via the call32_prep() function) so it is safe to use the
_nmi_off variant of transition32.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
The assembler between call16(), call16big() and call16_sloppy() are
very similar. Rework the functions so that a single version of the
inline assembly can be used for all variants.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
The variable stores information on how and what to restore during a
call to 16bit code, so Call16Data is a better name.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
The "smm" and "sloppy" variants of the 16bit to 32bit trampoline
backup/restore code are very similar. They can be unified into a
single copy of each function.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
Some compilers (such as the one in hardened/Gentoo) default this
option to on which leads to build failures:
src/stacks.c: In function 'call16_back':
src/stacks.c:139:5: error: 'asm' operand has impossible constraints
asm volatile(
^
URL: https://bugs.gentoo.org/559980
Reported-by: Alon Bar-Lev <alonbl@gentoo.org>
Signed-off-by: Magnus Granberg <zorry@gentoo.org>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
|