Commit Graph
81 Commits
Author SHA1 Message Date
Diederik de Haas ba6e78f0db fix spelling errors
Only spelling errors; no functional changes.

In docs/misc/dump-core-format.txt there are a few more instances of
'informations'. I'll leave that up to someone who can properly determine
how those sentences should be constructed.

Signed-off-by: Diederik de Haas <didi.debian@cknow.org>
Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
Acked-by: Jan Beulich <jbeulich@suse.com>
2020-12-04 08:28:21 +01:00
Ross Lagerwall 4c09689153 rombios/ata: wait for BSY to clear after write
After rombios transfers the data for a write, it checks the status and
fails if BSY is set. qemu-trad doesn't set BSY for PIO writes, but QEMU
upstream does, and this causes rombios to fail writes because they are
marked as BSY. Instead, wait for BSY to clear after a write.

INT 13 writes are probably rarely used these days, but they are used by
GRUB 2 to write to its environment file which happens by default on
Ubuntu.

Signed-off-by: Ross Lagerwall <ross.lagerwall@citrix.com>
Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
2017-06-20 17:13:02 +02:00
Ian Campbell 443701ef0c Replace FSF street address with canonical URL
As recommended in http://www.gnu.org/licenses/gpl-howto.en.html.

This is the result of:
$ git grep -El Mass\|Temple\|Franklin | xargs ./fsf.pl

