Commit Graph
58 Commits
Author SHA1 Message Date
George Dunlap d23749aaf7 hvmloader: Remove all 64-bit print arguments
The printf() available to hvmloader does not handle 64-bit data types;
manually break them down as two 32-bit strings.

v4:
 - Make macros for the requisite format and bit shifting

Signed-off-by: George Dunlap <george.dunlap@eu.citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Acked-by: Keir Fraser <keir@xen.org>
Acked-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
CC: Ian Campbell <ian.campbell@citrix.com>
CC: Ian Jackson <ian.jackson@citrix.com>
CC: Stefano Stabellini <stefano.stabellini@citrix.com>
CC: Hanweidong <hanweidong@huawei.com>
CC: Keir Fraser <keir@xen.org>
2013-06-24 12:20:29 +01:00
David Vrabel 82639998a5 Fix emacs local variable block to use correct C style variable.
The emacs variable to set the C style from a local variable block is
c-file-style, not c-set-style.

Signed-off-by: David Vrabel <david.vrabel@citrix.com
2013-02-21 16:12:46 +00:00
Xiantao Zhang 45f52f2646 hvmloader: Add 64 bits big bar support
Currently it is assumed PCI device BAR access < 4G memory. If there is
such a device whose BAR size is larger than 4G, it must access > 4G
memory address.  This patch enable the 64bits big BAR support on
hvmloader.

Signed-off-by: Xiantao Zhang <xiantao.zhang@intel.com>
Signed-off-by: Xudong Hao <xudong.hao@intel.com>
Committed-by: Keir Fraser <keir@xen.org>
2012-10-01 20:01:55 +01:00
Paul Durrant 373a0743e6 hvmloader: Add xenstore-write support
Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
Committed-by: Keir Fraser <keir@xen.org>
2011-11-30 06:57:20 -08:00
Paul Durrant 779f95e3a4 hvmloader: Add snprintf()
Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
Committed-by: Keir Fraser <keir@xen.org>
2011-11-30 06:55:31 -08:00
Paul Durrant eda65f1efe hvmloader: Allocate an 8 byte buffer to contain the VM generation id
and populate it at boot time with a value read from
"platform/generation_id". Also add code to libxl to populate this
xenstore key with the value of a new 'generation_id' parameter in the
VM config file.  Populate the ADDR package of VM_Gen_Counter ACPI
device such that the first integer evaluates to the low order 32 bits
of the buffer address and the second integer evaluates to the high
order 32 bits of the buffer address.

Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
Committed-by: Keir Fraser <keir@xen.org>
2011-11-30 06:53:36 -08:00
Paul Durrant 7f1c789576 hvmloader: Add 'ctype' infrastructure
Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
Committed-by: Keir Fraser <keir@xen.org>
2011-11-30 06:50:45 -08:00
Keir Fraser 5a9a98a7a6 hvmloader: Fix memory relocation loop.
Signed-off-by: Keir Fraser <keir@xen.org>
2011-11-21 21:28:34 +00:00
Keir Fraser 487f749f0f hvmloader: Allow default response to be specified to xenstore_read().
Signed-off-by: Keir Fraser <keir@xen.org>
2011-07-25 14:21:13 +01:00
Keir Fraser d31b9a4e40 hvmloader: Formatting cleanups.
Signed-off-by: Keir Fraser <keir@xen.org>
2011-07-25 14:09:41 +01:00
Keir Fraser 1123bdf3b9 hvmloader: Remove bogus and unused RESERVED_MEMSIZE decl.
Signed-off-by: Keir Fraser <keir@xen.org>
2011-07-23 09:56:13 +01:00
Keir Fraser dc21926aff hvmloader: New functions mem_hole_alloc() and mem_hole_populate_ram().
These can be used by BIOS-specific handlers to set up memory regions
as required by their firmware payload.

Use mem_hole_alloc() to allocate properly reserved space for the
shared-info-page mapping. The old location conflicts with space
required for the OVMF BIOS (support for which is work in progress).

