Commit Graph
59 Commits
Author SHA1 Message Date
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
kfraser@localhost.localdomain 11f0262cf2 hvmloader: Simplify 32bit-bios relocator.
Signed-off-by: Stefan Berger <stefanb@us.ibm.com>
2007-03-15 10:38:06 +00:00
kfraser@localhost.localdomain 8ff2288a9a hvm: Add a revision 1 FADT in ACPI, and link the original revision-4
FADT only to XSDT. It avoids a buffer overflow in the initialization
of Window 2000 ACPI HAL (pre ACPI 2.0 OS), and thus enables the
installation and boot. This compatibility practice is also used in
hardware, please refer to:
 http://www.acpi.info/presentations/S01USMOBS169_OS%20new.ppt

Signed-off-by: Qing He <qing.he@intel.com>
2007-03-14 11:38:26 +00:00
kfraser@localhost.localdomain bc510c7fd5 AMD HVM: Fix enter-realmode stub to initialise 32-bit GPRs.
This fixes booting Ubuntu live ISO, which assumes the upper half of
%esp is zero on entry.

Signed-off-by: Keir Fraser <keir@xensource.com>
2007-03-14 11:09:13 +00:00
kfraser@localhost.localdomain 1babae4d0c hvmloader: Avoid compile warnings char vs. unsigned char.
Avoid 'magic number' hardcoded string lengths.
Signed-off-by: Keir Fraser <keir@xensource.com>
2007-03-13 10:32:52 +00:00
kfraser@localhost.localdomain 506e6d7f53 AMD HVM: Exit hvmloader via a normal jump-to-realmode code sequence.
Strip out all SVM-special hypercall code.
Signed-off-by: Keir Fraser <keir@xensource.com>
2007-03-12 11:15:56 +00:00
kfraser@localhost.localdomain 2765521399 Remap PCI-ISA IRQ 6 to IRQ 7. Disable LPT1 by default and remove its
definition from the ACPI DSDT. This avoids conflict with FDC on IRQ6
(it is a bit more likely that someone will want to connect a floppy
image to a guest than it is that anyone will ever care about
parallel-port functionality).
Signed-off-by: Keir Fraser <keir@xensource.com>
2007-02-26 11:53:35 +00:00
kfraser@localhost.localdomain 2d420d93a6 hvm: Processor Objects require unique IDs.
Signed-off-by: Keir Fraser <keir@xensource.com>
2007-02-16 15:50:02 +00:00
kfraser@localhost.localdomain 938d51e10e hvm: Dynamically generate the correct number of ACPI Processor Objects
in an SSDT.
Signed-off-by: Keir Fraser <keir@xensource.com>
2007-02-16 15:33:51 +00:00
kfraser@localhost.localdomain 8d0689ddbe hvm: Fix acpi processor id in MADT LAPIC entries.
Signed-off-by: Keir Fraser <keir@xensource.com>
2007-02-15 19:03:09 +00:00
kaf24@localhost.localdomain 6696b4ae89 Fix firmware compile on Solaris.
Use $(LD) not ld. Include right headers for x86 ELF bits.

Signed-off-by: John Levon <john.levon@sun.com>
2007-01-28 18:45:04 +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
kaf24@localhost.localdomain c21d85bf59 [HVM] Change VCPU->LAPIC_ID mapping so that VCPU0 has ID0.
This fixes booting of older x86/64 Linux kernels.
Signed-off-by: Keir Fraser <keir@xensource.com>
2006-12-31 12:26:42 +00:00
kaf24@localhost.localdomain b8ca0e6839 [HVM] Rationalise OEM and Creator IDs and Table Revisions.
Create virtualised IDs and use them consistently.
Signed-off-by: Keir Fraser <keir@xensource.com>
2006-12-30 15:45:13 +00:00
kaf24@localhost.localdomain 175eac1a6d [HVM] Route ISA IRQ 0 to IOAPIC GSI 2, just like 99% of native systems.
This is a built-in assumption of HPET 'legacy' IRQ routing, which is
why we have changed to this routing strategy now.