Where fsf.pl is:
    #!/usr/bin/perl -w -pi.bak -0777
    my $repl = 'If not, see <http://www.gnu.org/licenses/>.';
    my $br = qr/(?:\s*\n\s*(?:[\*\#]|\/\/|\.\\" )?\s*|\s+)/;

    my $inwt = qr/[Ii]f${br}not,${br}write${br}(?:to${br})?the${br}Free${br}Software${br}Foundation,(?:${br}Inc\.,)?/;

    my $mass = qr/675${br}Mass${br}Ave,?${br}Cambridge,?${br}MA${br}02139,?${br}USA,?\.?/;
    my $franklin = qr/51${br}Franklin${br}St(?:reet)?(?:,${br}| - )Fifth${br}Floor,?${br}Boston,?${br}MA,?${br}02110-1301,?${br}USA,?\.?/;
    my $temple = qr/59${br}Temple${br}Place(?:,${br}| - )Suite${br}330,?${br}Boston,?${br}MA,?${br}021110?-1307,?${br}USA,?\.?/;

    s|$inwt$br$mass|$repl|m;
    s|$inwt$br$franklin|$repl|m;
    s|$inwt$br$temple|$repl|m;

The only remaining mentions of these addresses are in COPYING files which I
haven't touched.

Some of the changed files are imports from elsewhere, however
filtering them out is tricky, I think it is tolerable to have these
files be modified here and then perhaps reverted on the next sync,
since it's only 1-2 lines and obvious what is going on.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
2015-07-29 11:14:07 +01:00
Andrew Cooper 01d8e90c60 rombios/ata Remove another needless trap from the int 0x13 hotpath
The return value from await_ide() is always ignored, and most calls to
await_ide() immediately reread the status register.

Therefore, making await_ide() return the last value of the status register
removes a further two traps on the int 0x13 path.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Acked-by: Keir Fraser <keir@xen.org>
2013-08-08 12:03:17 +01:00
Andrew Cooper db46adf193 rombios/ata: Reading this status register has no relevant side effects
So taking two traps when one will do is pointless.  This removes 1 of 13
VMExits on the int 0x13 hotpath.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Acked-by: Keir Fraser <keir@xen.org>
2013-08-08 12:03:16 +01:00
Andrew Cooper 413a6fb4ee rombios/ata: Do not wait for BSY to be set
After issuing a reset, the BSY bit is expected to be set.  This is not the
case for Qemu.

In SeaBIOS.git: 580e33293244fee4556e56ecc67b8bd877f3c496

this check was even replaced with a udelay(5), as enough real hardware ignored
the BSY bit as well.

As rombios does not have an equivalent udelay(), replace the wait with a write
to port 0x80 which is whitelisted by Xen for 'a small delay'.

This causes 42k fewer IO traps to Qemu.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Acked-by: Keir Fraser <keir@xen.org>
2013-08-08 12:03:12 +01:00
Andrew Cooper 2002550427 rombios/keyboard: Don't needlessly poll the status register
Repeated polling of the status register is not going to change its value, so
don't needlessly take 8192 traps to Qemu when 1 will do.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Acked-by: Keir Fraser <keir@xen.org>
2013-08-08 12:03:09 +01:00
Ian Campbell ddff13d94c tools: hvmloader: move ROMBIOS configuration into tools/firmware/rombios/
Currently rombios and hvmloader are rather intertwined. Separate the
ROMBIOS configuration options out into a ROMBIOS provided file so that
the dependency can become strictly from hvmloader to rombios.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Keir Fraser <keir@xen.org>
2011-04-12 13:34:30 +01:00
Keir Fraser f3e5b69ec8 rombios: use explicit SS prefix for calculated on-stack array accesses.
The bcc compiler gets constant array offsets right but does all
calculated array offsets via DS.

Signed-off-by: Tim Deegan <Tim.Deegan@citrix.com>
2010-07-08 09:52:01 +01:00
Keir Fraser 6456803dab rombios: move the stack to 0x9e000 and protect it with an e820 entry
so that we don't corrupt E820_RAM memory with stack ops in S3 wakeup.
It has to move up so the lowest contiguous RAM area is >= 512MiB.

This relies on the previous fix to let DS != SS

Signed-off-by: Paul Durrant <Paul.Durrant@citrix.com>
Signed-off-by: Tim Deegan <Tim.Deegan@citrix.com>
2010-07-08 09:51:40 +01:00
Keir Fraser b825e251d2 rombios: wait 30s after a failed boot
Prevents waiting forever for a keypress that may never come if boot is
unattended.

Signed-off-by: Tim Deegan <Tim.Deegan@citrix.com>
2010-07-08 09:46:09 +01:00
Keir Fraser 9e3ba38157 rombios: fix implicit assumption that DS == SS
by passing boot device info by value, not by reference.

Signed-off-by: Tim Deegan <Tim.Deegan@citrix.com>
2010-07-06 16:51:54 +01:00
Keir Fraser 5bcc7775a7 rombios: pause for a keypress after a failed boot
rombios: inform the user and pause for a keypress after a failed boot
rather than powering off immediately.

Signed-off-by: Tim Deegan <Tim.Deegan@citrix.com>
2010-07-06 16:49:59 +01:00
Keir Fraser f38a18594b rombios: don't busy-wait for keystrokes
Spinning waiting for the keyboard is a bit rude on a virtual
machine. Wait for an interrupt instead.

Signed-off-by: Tim Deegan <Tim.Deegan@citrix.com>
2009-11-23 06:47:29 +00:00
Keir Fraser 6785f5fef3 Extend the max vcpu number for HVM guest.
- Originally the max vcpu number for HVM guest is 32, this patch
 extend the number to 128 on x86_64 hypervisor. (For i386 hypervisor,
 the max vcpu number  is still 32).
 - This patch extends the mp-table size to fit more vcpus.
 - HVM PV driver should call VCPUOP_register_vcpu_info hypercall to
 initialize the vcpu info if the vcpu number is more than 32.

Signed-off-by: Dongxiao Xu <dongxiao.xu@intel.com>
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2009-10-29 14:48:28 +00:00
Keir Fraser 39c0fe0403 rombios: compute checksum for roms bigger than a segment
From: Glauber Costa <glommer@redhat.com>
From: "Sebastian Herbszt" <herbszt@gmx.de>
Ported by: Akio Takebe <takebe_akio@jp.fujitsu.com>
2009-06-04 10:36:01 +01:00
Keir Fraser e420ef1e73 rombios: fix trying to boot from next device
If boot="ndc", rombios cannot try to boot next device.
Because rombios jump to the boot vector without pushing return
address, gPXE code and so on cannot return if it fail to boot.

Signed-off-by: Akio Takebe <takebe_akio@jp.fujitsu.com>
2009-05-27 11:19:38 +01:00
Keir Fraser 0456ddb432 Disable xen platform PCI device when xen_platform_pci=0 is specified
- Change guest firmware to use new fixed byte port 0x10.
 - Add "xen_platform_pci" option into guest config file and APIs.
    xen_platform_pci=0: Disable xen platform device.
    xen_platform_pci=1: Enable xen platform device. (default)
 - Add "disable_pf" entry into xenstore.

Signed-off-by: Yuji Shimada <shimada-yxb@necst.nec.co.jp>
2009-03-18 11:37:59 +00:00
Keir Fraser 54ddfee829 rombios: fix int15/86h (wait for microseconds)
The bcc compiler generates wrong stack pointer offset of a local
variable within ASM code if another local variable is declared
later.

Signed-off-by: Kouya Shimura <kouya@jp.fujitsu.com>
Signed-off-by: Akio Takebe <takebe_akio@jp.fujitsu.com>
2009-02-12 10:52:05 +00:00
Keir Fraser e64d0c2e62 rombios: fix pointer argument to PMM
The pointer to PMM function arguments must be flattened for protected
mode with zero-based segments.

Signed-off-by: Kouya Shimura <kouya@jp.fujitsu.com>
2009-01-26 11:22:03 +00:00
Keir Fraser 83833d973b rombios: Indirect through 32-bit jump table from within the 32-bit bios.
This gets rid of shenanigans with relocating the jump table around the
place.

Also clean up bios_info table while we are updating it.

Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2009-01-23 14:32:41 +00:00
Keir Fraser b08c16ec2f hvm bios: add PMM (a memory manager during POST)
The PMM (POST Memory Manager) offers malloc/free functionality
for PCI option ROMs during POST (Power On Self Test).

This patch adds a PMM functionality to the guest BIOS.

For example, the option ROM on LSI Logic SAS card uses PMM and
failed to initialize the device without PMM.  Thus, the HVM can't
boot up directly from the passthroughed SCSI disk.
gPXE also uses PMM (I don't know what happens without PMM).

With this patch, we succeeded in SAS boot of HVM.

For further information about PMM:
http://www.phoenix.com/en/OEM-ODM/Customer+Services/White+Papers-Specs/PC+Industry+Specifications.htm
http://www.phoenix.com/NR/rdonlyres/873A00CF-33AC-4775-B77E-08E7B9754993/0/specspmm101.pdf

Signed-off-by: Kouya Shimura <kouya@jp.fujitsu.com>
Signed-off-by: Akio Takebe <takebe_akio@jp.fujitsu.com>
2009-01-23 12:50:14 +00:00
Keir Fraser 85952ca7ce rombios: Simplify 32-bit gateway interface definitions.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2009-01-22 17:41:13 +00:00
Keir Fraser 4917117c97 rombios: Simplify 32-bit gateway and avoid need for EBDA space.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2009-01-22 16:32:06 +00:00
Keir Fraser 501b78cbc2 rombios: Protect the ax register before calling the TCG BIOS extensions function.
Signed-off-by: Stefan Berger <stefanb@us.ibm.com>
2009-01-15 12:35:09 +00:00
Keir Fraser 303e213ce3 rombios: Get rid of annoying delay at F12 boot menu.
Instead require the F12 to be pressed before the menu prompt appears.

Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2009-01-06 16:06:13 +00:00
Keir Fraser 872a09d262 rombios: Allow option ROMs to extend up to 0xEA000.
Signed-off-by: Akio Takebe <takebe_akio@jp.fujitsu.com>
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2009-01-06 16:02:10 +00:00
Keir Fraser e3b7dde955 rombios: Do not initialise PCI devices after hvmloader.
Signed-off-by: Akio Takebe <takebe_akio@jp.fujitsu.com>
2009-01-06 14:00:58 +00:00
Keir Fraser d47fd604d0 rombios: pass BDF correctly during option ROM scan
Signed-off-by: Akio Takebe <takebe_akio@jp.fujitsu.com>
Signed-off-by: Kouya Shimura <kouya@jp.fujitsu.com>
2008-12-29 14:00:15 +00:00
Keir Fraser 72d281ae08 rombios: enabling option ROM write access during initialisation.
Signed-off-by: Akio Takebe <takebe_akio@jp.fujitsu.com>
2008-12-29 13:55:59 +00:00
Keir Fraser e8a33bc38f rombios: Update to Bochs latest
Signed-off-by: Akio Takebe <takebe_akio@jp.fujitsu.com>
2008-12-18 14:52:53 +00:00
Keir Fraser a0c46b435d rombios: fix references to EBDA
Extended Bios Data Area (EBDA) can be relocated by the initialization
of PCI option ROM. The IPL boot table is also.
EBDA must be accessed via 0x40E after the initialization.

Signed-off-by: Kouya Shimura <kouya@jp.fujitsu.com>
2008-12-15 11:23:22 +00:00
Keir Fraser 3245eb0237 rombios: fix rom_scan (ja->jmp)
Signed-off-by: Akio Takebe <takebe_akio@jp.fujitsu.com>
Signed-off-by: Kouya Shimura <kouya@jp.fujitsu.com>
2008-12-11 11:32:39 +00:00
Keir Fraser 25fc0e6b27 rombios: support BCV
Signed-off-by: Akio Takebe <takebe_akio@jp.fujitsu.com>
Signed-off-by: Kouya Shimura <kouya@jp.fujitsu.com>
2008-12-09 12:41:12 +00:00
Keir Fraser ba10bcb00f hvmloader: Pass BDF to PCI option ROMs.
Signed-off-by: Shan Haitao <Haitao.shan@intel.com>
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2008-11-24 13:57:48 +00:00
Keir Fraser 8805df3883 rombios: fix int13h for floppy disk
A floppy on HVM can't be read correctly.
This fix is taken from upstream bochs-2.3.7.

Signed-off-by: Kouya Shimura <kouya@jp.fujitsu.com>
2008-10-30 13:27:07 +00:00
Keir Fraser 5a168d3d82 rombios: Simplify and clarify POST code a little.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2008-07-30 10:02:11 +01:00
Keir Fraser 67e5041100 rombios: Remove dead code.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2008-07-29 17:00:29 +01:00
Keir Fraser b5ee8eb3d6 rombios: Obtain S3 wake vector from >1MB.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2008-07-29 16:03:58 +01:00
Keir Fraser 8d375aa174 rombios: Narrow window where BIOS area is writable, and ensure it
really *is* writable in that region. This is almost enough to get S3
working again (read-only firmware-waking-vector is still a problem).

Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2008-07-29 13:11:29 +01:00
Keir Fraser 0905190686 rombios: S3 resume data must be in EBDA.
Rombios itself is read-only.

Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2008-07-24 13:44:08 +01:00
Keir Fraser f178c63b8f hvmloader, rombios: Make use of new rom-lock facility in ioemu platform device.
Signed-off-by: Trolle Selander <trolle.selander@eu.citrix.com>
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2008-07-11 12:31:32 +01:00
Keir Fraser da43e50cb3 hvm rombios: Move function calls out of 'post' function section
Through recent additions to the rombios the code section of the post
function has filled up considerably. When I enable the BX_TCGBIOS
compile time option the BIOS crashes since the post section code
(starts at $e05b) spills over into the nmi entry point (starts at
$e2c3). as86 doesn't cause an error when building.

Signed-off-by: Stefan Berger <stefanb@us.ibm.com>
2008-06-27 14:43:29 +01:00
Keir Fraser 9efd150651 rombios: S3 resume fixes.
On AMD cpus, HVM S3 resume was hanging in the bios when trying
to load the x_firmware_waking_vector from absolute
address 0xEA01C (that is, a segment offset greater than 64kB).

This change also now uses 20-bits (instead of 16) from the FACS
standard firmware_waking_vector.

Signed-off-by: Juergen Keil <jk@tools.de>
2008-06-02 16:05:07 +01:00
Keir Fraser 67ea9d3b8c rombios: Remove annoying 3-second boot delay waiting for user to hit
F10 to select boot device. This will be rarely used, and it is
possible to hit F10 before the message is displayed and the keypress
will still register. So in practice it is quite possibel to use this
boot feature reliably without needing a multi-second delay.

Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2008-05-23 11:58:08 +01:00
Keir Fraser 232cae0f1c hvm: rombios interface for HVM S3
- add S3 package in ACPI DSDT table. Guest OS will get S3 value from
   this package and write the value to PM1A control register to
   trigger S3 suspend.
 - Add S3 resume logic in rombios post code. the CMOS shutdown register
   is used to indicate if this is a S3 resume.
 - if it is s3 resume, rombios will get wakeup vector from ACPI FACS
   table and jump to wakeup vector. Per ACPI spec, the wakeup vector
   jumping must be the forms CS:IP, in which CS=3D(wakeup vector>>4)
   IP=3D(wakeup vector)&0xF, for example, for vector=3D0x12345,
   CS:IP=3D0x1234:0x5

Note: clobber_entry_point will clobber the post entry, which make S3
resume not work. We will directly jmp to POST Entry if it in S3
Resume path.

Signed-off-by: Yu Ke <ke.yu@intel.com>
Signed-off-by: Ke Liping <liping.ke@intel.com>
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2008-05-20 14:36:05 +01:00
Keir Fraser 79e5898480 hvm bios: Fix EDD pointer in int 13h, fn 48h BIOS call return buffer
I ran into this when I was reviewing what was outstanding to get
NetWare to run fully virtualized.

The BIOS emulator code has the segment and offset backward in the
returned buffer for the int 13h, fn 48h BIOS call.

Signed-off-by: Bruce Rogers <brogers@novell.com>
2008-03-17 11:16:08 +00:00
Keir Fraser 136beff178 hvm, x86: Add QEMU BIOS menu for choosing boot device.
The attached patch implements a mini BIOS menu for choosing a
non-default
boot device. When a guest starts it'll display

   'Press F10 to select boot device'

And wait 3 seconds, before continuing with the normal boot device. If
they press the F10 key, a menu is shown allowing a choice between
floppy, harddisk, cdrom and network (PXE).

I can't take credit for this originally - Jeremy Katz wrote it for
KVM, I merely re-diffed the patch to work against Xen's QEMU/BIOS code
tree. It has been tested in Fedora successfully against 3.1.x and 3.2.x

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
CC: Jeremy Katz <katzj@redhat.com>

If more than one boot device has been selected, the currently selected
number displayed in the menu is wrong.

Signed-off-by: Stefano Stabellini <stefano.stabellini@citrix.com>
2008-01-15 14:22:50 +00:00
Keir Fraser f8dc2a2051 x86, hvm, rombios: INT13 LBA48 support for disks bigger than 128GB.
The new limit should be 2TB.

Signed-off-by: Samuel Thibault <samuel.thibault@citrix.com>
2007-12-27 13:00:40 +00:00
Keir Fraser d62f502aaa hvm: TCGBIOS fixes
Fix IPL measurement of El Torito CD boot and some eventlog formats.

The TCG BIOS extensions are described here:
https://www.trustedcomputinggroup.org/specs/PCClient/TCG_PCClientImplementationforBIOS_1-20_1-00.pdf

- fix cdrom (El Torito) boot (8.2.5.6 El Torito, p63)
   tcpa_ipl() is modified to support various boot devices.
   move some measurement code into cdrom_boot() function.
- fix EV_IPL (0Dh) event (10.4.1 Event Types, p76)
   eventfield size should be zero
- fix EV_SEPARATOR event (3.2.2 Integrity Collection and Reporting,
   p32)
   change eventfield to -1 (0xFFFFFFFF)  from  "---------------"
- add "Returned INT 19h" event (8.2.3 Logging of Boot Events, p59)
   actually, tcgbios does not call int19h, but we extend this
   tentatively

Signed-off-by: Seiji Munetoh <seiji.munetoh@gmail.com>
2007-10-17 10:00:27 +01:00