xen.git
16 years agoActually set a HVM domain's time offset when it sets the RTC
Keir Fraser [Wed, 18 Mar 2009 13:24:42 +0000 (13:24 +0000)]
Actually set a HVM domain's time offset when it sets the RTC

Signed-off-by: Tim Deegan <Tim.Deegan@citrix.com>
16 years agofs-backend.c misses the unistd.h include for read() and write().
Keir Fraser [Wed, 18 Mar 2009 11:51:30 +0000 (11:51 +0000)]
fs-backend.c misses the unistd.h include for read() and write().

Signed-off-by: Stefan Berger <stefanb@us.ibm.com>
16 years agox86: Change the mod_lx_entry to accept the vcpu parameter
Keir Fraser [Wed, 18 Mar 2009 11:50:16 +0000 (11:50 +0000)]
x86: Change the mod_lx_entry to accept the vcpu parameter

Signed-off-by: Jiang, Yunhong <yunhong.jiang@intel.com>
16 years agoMove the suspend event channel function to libxc, it will use the
Keir Fraser [Wed, 18 Mar 2009 11:49:26 +0000 (11:49 +0000)]
Move the suspend event channel function to libxc, it will use the
/var/lib/xen/suspend_evtchn_lock.d to protect the access.

Signed-off-by: Jiang Yunhong <yunhong.jiang@intel.com>
16 years agoxc_save: remove the dependency on the global si structure
Keir Fraser [Wed, 18 Mar 2009 11:48:48 +0000 (11:48 +0000)]
xc_save: remove the dependency on the global si structure

Signed-off-by: Jiang Yunhong <yunhong.jiang@intel.com>
16 years agovtd: Only enable some VT-d features if all VT-d engines support them.
Keir Fraser [Wed, 18 Mar 2009 11:46:32 +0000 (11:46 +0000)]
vtd: Only enable some VT-d features if all VT-d engines support them.

By default, we enable snoop control, queued invalidation and interrupt
remapping if all VT-d engines support them, and for DMA passthrough we
don't enable it by default.

A user can use 'iommu=passthrough' to enable DMA passthrough (only
for Dom0). A user can use 'iommu=no-snoop,no-qinval,no-intremap' to
disable the 3 features.

Signed-off-by: Dexuan Cui <dexuan.cui@intel.com>=
16 years agoDisable xen platform PCI device when xen_platform_pci=0 is specified
Keir Fraser [Wed, 18 Mar 2009 11:37:59 +0000 (11:37 +0000)]
Disable xen platform PCI device when xen_platform_pci=0 is specified

 - Change guest firmware to use new fixed byte port 0x10.
 - Add "xen_platform_pci" option into guest config file and APIs.
    xen_platform_pci=0: Disable xen platform device.
    xen_platform_pci=1: Enable xen platform device. (default)
 - Add "disable_pf" entry into xenstore.

Signed-off-by: Yuji Shimada <shimada-yxb@necst.nec.co.jp>
16 years agoxend: Fix vscsi assignment when XenAPI is available
Keir Fraser [Wed, 18 Mar 2009 11:34:20 +0000 (11:34 +0000)]
xend: Fix vscsi assignment when XenAPI is available

When XenAPI is available, xm scsi-attach fails.  Also xm new and
xm create fail if a vscsi parameter is defined into domain
configuration files.

Signed-off-by: Masaki Kanno <kanno.masaki@jp.fujitsu.com>
16 years agoxend: Use vnc-listen setting specified in xend config file
Keir Fraser [Wed, 18 Mar 2009 11:32:46 +0000 (11:32 +0000)]
xend: Use vnc-listen setting specified in xend config file

If domU frame buffer configuration has no vnclisten attribute set, use
the global vnc-listen address specified in xend configuration file
when updating vfb location.  Currently the hardcoded value 'localhost'
is used.

Signed-off-by: Jim Fehlig <jfehlig@novell.com>
16 years agox86: Assert non-zero refcount on entry to put_page().
Keir Fraser [Tue, 17 Mar 2009 15:40:25 +0000 (15:40 +0000)]
x86: Assert non-zero refcount on entry to put_page().
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
16 years agoRevert debugging patch c/s 19344.
Keir Fraser [Tue, 17 Mar 2009 15:29:57 +0000 (15:29 +0000)]
Revert debugging patch c/s 19344.

Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
16 years agox86: Fix get_page() to not drop reference count if it wasn't incremented.
Keir Fraser [Tue, 17 Mar 2009 15:29:20 +0000 (15:29 +0000)]
x86: Fix get_page() to not drop reference count if it wasn't incremented.

Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
16 years agox86 mcheck: Fix the build.
Keir Fraser [Tue, 17 Mar 2009 14:32:52 +0000 (14:32 +0000)]
x86 mcheck: Fix the build.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
16 years agox86 shadow: Fix 2-on-3 mode.
Keir Fraser [Tue, 17 Mar 2009 14:30:15 +0000 (14:30 +0000)]
x86 shadow: Fix 2-on-3 mode.

