]> xenbits.xensource.com Git - xen.git/log
xen.git
14 years agoxend: Remove use of non-existent xc.handle() function.
Keir Fraser [Wed, 9 Jun 2010 06:55:19 +0000 (07:55 +0100)]
xend: Remove use of non-existent xc.handle() function.

Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
14 years agox86 mce: Make indentation consistent (soft tabs) in a couple of files.
Keir Fraser [Wed, 9 Jun 2010 06:54:10 +0000 (07:54 +0100)]
x86 mce: Make indentation consistent (soft tabs) in a couple of files.

Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
14 years agox86: add CMCI software injection interface
Keir Fraser [Wed, 9 Jun 2010 06:51:31 +0000 (07:51 +0100)]
x86: add CMCI software injection interface

A new command is added. User can set the target CPU map, since the
CMCI can be triggered on some specific CPUs.  Please be noticed that
the xenctl_cpumap structure is moved from domctl.h to xen.h.

Signed-off-by: Jiang, Yunhong <yunhong.jiang@intel.com>
14 years agomce: Clean-up mcheck_init handler
Keir Fraser [Wed, 9 Jun 2010 06:42:19 +0000 (07:42 +0100)]
mce: Clean-up mcheck_init handler

Firstly and most importantly, the maxium MCA banks are hard-coded as
MAX_NR_BANKS, which is 30. This is not architecture correct. This
patch removes this definition, replacig the cpu_banks_t with
mca_banks, and provide some basic function, like
set/clear/test/alloc/free for mcabanks_t.

Secondly, remove the broadcast_check code to intel specific, since
only Intel platform support broadcast now.

Thirdly, the X86_FEATURE_MCA check and CR4_MCE enable is done in every
vendor-specifc callback, that's redundant, move it to
mcheck_init. Also, we should enable CR4_MCE only in the end of the
mcheck_init, to close the small window between CR4_enable and the mca
setup.

And we also move vmce specific code to vmce.c as vmce_init, to make
code clean.

Signed-off-by: Jiang, Yunhong <yunhong.jiang@intel.com>
Acked-By: Christoph Egger <Christoph.Egger@amd.com>
14 years agotools/misc: xen-watchdog script is Linux specific
Keir Fraser [Wed, 9 Jun 2010 06:29:10 +0000 (07:29 +0100)]
tools/misc: xen-watchdog script is Linux specific

Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
14 years agotools: fix install bash-completion files to non-default locations.
Keir Fraser [Wed, 9 Jun 2010 06:21:32 +0000 (07:21 +0100)]
tools: fix install bash-completion files to non-default locations.

Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
14 years agonetbsd: Add boot-time init scripts.
Keir Fraser [Wed, 9 Jun 2010 06:18:30 +0000 (07:18 +0100)]
netbsd: Add boot-time init scripts.

Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
14 years agoblktap2: Fix toolstack build on NetBSD
Keir Fraser [Wed, 9 Jun 2010 05:59:52 +0000 (06:59 +0100)]
blktap2: Fix toolstack build on NetBSD

Signed-off-by: Daniel Stodden <daniel.stodden@citrix.com>
14 years agoblktap2: <sys/time.h> is needed for 'struct timeval'
Keir Fraser [Wed, 9 Jun 2010 05:58:55 +0000 (06:58 +0100)]
blktap2: <sys/time.h> is needed for 'struct timeval'

Also clean up a Makefile to use $(SBINDIR).

Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
14 years agohgignore: Update for new tap-ctl utility
Keir Fraser [Tue, 8 Jun 2010 07:09:16 +0000 (08:09 +0100)]
hgignore: Update for new tap-ctl utility

14 years agoblktap2: Port Xend to the tap-ctl interface.
Keir Fraser [Tue, 8 Jun 2010 07:05:43 +0000 (08:05 +0100)]
blktap2: Port Xend to the tap-ctl interface.

Signed-off-by: Jake Wires <jake.wires@citrix.com>
14 years agoblktap2: The tap-ctl userspace control utility and library.
Keir Fraser [Tue, 8 Jun 2010 07:05:09 +0000 (08:05 +0100)]
blktap2: The tap-ctl userspace control utility and library.

Tapdisk control in userspace, a replacement for the original blktap2
control stack, which had to pass a kernel space interface based on
sysfs nodes.

All tapdisk processes listen for commands on a unix stream socket. The
control library supports scanning the socket namespace for running
tapdisks, VBD minors allocated, associated images and state inquiry.

Control operations include allocating/releasing devices, spawning
tapdisks, opening/closing images, attaching disk images to
devices. disk pause/resume operations and runtime switching of disk
images.

Signed-off-by: Jake Wires <jake.wires@citrix.com>
Signed-off-by: Daniel Stodden <daniel.stodden@citrix.com>
14 years agoblktap2: Cleanup vdi stacking code.
Keir Fraser [Tue, 8 Jun 2010 07:04:36 +0000 (08:04 +0100)]
blktap2: Cleanup vdi stacking code.

