Commit Graph
100 Commits
Author SHA1 Message Date
kfraser@localhost.localdomain 1b3e78b73d [VMXASSIST] Remove unused variable declarations to avoid compiler warning.
Signed-off-by: Ben Thomas <ben@virtualiron.com>
2006-11-14 10:48:17 +00:00
kaf24@localhost.localdomain b991dfcee5 [VMXASSIST] Support all data segments in mov_to_seg().
This patch lets Plan9 crash at the same location before the original
patch by Stephen Tweedie.

Signed-off-by: Steven Rostedt <srostedt@redhat.com>
2006-11-11 01:16:40 +00:00
kfraser@localhost.localdomain 501330f105 [VMXASSIST] Emulate pop %ds and mov reg->{ds,es}.
Signed-off-by: Keir Fraser <keir@xensource.com>
2006-11-10 17:21:54 +00:00
kfraser@localhost.localdomain 21b5e9be6a [VMXASSIST] Fix mishandling of segment registers on entry into VM86_PROTECTED mode.
The bug occurs when the guest is entering protected mode and reaches
the far jump to set up the 32-bit segment registers for the virtual
VMENTER we're about to perform. vmxassist, in protected_mode(), looks
at the segment registers, which might be 16-bit segments or might be
32-bit segment selectors at this stage (depending on whether the OS
has reloaded them since entering protected mode); and it tries to load
the segments from the GDT.  Unconditionally.  Even if the segment
register still actually contains a real mode 16-bit segment.  Whoops.

vmxassist already has code to detect 16-bit segments that survived
unmodified from a transition into and out of protected mode, and to
save and restore those appropriately.  It does this using
"saved_rm_regs", which get cleared on entry to protected mode, and
then set to the old segment value if we fail to set a given 32-bit
segment correctly.

The fix is to save the 16-bit segments *always*, on entry to protected
mode when %CR0(PE) is first set; and to clear the saved 16-bit segment
and set the 32-bit variant in oldctx whenever a 32-bit segment
descriptor is set during the transition to 32-bit CS.  Then, when we
finally do the VMENTER, we will set up the VMCS from only the 32-bit
segments, clearing the VMCS entries for segments that have not been
assigned valid 32-bit segments yet.

Tested on various RHEL-5 boot.isos, including ones which worked before
and ones which triggered the bug; all now boot correctly.

Signed-off-by: Stephen Tweedie <sct@redhat.com>
2006-11-09 14:00:40 +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 725cc28901 [HVM] Clean up VCPU initialisation in Xen. No longer
parse HVM e820 tables in Xen (add some extra HVM parameters as a
cleaner alternative). Lots of code removal.
Signed-off-by: Keir Fraser <keir@xensource.com>
2006-11-02 15:55:51 +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 fcf4e106d0 [HVM] Move ACPI timer to HV, which is the last platform timer in Qemu.
We found Vista polls ACPI timer very frequently (about 15 times
averagely) when handling timer (RTC @ 64HZ) interrupt routine. Though
the exact reason is known, it should be related to system time
adjustment. When it's in Qemu, the overhead is big. After moving,
Vista's idle overhead decreases dramatically from ~10% to 0.9%.=20

Another benefit is that Vista can only pass Performance rating with
this patch. The root cause is that ACPI timer in Qemu isn't
synchronous with other platform timer in HV, which results in Vista
complains "can't measure TSC frequency".

This patch changes vpit.h to vpt.h, for it not only has pit structure
in it, but other platform timer's structure. Another change is moving
ACPI timer and related address from acpi.h to ioreq.h, which can be shared
by HV and ACPI firmware.