Signed-off-by: Gianluca Guida <Gianluca.Guida@eu.citrix.com>
16 years agox86 shadow: Prevent in-sync L1s to become writable
Keir Fraser [Tue, 17 Mar 2009 14:29:26 +0000 (14:29 +0000)]
x86 shadow: Prevent in-sync L1s to become writable
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
16 years agofs-back: Fixes and cleanups
Keir Fraser [Tue, 17 Mar 2009 14:28:33 +0000 (14:28 +0000)]
fs-back: Fixes and cleanups

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
16 years agoAdd CPU status info and a status call to the CPU on/offline sysctls.
Keir Fraser [Tue, 17 Mar 2009 14:25:41 +0000 (14:25 +0000)]
Add CPU status info and a status call to the CPU on/offline sysctls.

Signed-off-by: Frank van der Linden <frank.vanderlinden@sun.com>
16 years agox86 mcheck: Provide MCA "injection" hypervisor services.
Keir Fraser [Tue, 17 Mar 2009 14:24:08 +0000 (14:24 +0000)]
x86 mcheck: Provide MCA "injection" hypervisor services.

Signed-off-by: Gavin Maltby <gavin.maltby@sun.com>
16 years agox86 mcheck: Replace hypervisor MCA telemetry structures with something
Keir Fraser [Tue, 17 Mar 2009 14:22:50 +0000 (14:22 +0000)]
x86 mcheck: Replace hypervisor MCA telemetry structures with something
more robust and designed to make terminal error telemetry available to
the dom0 panic flow for diagnosis on reboot.

Use common code for a lot of the AMD and Intel MCE handling code.

Signed-off-by: Gavin Maltby <gavin.maltby@sun.com>
Signed-off-by: Frank van der Linden <frank.vanderlinden@sun.com>
16 years agoMake stubdom compile on systems with libvde installed
Keir Fraser [Tue, 17 Mar 2009 14:21:18 +0000 (14:21 +0000)]
Make stubdom compile on systems with libvde installed

We need to disable libvde in the stubdom qemu-xen configuration.
Thanks to Jun Koi for the report and testing.

Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
16 years agoFix MAX_EVTCHNS() definition.
Keir Fraser [Tue, 17 Mar 2009 13:21:46 +0000 (13:21 +0000)]
Fix MAX_EVTCHNS() definition.

Pointed out by Jan Beulich.

Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
16 years agox86, cpuidle: disable ARB_DISABLE access for latest intel platforms
Keir Fraser [Tue, 17 Mar 2009 10:50:16 +0000 (10:50 +0000)]
x86, cpuidle: disable ARB_DISABLE access for latest intel platforms

ARB_DISABLE is a nop on all of the recent Intel platforms. Disable
ARB_DISABLE and attached c3_lock on C3 entry exit for such platforms.

Signed-off-by: Venkatesh Pallipadi <venkatesh.pallipadi@intel.com>
Signed-off-by: Wei Gang <gang.wei@intel.com>
16 years agoxend: Add s3_integrity attribute for XenAPI
Keir Fraser [Tue, 17 Mar 2009 10:49:42 +0000 (10:49 +0000)]
xend: Add s3_integrity attribute for XenAPI

When XenAPI is available, xm new and xm create fail.

# xm new vm1
Using config file "/etc/xen/vm1".
Attribute 's3_integrity' not declared
# xm create vm1
Using config file "/etc/xen/vm1".
Attribute 's3_integrity' not declared

This patch adds an s3_integrity into create.dtd.

Signed-off-by: Masaki Kanno <kanno.masaki@jp.fujitsu.com>
16 years agohvmloader: Allow any unused PCI device to be used for PCI hotplug
Keir Fraser [Tue, 17 Mar 2009 10:48:52 +0000 (10:48 +0000)]
hvmloader: Allow any unused PCI device to be used for PCI hotplug

Signed-off-by: Simon Horman <horms@verge.net.au>
16 years agoxend: Use AUTO_PHP_SLOT_STR=0xff rather than 0x0 for auto pci allocation
Keir Fraser [Tue, 17 Mar 2009 10:42:32 +0000 (10:42 +0000)]
xend: Use AUTO_PHP_SLOT_STR=0xff rather than 0x0 for auto pci allocation

Rather than use "0x0" to signify that the hotplug slot should
be automatically selected by qemu-dm, define AUTO_PHP_SLOT_STR.

At the same time, change the magic value form 0x0 to 0xff,
in line with changes made to qemu-dm to allow any unused PCI
device to be used for hotplug.

Signed-off-by: Simon Horman <horms@verge.net.au>
16 years agoxend: Accept udev events and update physical resource information
Keir Fraser [Tue, 17 Mar 2009 10:40:47 +0000 (10:40 +0000)]
xend: Accept udev events and update physical resource information

When a udev event is received, udevevent.py parses the udev data and
tells XendNode.py to update the physical resource information.
This patch also add a boolean parameter 'xend-udev-event-server', to
let users indicate whether we should enable this function or not.

Signed-off-by: Yosuke Iwamatsu <y-iwamatsu@ab.jp.nec.com>
16 years agoAdd udev rules to deliver hw events to xend
Keir Fraser [Tue, 17 Mar 2009 10:38:06 +0000 (10:38 +0000)]
Add udev rules to deliver hw events to xend