Removes some rough edges, memory leakage (?), fixes __list_splice, ...

Signed-off-by: Jake Wires <jake.wires@citrix.com>
Signed-off-by: Daniel Stodden <daniel.stodden@citrix.com>
14 years agoblktap2: Fix E/DPRINTF defs all around the driver/ subdir.
Keir Fraser [Tue, 8 Jun 2010 07:04:09 +0000 (08:04 +0100)]
blktap2: Fix E/DPRINTF defs all around the driver/ subdir.

This is just to avoid macro madness among subdirs sharing blktaplib.h.

Signed-off-by: Daniel Stodden <daniel.stodden@citrix.com>
Signed-off-by: Jake Wires <jake.wires@citrix.com>
14 years agoblktap2: Fix tapdisk disktype issues.
Keir Fraser [Tue, 8 Jun 2010 07:03:41 +0000 (08:03 +0100)]
blktap2: Fix tapdisk disktype issues.

Stop coercing drivers/disktype code into the tool stack. Make both
blktapctrl and tap-ctl transfer type/path pairs as "<type>:<path>"
strings. Remove the message.disktype integer altogether.

Signed-off-by: Daniel Stodden <daniel.stodden@citrix.com>
Signed-off-by: Jake Wires <jake.wires@citrix.com>
14 years agoblktap2: Remove LVM hacks.
Keir Fraser [Tue, 8 Jun 2010 07:02:56 +0000 (08:02 +0100)]
blktap2: Remove LVM hacks.

These only mattered for XCP's LVHD with blktap1.

Signed-off-by: Jake Wires <jake.wires@citrix.com>
Signed-off-by: Daniel Stodden <daniel.stodden@citrix.com>
14 years agoblktap2: Remove tapdisk-ipc module.
Keir Fraser [Tue, 8 Jun 2010 07:01:50 +0000 (08:01 +0100)]
blktap2: Remove tapdisk-ipc module.

Obsoleted with blktapctrl.

Signed-off-by: Jake Wires <jake.wires@citrix.com>
Signed-off-by: Daniel Stodden <daniel.stodden@citrix.com>
14 years agolibxl/xl: implement xen_platform_pci enable/disable
Keir Fraser [Tue, 8 Jun 2010 07:01:04 +0000 (08:01 +0100)]
libxl/xl: implement xen_platform_pci enable/disable

Implement xen_platform_pci support in xl/libxl to allow users to
disable the xen platform pci device from the VM config file.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
14 years agotools: Add missing files under tools/hotplug/Linux/init.d
Keir Fraser [Mon, 7 Jun 2010 16:14:37 +0000 (17:14 +0100)]
tools: Add missing files under tools/hotplug/Linux/init.d

Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
14 years agohgignore: Modify *.d line to avoid fale trigger on tools/hotplug/Linux/init.d/
Keir Fraser [Mon, 7 Jun 2010 16:14:09 +0000 (17:14 +0100)]
hgignore: Modify *.d line to avoid fale trigger on tools/hotplug/Linux/init.d/

Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
14 years agox86: Force !in_irq() in machine_restart().
Keir Fraser [Mon, 7 Jun 2010 15:41:19 +0000 (16:41 +0100)]
x86: Force !in_irq() in machine_restart().

Various function we may call assert this fact. We just want to restart
the system.

Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
14 years agoxl: init scripts (v2)
Keir Fraser [Mon, 7 Jun 2010 14:49:46 +0000 (15:49 +0100)]
xl: init scripts (v2)

Now the init script is called xencommons and, as the name suggests, it
is a common script between xl and xend because it is used to start
xenconsoled, xenstored and xenbackendd and the initialization of these
three daemons has been removed from xend.  The global
xen_toolstack=xl/xend variable has been removed.  Regarding the
network setup, I made the vif scripts follow the same pattern as the
other scripts in xen-backend: a new script called vif-setup is
executed unconditionally. vif-setup is going to do the right thing
depending on the value of the environmental variable "script" (same
technique used before), defaulting to vif-bridge.  In the common
scenario the toolstack doesn't need to set the variable "script"
because vif-bridge is going to be called anyway.  There is no global
network script to setup the network bridges with xl, so if you are
using xl without xend, you need to manually configure the bridges
using your distro network setup, or, if you are lazy, you can just add
something like:

/etc/xen/scripts/network-bridge start

to your rc.local.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
14 years agolibxc: NetBSD build fix
Keir Fraser [Mon, 7 Jun 2010 14:48:12 +0000 (15:48 +0100)]
libxc: NetBSD build fix

Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
14 years agobltap2: implement md5 directly, to remove ssl dependency
Keir Fraser [Mon, 7 Jun 2010 14:47:28 +0000 (15:47 +0100)]
bltap2: implement md5 directly, to remove ssl dependency

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
14 years agox86 mce: Change the method to get the extended MCA information.
Keir Fraser [Mon, 7 Jun 2010 14:46:48 +0000 (15:46 +0100)]
x86 mce: Change the method to get the extended MCA information.

