aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2016-07-01fw/msr_feature_control: add support to set MSR_IA32_FEATURE_CONTROLrel-1.9.3Haozhong Zhang2-11/+21
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)
2016-06-01fw/pci: Add support for mapping Intel IGD via QEMUAlex Williamson1-0/+48
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)
2016-03-07fw/pci: add Q35 S3 supportrel-1.9.2Marcel Apfelbaum1-17/+56
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)
2016-02-24build: fix .text section address alignmentKevin O'Connor1-4/+10
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)
2016-01-18biostables: Support SMBIOS 2.6+ UUID formatrel-1.9.1Cole Robinson1-11/+36
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)
2016-01-15fw/pci: do not automatically allocate IO region for PCIe bridgesMarcel Apfelbaum1-4/+5
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)
2016-01-15coreboot: Check for unaligned cbfs headerKevin O'Connor1-0/+4
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)
2016-01-15scsi: Do not call printf() from scsi_is_ready()Kevin O'Connor1-1/+1
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)
2016-01-15nmi: Don't try to switch onto extra stack in NMI handlerKevin O'Connor1-1/+4
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)
2016-01-15sdcard: fix typo causing 32bit write to 16bit block_size fieldKevin O'Connor1-1/+1
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)
2016-01-15sdcard: Only enable error_irq_enable for bits defined in SDHCI v1 specKevin O'Connor1-1/+1
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)
2016-01-15xhci: Wait for port enable even for USB3 devicesKevin O'Connor1-22/+21
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)
2016-01-15xhci: Check for device disconnects during USB2 reset pollingKevin O'Connor1-5/+19
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)
2016-01-14build: fix typo in buildversion.pyRoger Pau Monne1-1/+1
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)
2015-11-17docs: Note v1.9.0 releaserel-1.9.0Kevin O'Connor1-0/+19
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2015-11-11buildversion: Add debugging messagesKevin O'Connor1-2/+19
Add ability to output debug messages from the buildversion.py build script. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2015-11-09buildversion: Avoid subprocess.check_output() as that requires python2.7Kevin O'Connor1-13/+19
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>
2015-11-04PCI SDHCI driver: Fix base addressKyösti Mälkki1-0/+1
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>
2015-10-26docs: Minor - replace seavgabios text in Build_overview.md with linkKevin O'Connor2-6/+3
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2015-10-24virtio: Minor - replace tab characters with spaceKevin O'Connor1-2/+2
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2015-10-24biostables: Minor - fix incorrect indentationKevin O'Connor1-1/+1
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2015-10-24coreboot: Minor - avoid K&R style function declarationKevin O'Connor1-1/+1
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2015-10-23build: Allow official tarball builds to be considered "clean"Kevin O'Connor1-2/+8
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>
2015-10-23docs: Document 'make EXTRAVERSION=xyz' and scripts/tarball.shKevin O'Connor1-0/+28
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>
2015-10-22build: Be more permissive in buildversion.py tool version scanKevin O'Connor1-25/+23
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>
2015-10-21Add QEMU fw_cfg DMA interfaceMarc Marí2-12/+93
Add support for the new fw_cfg DMA interface. The protocol is explained in QEMU documentation. Signed-off-by: Marc Marí <markmb@redhat.com>
2015-10-15malloc: Rename csm_malloc_preinit() to malloc_csm_preinit()Kevin O'Connor3-4/+4
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2015-10-15stacks: Use macro wrappers for call32() and stack_hop_back()Kevin O'Connor8-44/+41
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>
2015-10-15build: Generate "reproducible" version strings on "clean" buildsKevin O'Connor1-4/+6
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>
2015-10-15build: Report gcc and binutils versions in debug logKevin O'Connor7-7/+50
Attempt to extract the gcc and binutils versions. Report that information in the debug log. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2015-10-15build: Rework version generation; don't allow make version overrideKevin O'Connor5-37/+83
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>
2015-10-15memmap: Introduce SYMBOL() macro to access linker script symbolsKevin O'Connor7-48/+46
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>
2015-10-15malloc: Don't mix virtual and physical addressesKevin O'Connor4-89/+101
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>
2015-10-15malloc: Add warning if free() called on invalid memoryKevin O'Connor2-3/+11
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2015-10-15malloc: Introduce common helper alloc_new_detail()Kevin O'Connor2-35/+47
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>
2015-10-15malloc: Use consistent naming for internal low-level "alloc" functionsKevin O'Connor1-51/+51
Use the "alloc_" prefix for all the low-level allocation functions and avoid camelCase naming. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2015-10-15virtio: Move standard definitions from virtio-ring.h to standard headersKevin O'Connor4-8/+16
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>
2015-10-15virtio: Simplify vring alignment codeKevin O'Connor1-20/+9
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>
2015-10-15e820: Update debugging messages to report 64bit valuesKevin O'Connor1-1/+1
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2015-10-15e820: Rename memmap.c to e820map.c and use consistent "e820_" prefixKevin O'Connor13-66/+73
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>
2015-10-15e820: Introduce e820_remove() and avoid exporting E820_HOLEKevin O'Connor3-3/+11
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>
2015-10-09Fix typos found by codespellStefan Weil12-13/+13
Signed-off-by: Stefan Weil <sw@weilnetz.de> Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2015-10-09Always enable caching on transition32; backup/restore cr0 on call32Kevin O'Connor5-26/+35
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>
2015-10-09Consolidate code16*() functionsKevin O'Connor1-34/+27
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>
2015-09-14Use transition32_nmi_off from call32() and call16_back()Kevin O'Connor2-2/+3
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>
2015-09-14Unify call32_sloppy() and call32()Kevin O'Connor1-18/+12
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2015-09-14Unify inline assembler in variants of call16 functionsKevin O'Connor2-77/+34
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>
2015-09-14Rename Call32Data to Call16DataKevin O'Connor1-29/+29
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>
2015-09-14Unify smm/sloppy variants of call32_prep/post and call16_helperKevin O'Connor1-82/+50
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>
2015-09-13build: use -fstack-check=no when availableMagnus Granberg1-0/+1
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>