Signed-off-by: Yosuke Iwamatsu <y-iwamatsu@ab.jp.nec.com>
16 years agoxend: Add lock for lspci_info in pci.py
Keir Fraser [Tue, 17 Mar 2009 10:37:12 +0000 (10:37 +0000)]
xend: Add lock for lspci_info in pci.py

Add lspci_info_lock to protect lspci_info.

Signed-off-by: Yosuke Iwamatsu <y-iwamatsu@ab.jp.nec.com>
16 years agoxend: Add lock for xen-api class instances in XendAPIStore.py
Keir Fraser [Tue, 17 Mar 2009 10:36:51 +0000 (10:36 +0000)]
xend: Add lock for xen-api class instances in XendAPIStore.py

Add __classes_lock to protect __classes, since it can be modified by
the udev listener thread.

Signed-off-by: Yosuke Iwamatsu <y-iwamatsu@ab.jp.nec.com>
16 years agoxend: Implement DGRAM (connectionless) type socket listeners
Keir Fraser [Tue, 17 Mar 2009 10:36:20 +0000 (10:36 +0000)]
xend: Implement DGRAM (connectionless) type socket listeners

Introduce SocketDgramListener and UnixDgramListener classes.
We already have STREAM (connection) type socket listener classes in
the source tree, but we need DGRAM (connectionless) type listeners to
receive udev events.

Signed-off-by: Yosuke Iwamatsu <y-iwamatsu@ab.jp.nec.com>
16 years agoxenpm: Add CPU topology info (thread/core/socket)
Keir Fraser [Fri, 13 Mar 2009 10:09:25 +0000 (10:09 +0000)]
xenpm: Add CPU topology info (thread/core/socket)

CPU topology info is necessary for power management analysis. For
example, to analysis the effect of Px state coordination, Cx
package/core coordination,  the thread/core/socket topology
information is needed.

This patch add new command "get-cpu-topology" in xenpm to print the
CPU topology info:

Signed-off-by: Yu Ke <ke.yu@intel.com>
16 years ago[SVM] Always read zero AMD C1E control MSR to allow cross-vendor migration
Keir Fraser [Fri, 13 Mar 2009 07:45:11 +0000 (07:45 +0000)]
[SVM] Always read zero AMD C1E control MSR to allow cross-vendor migration

Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
16 years ago[SVM] fix segment descriptors to allow migration to Intel VT systems
Keir Fraser [Fri, 13 Mar 2009 07:43:45 +0000 (07:43 +0000)]
[SVM] fix segment descriptors to allow migration to Intel VT systems

Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
16 years agoxend: Fix xm scsi-attach for host OS without lsscsi
Keir Fraser [Fri, 13 Mar 2009 07:38:47 +0000 (07:38 +0000)]
xend: Fix xm scsi-attach for host OS without lsscsi

In the case of a host OS without lsscsi command, xm scsi-attach
command fails even if you specify existing SCSI device.

Signed-off-by: Masaki Kanno <kanno.masaki@jp.fujitsu.com>
16 years agoxend: Fix domain core-dumping about reset option
Keir Fraser [Fri, 13 Mar 2009 07:38:05 +0000 (07:38 +0000)]
xend: Fix domain core-dumping about reset option

This patch moves a call processing of a domain reset processing
from xm to xend.  Also, it adds a reset argument to do_dump() of
SrvDomain.py.

Signed-off-by: Masaki Kanno <kanno.masaki@jp.fujitsu.com>
16 years agominios: allow to allocate machine contiguous pages
Keir Fraser [Fri, 13 Mar 2009 07:37:24 +0000 (07:37 +0000)]
minios: allow to allocate machine contiguous pages

This is a port of XenLinux xen_alloc_contig_memory() to mini-os. A
sufficiently privileged mini-os guest can exchange a small number of
its pages with machine contiguous pages.

Signed-off-by: Rolf Neugebauer <rolf.neugebauer@netronome.com>
16 years agoblktap: Move error signaling to blktapctrl
Keir Fraser [Thu, 12 Mar 2009 18:48:09 +0000 (18:48 +0000)]
blktap: Move error signaling to blktapctrl

Until now the udev script for blktap devices needs to decide if to
signal success or failure to xend. As this script runs completely
independent of blktapctrl and tapdisk/ioemu which do the real work,
the udev script can't even theoretically know if tapdisk is happy.

This patch removes the udev script and replaces its checks by new
ones in libblktap.

Signed-off-by: Kevin Wolf <kwolf@suse.de>
16 years agoblktapctrl: Fix too early close of pipes
Keir Fraser [Thu, 12 Mar 2009 18:46:26 +0000 (18:46 +0000)]
blktapctrl: Fix too early close of pipes

Connections to ioemu have single_handler set, so they are closed as
soon as all images of a certain type are closed. This is wrong with
ioemu: All images that belong to the same domain are handled by the
same backend process (usually qemu-dm, but also tapdisk-ioemu for
domains without device model), regardless of the image type.

This patch checks for the same-domain condition for ioemu connections.

Signed-off-by: Kevin Wolf <kwolf@suse.de>
16 years agoblktap: Export disk type constants for ioemu
Keir Fraser [Thu, 12 Mar 2009 18:42:59 +0000 (18:42 +0000)]
blktap: Export disk type constants for ioemu