Several changes to get the extended MCA information:
a) Use the x86_mcinfo_reserve in mcinfo_extended to reserve buffer
from
   mc_info, instead of using the stack
b) For intel's extended MSR, we don't need write them one
   by one as the MSR are continous
c) We don't need enum mca_extinfo, since we can consider
   the extended MSR as either per bank, or global. Currently
   we add a hook in global data collection, and didn't call
   register intel_get_extended_msrs as callback. Later that
   hook can be replaced by cleaner way

Signed-off-by: Jiang, Yunhong <yunhong.jiang@inte.com>
14 years agotools: disable xen-hptool on ia64
Keir Fraser [Mon, 7 Jun 2010 14:45:56 +0000 (15:45 +0100)]
tools: disable xen-hptool on ia64

xen-hptool cannot be built on ia64, because xen-hptool depends on
xc_offline_page.c and xc_offline_page.c does not support ia64.

This patch disables it on ia64.

Signed-off-by: KUWAMURA Shin'ya <kuwa@jp.fujitsu.com>
14 years agoxl: fix 'xl help' command
Keir Fraser [Mon, 7 Jun 2010 06:49:07 +0000 (07:49 +0100)]
xl: fix 'xl help' command

xl help 'command' should give the help of the 'command',
but current it does not, it just gives a full list of xl
supported commands. This patch fix it.

Signed-off-by: Yang Hongyang <yanghy@cn.fujitsu.com>
14 years agox86: Small APIC timer initialisation cleanup
Keir Fraser [Mon, 7 Jun 2010 06:47:30 +0000 (07:47 +0100)]
x86: Small APIC timer initialisation cleanup

Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
14 years agoAMD: Workaround for erratum 411
Keir Fraser [Mon, 7 Jun 2010 06:38:09 +0000 (07:38 +0100)]
AMD: Workaround for erratum 411

Clear APIC TMICT when we mask APIC LVTT.

Signed-off-by: Wei Wang <wei.wang2@amd.com>
14 years agoxend: A few blktap2 fixes
Keir Fraser [Mon, 7 Jun 2010 06:19:43 +0000 (07:19 +0100)]
xend: A few blktap2 fixes

1. Bug fix for error: "Error: Device /dev/xvdp (51952, tap2) is
already connected." (xenstore does not clean after DomU stoped)
2. Bug fix for error: "File 'vhd:/path/.../disk.img' doesn't exist."
(not correct parsing)
3. Bug fix for error: "Error: Device 51952 not connected" (in config
file for DomU we should be use prefix "tap2:tapdisk:xxx" for devices
from (aio, ram, qcow, vhd, remus) or "tap:tapdisk:xxx" for devices
from (sync, vmdk, qcow2, ioemu))
4. Bug fix for error: "Disk is not accessible" (if use 'tap2'-device
type, then '/dev/xpvd' may not be accessible immediately after its
creation)

Signed-off-by: eXeC001er <execooler@gmail.com>
14 years agoxenwatchdogd: Fix build errors
Keir Fraser [Mon, 7 Jun 2010 06:16:43 +0000 (07:16 +0100)]
xenwatchdogd: Fix build errors

Signed-off-by: Patrick Colp <pjcolp@cs.ubc.ca>
14 years agoxl: block-detach command line parsing
Keir Fraser [Mon, 7 Jun 2010 06:14:19 +0000 (07:14 +0100)]
xl: block-detach command line parsing

Command line arguments start at argv[2].

Signed-off-by: Eric Chanudet <eric.chanudet@citrix.com>
14 years agoxl: block-list command line parsing
Keir Fraser [Mon, 7 Jun 2010 06:13:41 +0000 (07:13 +0100)]
xl: block-list command line parsing

Command line arguments start at argv[2].

Signed-off-by: Eric Chanudet <eric.chanudet@citrix.com>
14 years agoxl: block-attach command line parsing
Keir Fraser [Mon, 7 Jun 2010 06:13:02 +0000 (07:13 +0100)]
xl: block-attach command line parsing

Command line arguments start at argv[2].

Signed-off-by: Eric Chanudet <eric.chanudet@citrix.com>
14 years agoxl: network2-detach command
Keir Fraser [Mon, 7 Jun 2010 06:12:20 +0000 (07:12 +0100)]
xl: network2-detach command

Usage: xl network2-detach <Domain> <DevId>

Signed-off-by: Eric Chanudet <eric.chanudet@citrix.com>
14 years agoxl: network2-list command
Keir Fraser [Mon, 7 Jun 2010 06:11:15 +0000 (07:11 +0100)]
xl: network2-list command

Usage: xl network2-list <Domains>

Signed-off-by: Eric Chanudet <eric.chanudet@citrix.com>
14 years agoxl: network2-attach command
Keir Fraser [Mon, 7 Jun 2010 06:09:41 +0000 (07:09 +0100)]
xl: network2-attach command