Signed-off-by: Keir Fraser <keir@xen.org>
2011-07-23 09:43:47 +01:00
Keir Fraser 30191ad44f hvmloader: Remove hard tabs from source files.
Signed-off-by: Keir Fraser <keir@xen.org>
2011-07-20 14:52:16 +01:00
Ian Campbell 95fad62ad6 hvmloader: add missing emacs local variables.
Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
2011-06-08 13:40:46 +01:00
Ian Campbell d021c77cb4 hvmloader: reduce unnecessary e820 reservations for SeaBIOS
SeaBIOS will reserve memory in the e820 as necessary, including BIOS
data structures such as the EBDA, any tables it creates or copies into
pleace etc.  Therefore arrange that the memory map provided by
hvmloader to SeaBIOS reserves only things which HVMloader has created.

Since ROMBIOS is more tightly coupled with hvmloader we retain the
ability to reserve BIOS regions in the hvmloader produced e820 and use
that from the ROMBIOS backend.

The code for this could probably have been simpler but the existing
code avoids overlapping e820 areas and so the new code does the same
(many guest OSes sanitize the e820 map to handle this, but I wouldn't
trust that all do, so I didn't take the risk)

For ROMBIOS the resulting e820 map as seen by the guest is the same
except the reserved regions at 0x9e000-0x9fc00,0x9fc00-0xa0000 are
merged into a single region 0x9e000-0xa0000 (Linux guests sanitize the
e820 to look like this anyway).

For SeaBIOS the result is that the lowmem reserved region is from
0x9f000-0xa0000 rather than 0x9e000-0xa0000 which correctly reflects
SeaBIOS's actual usage.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
2011-06-08 13:40:23 +01:00
Ian Campbell e894fe2367 hvmloader: add code to generate a $PIR table.
Does not replace the table hardcoded in ROMBIOS (it ain't broke) but
is used for SeaBIOS.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
2011-06-01 16:50:16 +01:00
Ian Campbell 0f165d2645 hvmloader: allow the possibility to allocate the size of smbios table
we actually need.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
2011-06-01 16:49:23 +01:00
Ian Campbell 814c326008 hvmloader: smbios: allow the entry point data structure to be located separately.
Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
2011-06-01 16:48:29 +01:00
Ian Campbell e31a6b1889 hvmloader: return MPFPS from create_mp_tables()
This is the hook which the mptables hang off, so it is useful to know.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
2011-06-01 16:47:27 +01:00
Ian Campbell 80766862aa hvmloader: Add a simple "scratch allocator"
Returns memory which is passed to the subsequent BIOS but can be
reused once the contents is consumed. An example of this would be a
BIOS table which the BIOS consumes by copying rather than simply
referencing.

Users which need a temporary scratch buffer for internal use
scratch_start which follows these allocations.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
2011-06-01 16:46:28 +01:00
Ian Campbell b39d3fa428 hvmloader: setup PCI bus in a common function again.
Previous refactoring was premature.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
2011-06-01 16:41:42 +01:00
Ian Campbell 575f9fbdfa tools: hvmloader: Refactor MP table setup into struct bios_config
Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Keir Fraser <keir@xen.org>
2011-04-12 13:47:16 +01:00
Ian Campbell 6b4d8dbd51 tools: hvmloader: refactor highbios and bios_info setup into struct bios_config
Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Keir Fraser <keir@xen.org>
2011-04-12 13:45:59 +01:00
Ian Campbell 9978e0e2b7 tools: hvmloader: pass SMBIOS location as a runtime parameter.
Instead of hardcoding in a header.

Reduces the cross talk between ROMBIOS and hvmloader.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Keir Fraser <keir@xen.org>
2011-04-12 13:38:01 +01:00
Ian Campbell ac7802b593 tools: hvmloader: split e820 support into its own code module.
Pass the table address as a paramter to the build function and cause
it to return the number of entries. Pass both base and offset as
parameters to the dump function.

This adds a duplicated e820.h header to ROMBIOS. Since the e820 data
structure is well defined by existing BIOS implementations I think
this is OK and simplifies the cross talk between hvmloader and
ROMBIOS.

Reduces the cross talk between ROMBIOS and hvmloader.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Keir Fraser <keir@xen.org>
2011-04-12 13:36:17 +01:00
Keir Fraser da7abb1417 hvmloader: Properly block on xenstore daemon rather than merely yielding.
Signed-off-by: Keir Fraser <keir@xen.org>
2010-10-20 16:36:32 +01:00
Keir Fraser 8bced86016 hvmloader: clear the xenbus event-channel when we're done with it.
Otherwise a later xenbus client that naively waits for the rising edge
could get stuck.

Signed-off-by: Tim Deegan <Tim.Deegan@citrix.com>
2010-07-20 13:42:17 +01:00
Keir Fraser dc6c53ebb6 hvmloader: Add a xenbus frontend so it can read values from xenstore
Signed-off-by: Tim Deegan <Tim.Deegan@citrix.com>
2010-07-09 12:33:57 +01:00
Keir Fraser 37fddaa5fe hvmloader: Only mark LTP1 present in ACPI DSDT if parport really is there.
Signed-off-by: Daniel Kiper <dkiper@net-space.pl>
2009-12-24 09:10:25 +00:00
Keir Fraser cf75018188 HVM vcpu add/remove: parse 'vcpu_avail' to firmware and set up madt
accordingly

-- currently firmware has got 'vcpus' from xend, this patch add parse
   'vcpu_avail' to firmware;
-- setup madt 'lapic' subitems of processors accoring to vcpus and
   vcpu_avail which finally come from config;

Signed-off-by: Liu, Jinsong <jinsong.liu@intel.com>
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2009-12-14 09:25:47 +00:00
Keir Fraser 016a8a4a48 hvmloader: Add new test for MSR_SHADOW_GS_BASE validity after SWAPGS instruction.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2009-07-16 10:30:50 +01: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 e3a9e577ae hvmloader: Reserve BIOS memory and VGA memory at top of 4GB memory hole.
To make memory management easier in hvmloader, defer building a
generic E820 map until the end of hvmloader bootstrap.

Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2009-01-08 16:59:21 +00:00
Keir Fraser 54562e0cdf hvmloader: Simplify access to hvm_info_table.
Also require the table to be present.

Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2009-01-08 13:49:05 +00:00
Keir Fraser d818f3cb7c hvm: Use main memory for video memory.
When creating an HVM domain, if e.g. another domain is created before
qemu allocates video memory, the extra 8MB memory ballooning is not
available any more, because it got consumed by the other domain.

This fixes it by taking video memory from the main memory:

- make hvmloader use e820_malloc to reserve some of the main memory
  and notify ioemu of its address through the Xen platform PCI card.
- add XENMAPSPACE_mfn to the xen_add_to_physmap memory op, to allow
  ioemu to move the MFNs between the original position and the PCI
  mapping, when LFB acceleration is disabled/enabled
- add a remove_from_physmap memory op, to allow ioemu to unmap it
  completely for the case of old guests with acceleration disabled.
- add xc_domain_memory_translate_gpfn_list to libxc to allow ioemu to
  get the MFNs of the video memory.
- have xend save the PCI memory space instead of ioemu: if a memory
  page is there, the guest can access it like usual memory, so xend
  can safely be responsible to save it.  The extra benefit is that
  live migration will apply the logdirty optimization there too.
- handle old saved images, populating the video memory from ioemu if
  really needed.

Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com>
2008-08-27 14:53:39 +01:00
Keir Fraser 64a86b092f hvmloader: Debug build incorporates HVM environment tests which must
pass for the HVM guest to successfully boot.

Currently only one test (REP INS across page boundaries) but more will
be added in future.

Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2008-08-21 15:18:05 +01:00
Keir Fraser 3c1221fce3 hvmloader: Load ACPI tables outside BIOS area, so they are writable by
OSPM (particularly the S3 firmware_waking_vector).

TODO: rombios must enter protected mode to fetch the vector on S3 resume.

Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2008-07-29 15:10:58 +01:00
Keir Fraser 7eb8d34c18 tools: Declare functions static where they should be, and provide
proper prototypes for others as required.

Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
2008-07-15 13:19:26 +01:00
Keir Fraser 1eaea3f0b6 hvmloader: Framework for multiprocessor initialisation.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2008-04-15 16:39:00 +01:00
Keir Fraser f541851c79 hvmloader: Small cleanups.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2008-04-14 14:10:11 +01:00
Keir Fraser 75d2b7df30 hvmloader: Properly implement some more SMBIOS fields.
In particular:
 - BIOS release date
 - BIOS characteristics
 - BIOS extended characteristics (Targeted Content Distribution is
   required to be specified to pass WHQL).
 - CPU speed

Based on a patch by Kamala Narasimhan <kamala.narasimhan@citrix.com>

Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2008-04-01 17:21:05 +01:00
kfraser@localhost.localdomain 22f2674542 hvmloader: Clarify relationship between xen_domain_handle_t and SMBIOS uuid field.
Signed-off-by: Keir Fraser <keir@xensource.com>
2007-08-24 16:32:56 +01:00
Keir Fraser ebb19b1cc8 hvm: e820 public header cleanup.
Signed-off-by: Keir Fraser <keir@xensource.com>
2007-06-10 19:49:44 +01:00
kfraser@localhost.localdomain 56d126ace6 hvmloader: Place SMBIOS tables at 0xE9000. Previous location was lower
than nay native system would place them.
Signed-off-by: Keir Fraser <keir@xensource.com>
2007-04-26 16:45:06 +01:00
Keir Fraser f7ffac81ac hvmloader: Fix ROMBIOS highmem relocation. Only SHF_ALLOC sections
should be relocated. SHT_NOBITS must be handled properly (space
explicitly allocated and zeroed).
Signed-off-by: Keir Fraser <keir@xensource.com>
2007-04-19 21:06:29 +01:00
Keir Fraser e5baa1aa0c hvmloader: Simplify e820_malloc() interface and improve
implementation. Strip unnecessary sections from the highmem bios
extension elf image.
Signed-off-by: Keir Fraser <keir@xensource.com>
2007-04-19 19:22:12 +01:00
Keir Fraser 36200329b1 hvmloader: More simplification of highmem bios relocation code.
Signed-off-by: Keir Fraser <keir@xensource.com>
2007-03-16 23:56:26 +00:00
Keir Fraser b54ada182d General hvmloader cleanups and write memory fields of CMOS with
correct values.
Signed-off-by: Keir Fraser <keir@xensource.com>
2007-03-16 23:34:24 +00:00
kaf24@localhost.localdomain dd59dfdfb1 This patch adds a 32bit gateway to the Bochs BIOS. The 32 bit code is
compiled with gcc and linked into the hvmloader as a byte-array.
Hvmloader allocates memory (rounded up to next 64kb) from the e820
table
below 4GB, copies and relocates the 32bit code in the allocated area
and
copies a jumptable (located in a section '.biosjumptable') pointing to
the 'exported' functions into the Bochs BIOS's memory area to link the
two code sections. The memory area has been reserved and can be
identified with the signature '___JMPT'.

In the Bochs BIOS only stub functions are provided. These load the
index
of a particular function in the jump table, switch to protected mode
and
call the function in the high memory area.  The stack is prepared such
that functions compiled by gcc can just pick the parameters from the
stack as usual - this means that the 16bit real-mode return address is
taken off the stack. The stub functions should have the same signature
as those in 32bit space. For ABI compatibility reasons parameters
inside
the Bochs BIOS stubs should all be 32bit wide.

This patch includes a test function that calls three gcc-compiled
functions in the high memory area and displays their success status.
Simple tests are done doing multiplication and addition of 32-bit
numbers and reading and modification of a static variable. These
functions test the interface and the relocation code. The test code is
removed in patch part 3.

Signed-off-by: Stefan Berger <stefanb@us.ibm.com>
2007-01-26 16:30:48 +00:00
kfraser@localhost.localdomain db08b83ada [HVMLOADER][ACPI] Move SSDT initialisation to acpi/ dir.
This kills off a few hundred lines of unnecessary code.
Signed-off-by: Keir Fraser <keir@xensource.com>
2006-11-28 15:47:52 +00:00