Currently all disk types that are supported are defined in a header
file private to blktapctrl and tapdisk. When restoring ioemu as a
backend for blktap these constants are needed by ioemu, so move them
to a more public header file.

Signed-off-by: Kevin Wolf <kwolf@suse.de>
16 years agoblktapctrl: Select backend by prefix
Keir Fraser [Thu, 12 Mar 2009 18:42:31 +0000 (18:42 +0000)]
blktapctrl: Select backend by prefix

This patch adds support for specifying the backend (tapdisk or ioemu)
to blktapctrl. Images can be specified e.g. as tap:tapdisk:aio,
tap:ioemu:qcow2 or tap:vmdk. When omitting the backend, a default is
chosen based on the image type (currently always tapdisk because ioemu
as a backend is broken until a follow-up patch series against qemu-xen
is applied)

Signed-off-by: Kevin Wolf <kwolf@suse.de>
16 years agoxend: fix regression in c/s 19330
Keir Fraser [Thu, 12 Mar 2009 15:40:52 +0000 (15:40 +0000)]
xend: fix regression in c/s 19330

attached patch fixes a regression in c/s 19330 which
prevents to start guests on a Linux Dom0.

Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
16 years agoAdd debug code to catch count_info errors in page_alloc.c
Keir Fraser [Thu, 12 Mar 2009 15:37:12 +0000 (15:37 +0000)]
Add debug code to catch count_info errors in page_alloc.c

This patch is temporary.

Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
16 years agoCode cleanups after page offline patch.
Keir Fraser [Thu, 12 Mar 2009 15:31:36 +0000 (15:31 +0000)]
Code cleanups after page offline patch.

Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
16 years agoxend: Fix removing /vm/UUID/device paths when device cannot be disconnected
Keir Fraser [Thu, 12 Mar 2009 15:08:08 +0000 (15:08 +0000)]
xend: Fix removing /vm/UUID/device paths when device cannot be disconnected

This is a corrected version of a patch commited as c/s 19250 and
reverted by c/s 19314. Thanks to "trap sigerr ERR" in
xen-hotplug-common.sh the xen-hotplug-cleanup would exit when reading
/local/domain/ID/vm fails thus skipping all the xenstore-rm lines in
the rest of the script.

Change deviceDestroy behavior to remove /vm/UUID/device/...
path only when force was used (as it already does so for both frontend
and backend) and do the removing from xen-hotplug-cleanup script when
we are sure the device is really not attached to the guest any more.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
16 years agoxentrace: error handling on non-existent formats file
Keir Fraser [Thu, 12 Mar 2009 15:07:20 +0000 (15:07 +0000)]
xentrace: error handling on non-existent formats file

Attached patch does proper error handling when specified
formats file doesn't exist.

Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
16 years agoxend: Use parse_hex() in XendPPCI.py
Keir Fraser [Thu, 12 Mar 2009 11:33:35 +0000 (11:33 +0000)]
xend: Use parse_hex() in XendPPCI.py

Signed-off-by: Yosuke Iwamatsu <y-iwamatsu@ab.jp.nec.com>
16 years agoxend: Do not create XendNetwork instance of tmpbridge
Keir Fraser [Thu, 12 Mar 2009 11:33:06 +0000 (11:33 +0000)]
xend: Do not create XendNetwork instance of tmpbridge

This patch prevents xend from creating a XendNetwork instance of
tmpbridge (a temporary bridge used in network-bridge script).

Signed-off-by: Yosuke Iwamatsu <y-iwamatsu@ab.jp.nec.com>
16 years agox86: Fix a typo in vpmu_core2.c
Keir Fraser [Thu, 12 Mar 2009 11:26:32 +0000 (11:26 +0000)]
x86: Fix a typo in vpmu_core2.c

When the HVM guest which is xenoprof's passive domain, is going to
shutdown, the Hypervisor panics because of typo in vpmu_core2.c

Signed-off-by: Kazuhiro Suzuki <kaz@jp.fujitsu.com>
16 years agoPV-on-HVM: Add a compatibility linux/scatterlist.h for kernels before 2.6.12
Keir Fraser [Thu, 12 Mar 2009 11:25:40 +0000 (11:25 +0000)]
PV-on-HVM: Add a compatibility linux/scatterlist.h for kernels before 2.6.12

Signed-off-by: KUWAMURA Shin'ya <kuwa@jp.fujitsu.com>
16 years agoFix Makefile portability: head -n -1 isn't portable.
Keir Fraser [Thu, 12 Mar 2009 11:24:25 +0000 (11:24 +0000)]
Fix Makefile portability: head -n -1 isn't portable.

Signed-off-by: John Levon <john.levon@sun.com>
16 years agox86: Fix APIC 0x40 error when CPU online and Host s3 resume
Keir Fraser [Thu, 12 Mar 2009 11:16:54 +0000 (11:16 +0000)]
x86: Fix APIC 0x40 error when CPU online and Host s3 resume