Usage: xl network2-attach <Domain> [front_mac=<mac>]
[back_mac=<mac>]
[backend=<BackDomain>] [trusted=<0|1>] [back_trusted=<0|1>]
[bridge=<bridge>] [filter_mac=<0|1>] [front_filter_mac=<0|1>]
[pdev=<PDEV>] [max_bypasses=n]

Signed-off-by: Eric Chanudet <eric.chanudet@citrix.com>
14 years agoxentrace: update formats file for INTR_WINDOW and NPF
Keir Fraser [Mon, 7 Jun 2010 06:07:03 +0000 (07:07 +0100)]
xentrace: update formats file for INTR_WINDOW and NPF

Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
14 years agoAdd xl init scripts
Keir Fraser [Mon, 7 Jun 2010 06:05:54 +0000 (07:05 +0100)]
Add xl init scripts

this patch adds an init script for xl, so that it can be used without
xend installed on the system.  In cases in which both toolstacks are
present, only one init script will be run, dependening on the value of
xen_toolstack in /etc/sysconfig/xen_toolstack.  Please note that a
correct value of xen_toolstack (either xl or xend), is required now.
The network script and the vif script to be used with xl can be
specified in /etc/sysconfig/xenlightdaemons.  Xl sets the vif script
to xl-vif-script by default, that reads /etc/sysconfig/xenlightdaemons
and calls the vif script set there.  A port to a debian system should
be straightforward, just replacing /etc/sysconfig with /etc/default
everywhere.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
14 years agoxl: make mem-set and mem-max to use MB for memory unit by default.
Keir Fraser [Mon, 7 Jun 2010 05:56:04 +0000 (06:56 +0100)]
xl: make mem-set and mem-max to use MB for memory unit by default.

Signed-off-by: Zhigang Wang <zhigang.x.wang@oracle.com>
14 years ago[IA64] support XEN_SYSCTL_numainfo
Keir Fraser [Fri, 4 Jun 2010 10:39:06 +0000 (11:39 +0100)]
[IA64] support XEN_SYSCTL_numainfo

Signed-off-by: KUWAMURA Shin'ya <kuwa@jp.fujitsu.com>
14 years agoWatchdog timers for domains
Keir Fraser [Fri, 4 Jun 2010 10:35:23 +0000 (11:35 +0100)]
Watchdog timers for domains

Each domain is allowed to set, reset and disable its timers; when any
timer runs out the domain is killed.

Patch from Christian Limpach <Christian.Limpach@citrix.com>
Signed-off-by: Tim Deegan <Tim.Deegan@citrix.com>
14 years agolibxc: Remove obsolete xc_find_device_number() declaration.
Keir Fraser [Fri, 4 Jun 2010 09:46:32 +0000 (10:46 +0100)]
libxc: Remove obsolete xc_find_device_number() declaration.

Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
14 years agonotify_via_xen_event_channel() takes explicit domain parameter.
Keir Fraser [Fri, 4 Jun 2010 09:25:45 +0000 (10:25 +0100)]
notify_via_xen_event_channel() takes explicit domain parameter.

Also remove pointless tasklet from mem_event notify path.

Signed-off-by: John Byrne <john.l.byrne@hp.com>
14 years agoIntel: Add CPUID feature mask support for NHM processors.
Keir Fraser [Fri, 4 Jun 2010 09:18:31 +0000 (10:18 +0100)]
Intel: Add CPUID feature mask support for NHM processors.

Signed-off-by: Jun Nakajima <jun.nakajima@intel.com>
Signed-off-by: Liping Ke <liping.ke@intel.com>
14 years ago[VTD] fixed a timing issue on DELL calpella laptop while doing graphics pass-through
Keir Fraser [Fri, 4 Jun 2010 09:17:19 +0000 (10:17 +0100)]
[VTD] fixed a timing issue on DELL calpella laptop while doing graphics pass-through

Added additional sleep time between FLR and PCI config restore.

Signed-off-by: Allen Kay <allen.m.kay@intel.com>
14 years agolibxl/xl: fix multivcpu handling
Keir Fraser [Fri, 4 Jun 2010 09:14:06 +0000 (10:14 +0100)]
libxl/xl: fix multivcpu handling

Signed-off-by: Stefano Stabellini<stefano.stabellini@eu.citrix.com>
14 years agoxl: enable hap, parse hap option in the config files
Keir Fraser [Fri, 4 Jun 2010 09:13:02 +0000 (10:13 +0100)]
xl: enable hap, parse hap option in the config files

This simple patch enables hap by default in xl and also allows xl to
parse the hap option in the VM config file.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
14 years agoxl: correct help message of migrate and migrate-receive command
Keir Fraser [Fri, 4 Jun 2010 09:12:11 +0000 (10:12 +0100)]
xl: correct help message of migrate and migrate-receive command