Signed-off-by: Xiaowei Yang <xiaowei.yang@intel.com>
2006-10-25 11:50:54 +01:00
kaf24@firebug.cl.cam.ac.uk 86d55ec10a [VMXASSIST] Some reports that macros do not get picked up by CPP
if they are prefixed with $. Fix by placing macro uses in ().
Signed-off-by: Keir Fraser <keir@xensource.com>
2006-10-19 22:05:07 +01:00
kfraser@localhost.localdomain da161aeaa8 [HVM][VMX] Use CPUID instruction virtualization to workaround VMXAssist 4G limit.
Address space access limit in VMXAssist is 4G, because IA-32 only has
4GB virtual address space which VMXassist can use to map physical
memory. The issue is, win2k3 server with more than 4G memory will put
AP GDT above 4G, so when AP changes its mode from real mode to PAE
paging mode, the long jump instrction it uses need access AP GDT
entries which resides above 4G, but because of this constraint, it can
not access GDT and so fails boot.

Signed-off-by: Xin Li <xin.b.li@intel.com>
2006-10-19 15:49:16 +01: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 6311dc03da Clean up duplication of 'install' macros in the Makefiles.
Signed-off-by: John Levon <john.levon@sun.com>
2006-10-17 15:57:05 +01:00
kfraser@localhost.localdomain 0491bf8d2c Include resources for PV xen-platform device in ACPI DSDT.
From: Qing He <qing.he@intel.com>
Signed-off-by: Keir Fraser <keir@xensource.com>
2006-10-12 14:14:58 +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@firebug.cl.cam.ac.uk 137a9ce8c7 [HVM] Add RDMSR/WRMSR instruction emulation to VMXAssist decoder
AP of PAE SMP windows will use it to set NX bit in EFER.

Signed-off-by: Xin Li <xin.b.li@intel.com>
2006-09-30 11:11:54 +01:00
kfraser@localhost.localdomain b7b0acf60f [VMXASSIST] Fix data32/addr32 instruction decode issue.
Signed-off-by: Yunhong Jiang <yunhong.jiang@intel.com>
2006-09-29 11:11:49 +01:00
kfraser@localhost.localdomain 4ac7a6de2f [VMXASSIST] Cast to pointer type via long to avoid compile
warnings/errors with latest gcc versions.
Signed-off-by: Keir Fraser <keir@xensource.com>
2006-09-27 17:49:22 +01:00
kaf24@firebug.cl.cam.ac.uk 2d5c2b773d [VMXASSIST] Small fix to virt-to-phys translation.
CR4.PSE is ignored in PAE mode, so remove test of it.
Signed-off-by: Keir Fraser <keir@xensource.com>
2006-09-26 08:36:39 +01:00
kfraser@localhost.localdomain 681ed1d454 [VMXASSIST] Fix virt-to-phys translation routine.
Signed-off-by: Keir Fraser <keir@xensource.com>
2006-09-25 18:19:30 +01:00
Steven Hand f0cb8942c4 Fix vmxassist to boot Vista.
Currently, guest_linear_to_real to_real() in vmxassist assumes guest HVM
use 2 level page table when entering protect mode with PG enabled. Vista
uses 3 level (PAE enabled) page table, so memory addressing is wrong.
This patch fixes it, by considering all 4 possible cases.

Signed-off-by: Xiaowei Yang <xiaowei.yang@intel.com>
2006-09-22 12:14:22 +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 e954b70928 [HVM] Fixes to the ACPI table definition.
1) Fixed HCT test "Unreported Memory and I/O Port test" for memory
   range 0xC0000~0xFFFFF and IO 0x378
2) Make consistent with non-acpi OS by enabling LPT1, remove com2
   which conflicts with usb mouse
3) Fixed the USB HID-Compliant mouse when set
   usbdevice='tablet'/'mouse'
4) Fixed Vista boot by removing old NIC "resourceConsumer"

Signed-off-by: Winston Wang <winston.l.wang@intel.com>
2006-08-24 17:24:54 +01:00
kaf24@localhost.localdomain cd93eaf1c7 [HVM] Fix SMBIOS entry point copy destination.
Spotted by Xiaowei Yang <xiaowei.yang@intel.com>
Signed-off-by: Keir Fraser <keir@xensource.com>
2006-08-19 12:06:36 +01:00
kfraser@localhost.localdomain c724d70275 [HVM] Fix the APM BIOS to ensure that interrupts are enabled when it
executes an idling HLT. This allow us to re-enable the 'shutdown on
HLT-with-interrupts-disabled' heuristic.