disable_APIC_timer actually is not useful here. Actually it will
trigger a local APIC error when masking the LVT entry when vector is
zero (before timer is inited) on Intel P6 family. This APIC error(40)
appears when online the offlined CPU and Host S3 resume.

Signed-off-by: Liping Ke <liping.ke@intel.com>
Signed-off-by: Gang Wei <gang.wei@intel.com>
16 years agoFix xenstore permissions for Solaris domUs.
Keir Fraser [Thu, 12 Mar 2009 11:14:22 +0000 (11:14 +0000)]
Fix xenstore permissions for Solaris domUs.

Solaris domUs use hvmpv/ and guest/ frontend xenstore directories.

Signed-off-by: John Levon <john.levon@sun.com>
16 years agorombios: __STRING() is Linux-specific
Keir Fraser [Thu, 12 Mar 2009 11:12:43 +0000 (11:12 +0000)]
rombios: __STRING() is Linux-specific

Signed-off-by: John Levon <john.levon@sun.com>
16 years agopygrub: Detect NetWare PV in pygrub
Keir Fraser [Thu, 12 Mar 2009 11:10:22 +0000 (11:10 +0000)]
pygrub: Detect NetWare PV in pygrub

Signed-off-by: John Levon <john.levon@sun.com>
16 years agoDomain core-dumping fixes
Keir Fraser [Thu, 12 Mar 2009 11:09:57 +0000 (11:09 +0000)]
Domain core-dumping fixes

The code was attempting to use the domain's current number of pages
(info.nr_pages) as a maximum index.  We then walk the memory map and
can easily over-write past the end of the nr_pages-sized array, if the
domain has more pages mapped in than earlier (live dump).  Restrict
ourselves to the current number of pages.

Also fix the dump core method in xend to actually implement the crash
and live options.  In particular this means that xend clients other
than xm now get non-live dumps by default.

Signed-off-by: John Levon <john.levon@sun.com>
16 years agoxend: Skip tap pipe creation on Solaris
Keir Fraser [Thu, 12 Mar 2009 11:08:45 +0000 (11:08 +0000)]
xend: Skip tap pipe creation on Solaris

Signed-off-by: John Levon <john.levon@sun.com>
16 years agoxend: Crash the domain if qemu-dm stops running
Keir Fraser [Thu, 12 Mar 2009 11:07:34 +0000 (11:07 +0000)]
xend: Crash the domain if qemu-dm stops running

The comment about the lack of restart prevention is not accurate.

Bump the minimum restart time to 60 seconds.

Signed-off-by: John Levon <john.levon@sun.com>
16 years agoFix qemu spawn for Solaris
Keir Fraser [Thu, 12 Mar 2009 11:07:00 +0000 (11:07 +0000)]
Fix qemu spawn for Solaris

On Solaris, xend runs in a 'process contract' such that all children
are killed when the service is restarted.  Spawn qemu processes in a
new contract to avoid this.

Signed-off-by: John Levon <john.levon@sun.com>
16 years agoxend: Allow replacement of a cdrom device on a device_add
Keir Fraser [Thu, 12 Mar 2009 11:01:25 +0000 (11:01 +0000)]
xend: Allow replacement of a cdrom device on a device_add

When adding a device, allow a cd to replace another if the device is a
cdrom.

Signed-off by: Ryan Scott <ryan.scott@sun.com>

16 years agoxend: Time-out if guest fails to suspend
Keir Fraser [Thu, 12 Mar 2009 11:00:52 +0000 (11:00 +0000)]
xend: Time-out if guest fails to suspend

If a guest fails to re-write control/shutdown node within a minute,
fail the suspend operation.

Signed-off-by: John Levon <john.levon@sun.com>
16 years agoxend: Allow off-line NIC removal
Keir Fraser [Thu, 12 Mar 2009 10:59:53 +0000 (10:59 +0000)]
xend: Allow off-line NIC removal

Match a MAC address so device_destroy can remove off-line NICs.

Signed-off-by: John Levon <john.levon@sun.com>
16 years agoxend: Correctly catch invalid domain lookups
Keir Fraser [Thu, 12 Mar 2009 10:59:19 +0000 (10:59 +0000)]
xend: Correctly catch invalid domain lookups

If a client asks about a non-existent domain, report the error back
properly instead of just backtracing within xend.

Signed-off-by: John Levon <john.levon@sun.com>
16 years agolibfsimage: Support for zfs version 14.
Keir Fraser [Thu, 12 Mar 2009 10:58:47 +0000 (10:58 +0000)]
libfsimage: Support for zfs version 14.

Signed-off-by: Susan Kamm-Worrell <susan.kamm-worrell@sun.com>
16 years agopygrub: Workaround for Solaris CR 1143256.
Keir Fraser [Thu, 12 Mar 2009 10:58:21 +0000 (10:58 +0000)]
pygrub: Workaround for Solaris CR 1143256.

The Solaris curses library has a broken timeout() function: after a
first timeout() call with a positive value for an argument, subsequent
calls will fail to reset it. So, getch() always times out, confusing
the pygrub timer in the main loop. Add an extra check to avoid exiting
prematurely.