Signed-off-by: Yang Hongyang <yanghy@cn.fujitsu.com>
14 years agoxl: fix vcpu-* command line args
Keir Fraser [Fri, 4 Jun 2010 09:11:40 +0000 (10:11 +0100)]
xl: fix vcpu-* command line args

Command line arguments start at argv[2]

Signed-off-by: Yang Hongyang <yanghy@cn.fujitsu.com>
14 years agoxl: fix network-detach command line parsing
Keir Fraser [Fri, 4 Jun 2010 09:10:45 +0000 (10:10 +0100)]
xl: fix network-detach command line parsing

Command line arguments start at argv[2].  Also, exit(1) on failure.

Signed-off-by: Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>
14 years agoxl: fix network-list command line parsing
Keir Fraser [Fri, 4 Jun 2010 09:10:25 +0000 (10:10 +0100)]
xl: fix network-list command line parsing

Command line arguments start at argv[2].

Signed-off-by: Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>
14 years agoxl: fix network-attach command line parsing
Keir Fraser [Fri, 4 Jun 2010 09:09:59 +0000 (10:09 +0100)]
xl: fix network-attach command line parsing

Command line arguments start at argv[2].

Signed-off-by: Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>
14 years agoBash completion scripts go to /etc/bash_completion.d/
Keir Fraser [Fri, 4 Jun 2010 09:09:11 +0000 (10:09 +0100)]
Bash completion scripts go to /etc/bash_completion.d/

Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
14 years agoAdd the USE_PLATFORM_TIMER flag to the FADT, to make w2k3 use the PMTIMER
Keir Fraser [Fri, 4 Jun 2010 09:06:23 +0000 (10:06 +0100)]
Add the USE_PLATFORM_TIMER flag to the FADT, to make w2k3 use the PMTIMER

...because the default timesource (TSC) drifts under load.

The flag is only defined in ACPI 3.0, and we provide ACPI 2.0 tables,
but Windows seems happy enough to obey it anyway.

Signed-off-by: Tim Deegan <Tim.Deegan@citrix.com>
14 years agoAdd a safety valve to the HVM RTC model for big time jumps
Keir Fraser [Fri, 4 Jun 2010 09:05:42 +0000 (10:05 +0100)]
Add a safety valve to the HVM RTC model for big time jumps

If xen's time leaps forward by a large amount, the RTC will try to
model a tick for every second that it thinks has passed.  This can
livelock a CPU with a series of timer requests each of which fires
immediately and requests the next one.

This patch treats a delay of more than a day between ticks as a
special case, abandoning the attempt to catch up.  That should be good
enough to avoid livelock but doesn't fix the underlying time problem.

Signed-off-by: Tim Deegan <Tim.Deegan@citrix.com>
14 years agox86: Suppress warnings about spurious pagefaults
Keir Fraser [Fri, 4 Jun 2010 09:04:30 +0000 (10:04 +0100)]
x86: Suppress warnings about spurious pagefaults

RHEL4 guests take a fair number of spurious pagefaults on Nehalem; no
need to report each one of them at XENLOG_WARNING.

Signed-off-by: Tim Deegan <Tim.Deegan@citrix.com>
14 years agox86: Quieten the warning about paging domctls called on domains with no vcpus
Keir Fraser [Fri, 4 Jun 2010 09:02:51 +0000 (10:02 +0100)]
x86: Quieten the warning about paging domctls called on domains with no vcpus

Xapi tends to trigger this a lot by looking up the shadow memory
allocation of domains that aren't quite built yet.

Signed-off-by: Tim Deegan <Tim.Deegan@citrix.com>
14 years agoQuieten console warning about incomplete PAE PTE writes
Keir Fraser [Fri, 4 Jun 2010 09:01:15 +0000 (10:01 +0100)]
Quieten console warning about incomplete PAE PTE writes

Older (<4.6) RHEL kernels clear PAE pagetable entries without taking
care to write the bottom half first, often enough to make it annoying.

Signed-off-by: Tim Deegan <Tim.Deegan@citrix.com>
14 years agotimer: Do not acquire a lock on a killed timer.
Keir Fraser [Fri, 4 Jun 2010 08:50:45 +0000 (09:50 +0100)]
timer: Do not acquire a lock on a killed timer.

Its cpu field might be stale and refer to an offlined cpu.

Furthermore, this avoids performing invalid operations on killed
timers.

Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
14 years agoAllow domains to set a shutdown code without actually shutting down
Keir Fraser [Fri, 4 Jun 2010 08:33:11 +0000 (09:33 +0100)]
Allow domains to set a shutdown code without actually shutting down

Useful for Windows guests, since the PV drivers are notified that
the domain is about to crash just before the crash dump gets written.

Signed-off-by: Tim Deegan <Tim.Deegan@citrix.com>
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
14 years agotimer: Migrate timers from dying CPU on CPU_DYING notification.
Keir Fraser [Thu, 3 Jun 2010 06:30:54 +0000 (07:30 +0100)]
timer: Migrate timers from dying CPU on CPU_DYING notification.