Signed-off-by: Keir Fraser <keir@xensource.com>
2006-12-26 19:49:11 +00:00
kfraser@localhost.localdomain e4caeac504 [HVM] Emulates HPET in hypervisor and extend ACPI tables.
Signed-off-by: Dexuan Cui <dexuan.cui@intel.com>
Signed-off-by: Eddie Dong <eddie.dong@intel.com>
Signed-off-by: Xiaowei Yang <xiaowei.yang@intel.com>
2006-12-21 12:05:34 +00:00
Tim Deegan 6f7ff73d57 [HVM] Add Etherboot option ROM, for network-booting HVM guests.
Signed-off-by: Tim Deegan <Tim.Deegan@xensource.com>
2006-12-20 11:59:54 +00:00
kfraser@localhost.localdomain 72941f1998 [HVMLOADER] Clean up makefile, change TPM detection.
Signed-off-by: Keir Fraser <keir@xensource.com>
2006-11-29 12:41:30 +00:00
kfraser@localhost.localdomain f46695b45b [HVMLOADER] Fix CFLAGS.
Signed-off-by: Keir Fraser <keir@xensource.com>
2006-11-29 11:38:17 +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
kfraser@localhost.localdomain d8dfab4a35 [HVMLOADER] acpi: Implement an acpi_rsdp_get() function that searches
for the RSDP in memory (up to the BIOS) rather than calculating its
start address. Recent changes seem to have moved the RSDP to another
location in memory so that I received 'BAD RSPD signature' messages.
I have also fixed some other possible issues related to return codes
and alignment of ACPI entries.

Signed-off-by: Stefan Berger <stefanb@us.ibm.com>
2006-11-28 13:53:12 +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
kfraser@localhost.localdomain a41ba620b1 [HVM] Move IOAPIC ID back to 0x00. Shift LAPIC IDs to 0x01 upwards.
Actually the conflict between LAPIC ID 0x00 and IOAPIC ID 0x00
really doesn't matter even in a native system but we can avoid
any risk of a warning by shifting the LAPIC ID space by one.

Also the changeset fixes construction of the MADT (LAPIC info
was overwriting the IOAPIC info) so we can now boot with ACPI
MADT again.

Signed-off-by: Keir Fraser <keir@xensource.com>
2006-11-27 12:00:01 +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 3af4730c8d [HVM] Update ACPI tables to reflect new PIRQ routing:
1. Override ISA IRQs 5,6,10,11 as active-low level-triggered.
    These are 'wired' to PCI devices.
 2. Limit PCI-ISA link routers to route to 5,6,10,11. Others
    are active-high edge-triggered and so invalid to use for
    PCI devices. In any case, four ISA IRQs is sufficient to
    avoid unnecessary aliasing among four links.
Also remove PCI device 0 IRQ info. It's an embedded host bridge with
no interrupt sources.

Signed-off-by: Keir Fraser <keir@xensource.com>
2006-11-22 18:36:48 +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 facdf41917 [HVM] Set VIOAPIC ID to a value that does not conflict with LAPIC IDs.
Signed-off-by: Keir Fraser <keir@xensource.com>
2006-11-22 11:52:46 +00:00
kfraser@localhost.localdomain d46c9ce0d7 [HVM] Reworked interrupt distribution logic.
TODO:
 1. Fix IO-APIC ID to not conflict with LAPIC IDS.
 2. Fix i8259 device model (seems to work already though!).
 3. Add INTSRC overrides in MPBIOS and ACPI tables so
    that PCI legacy IRQ routing always ends up at an
    IO-APIC input with level trigger. Restricting link
    routing to {5,6,10,11} and setting overrides for all
    four of those would work.

Signed-off-by: Keir Fraser <keir@xensource.com>
2006-11-21 19:22:25 +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
kfraser@localhost.localdomain de6e26cec4 [HVMLOADEr] Reserve MMIO 0xa0000 to 0xc0000 in ACPI dsdt.
Avoids possible vga driver loading problem in HVM Windows guest.
Also fixes a Makefile bug in hvmloader directory.

Signed-off-by: Qing He <qing.he@intel.com>
2006-11-17 10:02:54 +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
kaf24@localhost.localdomain 6bc01e4efd [XEN] Replace hvm_setup_platform() with hvm_domain_initialise()
and extra code in hvm_vcpu_initialise(). Remove 'apic' config
option -- HVM CPUs will always have an APIC (which should be
set up in virtual wire mode for backward compatibility, just as
in a real system).
Signed-off-by: Keir Fraser <keir@xensource.com>
2006-11-05 20:17:40 +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
kfraser@localhost.localdomain f9038804d6 Replace test-gcc-flag with Linux-style cc-option.
Improve on Linux implementation by looking for any output
on stdout/stderr. This indicates badness.