Signed-off-by: Frank van der Linden <frank.vanderlinden@sun.com>
16 years agoxend: Add support for cpuinfo data on Solaris
Keir Fraser [Thu, 12 Mar 2009 10:57:44 +0000 (10:57 +0000)]
xend: Add support for cpuinfo data on Solaris

Signed-off-by: Russell Blaine <russell.blaine@sun.com>
16 years agotools: Make some code compile only on Linux
Keir Fraser [Thu, 12 Mar 2009 10:57:19 +0000 (10:57 +0000)]
tools: Make some code compile only on Linux

Signed-off-by: John Levon <john.levon@sun.com>
16 years agoxenconsole: Solaris ptys have different semantics.
Keir Fraser [Thu, 12 Mar 2009 10:56:55 +0000 (10:56 +0000)]
xenconsole: Solaris ptys have different semantics.

Make sure that tty semantics are active for Solaris ptys, or if they
aren't (and not needed) to not do tcget/setattr on the filedescriptor
in Python code.

Also work around a bug in the Solaris ptm streams driver, which will
cause a write error on the master side of a pty (because of e.g. a
missing slave) to persist forever.

Signed-off-by: Frank van der Linden <frank.vanderlinden@sun.com>
16 years agoFix solaris xc_map_foreign_ranges()
Keir Fraser [Thu, 12 Mar 2009 10:56:08 +0000 (10:56 +0000)]
Fix solaris xc_map_foreign_ranges()

Signed-off-by: John Levon <john.levon@sun.com>
16 years agox86 shadow: fix vram tracking
Keir Fraser [Thu, 12 Mar 2009 10:55:43 +0000 (10:55 +0000)]
x86 shadow: fix vram tracking

Check for writable mappings in ptes before assuming that the type
count in the page has changed.

Signed-off-by: Gianluca Guida <gianluca.guida@eu.citrix.com>
16 years agopassthrough: fix alignment of bind.u.msi.gtable
Keir Fraser [Thu, 12 Mar 2009 08:35:12 +0000 (08:35 +0000)]
passthrough: fix alignment of bind.u.msi.gtable

use uint64_aligned_t gtable instead of uint64_t for 32/64 compatiblity

Signed-off-by: Qing He <qing.he@intel.com>
16 years agolibxc: Replace bzero() usage with memset().
Keir Fraser [Thu, 12 Mar 2009 08:34:07 +0000 (08:34 +0000)]
libxc: Replace bzero() usage with memset().
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
16 years agoRevert c/s 19250, as it seems to be causing problems.
Keir Fraser [Thu, 12 Mar 2009 08:32:30 +0000 (08:32 +0000)]
Revert c/s 19250, as it seems to be causing problems.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
16 years agox86 hvm: Fix hvmemul_read_msr().
Keir Fraser [Wed, 11 Mar 2009 19:13:47 +0000 (19:13 +0000)]
x86 hvm: Fix hvmemul_read_msr().

Original patch by Christoph Egger <christoph.egger@amd.com>

Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
16 years agovscsi: Fix changeset 19310.
Keir Fraser [Wed, 11 Mar 2009 13:11:21 +0000 (13:11 +0000)]
vscsi: Fix changeset 19310.

Signed-off-by: Masaki Kanno <kanno.masaki@jp.fujitsu.com>
16 years agocpuidle: remove BM_RLD access from idle entry path
Keir Fraser [Wed, 11 Mar 2009 10:15:06 +0000 (10:15 +0000)]
cpuidle: remove BM_RLD access from idle entry path

Port below linux patch into xen to reduce overhead from idle entry path.

commit 31878dd86b7df9a147f5e6cc6e07092b4308782b
Author: Len Brown <len.brown@intel.com>
Date:   Wed Jan 28 18:28:09 2009 -0500

    ACPI: remove BM_RLD access from idle entry path

    It is true that BM_RLD needs to be set to enable
    bus master activity to wake an older chipset (eg PIIX4) from C3.

    This is contrary to the erroneous wording the ACPI 2.0, 3.0
    specifications that suggests that BM_RLD is an indicator
    rather than a control bit.

    ACPI 1.0's correct wording should be restored in ACPI 4.0:
    http://www.acpica.org/bugzilla/show_bug.cgi?id=3D689

    But the kernel should not have to clear BM_RLD
    when entering a non C3-type state just to set
    it again when entering a C3-type C-state.

    We should be able to set BM_RLD at boot time
    and leave it alone -- removing the overhead of
    accessing this IO register from the idle entry path.

Signed-off-by: Len Brown <len.brown@intel.com>
Signed-off-by: Wei Gang <gang.wei@intel.com>
16 years agoxend: Discard error messages of lsscsi
Keir Fraser [Wed, 11 Mar 2009 10:14:33 +0000 (10:14 +0000)]
xend: Discard error messages of lsscsi

In the case of a host OS without lsscsi command, the following
error message is recorded into xend-debug.log when xend is started.
The error message is recorded once certainly.  If SCSI devices are
connected to the host OS, it is recorded to the number of SCSI
devices.

  sh: lsscsi: command not found

This patch discards the error message to /dev/null.

Signed-off-by: Masaki Kanno <kanno.masaki@jp.fujitsu.com>
16 years agoxm: Sort pvSCSI devices information by virtual HCTL
Keir Fraser [Wed, 11 Mar 2009 10:13:46 +0000 (10:13 +0000)]
xm: Sort pvSCSI devices information by virtual HCTL