Otherwise timer_lock() can race a timer's ->cpu field being updated by
migrate_timers_from_cpu().

The rest of this patch is all debug paranoia.

Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
14 years agotimers: Track inactive timers and migrate them on cpu offline.
Keir Fraser [Wed, 2 Jun 2010 12:13:11 +0000 (13:13 +0100)]
timers: Track inactive timers and migrate them on cpu offline.

Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
14 years agotools: assume that special Xen devices have been created by the platform
Keir Fraser [Wed, 2 Jun 2010 09:54:32 +0000 (10:54 +0100)]
tools: assume that special Xen devices have been created by the platform

Remove all the magic surrounding the special Xen devices in Linux
specific code whereby we attempt to figure out what the correct
major:minor number is and check the the existing device has these
numbers etc. In 2010 we really should be able to trust that the
platform has created the devices correctly or provide correct
configuration settings such that they are without resorting to tearing
down the platform configured state and rebuilding it.

tools/hotplug/Linux/xen-backend.rules already contains the necessary
udev rules to create /dev/xen/evtchn and friends in the correct place.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
14 years agoxl: adds shutdown and reboot commands
Keir Fraser [Wed, 2 Jun 2010 09:52:17 +0000 (10:52 +0100)]
xl: adds shutdown and reboot commands
libxl : remote shutdown to work for pure hvm domains

Signed-off-by: Gihan Munasinghe <GMunasinghe@flexiant.com>
14 years agoFix xm man page statement about asynchonous operation
Keir Fraser [Wed, 2 Jun 2010 09:49:35 +0000 (10:49 +0100)]
Fix xm man page statement about asynchonous operation

The man page for xm command states that many commands acts
asynchronously which is not true. According to my experience most
commands does act synchronously with several exceptions, like create,
shutdown, mem-set and vcpu-set commands so this fixes the paragraph
available in this xm man page.

Signed-off-by: Michal Novotny <minovotn@redhat.com>
14 years agox86: On CPU offline, freed stack should be *un*guarded.
Keir Fraser [Wed, 2 Jun 2010 09:38:55 +0000 (10:38 +0100)]
x86: On CPU offline, freed stack should be *un*guarded.

Fix stupid typo.

Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
14 years agoVMX: does EPT capabilities detection strictly according to Intel SDM.
Keir Fraser [Tue, 1 Jun 2010 13:25:59 +0000 (14:25 +0100)]
VMX: does EPT capabilities detection strictly according to Intel SDM.

Signed-off-by: Xin Li <xin.li@intel.com>
14 years agox86: During cpu offline, cpu_disable_scheduler() cannot fail.
Keir Fraser [Tue, 1 Jun 2010 12:57:44 +0000 (13:57 +0100)]
x86: During cpu offline, cpu_disable_scheduler() cannot fail.

BUG on this scenario.

Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
14 years agosmp_call_function/on_selected_cpus/on_each_cpu all return void.
Keir Fraser [Tue, 1 Jun 2010 10:04:08 +0000 (11:04 +0100)]
smp_call_function/on_selected_cpus/on_each_cpu all return void.

None of them can fail, so a return code is pointless.

Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
14 years agox86 mtrr: Remove (noop) lock_cpu_hotplug().
Keir Fraser [Tue, 1 Jun 2010 09:56:07 +0000 (10:56 +0100)]
x86 mtrr: Remove (noop) lock_cpu_hotplug().

CPUs coming online sync themselves with current MTRR state at an
appropriate point anyway.

It's not actually possible to have a newly booted CPU immediately have
in-sync MTRR state anyway. It has to be synced up as part of normal
CPU bootstrap procedure. Which is what we do.

Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
14 years agox86 mtrr: Fix set_mtrr() race against cpu_online_map changes.
Keir Fraser [Tue, 1 Jun 2010 09:40:06 +0000 (10:40 +0100)]
x86 mtrr: Fix set_mtrr() race against cpu_online_map changes.

Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
14 years agoxl: remove duplicate code in migrate_domain()
Keir Fraser [Tue, 1 Jun 2010 06:06:50 +0000 (07:06 +0100)]
xl: remove duplicate code in migrate_domain()

libxl_domid_to_name() have already been called in
save_domain_core_begin()->find_domain(), so remove it.

Signed-off-by: Yang Hongyang <yanghy@cn.fujitsu.com>
14 years agolibxl: fix domain suspend debug typo.
Keir Fraser [Tue, 1 Jun 2010 06:06:05 +0000 (07:06 +0100)]
libxl: fix domain suspend debug typo.

Signed-off-by: Zhigang Wang <zhigang.x.wang@oracle.com>
14 years agoxend: PoD check should be for HVM domain only.
Keir Fraser [Tue, 1 Jun 2010 06:05:22 +0000 (07:05 +0100)]
xend: PoD check should be for HVM domain only.