Signed-off-by: Keir Fraser <keir@xensource.com>
2006-10-18 19:14:34 +01:00
kfraser@localhost.localdomain ea847a59dc Clean up linker flag definitions.
1. GNU ld does not understand -m{32,64}. It must be cooked for it by
    the GCC driver program.
 2. Where GNU ld is directly called we must use -melf_{i386,x86_64}.
 3. We cannot avoid calling GNU ld directly in some cases (e.g., when
    specifying GNU-specific linker scripts) as on some host
    architectures the GCC driver is configured to call the host
    linker.
 4. We cannot add -melf_{i386,x86_64} to LDFLAGS as the option is
    not recognised by GCC.

Hence we define new LDFLAGS_DIRECT, to be added to the command line
only when invoking GNU ld directly.

Signed-off-by: Keir Fraser <keir@xensource.com>
2006-10-18 16:56:27 +01:00
kfraser@localhost.localdomain bfebdba8ee [HVMLOADER] Remove an unused variable from an SMBIOS function.
Signed-off-by: Keir Fraser <keir@xensource.com>
2006-10-12 14:14:12 +01:00
kaf24@firebug.cl.cam.ac.uk 592a9a5792 [HVMLOADER] Fix SMBIOS table code. One of the string lengths is incorrectly computed.
Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
2006-10-04 09:32:01 +01:00
kfraser@localhost.localdomain 51568a0cbf [HVMLOADER] Clean up SMBIOS table-length computations.
It's easier and less prone to error not to attempt the
length computation up front.
Signed-off-by: Keir Fraser <keir@xensource.com>
2006-10-02 18:04:56 +01: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 cdd3927215 [HVM] Fix roms.h to depend on acpi data.
Signed-off-by: Xiaowei Yang <xiaowei.yang@intel.com>
2006-08-14 17:57:37 +01:00
kfraser@localhost.localdomain c683914ef9 Add code to generate SMBIOS tables to hvmloader.
Signed-off-by: Andrew D. Ball <aball@us.ibm.com>
2006-08-14 17:37: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 fd714c8ac1 [HVMLOADER] Include xen.h for __HYPERVISOR* constants.
Signed-off-by: Andrew D. BAll <aball@us.ibm.com>
2006-08-14 16:41:20 +01:00
kfraser@localhost.localdomain 84b9298c75 [HVM] Remove unused apic_enabled field from hvm_info_table.
Signed-off-by: Keir Fraser <keir@xensource.com>
2006-08-10 15:45:47 +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
kfraser@localhost.localdomain 8e3af29104 [HVM][SVM] Change the calling convention for SVM VMMCALLs so
that they don't conflict with the hypercall calling convention.
Signed-off-by: Steven Smith <ssmith@xensource.com>
2006-08-01 17:28:19 +01:00
kaf24@firebug.cl.cam.ac.uk f5ea9f8ba8 [HVM][Firmware] Make the creation of MP tables more dynamic
Currently the ROMBIOS includes static MP tables for only four
configurations: 1-way, 2-way, 4-way, and 8-way.

This patch makes the creation of MP tables more dynamic by creating them
from within HVMLOADER based upon the VCPU number provided by the HVM
information table.

Note: Some of the information included used to create the MP tables is
still hard coded and based upon values used in the original ROMBIOS MP
tables.  Data such as the CPU family/model/stepping information should
probably be made to match the information provided to the guest when
executing a CPUID.

Signed-off-by: Travis Betak <travis.betak@amd.com>
2006-06-28 13:59:29 +01:00
kaf24@firebug.cl.cam.ac.uk fa50dd1a8e [HVMLOADER] Revert to uniprocessor MPS table in rombios.
Advertising more CPUs than the guest is allocated hangs boot
of Windows XP (selects wrong HAL). The correct fix here is
to dynamically generate the MPS table (at least the CPU
entries) from hvmloader binary.
Signed-off-by: Keir Fraser <keir@xensource.com>
2006-06-07 09:59:56 +01:00