Signed-off-by: Masaki Kanno <kanno.masaki@jp.fujitsu.com>
16 years agoImprove vcpu_migration_delay handling.
Keir Fraser [Wed, 11 Mar 2009 10:12:14 +0000 (10:12 +0000)]
Improve vcpu_migration_delay handling.

Signed-off-by: Xiaowei Yang <xiaowei.yang@intel.com>
16 years agoxend: Test tap devices in testDeviceComplete()
Keir Fraser [Wed, 11 Mar 2009 10:10:15 +0000 (10:10 +0000)]
xend: Test tap devices in testDeviceComplete()

XendDomainInfo.testDeviceComplete() should check block devices have
shutdown correctly but it only considers vbd class devices and ignores
tap devices. The attached patch changes testDeviceComplete() to wait
for both vbd and tap devices to be shutdown correctly.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
16 years agopassthrough: fix some spinlock issues in vmsi
Keir Fraser [Wed, 11 Mar 2009 10:09:21 +0000 (10:09 +0000)]
passthrough: fix some spinlock issues in vmsi

Apart from efficiency, I hasten to fix the assertion failure.

- acquire pcidevs_lock before calling pt_irq_xxx_bind_vtd
- allocate msixtbl_entry beforehand
- check return value from domain_spin_lock_irq_desc()
- typo: spin_unlock(&irq_desc->lock) ->
- spin_unlock_irq(&irq_desc->lock)
- acquire msixtbl_list_lock with irq_disabled

Signed-off-by: Kouya Shimura <kouya@jp.fujitsu.com>
16 years agoxenconsole: Compile fixes for console code on Solaris
Keir Fraser [Wed, 11 Mar 2009 10:08:31 +0000 (10:08 +0000)]
xenconsole: Compile fixes for console code on Solaris

Signed-off-by: John Levon <john.levon@sun.com>
16 years agoxentrace: TRC_SCHED_DOM_REM is defined, but never used. Use it.
Keir Fraser [Wed, 11 Mar 2009 10:07:06 +0000 (10:07 +0000)]
xentrace: TRC_SCHED_DOM_REM is defined, but never used. Use it.

Signed-off-by: George Dunlap <george.dunlap@eu.citrix.com>
16 years agopassthrough: allow pass-through devices to share virtual GSI
Keir Fraser [Wed, 11 Mar 2009 10:05:00 +0000 (10:05 +0000)]
passthrough: allow pass-through devices to share virtual GSI

Allow multiple pass-through devices to use the same guest_gsi.

The motivation for this is:

* Allow multi-function devices to be passed through as multi-function
  devices
* Allow more than two pass-through devices.
  - This will place more contention on the GSI-space, and allocation
    becomes a lot simpler if GSI sharing is allowed.

Signed-off-by: Simon Horman <horms@verge.net.au>
16 years agopassthrough: pt_irq_time_out() should act on all machine_irq
Keir Fraser [Wed, 11 Mar 2009 10:03:54 +0000 (10:03 +0000)]
passthrough: pt_irq_time_out() should act on all machine_irq

Signed-off-by: Simon Horman <horms@verge.net.au>
16 years agoxentrace: trace when we continue with the same task
Keir Fraser [Mon, 9 Mar 2009 15:01:34 +0000 (15:01 +0000)]
xentrace: trace when we continue with the same task

Trace when the scheduler decides to continue running the same process.
This lets us see that this is happening for one; it also lets us see
domains in a trace which are actively running on pcpu but never
scheduled out.

Signed-off-by: George Dunlap <george.dunlap@eu.citrix.com>
16 years agoFix the perfc=y build.
Keir Fraser [Mon, 9 Mar 2009 13:52:59 +0000 (13:52 +0000)]
Fix the perfc=y build.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
16 years agohvm/vpt: Check that an irq is not blocked before waking the vcpu
Keir Fraser [Mon, 9 Mar 2009 13:50:45 +0000 (13:50 +0000)]
hvm/vpt: Check that an irq is not blocked before waking the vcpu

Currently, when a timer fires for a vpt interrupt, the interrupt
handler calls vcpu_kick() without checking to see if the IRQ is
blocked.  This causes the vcpu to wake up out of a halt when it
shouldn't.

Signed-off-by: George Dunlap <george.dunlap@eu.citrix.com>
16 years ago[DOC] Add boot option vcpu_migration_delay in user.tex
Keir Fraser [Mon, 9 Mar 2009 13:35:47 +0000 (13:35 +0000)]
[DOC] Add boot option vcpu_migration_delay in user.tex

Signed-off-by: Atsushi SAKAI <sakaia@jp.fujitsu.com>
16 years agoscheduler: Use perf_counter subsystem for stats
Keir Fraser [Mon, 9 Mar 2009 10:32:24 +0000 (10:32 +0000)]
scheduler: Use perf_counter subsystem for stats