Signed-off-by: Keir Fraser <keir@xensource.com>
2006-08-18 16:20:45 +01:00
kfraser@localhost.localdomain 01c74dcb72 [VMX] Fix vmxassist for booting Vista.
This patch fixes 2 vmxassist bugs to boot Vista:
1) When switching from VM86_REAL_TO_PROTECTED to VM86_PROTECTED,
protected_mode() sets return eip to switch_to_protected_mode and
segments to vmxassist's. But in later set_mode(), it still consides
these segments are guest's (Bios at this time) and use its gdt table
to calculate address(), which results in segment limitation fault. 2) In
current vmxassist, when entering VM86_PROTECTED_TO_REAL, we need to
decode every instruction manually until we catch instructions like
jmpl to reset cs to really return to real mode. Vista boot manager uses
more instructions.

Signed-off-by: Xiaowei Yang <xiaowei.yang@intel.com>
2006-08-15 10:45:05 +01:00
kfraser@localhost.localdomain 386f9501d5 [VMX] Fix VMX ap boot.
Signed-off-by: Xin Li <xin.b.li@intel.com>
2006-08-15 10:43:43 +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 7af667dcc6 [VMXASSIST] Fix linker script to define start/end section labels
in the usual idiomatic way. This avoids some BSS symbols being
defined oustide of range _sbss/_ebss.

Issue raised by Xiaowei Yang from Intel.

Signed-off-by: Keir Fraser <keir@xensource.com>
2006-08-14 17:56:59 +01:00
kfraser@localhost.localdomain 8919329ca7 Pick up SMBIOS entry point in the ROMBIOS.
Signed-off-by: Andrew D. Ball <aball@us.ibm.com>
2006-08-14 17:38:23 +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
kaf24@localhost.localdomain 848ded1e09 [XEN] Clean up e820 definitions. Define shared set in hvm public dir.
Signed-off-by: Keir Fraser <keir@xensource.com>
2006-08-13 17:47:59 +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
chris@kneesaa.uk.xensource.com c6d786bfd0 [qemu] Move acpi to devfn 2, so that it matches the fadt.
Based on feedback from: Wang, Winston L <winston.l.wang@intel.com>
Signed-off-by: Christian Limpach <Christian.Limpach@xensource.com>
2006-08-09 21:33:59 +01:00
kaf24@firebug.cl.cam.ac.uk 74d7945b4d [HVMLOADER] Only install hvmloader if it is built.
This reverts a broken change in changeset 10948 that broke
the ia64 build.
Signed-off-by: Al Stone <ahs3@fc.hp.com>
2006-08-08 09:51:08 +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
chris@kneesaa.uk.xensource.com a5da231f56 [hvm firmware] Update hvm acpi dsdt table.
1)Code style clean up
2)Mininor fix for pci bus 0, dev 4 apic IRQ number
3)Add support for HCT "unreported IO and Memory" test by reporting low
640 MB mem as motherboard resource

Signed-off-by: Winston Wang <winston.l.wang@intel.com>
2006-08-04 11:03:17 +01:00
kfraser@localhost.localdomain f0667416be [VMXASSIST] Fix GDTR accesses when paging mode enabled.
The gdtr information in oldctx is an address for guest, not for
vmxassist. When access descriptor on guest gdt, we need to go through
guest page table if guest enable paging. This error may happen if
guest enable PE/PG in one instruction.

Signed-off-by: Yunhong Jiang <yunhong.jiang@intel.com>=20
Signed-off-by: Xin Li <xin.b.li@intel.com>
2006-08-02 10:03:04 +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
chris@kneesaa.uk.xensource.com 1aa6701ce1 [VMXASSIST] Include all rodata sections into text section.
Some versions of ld put non-matched sections into random locations otherwise.

Signed-off-by: Christian Limpach <Christian.Limpach@xensource.com>
2006-07-10 18:35:07 +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 801d469ad8 [HVM] ACPI support patch 3 of 4: ACPI _PRT table.
Adds ACPI _PRT table for PCI IRQ routing table in PIC mode
and fixes the _PRT table in APIC mode

