aboutsummaryrefslogtreecommitdiffstats
path: root/src/x86.h
Commit message (Collapse)AuthorAgeFilesLines
* Add implementations for sha256, sha384, and sha512Stefan Berger2021-06-301-0/+7
| | | | Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
* x86: add readq()Marc-André Lureau2018-02-271-0/+5
| | | | | | Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Reviewed-by: Stefan Berger <stefanb@linux.vnet.ibm.com> Tested-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
* stacks: Don't update the A20 settings if they haven't changedKevin O'Connor2017-05-161-3/+4
| | | | | | | 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>
* support booting with more than 255 CPUsIgor Mammedov2016-10-251-0/+1
| | | | | | | | | | | | | | | | 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>
* virtio: Move standard definitions from virtio-ring.h to standard headersKevin O'Connor2015-10-151-0/+8
| | | | | | | 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>
* Always enable caching on transition32; backup/restore cr0 on call32Kevin O'Connor2015-10-091-3/+6
| | | | | | | | | | | 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>
* Support for BIOS interrupt handlerStefan Berger2015-05-211-0/+7
| | | | | | | | | | | | | | | | | | | | | | This patch implements the TCG BIOS interrupt handler 1ah. It is for example used by trusted grub. This patch adds an implementation of SHA1 (following NIST specs., IETF RFC 3147 and Wikipedia) for speeding up measurements of code. Trusted Grub for example makes use of this interface and measures (calculates SHA1) of the Linux kernel and initrd. Those files can be rather large and hunting their bytes through the TIS interface as part of the int handler commands invoked by trusted grub does take quite some time due to the many vmexits the interface is creating (one per byte). There is also a threshold for the size of data to hash (100k) below which the TPM is used and above the internal faster SHA1 algorithm is used. This patch for example enables trusted grub to interact with the TPM and take additional measurements. Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com> Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* vgabios: Don't use extra stack if it appears a modern OS is in useKevin O'Connor2015-03-181-0/+5
| | | | | | | | | | | | | | | If the last mode set (while not in vm86 mode) was done from a VBE mode set call then disable the extra stack. This works under the premise that only a modern OS would invoke the VBE mode changing facilities and a modern OS would always call the vgabios with sufficient stack space. This is an ugly hack to work around a problem Windows Vista (and possibly later Windows releases) has with the VGA BIOS using a stack in the e-segment. Reported-by: Richard Laager <rlaager@wiktel.com> Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* x86: add barrier to read{b,w,l} and write{b,w,l} functionsAmeya Palande2015-02-181-3/+12
| | | | | | | | | | | | | | Use barrier() for memory mapped IO functions. This fixes pvscsi driver to boot on QEMU's pvscsi controller. Test command: qemu -m 512 --enable-kvm -device pvscsi,id=pvscsi0 -device scsi-disk,bus=pvscsi0.0,drive=drive0 -drive id=drive0,if=none,file=ubuntu1410.img,if=none -bios seabios/out/bios.bin Signed-off-by: Ameya Palande <2ameya@gmail.com> Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* Move a20 code from system.c and ps2port.h to x86.hKevin O'Connor2014-10-151-1/+14
| | | | | | | | Although the a20 functionality was originally implemented in the ps2 controller, that is just a historical artifact. It's a core feature of modern x86 cpus and the code is better located in the x86.h header. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* Minor - move sgdt/lgdt macros from stacks.c to x86.h.Kevin O'Connor2013-12-051-0/+6
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* Remove ioport.h; disperse its contents to other header files.Kevin O'Connor2013-09-281-0/+51
| | | | | | | Move the inb(), insb(), etc. code from ioport.h to x86.h. Move the PORT_* definitions to their appropriate hardware files. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* Split x86 specific functions out of util.c/h to new files x86.c/h.Kevin O'Connor2013-09-181-0/+168
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>