Signed-off-by: Xiaowei Yang <xiaowei.yang@intel.com>
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
16 years agoAvoid deadlock in tasklet_schedule() after console_force_unlock().
Keir Fraser [Mon, 9 Mar 2009 09:56:16 +0000 (09:56 +0000)]
Avoid deadlock in tasklet_schedule() after console_force_unlock().

Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
16 years agopvscsi: Some fixes for xm scsi-attach
Keir Fraser [Mon, 9 Mar 2009 09:49:50 +0000 (09:49 +0000)]
pvscsi: Some fixes for xm scsi-attach

Signed-off-by: Masaki Kanno <kanno.masaki@jp.fujitsu.com>
16 years agoblktap: Fix compile warnings in block-qcow2.c
Keir Fraser [Mon, 9 Mar 2009 09:48:45 +0000 (09:48 +0000)]
blktap: Fix compile warnings in block-qcow2.c

Signed-off-by: Yosuke Iwamatsu <y-iwamatsu@ab.jp.nec.com>
16 years agoAdd vcpu_migration_delay=<microsecs> boot option to scheduler
Keir Fraser [Mon, 9 Mar 2009 09:37:52 +0000 (09:37 +0000)]
Add vcpu_migration_delay=<microsecs> boot option to scheduler

The idea is borrowed from Linux kernel: if the vCPU is just
scheduled out and put to run-queue, it's likely cache-hot on its
current pCPU, and it may be scheduled in in a short period of time;
however, if vCPU is migrated to another pCPU, it need to re-warm the
cache.

The patch introduces an option vcpu_migration_delay to avoid
aggressive vCPU migration (actually we really see migration frequency
is very high most of the time.), while in the meantime keeping load
balancing over slightly longer time scales.

Linux kernel uses 0.5ms by default. Considering the cost may be
higher (e.g. VMCS impact) than in native, vcpu_migration_delay=1000 is
chosen for our tests, which are performed on a 4x 6-core Dunnington
platform. In 24-VM case, there is ~2% stable performance gain for
enterprise workloads like SPECjbb and sysbench. If HVM is with
stubdom, the gain is more: 4% for the same workloads.

Signed-off-by: Xiaowei Yang <xiaowei.yang@intel.com>
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
16 years ago[IA64] fix compilation error caused by 19286:dd489125a2e7
Keir Fraser [Mon, 9 Mar 2009 09:19:42 +0000 (09:19 +0000)]
[IA64] fix compilation error caused by 19286:dd489125a2e7

This patch fixes compilation error caused by 19286:dd489125a2e7

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
16 years agopygrub: Enable domU boot without xen specific arg
Keir Fraser [Mon, 9 Mar 2009 09:19:10 +0000 (09:19 +0000)]
pygrub: Enable domU boot without xen specific arg

This patch makes domUs bring up without xen specific args to guest
kernels. A domU should be bootable without args parameter because
tools/examples/xmexample1 doesn't have one.

Signed-off-by: INAKOSHI Hiroya <inakoshi.hiroya@jp.fujitsu.com>
16 years ago[IA64] fix issue of can not find the qemu-dm in ia64
Keir Fraser [Mon, 9 Mar 2009 09:18:08 +0000 (09:18 +0000)]
[IA64] fix issue of  can not find the qemu-dm in ia64

IA64 uses the /usr/lib/ for xen. We do not=20
need to check the arch_libdir in ia64. It will
return the wrong value to arch_libdir. And guest
can not boot.

Signed-off-by: Yang Zhang <yang.zhang@intel.com>
16 years agohvmloader acpi: Describe PIRQ routing for all 32 PCI devices on bus 0.
Keir Fraser [Mon, 9 Mar 2009 09:13:50 +0000 (09:13 +0000)]
hvmloader acpi: Describe PIRQ routing for all 32 PCI devices on bus 0.

Signed-off-by: Simon Horman <horms@verge.net.au>
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
16 years agox86: Mask X86_FEATURE_XSAVE in cpuid leaf 1, ecx, as we don't allow
Keir Fraser [Mon, 9 Mar 2009 08:54:19 +0000 (08:54 +0000)]
x86: Mask X86_FEATURE_XSAVE in cpuid leaf 1, ecx, as we don't allow
guests to use it (by setting cr4.OSXSAVE).

This prevents crashes in pvops kernels, as new versions of Linux
try to use this feature.

Signed-off-by: Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
16 years agominios: Fix 18874 memory clipping
Keir Fraser [Mon, 9 Mar 2009 08:43:11 +0000 (08:43 +0000)]
minios: Fix 18874 memory clipping

Fix 18874's memory clipping: there are three page-sized holes between
direct mapping, demand mapping, heap pages and the end of memory.

Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
16 years agoPage offline support in Xen side
Keir Fraser [Fri, 6 Mar 2009 19:18:39 +0000 (19:18 +0000)]
Page offline support in Xen side

This patch add support to offline a page. The basical idea is, when a
page is assigned, it will be marked offline pending and be moved out of
buddy when freed, when a page is free, it will be moved out of buddy directly.

One notice after this change is, now the page->count_info is not
always 0, especially for shadow page, since the PGC_offlining bit may be set.

Signed-off-by: Wang, Shane <shane.wang@intel.com>
Signed-off-by: Jiang, Yunhong <yunhong.jiang@intel.com>