Commit Graph
43 Commits
Author SHA1 Message Date
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 029265a33a hvmloader: Move acpi_info structure out from low memory.
This avoids a conflict with SeaBIOS's memory management. Moreover
there is no reason that acp_info must live below 1MB, and moving it
out actually simplifies our code.

Signed-off-by: Keir Fraser <keir@xen.org>
2011-11-14 20:15:35 +00: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 ab0e7218e7 hvmloader: reduce minimum allocation alignment from 1024 bytes to 16.
1024 bytes create a lot of wastage when the majority of allocations
are of BIOS table data structures which are generally happy with much
lower alignment. I conservatively chose 16 bytes.

Most callers pass 0 for the alignment anyway, for the rombios high
code allocation I kept it 1024 byte aligned since it was the only case
that didn't seem obviously ok with a smaller alignment.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
2011-06-03 17:21:28 +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
Keir Fraser 576d39339e tools: hvmloader: attempt to SHUTDOWN_crash on BUG
Executing UD2 (invalid opcode) triggers a triple fault which signals
reboot to the toolstack, rather than crash.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Signed-off-by: Keir Fraser <keir@xen.org>
2011-04-18 18:34:45 +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 23b4cad2cd hvmloader: Fixes to printf() implementation.
1. Remove unportable O and D format specifiers
2. Fix X format specifier to print upper-case hex characters
3. Fix d format specifier to print -ve numbers
4. Fix handling of int vs. long (although not actually an issue
   for the i386 compile target)
5. Don't use the antiquated C 'register' type attribute.

Signed-off-by: Keir Fraser <keir@xen.org>
2011-01-14 15:21:24 +00: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 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 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 31b8c8391c hvmloader: Dynamically size the PCI hole.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2009-01-09 12:41:25 +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 ad8b20cc85 x86, hvm: Move E820 table creation into hvmloader, extend
hvm_info_table to describe memory parameters in a simpler form from
domain builder to hvmloader.

Also move reserved special page mappings immediately below the 4GB
boundary.

Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2009-01-08 15:27:20 +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 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 f844c8910a hvmloader: Fix e820_malloc() after bug I introduced in c/s 18383
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2008-08-27 15:16:13 +01: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 cc8cdb7e47 hvmloader: No need to map shared_info page into the legacy VGA MMIO
hole. We can access address 0xfffff000 from 32-bit protected mode.

Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2008-05-28 10:02: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
Keir Fraser b816828e04 firmware: Use new path to xen public headers.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2008-01-28 12:03:02 +00:00
kfraser@localhost.localdomain ea511d357e tools: Clean up usage of const type qualifier.
Signed-off-by: Keir Fraser <keir@xensource.com>
2007-06-12 11:26:51 +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
kfraser@localhost.localdomain 7f804c918c hvmloader: Fix e820_collapse() to not lose E820 entries.
Fixes bugzilla bug #971.
Signed-off-by: Keir Fraser <keir@xensource.com>
2007-04-24 10:34:47 +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 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 da38d1f64b [HVM] Re-introduce the 'apic' configuration option, default to 1.
Also simplify the HVM builder interface by doing more work in
the python wrapper, and fix mapping of shared_info page after the
change to map foreign pages by GMFN rather than MFN.

Signed-off-by: Keir Fraser <keir@xensource.com>
2006-11-27 17:49:41 +00:00
kaf24@localhost.localdomain 938cee9d41 [HVM] Dynamically build ACPI-table data block.
Only emit MP tables and MADT for multi-processor guests.
Signed-off-by: Keir Fraser <keir@xensource.com>
2006-11-26 17:37:28 +00:00
kaf24@localhost.localdomain 00a70f44a6 [HVM] Update VPIC device model for new interrupt delivery code.
Move BSP VLAPIC initialisation to hvmloader.
Remove callback_irq update hack from Linux unmodified drivers.
Signed-off-by: Keir Fraser <keir@xensource.com>
2006-11-26 13:37:27 +00:00
kfraser@localhost.localdomain bbfa22f8c9 [HVM] Move PCI and PCI-ISA bridge setup to hvmloader.
Signed-off-by: Keir Fraser <keir@xensource.com>
2006-11-22 17:50:20 +00:00
kfraser@localhost.localdomain 9fd9787b0e [HVMLOADER][VTPM] Add support for a TCG ACPI table.
The ACPI table is generated if the probing for the TIS interface
succeeds. I cleaned up the ACPI signatures in acpi2_0.h to be more
readable.

The specification for the layout of these ACPI tables can be found here:
https://www.trustedcomputinggroup.org/groups/server/TCG_ACPIGeneralSpecification_1-00_1-00_FINAL.pdf

Extensions to the Bochs BIOS that use these ACPI extensions will follow.

Signed-off-by: Stefan Berger <stefanb@us.ibm.com>
2006-11-17 10:24:22 +00:00
Steven Smith 5c445c2f6d [HVM] Be sure to nul terminate uuids in HVM SMBIOS tables.
Signed-off-by: Steven Smith <sos22@cam.ac.uk>
2006-11-06 09:46:13 +00:00
kfraser@localhost.localdomain 883236e49a [HVM] ACPI: Clean up table definitions, move under hvmloader/
directory pending tighter integration of table generation
into hvmloader. This patch also includes the TPM TIS SSDT
generator from Stefan Berger at IBM.

Signed-off-by: Keir Fraser <keir@xensource.com>
2006-10-31 12:42:50 +00:00
kaf24@localhost.localdomain 10a74ed0a2 [HVM] [SMBIOS] Duplicate UUID into serial number in SMBIOS tables.
Windows zeroes out the UUID in the SMBIOS tables, but the identifier
is often needed by systems management code.  Duplicating the UUID
as the virtual system's serial number should help.

Signed-off-by: Andrew D. Ball <aball@us.ibm.com>
2006-08-28 12:59:07 +01:00
kfraser@localhost.localdomain 318ac791f9 Add utilities needed for SMBIOS generation to hvmloader.
Signed-off-by: Andrew D. Ball <aball@us.ibm.com>
2006-08-14 17:28:25 +01:00
kfraser@localhost.localdomain 5eeca68ffd [HVMLOADER] HVM loader initialises hypercall shim and uses
it to interrogate Xen version information. Also add support
for HVM hypercall execution on 64-bit host.

Signed-off-by: Steven Smith <ssmith@xensource.com>
Signed-off-by: Keir Fraser <keir@xensource.com>
2006-08-04 20:30:12 +01:00