Signed-off-by: Dongxiao Xu <dongxiao.xu@intel.com>
14 years agoxc: deal with xen/evtchn and xen/gntdev device names
Keir Fraser [Tue, 1 Jun 2010 06:04:35 +0000 (07:04 +0100)]
xc: deal with xen/evtchn and xen/gntdev device names

This patch makes xc_linux properly deal with:
 1. discovering and creating device nodes if necessary
 2. the new form of xen/<dev> device names soon to be used by the
 kernel

This changes the logic slightly:
 - If a device node already exists with the proper name, then it uses
 it as-is, assuming it has already been correctly created.
 - If the path doesn't exist, or it exists but isn't a device node,
 and
   it has successfully found the major/minor for the device, then
   (re)create the device node.

Since this logic is identical for gntdev and evtchn, make a common
function to handle both.

Signed-off-by: Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>
14 years agoxend: Remove broken bits of NUMA code.
Keir Fraser [Tue, 1 Jun 2010 05:55:23 +0000 (06:55 +0100)]
xend: Remove broken bits of NUMA code.

Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
14 years agoxen: update_runstate_area for 32 bit PV on HVM guests
Keir Fraser [Tue, 1 Jun 2010 05:45:44 +0000 (06:45 +0100)]
xen: update_runstate_area for 32 bit PV on HVM guests

The current implementation of update_runstate_area is unable to handle
32 bit PV on HVM guests because the check is_pv_32on64_domain doesn't
cover that case. This patch fixes it.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
14 years agox86: Fix guest-pointer-array memmove in __pirq_guest_unbind().
Keir Fraser [Fri, 28 May 2010 09:54:07 +0000 (10:54 +0100)]
x86: Fix guest-pointer-array memmove in __pirq_guest_unbind().

Thanks to Alex Zefefrt for finding this.

Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
14 years agotools: Build fixes.
Keir Fraser [Fri, 28 May 2010 08:45:50 +0000 (09:45 +0100)]
tools: Build fixes.

Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
14 years agoxl/libxtl: Remove glitch in xl migrate log output
Keir Fraser [Fri, 28 May 2010 08:38:56 +0000 (09:38 +0100)]
xl/libxtl: Remove glitch in xl migrate log output

* Provide a new XTL_STDIOSTREAM_HIDE_PROGRESS flag in the stdio logger
* Provide a way to adjust the flags after logger setup
* Use these to disable progress output from the migration receiver, as
  the sender is also sending progress information.

Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
14 years agolibxc: remove \n from strings passed to PERROR
Keir Fraser [Fri, 28 May 2010 08:38:18 +0000 (09:38 +0100)]
libxc: remove \n from strings passed to PERROR

Previously, the code was inconsistent: some calls to PERROR passed \n
and some did not.  With the new logging arrangements, passing \n is
definitely incorrect.

Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
14 years agolibxc: save/restore error handling fixes
Keir Fraser [Fri, 28 May 2010 08:37:42 +0000 (09:37 +0100)]
libxc: save/restore error handling fixes

* Make "read_exact" in libxc always set errno.
* Rename "read_exact" macro in xc_domain_restore.c (which shadows
  real function) to RDEXACT and change all callers.
* Make RDEXACT anamorphically use xch for error reporting rather than
* stderr.
* Call PERROR rather than ERROR when appropriate, so that log messages
  include errno.
* Save errno in noncached_write so that its errno value is always
* right.

Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
14 years agoxl: Allow control of logging level.
Keir Fraser [Fri, 28 May 2010 08:35:12 +0000 (09:35 +0100)]
xl: Allow control of logging level.

The -v option, which must come before the xl command, increases the
logging level each time it is supplied.

Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
14 years agolibxl: Use the caller's logger (xentoollog)
Keir Fraser [Fri, 28 May 2010 08:34:42 +0000 (09:34 +0100)]
libxl: Use the caller's logger (xentoollog)

We now require callers to provide a xentoollog_logger* for
libxl_ctx_init, and use that for all our own logging and also for
xc_interface_open.

Corresponding change to xl.c.

Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
14 years agolibxl: Fix up some incorrect printf formats
Keir Fraser [Fri, 28 May 2010 08:31:43 +0000 (09:31 +0100)]
libxl: Fix up some incorrect printf formats

We need to use PRIu32 for domids, and also to pass arguments in the
right order.

Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
14 years agolibxc: Use new DBGPRINTF for a few debugging output messages
Keir Fraser [Fri, 28 May 2010 08:31:09 +0000 (09:31 +0100)]
libxc: Use new DBGPRINTF for a few debugging output messages

oubuf and batch restore write messages should be sent with level
XTL_DEBUG so that they don't disturb progress output even with -v.

Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
14 years agolibxc: eliminate static variables, use xentoollog; API change
Keir Fraser [Fri, 28 May 2010 08:30:19 +0000 (09:30 +0100)]
libxc: eliminate static variables, use xentoollog; API change

This patch eliminate the global variables in libxenctrl (used for
logging and error reporting).