Signed-off-by: Tang Liang <tangliang@lenovo.com>
Signed-off-by: Winston Wang <winston.l.wang@intel.com>
2006-06-17 09:06:46 +01:00
kaf24@firebug.cl.cam.ac.uk f4cdf1dbe8 [HVM] ACPI support patch 1 of 4: main components.
The patch support ACPI UP Guest Windows 2000,  XP and 2003, based on
this we are going to add more support on SMP and 64bit Windows( which
are only working in ACPI mode) later. We tested: in ia32 guest:

  a. Installation and boot of  Windows XP sp2 and 2003 server in ACPI
mode
  b  when boot to both window, no yellow mark in device manger and  USB,
network card and IDE DMA are working.
  c. clean boot (without ACPI related errors) on UP and  4 vcpu rhel4u1
SMP guest and got ioapic Interrupt assigned according to ACPI DSDT
table's _PRT table's GSI.
  
To minimize the implementation efforts to satisfy the ACPI OS
installation and boot, we implemented  ACPI only event logical model by
emulating ACPI hardware based on PIIX4 (Intel 82371ab) by:  Populating
the PIIX4  ACPI bridge PCI configuration space; Adding ACPI timer
(required during windows installation/boot), PM1 event register block
and PM1 control register block (both are required during
installation/boot, shutdown, entering and leaving PM S state if adding
those features later), we provided full ACPI hardware registers above
using byte/word/dword access per ACPI spec requirement.

The patch also fixed many existing hvm ACPI related bugs, such as
warnings when boot to ACPI  UP and SMP guest Linux OS; adding new ACPI
_PRT table reporting PCI IRQ routing table in PIC mode,  adding new _PRT
table in APIC mode, that fixed no IRQ GSI cause it is forced to shutdown
when OS find new device to assign IRQ without ACPI event service; The
patch also fixed the ACPI DSDT table's  PCI resource conflict with guest
e820 table when booting and installing ACPI Windows; we also added ACPI
shutdown service by incorporating the code in ACPI "hardware enable
register writer" from  Ben's Virtual Iron's team's patch in changeset
9989:f8d20c3e4225.

We only provide minimum power management requirement support per spec-c1
and S5 for shutdown, may be S4 (hibernating which is meaningful for user
to save their working section)  in the future.

Please note, current patch needs to  have following switches in guest
configuration to enable proper ACPI support
  a. need to add ACPI=1 (apic=1 if boot SMP Linux guest plus vcpu=
number want to test) in xmexample.hvm
  b. need to add USB support: USB=1 and usbdevice='device' (or
='tablet') as the pm register base is static..., I will adding dynamic
ACPI FADT table for pm register base pointer later.

When installing guest OS in ACPI mode, need to manually tell Windows
setup program to install single core ACPI HAL:
   After passing the 1st screen of windows setup of install Windows,
   the first thing you'll see at the bottom of the screen is the
   option to press F6 if you need to install a SCSI or RAID
   controller. Don't press F6. Press F5 instead. This will take
   you to a separate menu of Hardware Abstraction Layer's where
   you can choose an appropriate HAL .The choices will be:
  
   ACPI Multiprocessor PC
   ACPI Uniprocessor PC
   Advanced Configuration and Power Interface (ACPI) PC
   ...
   Standard PC
   Standard PC with C-Step i486
  
Please select "Advanced Configuration and Power Interface (ACPI) PC"
using current patch.

Signed-off-by: Winston Wang <winston.l.wang@intel.com>
2006-06-17 09:00:16 +01:00
kaf24@firebug.cl.cam.ac.uk 104f354554 [HVM][DM] Cleaner way of clearing VGA memory on mode changes (thanks to
Fabrice Bellard on the QEMU project). This patch clears the
memory in the BIOS call rather than when the Cirrus Logic register changes,
which more closely matches what happens on the real hardware.

Signed-off-by: Don Dugger <donald.d.dugger@intel.com>
2006-06-07 14:13:22 +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