Commit Graph
16985 Commits
Author SHA1 Message Date
Keir Fraser 563f5ebfcc minios: Support net/block backend in domU
Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com>
2008-02-07 09:15:59 +00:00
Keir Fraser 399874b1de hvmloader: Remove dead function check_amd().
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2008-02-06 18:31:02 +00:00
Keir Fraser 50b12df836 x86 vmx: Remove vmxassist.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2008-02-06 12:07:55 +00:00
Keir Fraser 2d700e03ef Revert 16973:b5427f2d83c3, which breaks automated testing (HVM qemu-dm
will not die when it is told to).
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2008-02-05 23:27:12 +00:00
Keir Fraser bf3e94d5f6 x86_emulate: fix side-effect macro call.
Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com>
2008-02-05 15:50:59 +00:00
Keir Fraser 1118c5715f vmx realmode: Emulate protected-mode transition while CS and SS have
bad selector values (bottom two bits non-zero).

Allows opensuse 10.3 install CD to boot. Unfortunately SUSE Linux 10.1
install CD still fails to work...

Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2008-02-05 15:45:10 +00:00
Keir Fraser ae9093a33f xend: Scrub vnc password for vfb from xend.log.
Signed-off-by: Masaki Kanno <kanno.masaki@jp.fujitsu.com>
2008-02-05 10:40:10 +00:00
Keir Fraser 3ad6af357a xend: Restore values of /vm/uuid/xend/* to recreated domains.
When guest domains are restarted, previous values of /vm/uuid/xend/*
in xenstore are lost.  (e.g. previous_restart_time,
last_shutdown_reason). This patch restores them to restarting domains.
And we should update /vm/uuid/xend/restart_count of restarting
domains, not previous domains.

Signed-off-by: Masaki Kanno <kanno.masaki@jp.fujitsu.com>
2008-02-05 10:39:35 +00:00
Keir Fraser 054ccca730 x86_emulate: Fix SAHF emulation.
Signed-off-by: Xiaohui Xin <xiaohui.xin@intel.com>
Signed-off-by: Kevin Tian <kevin.tian@intel.com>
2008-02-05 10:29:19 +00:00
Keir Fraser 08286e1a3c x86: adjust reserved bit page fault handling
Signed-off-by: Jan Beulich <jbeulich@novell.com>
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2008-02-04 13:57:01 +00:00
Keir Fraser 47cffd5fe1 x86 shadow: Cleanup for early-unshadow code.
The unhooking of toplevel shadow entries has been removed; the rest of
the early-unshadow code needs to reflect that.

Signed-off-by: Tim Deegan <Tim.Deegan@citrix.com>
2008-02-04 13:51:17 +00:00
Keir Fraser 264f5caa68 ioemu: use SIGHUP instead of SIGKILL
The stub domain device model needs to trap the termination signal so
as to actually destroy the stub domain.  SIGKILL can't be trapped,
SIGTERM is caught by SDL and so may be unnoticed.  SIGHUP can be
trapped and is not caught by SDL (and by default causes a process
termination without core).

Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com>
2008-02-04 13:44:29 +00:00
Keir Fraser b490b3db06 Revert 16947:32b898768217027. Breaks HVM qcow-backed discs.
Sigend-off-by: Keir Fraser <keir.fraser@citrix.com>
2008-02-04 13:42:53 +00:00
Keir Fraser 5f013ef0b2 hvm: FPU management cleanups.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2008-02-03 10:22:08 +00:00
Keir Fraser b2e1b25f9c vmx realmode: HOST_CR0.TS must be cleared when restoring guest FPU
state, otherwise in-Xen CR0.TS value becomes set again on next
vmexit. Then we crash the next time we try to emulate an FPU
instruction.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2008-02-03 09:30:59 +00:00
Keir Fraser 7eec742d38 Revert 16963:d29d74d4eeac and 16750:2ac0fd9fd4b4.
Continue to SIGKILL qemu-dm so that 'xm destroy' should always work
rather than hang if qemu-dm is in a bad state.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2008-02-03 09:09:21 +00:00
Keir Fraser e1781903c7 Fix hvmloader makefile dependencies, and do not recurse into
tools/firmware/etherboot by default (the dependency of eb_roms.h on
Config does not seem to always prevent the build from going ahead, for
some reason).
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2008-02-02 13:40:43 +00:00
Keir Fraser abae89340b etherboot: Supply pre-built option ROMs to avoid needing to build
Etherboot from scratch in most situations.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2008-02-02 11:24:20 +00:00
Keir Fraser e9e114d5f4 Fix to Xen NAT network scripts for Debian.
Xen recently (changeset 16873:86c32269ba60) started looking for a
DHCP defaults file in /etc/sysconfig/dhcpd or /etc/defaults/dhcp.
Debian (lenny) puts this file in a different place though:
/etc/default/dhcp3-server.  I added this location to Xen's search
path.

From: Michael Abd-El-Malek <mabdelmalek@cmu.edu>
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2008-02-02 10:55:25 +00:00
Keir Fraser 48a61dfcea xend: Fix grow of the LEGACY_UNSUPPORTED_BY_XENAPI_CFG list each time
we instantiate a new XendConfig.
Signed-off-by: Pascal Bouchareine <pascal@gandi.net>
2008-02-02 10:53:24 +00:00
Keir Fraser 912c5a1f61 Fix save/restore failure cleanup
The save failure cleanup introduced in 13543:207523704fb1 is
incorrect: if we didn't get as far as actually suspending the domain,
then the guest domain will not be expecting the devices to be removed
(seen on both Linux and Solaris, which don't expect a 'Closing' state
when they hold the device open). Only re-jig devices if we definitely
shut the domain down.

Signed-off-by: John Levon <john.levon@sun.com>
2008-02-02 10:51:54 +00:00
Keir Fraser ef532054c0 hvm: Fix 'xm save' bug in qhich qemu-dm ignores SIGTERM.
When saving a guest in early ChangeSet (Before 16750), Xend will
send "SIGKILL" signal to kill qemu process. But in ChangeSet 16750,
the signal is modified to "SIGTERM". However, "SIGTERM" handler has
been registered by SDL in qemu. So when qemu process receives a
"SIGTERM", SDL will catch it and it will push out a "SDL_QUIT" even to
qemu. If qemu can receive that event, it will be successfully
terminated. While we do "xm save", qemu can't go out from the dead
loop "while (suspend_requested) {...}" in main_loop() to handle the
SQL_QUIT event. So it is unable to poll that "SDL_QUIT" event. This
makes xm save command hang. This fix enables qemu to poll the
"SDL_QUIT" event while doing save.

Signed-off-by: Xu Dongxiao <dongxiao.xu@intel.com>
2008-02-01 12:01:34 +00:00
Keir Fraser 9ea5303120 x86 shadow: Fix cross-page write emulation failure.
Signed-off-by: Disheng Su <disheng.su@intel.com>
2008-02-01 11:21:27 +00:00
Keir Fraser 6cc641c89f Direct Linux boot: XenD changes for HVM direct Linux boot.
This patch provides the tools support for direct kernel boot of
HVM guests. Currently the config files in /etc/xen support the
args  'kernel', 'ramdisk' and 'extra'. For PV guests these have
the obvious meaning.

Unfortunately HVM guest configs hijacked the 'kernel' parameter
and use it to refer to the path of the HVM firmware. So, this
patch adds a new config file parameter called 'loader' which is
used to refer to the HVM firmware instead.

The conventions for loading the initrd image say that it should
live at the end of memory. This requires QEMU to know the size
of the guest's initial RAM allocation, so image.py is changed
to pass the '-m' flag to QEMU.

The HVMImageHandler class in image.py is changed so that if the
'kernel', 'ramdisk' or 'extra' params were given in the config
these are passed to QEMU with the '-kernel', '-initrd' and
'-append' flags respectively.

Finally, the 'loader' param is used as the arg to 'xc_hvm_build'
instead of the old 'kernel' param.

For the sake of compatability with old HVM guest config files,
if the config file has a 'kernel' param whose path matches that
of the HVM firmware, then we automatically convert this 'kernel'
param into the 'loader' param. This ensures existing HVM guests
work without changes required.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
2008-02-01 11:18:15 +00:00
Keir Fraser 042397126c Direct Linux boot: Support booting non-relocatable Linux kernels.
This patch introduces a hack to make non-relocatable kernels
bootable too. Non-relocatable kernels absolutely want to run
at 0x100000 and are not at all happy about being at 0x200000.
Fortunately, thanks to crazy programs like LOADLIN, Linux has
a couple of hooks in its boot process which can be used to
play games. The 'code32_switch' hook is executed immediately
following the switch to protected mode.

So, this patch installs a hook at 0x200000+kernel_size. The hook
is hand crafted assembly which sets up all the segments as needed,
then essentially does memmove(0x100000,0x200000,kernel_size) and
finally does an unconditional jmp to 0x100000.

Amazingly this actually really does work. It has been successfully
tested with RHEL-2.1 and Fedora Core 6 install kernels on i386, and
Fedora Core 6 and 7 kernels on x86_64.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
2008-02-01 11:16:37 +00:00
Keir Fraser bd03fbb90e Direct Linux boot: Support booting relocatable Linux kernels.
This patch introduces the basic infrastructure for direct kernel
boot in the ioemu copy of QEMU. The current #ifdef disabled
code is actually obsolete wrt to upstream QEMU code. So this
is removed entirely. In its place I have imported the latest
upstream QEMU code. The QEMU code assumes that the guest RAM
is directly mapped into the QEMU process, so there were some
changes neccessary. Instead of strcpy/memcpy'ing the args
and kernel header into guest RAM, cpu_physical_memory_rw is
used. Intead of fread() the initrd and kernel into guest RAM
a helper function is used fread2guest which reads into a small
buffer and then uses cpu_physical_memory_rw.

NB in reading the following, Documentation/i386/boot.txt is
a useful reference for what's going on.

Next, instead of loading the kernel at 0x100000, this code
loads it at 0x200000. This is far enough away that there's
no risk of it overlapping with the HVM firmware image. If the
Linux kernel boot protocol is 0x205 or later, and the flag
at offset 0x234 in the kernel header is 1, then the guest
kernel was built with CONFIG_RELOCATABLE=y.

In this scenario we merely need to tell the kernel what address
it has been relocated to by writing 0x200000 into the kernel
header at offset 0x214. When switching from real mode into
protected mode the kernel will immediately start executing at
0x200000 and be happy with life. This should work for 2.6.20 or
later on i386, and 2.6.22 or later on x86_64.

This has been verified with Fedora 7 and Fedora 8 bare metal kernels
on i386 and x86_64 from the $TREE/images/pxeboot of the install trees.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
2008-02-01 11:14:53 +00:00
Keir Fraser 2c16ce588c hvm: Etherboot for E100 NIC
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
Signed-off-by: Yosuke Iwamatsu <y-iwamatsu@ab.jp.nec.com>
2008-01-31 16:23:35 +00:00
Keir Fraser 90aa975562 Remove unused find-gcc-3 script.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2008-01-31 14:14:23 +00:00
Keir Fraser 77d293d885 etherboot: Fix the build.
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
2008-01-31 14:01:59 +00:00
Keir Fraser 717a8c8a0a vmx realmode: Exception delivery clears interrupt shadow.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2008-01-31 13:01:08 +00:00
Keir Fraser 291871e04c Fix x86/64 Xen build.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2008-01-31 11:05:14 +00:00
Keir Fraser d113c0a940 Fix xm shutdown/reboot for HVM domain of IA64
xc.domain_destroy_hook() is called twice when we execute
xm shutdown/reboot command to an HVM domain without PV drivers.
The first calling is from shutdown() in XendDomainInfo.py.
The second calling is from destroyDomain() in XendDomainInfo.py.
The first calling is not necessary, so this patch removes it.

A discussion about this patch is as follows.
 http://lists.xensource.com/archives/html/xen-ia64-devel/2008-01/msg00232.html

Signed-off-by: Masaki Kanno <kanno.masaki@jp.fujitsu.com>
2008-01-31 09:43:05 +00:00
Keir Fraser 8013b9017d Small fix for VMX Core2 perfctr access.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2008-01-31 09:41:32 +00:00
Keir Fraser aba29a98bc libxc: Fix the third argument of bitmap_64_to_byte in xc_tbuf_set_cpu_mask
Signed-off-by: Eric Liu <eric.e.liu@intel.com>
2008-01-31 09:39:44 +00:00
Keir Fraser 4c4ca29ff9 build: Make PREFIX work by fixing LIBDIR
In the current tree, setting PREFIX does not work very well.  This is
because of confusion about the meaning of LIBDIR.  In some places it
is the pathname tail of directories containing libraries (lib, lib64
or lib/amd64).  But in other places it is a destination pathname
(implicitly, including any PREFIX).  This can result in PREFIX or /usr
being added the wrong number of times.

This patch splits LIBDIR into two variables, LIBLEAFDIR and
LIBDIR.  LIBDIR is the directory into which Xen libraries and other
similar code is to be placed, and includes any PREFIX.  LIBLEAFDIR is
just the library tail and can be appended to various different
prefixes; for example, to construct the X11 library directory for -L.

Neither variable contains the value of DESTDIR, which is of course
used only to redirect the results of `make install' when desired.

Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
2008-01-31 09:38:34 +00:00
Keir Fraser 2179dc47cf vmx realmode: Emulate MSR accesses.
Signed-off-by: Nitin A Kamble <nitin.a.kamble@intel.com>
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2008-01-31 09:33:26 +00:00
Keir Fraser d66e065f7f Add DTrace support to xenstored
Add USDT probes for significant xenstore operations to allow dynamic
tracing.

Signed-off-by: John Levon <john.levon@sun.com>
2008-01-31 09:13:27 +00:00
Keir Fraser 87fdf3231c ioemu: Stop PV guest from parsing xenstore and opening block devices.
PV guests are now using QEMU for a vncserver.  During initialization
of QEMU xenstore_parse_config() is being called causing PV guests to
open block devices.  This patch makes a new function,
xenstore_daemon_open(), so that the vnc password functions have an
open xenstore handle and moves xenstore_parse_config() into the FV
machine specific init function.

Signed-off-by:  Pat Campbell <plc@novell.com>
2008-01-31 09:11:21 +00:00
Ian Jackson 2d06b3f0df Build etherboot ROM from source.
We now include the source for Etherboot (5.4.2, obtained from git)
rather than a pre-built ROM.  This gives better traceability and GPL
licence compliance.  See tools/firmware/etherboot/README for details.

Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
2008-01-30 18:39:04 +00:00
Keir Fraser 26f9a3f7f5 ioemu: Fix xenstore access changes.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2008-01-30 15:19:22 +00:00
Keir Fraser 9239f4852e ioemu: strip tap subtype prefix from image name
Currently I am not able to mount or boot from an HVM CDROM when it is
configured for 'tap:aio' instead of 'file'.

disk=[ 'tap:aio:/var/lib/xen/images/sles10-sp2-fv/disk0,hda,w', '
       tap:aio:/home/iso/sles/SLES10.iso,hdc:cdrom,r', ]

With this patch I am able to boot from the CDROM and or mount it.

Patch changes xenstore.c:xenstore_process_event() to strip the tap
subtype prefix from the image name.

Signed-off-by: Pat Campbell <plc@novell.com>
2008-01-30 14:25:55 +00:00
Keir Fraser 5fcfe68304 xend: fix external-device-migrate step 0
Add domain name to a migrateDevice call, so the helper script
(external-device-migrate example) does not fail at step 0
(MIGRATION_TEST).

Signed-off-by: Pascal Bouchareine <pascal@gandi.net>
2008-01-30 14:24:20 +00:00
Keir Fraser 17cbb242dc acm, xend: Fix resetting policy.
Fix a problem when resetting the policy and the label of Domain-0
needs to be renamed.

Signed-off-by: Stefan Berger <stefanb@us.ibm.com>
2008-01-30 14:23:17 +00:00
Keir Fraser 458960ebe9 vmx: Clean up after Core2 perf-monitoring patch.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2008-01-30 11:17:14 +00:00
Keir Fraser 03406ca94c vmx: Enable Core 2 Duo Performance Counters in HVM guest
Signed-off-by: Haitao Shan <haitao.shan@intel.com>
2008-01-30 09:59:27 +00:00
Keir Fraser a1d430b309 xend: Small fix for hvm/hap flags.
Signed-off-by: Yosuke Iwamatsu <y-iwamatsu@ab.jp.nec.com>
2008-01-30 09:38:10 +00:00
Keir Fraser fe1725b641 ioemu: use standard uint8_t instead of uint8 in new e100 s/r code
Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com>
2008-01-30 09:37:06 +00:00
Keir Fraser 0f63bb058b xend: Perform uuid/name uniqueness check on restore.
From: Zhigang Wang <zhigang.x.wang@oracle.com>
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2008-01-30 09:35:49 +00:00
Keir Fraser 0ccfc15fae ioemu: Better fix for SB16 infinite looping.
Qemu upstream solves "Fix an infinite loop in the emulated SB16
device" issue differently as stated in [2]

[1] http://xenbits.xensource.com/xen-3.1-testing.hg?rev/4b22d472bda6
[2] http://lists.gnu.org/archive/html/qemu-devel/2008-01/msg00709.html

Signed-off-by: S. Caglar Onur <caglar@pardus.org.tr>
2008-01-30 09:33:26 +00:00
Keir Fraser 4607daebbb vtpm: Small makefile fix.
Signed-off-by: Jason Andryuk <the_deuce@yahoo.com>
2008-01-30 09:31:35 +00:00