Instead the information which was in the global variables is now in a
new xc_interface* opaque structure, which xc_interface open returns
instead of the raw file descriptor; furthermore, logging is done via
xentoollog.

There are three new parameters to xc_interface_open to control the
logging, but existing callers can just pass "0" for all three to get
the old behaviour.

All libxc callers have been adjusted accordingly.

Also update QEMU_TAG for corresponding qemu change.

Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
14 years agoxtl: New xentoollog mini-library.
Keir Fraser [Fri, 28 May 2010 08:29:15 +0000 (09:29 +0100)]
xtl: New xentoollog mini-library.

We provide a new header file "xentoollog.h" which defines an interface
that libraries and applications can use for logging.  This avoids
having to wrap each library's log callbacks up, massage arguments to
log callbacks, and so on.

The library's .o files are within libxc to avoid having to create a
separate lib*.a, but callers do not need to #include xenctrl.h and it
should be regarded as a separate API.

Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
14 years agolibelf: Tidy up logging and remove dependency on stdio.
Keir Fraser [Fri, 28 May 2010 08:27:40 +0000 (09:27 +0100)]
libelf: Tidy up logging and remove dependency on stdio.

libelf now permits callers to specify logging callback functions,
rather than a FILE*.  libelf's non-Xen callers are all libxc users, so
the stdio dependency and the default logging callback function (which
calls vfprintf) is now in libxc.

Xen's use of libxc is unaffected in this patch.

Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
14 years agolibxc: xc_domain_save.c: rename "write_exact" macro
Keir Fraser [Fri, 28 May 2010 08:26:51 +0000 (09:26 +0100)]
libxc: xc_domain_save.c: rename "write_exact" macro

There is already a "write_exact" function declared in xc_private.h.
So rename this macro to to wrexact.

Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
14 years agostubdom/newlib: Provide correct names for time.h timezone variables
Keir Fraser [Fri, 28 May 2010 08:26:25 +0000 (09:26 +0100)]
stubdom/newlib: Provide correct names for time.h timezone variables

Newlib unaccountably defines _daylight, _timezone and _tzname, rather
than daylight, timezone and tzname.  The latter are specified in
SuSv3.

So do a global search and replace as part of our newlib patching :-(.

Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
14 years agoxl: Move "extern" declarations to xl.h
Keir Fraser [Fri, 28 May 2010 08:25:34 +0000 (09:25 +0100)]
xl: Move "extern" declarations to xl.h

Declarations (as opposed to definitions) of external objects should
not appear in .c files.

Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
14 years agoxl: Combine headers into one header file.
Keir Fraser [Fri, 28 May 2010 08:25:07 +0000 (09:25 +0100)]
xl: Combine headers into one header file.

This provides a single place to put declarations of external symbols
etc.

Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
14 years agoiommu: Map correct permissions in IOMMU on grant read-only map request.
Keir Fraser [Fri, 28 May 2010 08:08:00 +0000 (09:08 +0100)]
iommu: Map correct permissions in IOMMU on grant read-only map request.

Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
14 years agoiommu: Specify access permissions to iommu_map_page().
Keir Fraser [Fri, 28 May 2010 07:48:50 +0000 (08:48 +0100)]
iommu: Specify access permissions to iommu_map_page().

Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
14 years agoHAP: Add hardware capability check for 2MB super page.
Keir Fraser [Fri, 28 May 2010 07:14:54 +0000 (08:14 +0100)]
HAP: Add hardware capability check for 2MB super page.

While setting the HAP entry previously, we only check the hardware
capability for 1GB super page. This patch adds hardware capability
check for 2MB superpage

Also, Intel SDM doesn't exclude 1GB feature for 32/pae
host. Therefore remove the BUG_ON() check in common code.

Signed-off-by: Dongxiao Xu <dongxiao.xu@intel.com>
14 years agoxl: print BDF parse errors
Keir Fraser [Fri, 28 May 2010 07:12:15 +0000 (08:12 +0100)]
xl: print BDF parse errors

When parsing BDFs for pci-attach/detach, check the return of scanf
rather than operating on random devices.

Signed-off-by: Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>
14 years agoxl: fix pci-detach usage message
Keir Fraser [Fri, 28 May 2010 07:11:47 +0000 (08:11 +0100)]
xl: fix pci-detach usage message

"xl pci-detach -h" shows the usage for pci-attach

Signed-off-by: Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>
14 years agoxl: fix PCI resource parsing
Keir Fraser [Fri, 28 May 2010 07:10:48 +0000 (08:10 +0100)]
xl: fix PCI resource parsing

The parsing of PCI resources has two problems:

   1. it assumes devices are 32-bits, whereas the fields in the
      "resources" file can have full 64-bit values
   2. it only parses the first resource because the format string is
      missing a \n

Fix both of these up, which allows my Intel 82574L to work with MSI-X.

However, this should probably be using a PCI access library rather
than rummaging around in /sys/bus/pci...

Signed-off-by: Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>