]> xenbits.xensource.com Git - xen.git/log
xen.git
15 years agoocaml: Add xenstored implementation.
Keir Fraser [Thu, 6 May 2010 10:04:39 +0000 (11:04 +0100)]
ocaml: Add xenstored implementation.

Signed-off-by: Vincent Hanquez <vincent.hanquez@eu.citrix.com>
15 years agoocaml: add logging bindings.
Keir Fraser [Thu, 6 May 2010 10:04:02 +0000 (11:04 +0100)]
ocaml: add logging bindings.

Signed-off-by: Vincent Hanquez <vincent.hanquez@eu.citrix.com>
15 years agoocaml: add uuid bindings.
Keir Fraser [Thu, 6 May 2010 10:03:28 +0000 (11:03 +0100)]
ocaml: add uuid bindings.

Signed-off-by: Vincent Hanquez <vincent.hanquez@eu.citrix.com>
15 years agoocaml: Add XS bindings.
Keir Fraser [Thu, 6 May 2010 10:02:54 +0000 (11:02 +0100)]
ocaml: Add XS bindings.

Signed-off-by: Vincent Hanquez <vincent.hanquez@eu.citrix.com>
15 years agoocaml: Add XC bindings.
Keir Fraser [Thu, 6 May 2010 10:02:18 +0000 (11:02 +0100)]
ocaml: Add XC bindings.

This include a small and simpler reimplementation of libxc.

Signed-off-by: Vincent Hanquez <vincent.hanquez@eu.citrix.com>
15 years agoocaml: add mmap bindings implementation.
Keir Fraser [Thu, 6 May 2010 10:01:31 +0000 (11:01 +0100)]
ocaml: add mmap bindings implementation.

This is quite similar to the mmap functionality available in bigarray
but it's less complicated.

Signed-off-by: Vincent Hanquez <vincent.hanquez@eu.citrix.com>
15 years agolibxl: Ensure install directories are created, and copy
Keir Fraser [Wed, 5 May 2010 19:23:27 +0000 (20:23 +0100)]
libxl: Ensure install directories are created, and copy
bash-completion script relative to $(DESTDIR).

Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
15 years agosysctl: Move sysctl enumeration into a single block, same as domctl.
Keir Fraser [Tue, 4 May 2010 21:50:58 +0000 (22:50 +0100)]
sysctl: Move sysctl enumeration into a single block, same as domctl.

Reduces risk of aliased commands.

Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
15 years agoscheduler: Add a global parameter adjustment to the switchable scheduler interface
Keir Fraser [Tue, 4 May 2010 21:43:30 +0000 (22:43 +0100)]
scheduler: Add a global parameter adjustment to the switchable scheduler interface

...along with a new sysctl to call it directly.  This is in order to
support DornerWorks' new ARINC653 scheduler.

Based on code from Josh Holtrop and Kathy Hadley at DornerWorks, Ltd

Signed-off-by: George Dunlap <george.dunlap@eu.citrix.com>
Signed-off-by: Keir Fraser <keir.fraser@eu.citrix.com>
15 years agoscheduler: const-ify references to 'struct scheduler' where possible.
Keir Fraser [Tue, 4 May 2010 21:42:34 +0000 (22:42 +0100)]
scheduler: const-ify references to 'struct scheduler' where possible.

Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
15 years agocpupool: Control interface should be a sysctl rather than a domctl.
Keir Fraser [Tue, 4 May 2010 21:20:05 +0000 (22:20 +0100)]
cpupool: Control interface should be a sysctl rather than a domctl.

Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
15 years agoxen-hptool: Fix after interface change to xc_suspend_evtchn_release().
Keir Fraser [Tue, 4 May 2010 21:19:35 +0000 (22:19 +0100)]
xen-hptool: Fix after interface change to xc_suspend_evtchn_release().

Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
15 years agomce: Revert 21264:a8eb546e3cb0
Keir Fraser [Tue, 4 May 2010 12:59:55 +0000 (13:59 +0100)]
mce: Revert 21264:a8eb546e3cb0

Changes Xen machine-check ABI in incompatible way.

Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
15 years agoCPUIDLE: shorten hpet spin_lock holding time
Keir Fraser [Tue, 4 May 2010 11:52:48 +0000 (12:52 +0100)]
CPUIDLE: shorten hpet spin_lock holding time

Try to reduce spin_lock overhead for deep C state entry/exit. This
will benefit systems with a lot of cpus which need the hpet broadcast
to wakeup from deep C state.

Signed-off-by: Wei Gang <gang.wei@intel.com>
15 years agox86: Relocate boot trampoline to avoid BIOS conflicts.
Keir Fraser [Tue, 4 May 2010 11:51:33 +0000 (12:51 +0100)]
x86: Relocate boot trampoline to avoid BIOS conflicts.

Fix booting through iSCSI protocol with Broadcom network cards.

These boards use the option ROM feature to implement the TCP/IP stack
protocol, and the iSCSI software initiator. The memory address
normally used by the PMM is 0x87000 which conflicts with the memory
allocation for Xen's trampoline routine, currently 0x88000.

Relocating down to 0x7c000 fixes the problem.

Signed-off-by: Fabio Guarneri <fabioguarneri@gmail.com>
15 years agoCPUIDLE: re-implement mwait wakeup process
Keir Fraser [Tue, 4 May 2010 11:48:28 +0000 (12:48 +0100)]
CPUIDLE: re-implement mwait wakeup process

It MWAITs on a completely new flag field, avoiding the IPI-avoidance
semantics of softirq_pending. It also does wakeup-waiting checks on
timer_deadline_start, that being the field that initiates wakeup via
the MONITORed memory region.

Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
Signed-off-by: Wei Gang <gang.wei@intel.com>
15 years agocredit2/cpupools: Fix crash
Keir Fraser [Tue, 4 May 2010 11:46:56 +0000 (12:46 +0100)]
credit2/cpupools: Fix crash

Signed-off-by: Juergen Gross <juergen.gross@ts.fujitsu.com>
15 years agolinux pvdrv: generalize location of autoconf.h
Keir Fraser [Tue, 4 May 2010 11:42:56 +0000 (12:42 +0100)]
linux pvdrv: generalize location of autoconf.h

The location of the file in the build tree changed in recent Linux;
since there can be only one such file, using a wild card instead of
an explicit directory name seems the easiest solution.

Signed-off-by: Jan Beulich <jbeulich@novell.com>
15 years agox86: fix Dom0 booting time regression
Keir Fraser [Tue, 4 May 2010 11:42:21 +0000 (12:42 +0100)]
x86: fix Dom0 booting time regression

Unfortunately the changes in c/s 21035 caused boot time to go up
significantly on certain large systems. To rectify this without going
back to the old behavior, introduce a new memory allocation flag so
that Dom0 allocations can exhaust non-DMA memory before starting to
consume DMA memory. For the latter, the behavior introduced in
aforementioned c/s gets retained, while for the former we can now even
try larger chunks first.

This builds on the fact that alloc_chunk() gets called with non-
increasing 'max_pages' arguments, end hence it can store locally the
allocation order last used (as larger order allocations can't succeed
during subsequent invocations if they failed once).

Signed-off-by: Jan Beulich <jbeulich@novell.com>
15 years agox86: add support for domain-initiated global cache flush
Keir Fraser [Tue, 4 May 2010 11:41:11 +0000 (12:41 +0100)]
x86: add support for domain-initiated global cache flush

Newer Linux' AGP code wants to flush caches on all CPUs under certain
circumstances. Since doing this on all vCPU-s of the domain in
question doesn't yield the intended effect, this needs to be done in
the hypervisor. Add a new MMUEXT operation for this.

Signed-off-by: Jan Beulich <jbeulich@novell.com>
15 years agox86: fix off-by-one error in the cache flush portion of flush_area_local().
Keir Fraser [Tue, 4 May 2010 11:39:29 +0000 (12:39 +0100)]
x86: fix off-by-one error in the cache flush portion of flush_area_local().

Signed-off-by: Jan Beulich <jbeulich@novell.com>
15 years agoblktap: Fix old QCow tapdisk image handling
Keir Fraser [Tue, 4 May 2010 11:38:19 +0000 (12:38 +0100)]
blktap: Fix old QCow tapdisk image handling

When I tried to use QCow image, I found that only each second boot is
successful. As I discovered, this is caused by wrong handling old qcow
tapdisk images. Extended header flag is not stored correctly so the
blktap tries to change endian fo L1 table on each startup.

From: Miroslav Rezanina <mrezanin@redhat.com>
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
15 years agolibxl: make set_memory_target work on domains with no videoram
Keir Fraser [Tue, 4 May 2010 11:36:30 +0000 (12:36 +0100)]
libxl: make set_memory_target work on domains with no videoram

If a domain has no videoram (say, dom0), then treat the size as 0 and
continue, rather than just failing.

Signed-off-by: Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>
15 years agop2m_alloc_table: use p2m_alloc_ptp
Keir Fraser [Tue, 4 May 2010 11:33:14 +0000 (12:33 +0100)]
p2m_alloc_table: use p2m_alloc_ptp

Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
15 years agovmx, tboot: Check the correct in/outside-SMX flag when init'ing VMX.
Keir Fraser [Tue, 4 May 2010 11:29:05 +0000 (12:29 +0100)]
vmx, tboot: Check the correct in/outside-SMX flag when init'ing VMX.

Signed-off-by: Shane Wang <shane.wang@intel.com>
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
15 years agoxend: fix bug in option parsing
Keir Fraser [Tue, 4 May 2010 11:23:54 +0000 (12:23 +0100)]
xend: fix bug in option parsing

If you enable legacy tcp xmlrpc in xend's config but omit to enable
ssl then a backtrace is generated when starting xend.

Signed-off-by: Arnd Hannemann <hannemann@nets.rwth-aachen.de>
15 years agox86: add CMCI software injection interface
Keir Fraser [Tue, 4 May 2010 11:22:25 +0000 (12:22 +0100)]
x86: add CMCI software injection interface

This small patch now add CMCI software injection interface.
So that CMCI error could be triggered by software on CPUs
which support CMCI.

Signed-off-by: Yunhong Jiang<yunhong.jiang@intel.com>
Signed-off-by: Liping Ke <liping.ke@intel.com>
15 years agoxl: Make xl usage summary legible
Keir Fraser [Tue, 4 May 2010 11:19:50 +0000 (12:19 +0100)]
xl: Make xl usage summary legible

The xl usage summary is illegible with its double spacing and huge gap
between the command and its description.  Tighten it up.

Signed-off-by: Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>
Acked-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
15 years agopv_ops: Switch kernel from xen/master to xen/stable-2.6.31.x
Keir Fraser [Tue, 4 May 2010 11:17:19 +0000 (12:17 +0100)]
pv_ops: Switch kernel from xen/master to xen/stable-2.6.31.x

This is functionally identical to xen/master at the moment, but more
meaningful.

Signed-off-by: Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>
15 years agoMake sure git clone gets the right kernel branch
Keir Fraser [Tue, 4 May 2010 11:16:37 +0000 (12:16 +0100)]
Make sure git clone gets the right kernel branch

When cloning kernel repo:
  1. make remote called "xen" rather than the default "origin"
  2. directly checkout the desired branch, rather than the default
  then the desired one

Git 1.5 doesn't support -b on git clone, and seems to do something odd
with the checkout branch argument, so avoid using the newer
commandline options.

Signed-off-by: Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>
15 years agomini-os: Revert 21106:b20f897d6010 "Fix xenbus initialisation"
Keir Fraser [Tue, 4 May 2010 11:15:28 +0000 (12:15 +0100)]
mini-os: Revert 21106:b20f897d6010 "Fix xenbus initialisation"

Jeremy Fitzhardinge (jeremy@goop.org) reports that this fixes HVM+stubdom.

Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
15 years agoChange the global suspend event channel lock file to a per-domain lock file
Keir Fraser [Tue, 4 May 2010 11:12:28 +0000 (12:12 +0100)]
Change the global suspend event channel lock file to a per-domain lock file

This allows multiple guests to be migrated or protected by Remus
simultaneously.

Signed-off-by: Shriram Rajagopalan <rshriram@cs.ubc.ca>
Acked-by: Brendan Cully <brendan@cs.ubc.ca>
15 years agoxm: catch TypeError if xenconsole is nonexistent
Keir Fraser [Tue, 4 May 2010 11:10:54 +0000 (12:10 +0100)]
xm: catch TypeError if xenconsole is nonexistent

Signed-off-by: Yu Zhiguo <yuzg@cn.fujitsu.com>
15 years agoxl: Add option '-c' for 'xl create'
Keir Fraser [Tue, 4 May 2010 11:09:48 +0000 (12:09 +0100)]
xl: Add option '-c' for 'xl create'
* -c Connect to the console after the domain is created.

Signed-off-by: Yu Zhiguo <yuzg@cn.fujitsu.com>
Acked-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
15 years agoxl: Add support of specifying '[vars]' in 'xl create'.
Keir Fraser [Tue, 4 May 2010 11:03:20 +0000 (12:03 +0100)]
xl: Add support of specifying '[vars]' in 'xl create'.

Signed-off-by: Yu Zhiguo <yuzg@cn.fujitsu.com>
Acked-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
15 years agoxl: Add some return-code sanity checks to 'xl info'.
Keir Fraser [Tue, 4 May 2010 10:56:26 +0000 (11:56 +0100)]
xl: Add some return-code sanity checks to 'xl info'.

Signed-off-by: Yu Zhiguo <yuzg@cn.fujitsu.com>
15 years agoxl: fix XL_LOG_ERRNOVAL output
Keir Fraser [Tue, 4 May 2010 10:49:46 +0000 (11:49 +0100)]
xl: fix XL_LOG_ERRNOVAL output

Signed-off-by: Yang Hongyang <yanghy@cn.fujitsu.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
15 years agoxl: Add basic bash completion for xl command.
Keir Fraser [Tue, 4 May 2010 10:48:10 +0000 (11:48 +0100)]
xl: Add basic bash completion for xl command.

Signed-off-by: Yang Hongyang <yanghy@cn.fujitsu.com>
15 years agoxl: Remove unused variable verbose in info function
Keir Fraser [Tue, 4 May 2010 10:46:24 +0000 (11:46 +0100)]
xl: Remove unused variable verbose in info function

Signed-off-by: Yang Hongyang <yanghy@cn.fujitsu.com>
15 years agoxl: Add help for 'xl info' command
Keir Fraser [Tue, 4 May 2010 10:44:19 +0000 (11:44 +0100)]
xl: Add help for 'xl info' command

Signed-off-by: Yang Hongyang <yanghy@cn.fujitsu.com>
15 years agolibxl: Build with -Werror
Keir Fraser [Tue, 4 May 2010 10:38:24 +0000 (11:38 +0100)]
libxl: Build with -Werror

Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
15 years agoxl: Add command description to command table
Keir Fraser [Tue, 4 May 2010 10:37:06 +0000 (11:37 +0100)]
xl: Add command description to command table

Signed-off-by: Yang Hongyang <yanghy@cn.fujitsu.com>
15 years agoxl: Use command table to store command name and implementation
Keir Fraser [Tue, 4 May 2010 10:28:06 +0000 (11:28 +0100)]
xl: Use command table to store command name and implementation

Signed-off-by: Yang Hongyang <yanghy@cn.fujitsu.com>
15 years agoxl: Move xl command implementation to a seperate file
Keir Fraser [Tue, 4 May 2010 10:23:17 +0000 (11:23 +0100)]
xl: Move xl command implementation to a seperate file

Signed-off-by: Yang Hongyang <yanghy@cn.fujitsu.com>
15 years agoxl: Add subcommand "xl sched-credit"
Keir Fraser [Tue, 4 May 2010 10:09:32 +0000 (11:09 +0100)]
xl: Add subcommand "xl sched-credit"

Signed-off-by: Yu Zhiguo <yuzg@cn.fujitsu.com>
Acked-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
15 years agoUpdate QEMU_TAG to 01626771cf2e9285fbfddcbded2820fc77745e4b
Keir Fraser [Tue, 4 May 2010 10:07:06 +0000 (11:07 +0100)]
Update QEMU_TAG to 01626771cf2e9285fbfddcbded2820fc77745e4b

15 years agoRemus: use IFB for net buffer on newer kernels
Keir Fraser [Tue, 4 May 2010 08:36:05 +0000 (09:36 +0100)]
Remus: use IFB for net buffer on newer kernels

IMQ does not work with ebtables on 2.6.31, and IFB is not a
third-party patch.

Signed-off-by: Brendan Cully <brendan@cs.ubc.ca>
15 years agoRemus: add file locking and modprobe utility functions
Keir Fraser [Tue, 4 May 2010 08:35:42 +0000 (09:35 +0100)]
Remus: add file locking and modprobe utility functions

Signed-off-by: Brendan Cully <brendan@cs.ubc.ca>
15 years agoRemus: include device name in vif objects
Keir Fraser [Tue, 4 May 2010 08:35:18 +0000 (09:35 +0100)]
Remus: include device name in vif objects

Signed-off-by: Brendan Cully <brendan@cs.ubc.ca>
15 years agoRemus: fix VM stringification
Keir Fraser [Tue, 4 May 2010 08:34:50 +0000 (09:34 +0100)]
Remus: fix VM stringification

Signed-off-by: Brendan Cully <brendan@cs.ubc.ca>
15 years agoRemus: move device handling into its own module
Keir Fraser [Tue, 4 May 2010 08:34:23 +0000 (09:34 +0100)]
Remus: move device handling into its own module

Signed-off-by: Brendan Cully <brendan@cs.ubc.ca>
15 years agoRemus: remove obsolete code
Keir Fraser [Tue, 4 May 2010 08:31:13 +0000 (09:31 +0100)]
Remus: remove obsolete code

Signed-off-by: Brendan Cully <brendan@cs.ubc.ca>
15 years agoRemus: python netlink fixes
Keir Fraser [Tue, 4 May 2010 08:30:53 +0000 (09:30 +0100)]
Remus: python netlink fixes

Fix deprecation warning in Qdisc class under python 2.6.
Fix rtattr length and padding (rta_len is unaligned).
Null-terminate qdisc name in rtnl messages.

Signed-off-by: Brendan Cully <brendan@cs.ubc.ca>
15 years agolibxl: Expose build-time install paths inside libxl.
Keir Fraser [Thu, 29 Apr 2010 18:38:52 +0000 (19:38 +0100)]
libxl: Expose build-time install paths inside libxl.

Use this to construct the fully-qualified path to xenconsole.

Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
15 years agox86, shadow: propagate pat caching on the shadow l1
Keir Fraser [Mon, 26 Apr 2010 11:13:23 +0000 (12:13 +0100)]
x86, shadow: propagate pat caching on the shadow l1

PAT caching was only propagated if has_arch_pdevs(),
causing the hvm_get_mem_pinned_cacheattr() to be ignored
in the non passthrough case.
l1_disallow_mask() needs to be relaxed.

Signed-off-by: Jean Guyader <jean.guyader@citrix.com>
15 years agoSupport Linux's advanced crashkernel= syntax
Keir Fraser [Mon, 26 Apr 2010 11:12:12 +0000 (12:12 +0100)]
Support Linux's advanced crashkernel= syntax

Quoting the original Linux patch's description:

"This patch adds a extended crashkernel syntax that makes the value of
 reserved system RAM dependent on the system RAM itself:

    crashkernel=3D<range1>:<size1>[,<range2>:<size2>,...][@offset]
    range=3Dstart-[end]

 For example:

    crashkernel=3D512M-2G:64M,2G-:128M

 The motivation comes from distributors that configure their
 crashkernel command line automatically with some configuration tool
 (YaST, you know ;)). Of course that tool knows the value of System
 RAM, but if the user removes RAM, then the system becomes unbootable
 or at least unusable and error handling is very difficult."

For x86, other than Linux we pass the actual amount of RAM rather than
the highest page's address (to cope with sparse physical address
maps).

This still needs to be hooked up for ia64.

Signed-off-by: Jan Beulich <jbeulich@novell.com>
15 years agox86: make pxm_to_node() return sane values when disabling NUMA internally
Keir Fraser [Mon, 26 Apr 2010 11:11:30 +0000 (12:11 +0100)]
x86: make pxm_to_node() return sane values when disabling NUMA internally

Otherwise, pass-through code may call memory allocation functions with
invalid node IDs, causing the allocations to fail.

Signed-off-by: Jan Beulich <jbeulich@novell.com>
15 years agoxl: Add option '-p' for command 'xl create'
Keir Fraser [Mon, 26 Apr 2010 05:52:44 +0000 (06:52 +0100)]
xl: Add option '-p' for command 'xl create'

Add option '-p' for command 'xl create', and update
the help info.
* -p Leave the domain paused after it is created.

Signed-off-by: Yu Zhiguo <yuzg@cn.fujitsu.com>
15 years agoxl: Fix segment fault of 'xl list'
Keir Fraser [Mon, 26 Apr 2010 05:52:13 +0000 (06:52 +0100)]
xl: Fix segment fault of 'xl list'

If libxl_list_domain() returns NULL, segment fault occurs now.

Signed-off-by: Yu Zhiguo <yuzg@cn.fujitsu.com>
15 years agocpupools, xend: Add missing file sxputils.py
Keir Fraser [Mon, 26 Apr 2010 05:50:39 +0000 (06:50 +0100)]
cpupools, xend: Add missing file sxputils.py

Signed-off-by: Juergen Gross <juergen.gross@ts.fujitsu.com>
15 years agocpupools, xend: Add missing file XendCPUPool.py
Keir Fraser [Fri, 23 Apr 2010 14:04:26 +0000 (15:04 +0100)]
cpupools, xend: Add missing file XendCPUPool.py

Signed-off-by: Juergen Gross <juergen.gross@ts.fujitsu.com>
15 years agoAdd debug-key 'D' to dump EPT p2m table.
Keir Fraser [Fri, 23 Apr 2010 07:40:58 +0000 (08:40 +0100)]
Add debug-key 'D' to dump EPT p2m table.

Signed-off-by: Dongxiao Xu <dongxiao.xu@intel.com>
15 years agoxl: support oos domain parameter
Keir Fraser [Fri, 23 Apr 2010 07:39:29 +0000 (08:39 +0100)]
xl: support oos domain parameter

Signed-off-by: Juergen Gross <juergen.gross@ts.fujitsu.com>
Acked-by: Vincent Hanquez <vincent.hanquez@eu.citrix.com>
15 years agocpupools: optimise domain creation if pool movement is a no-op
Keir Fraser [Fri, 23 Apr 2010 07:38:35 +0000 (08:38 +0100)]
cpupools: optimise domain creation if pool movement is a no-op

Signed-off by: Juergen Gross <juergen.gross@ts.fujitsu.com>

15 years agoRevert 21224:a7947fd90328 "xend: earlier remove the backend of tapdisk device"
Keir Fraser [Fri, 23 Apr 2010 07:37:19 +0000 (08:37 +0100)]
Revert 21224:a7947fd90328 "xend: earlier remove the backend of tapdisk device"

Consensus is that this is not the correct fix.

Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
15 years agoconsole: Make initial static console buffer __initdata.
Keir Fraser [Thu, 22 Apr 2010 16:43:56 +0000 (17:43 +0100)]
console: Make initial static console buffer __initdata.

The previous scheme --- freeing an area of BSS --- did not interact
nicely with device passthrough as IOMMU will not have any Xen BSS area
in guest device pagetables. Hence if the freed BSS space gets
allocated to a guest, DMAs to guest's own memory can fail.

The simple solution here is to always free the static buffer at end of
boot (initmem is specially handled for IOMMUs) and require a
dynamically-allocated buffer always to be created.

Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
15 years agoxend: earlier remove the backend of tapdisk device in
Keir Fraser [Thu, 22 Apr 2010 08:44:29 +0000 (09:44 +0100)]
xend: earlier remove the backend of tapdisk device in
xenstore to release the resource allocated in backend driver
lies in dom0'kernel

Blktapctl thread will use qemu-dm connection instead of tapdisk-ioemu
in the case of FV VM. We found the resource like memory allocated for
this Guest can't be free for backend driver couldn't be closed in qemu-dm.

This patch would  remove the backend of tapdisk device earlier in
xenstore to triger qemu-dm to notify the backend driver to release the
resource allocated.
I have tested this patch at the case of
1, save && restore
2, destory && shutdown
3, snapshot

Signed-off-by: James ( Song Wei ) <jsong@novell.com>
15 years agoxend: don't drop device config on domain start failure
Keir Fraser [Thu, 22 Apr 2010 08:42:37 +0000 (09:42 +0100)]
xend: don't drop device config on domain start failure

If domain creation in xend fails before devices are configured, e.g.
insufficient memory, device config is dropped from xend's managed
domain config.

Once xend is restarted, the domain's devices are lost.

This patch fixes a bug in XendConfig where only the device
controller was consulted for device configuration.

Signed-off-by: Jim Fehlig <jfehlig@novell.com>
15 years agoHAP 1GB: Add corner case handling for 1GB super page.
Keir Fraser [Thu, 22 Apr 2010 08:41:36 +0000 (09:41 +0100)]
HAP 1GB: Add corner case handling for 1GB super page.

 - Without the check, guest memory allocation will never reach the
   boundary of a 1GB super page.

Signed-off-by: Dongxiao Xu <dongxiao.xu@intel.com>
15 years agoxl: add "xl info" command
Keir Fraser [Thu, 22 Apr 2010 08:39:58 +0000 (09:39 +0100)]
xl: add "xl info" command

The info subcommand was missing from the xl tool. Use the new libxl
wrapper functions to create a clone of "xm info". The splitting into
several smaller functions is enspired by the implementation in
XendNode.py.

Signed-off-by: Andre Przywara <andre.przywara@amd.com>
Acked-by: Vincent Hanquez <vincent.hanquez@eu.citrix.com>
15 years agolibxl: add version_info function
Keir Fraser [Thu, 22 Apr 2010 08:39:17 +0000 (09:39 +0100)]
libxl: add version_info function

Xen provides a xen_version hypercall to query the values of several
interesting things (like hypervisor version, commandline used, actual
changeset, etc.). Create a user-friendly and efficient wrapper around
the libxc function to provide values for xl info output.
Since the information is static during the whole runtime, we store
it within the libxl_ctx structure and just deliver the pointer on
subsequent calls.

Signed-off-by: Andre Przywara <andre.przywara@amd.com>
Acked-by: Vincent Hanquez <vincent.hanquez@eu.citrix.com>
15 years agolibxl: add sched_get_id function
Keir Fraser [Thu, 22 Apr 2010 08:38:39 +0000 (09:38 +0100)]
libxl: add sched_get_id function

To get the name of the currently used scheduler, Xen provides a
sched_id sysctl. Add a libxl wrapper around the libxc function to
query this.

Signed-off-by: Andre Przywara <andre.przywara@amd.com>
Acked-by: Vincent Hanquez <vincent.hanquez@eu.citrix.com>
15 years agolibxl: extend physinfo structure
Keir Fraser [Thu, 22 Apr 2010 08:37:31 +0000 (09:37 +0100)]
libxl: extend physinfo structure

The libxl version of the physinfo sysctl does not contain some
fields like nr_nodes or capabilities needed for xl info output.
Add them to the structure and the retrieving function.

Signed-off-by: Andre Przywara <andre.przywara@amd.com>
Acked-by: Vincent Hanquez <vincent.hanquez@eu.citrix.com>
15 years agocpupools [6/6]: Documentation changes
Keir Fraser [Wed, 21 Apr 2010 11:51:53 +0000 (12:51 +0100)]
cpupools [6/6]: Documentation changes

Signed-off-by: Juergen Gross <juergen.gross@ts.fujitsu.com>
15 years agocpupools [5/6]: xm-test add-ons
Keir Fraser [Wed, 21 Apr 2010 11:51:13 +0000 (12:51 +0100)]
cpupools [5/6]: xm-test add-ons

Signed-off-by: Juergen Gross <juergen.gross@ts.fujitsu.com>
15 years agocpupools [4/6]: python/xend changes
Keir Fraser [Wed, 21 Apr 2010 11:50:32 +0000 (12:50 +0100)]
cpupools [4/6]: python/xend changes

Signed-off-by: Juergen Gross <juergen.gross@ts.fujitsu.com>
15 years agocpupools [3/6]: libxen changes
Keir Fraser [Wed, 21 Apr 2010 11:49:41 +0000 (12:49 +0100)]
cpupools [3/6]: libxen changes

Signed-off-by: Juergen Gross <juergen.gross@ts.fujitsu.com>
15 years agocpupools [2/6]: libxc changes
Keir Fraser [Wed, 21 Apr 2010 11:49:00 +0000 (12:49 +0100)]
cpupools [2/6]: libxc changes

Signed-off-by: Juergen Gross <juergen.gross@ts.fujitsu.com>
15 years agocpupools [1/6]: hypervisor changes
Keir Fraser [Wed, 21 Apr 2010 11:48:03 +0000 (12:48 +0100)]
cpupools [1/6]: hypervisor changes

Signed-off-by: Juergen Gross <juergen.gross@ts.fujitsu.com>
15 years agodocs: Add tmem documentation
Keir Fraser [Wed, 21 Apr 2010 07:31:31 +0000 (08:31 +0100)]
docs: Add tmem documentation

Signed-off-by: Dan Magenheimer <dan.magenheimer@oracle.com>
15 years agoxen: build fix GNU sed vs. BSD sed
Keir Fraser [Wed, 21 Apr 2010 07:30:45 +0000 (08:30 +0100)]
xen: build fix GNU sed vs. BSD sed

Fixes the build error below:

gmake[5]: Entering directory `xen/arch/x86/boot'
gcc  -O1 -fno-omit-frame-pointer -fno-optimize-sibling-calls -m32
-march=3Di686 -g -fno-strict-aliasing -std=3Dgnu99 -Wall
-Wstrict-prototypes
-Wno-unused-value -Wdeclaration-after-statement  -fno-stack-protector
-Werror -fno-builtin -msoft-float -c reloc.c -o reloc.o
ld -melf_i386 -N -Ttext  -o reloc.lnk reloc.o
ld: invalid hex number `-o'

BSD sed does not support the '+' in the basic re while gnu sed does.
BSD sed supports '+' in the extended re and uses the -E flag while
gnu sed uses -r.

The only difference with the original version is that the '+'
qualifier is replaced with '\{1\,\}' which should work with both BSD
sed and GNU sed.

Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
15 years agoTools: add online/offline hotplug user interfaces
Keir Fraser [Wed, 21 Apr 2010 07:29:26 +0000 (08:29 +0100)]
Tools: add online/offline hotplug user interfaces

Exporting cpu on/offline and memory on/offline hotplug interfaces,
so that users can do those (memory/cpu) hotplug actions with
following command line freely:

usage: xen-hptool <command> [args]
    xen-hptool command list:\n\n
    cpu-online    <cpuid>    online CPU <cpuid>
    cpu-offline   <cpuid>    offline CPU <cpuid>
    mem-online    <mfn>      online MEMORY <mfn>
    mem-offline   <mfn>      offline MEMORY <mfn>
    mem-status    <mfn>      query Memory status<mfn>

Signed-off-by: Yunhong Jiang<yunhong.jiang@intel.com>
Signed-off-by: Liping Ke <liping.ke@intel.com>
15 years agotasklet: Add lock-free exit path from do_tasklet() when no work to do.
Keir Fraser [Tue, 20 Apr 2010 13:32:53 +0000 (14:32 +0100)]
tasklet: Add lock-free exit path from do_tasklet() when no work to do.

Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
15 years agox86: No need to sync_local_execstate() during CPU hot-unplug.
Keir Fraser [Tue, 20 Apr 2010 06:54:47 +0000 (07:54 +0100)]
x86: No need to sync_local_execstate() during CPU hot-unplug.

This is done implicitly when we enter stopmachine_run() context,
because the underlying tasklet mechanism performs the sync before
running a tasklet handler.

Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
15 years agox86: Rename __sync_lazy_execstate() to __sync_local_execstate().
Keir Fraser [Mon, 19 Apr 2010 16:57:28 +0000 (17:57 +0100)]
x86: Rename __sync_lazy_execstate() to __sync_local_execstate().

This naming scheme is more rational. Also use non-x86-specific
function sync_local_execstate() where possible.

Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
15 years agox86 hvm: Simplify vlapic init-sipi logic (no async pause logic)
Keir Fraser [Mon, 19 Apr 2010 16:53:10 +0000 (17:53 +0100)]
x86 hvm: Simplify vlapic init-sipi logic (no async pause logic)

This is possible now that tasklets run in idle-vcpu context

Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
15 years agoSynchronise lazy execstate before calling tasklet handlers.
Keir Fraser [Mon, 19 Apr 2010 16:48:20 +0000 (17:48 +0100)]
Synchronise lazy execstate before calling tasklet handlers.

This ensures we are properly running on idle-vcpu state, which certain
things (e.g., use of vmx_vmcs_{enter,exit}) rely on. It also means we
don't need to do the same thing in the stopmachine_run handler.

Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
15 years agotmem: (re-)enable by default
Keir Fraser [Mon, 19 Apr 2010 16:20:43 +0000 (17:20 +0100)]
tmem: (re-)enable by default

Late in the 4.0 release it was discovered that certain order>0
allocations could fail and had no fallback.  This conflicted with
tmem especially when combined with aggressive ballooning.
A hack-y workaround patch was added in time for 4.0 that has
reduced (but not completely eliminated) the problem but
tmem was left disabled-by-default for the 4.0 release.

Re-enable it in xen-unstable by default to help identify cases
where the workaround is insufficient.   Tmem can be
disabled with the no-tmem Xen boot option.  Please report
failures (that are fixed with the no-tmem option) to me.

Signed-off-by: Dan Magenheimer <dan.magenheimer@oracle.com>
15 years agostopmachine: Implement using tasklets rather than a softirq.
Keir Fraser [Mon, 19 Apr 2010 10:47:59 +0000 (11:47 +0100)]
stopmachine: Implement using tasklets rather than a softirq.

Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
15 years agox86: Simplify freeze_domains() and thaw_domains(). Since they now
Keir Fraser [Mon, 19 Apr 2010 10:34:49 +0000 (11:34 +0100)]
x86: Simplify freeze_domains() and thaw_domains(). Since they now
run in idle-vcpu context, no care needs to be taken about pausing
'current'.

Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
15 years agoCleanups to cpu_disable_scheduler().
Keir Fraser [Mon, 19 Apr 2010 10:30:51 +0000 (11:30 +0100)]
Cleanups to cpu_disable_scheduler().

Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
15 years agoRevert 21180:11423ce78ee0, 21181:9d5ecf79f1b5, 21185:fddff17c7c74.
Keir Fraser [Mon, 19 Apr 2010 10:16:06 +0000 (11:16 +0100)]
Revert 21180:11423ce78ee0, 21181:9d5ecf79f1b5, 21185:fddff17c7c74.

Unnecessary now that tasklets run in vcpu context.

Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
15 years agoSimplify continue_hypercall_on_cpu() now that it runs in vcpu context.
Keir Fraser [Mon, 19 Apr 2010 10:07:14 +0000 (11:07 +0100)]
Simplify continue_hypercall_on_cpu() now that it runs in vcpu context.

We do not need to take so much care over putting the original vcpu to
sleep, as it will not be spinning on progress of the idle vcpu.

Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
15 years agoImplement tasklets as running in VCPU context (sepcifically, idle-VCPU context)
Keir Fraser [Mon, 19 Apr 2010 09:12:41 +0000 (10:12 +0100)]
Implement tasklets as running in VCPU context (sepcifically, idle-VCPU context)

...rather than in softirq context. This is expected to avoid a lot of
subtle deadlocks relating to the fact that softirqs can interrupt a
scheduled vcpu.

Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
15 years agoMove tasklet implementation into its own source files.
Keir Fraser [Mon, 19 Apr 2010 09:06:42 +0000 (10:06 +0100)]
Move tasklet implementation into its own source files.

This is preparation for implementing tasklets in vcpu context rather
than softirq context. There is no change to the implementation of
tasklets in this patch.

Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
15 years agoCalling awk and not gawk in the Xen scripts
Keir Fraser [Mon, 19 Apr 2010 08:00:30 +0000 (09:00 +0100)]
Calling awk and not gawk in the Xen scripts

I noticed that 2 scripts in Xen 4.0.0 are calling "gawk". Normally, in
most distributions, gawk is considered a specific version of awk.
Calling "gawk" and not "awk" generally means that you need
specificities of the "g" version of awk, as opposed to "mawk" which is
another implementation of the same tool.

So, unless I misread the scripts, Xen doesn't need to use gawk but
just any implementation of awk, and the attached patch can safely be
applied.

If I am wrong (which I don't think I am at the first look) and that
there's a reason why gawk is used and not awk, then IMHO, the toplevel
README should mention it in the prerequisites.

From: Thomas Goirand <thomas@goirand.fr>
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
15 years agoxend: support 'ioemu' subtype in tap protocol specification
Keir Fraser [Mon, 19 Apr 2010 07:59:14 +0000 (08:59 +0100)]
xend: support 'ioemu' subtype in tap protocol specification

blktapctrl supports both 'tapdisk' and 'ioemu' subtypes in tap
protocol specification.  Support the 'ioemu' subtype in xend
BlktapController as well.

Signed-off-by: Jim Fehlig <jfehlig@novell.com>
15 years agotools/hotplug/Linux/blktap: remove optional tapdisk: prefix
Keir Fraser [Mon, 19 Apr 2010 07:58:43 +0000 (08:58 +0100)]
tools/hotplug/Linux/blktap: remove optional tapdisk: prefix

Perhaps this should even be further generalized (e.g. to remove any
"[!/]*:" pattern prefixes) to be more forward compatible?

Signed-off-by: Jan Beulich <jbeulich@novell.com>
15 years agomce: Add a x86_mcinfo_reserve() function, to reserve space from mc_info.
Keir Fraser [Mon, 19 Apr 2010 07:55:33 +0000 (08:55 +0100)]
mce: Add a x86_mcinfo_reserve() function, to reserve space from mc_info.

With this method, we don't need to collect bank and globalinformation
to a local variable and do x86_mcinfo_add() to copy that information
to mc_info.  This avoid copy and also we can be aware earlier if there
is enough space in the mc_info.

Also extract function that get global/bank information to seperated
function mca_init_bank/mca_init_global.

It's meaningless to get the current information in mce context, keep
it here but should be removed in future.

Also a flag added to mc_info, to indicate some information is lost due
to OOM.

Signed-off-by: Jiang, Yunhong <yunhong.jiang@intel.com>
15 years agoClean up MCA MSR virtualization and vMCE injection
Keir Fraser [Mon, 19 Apr 2010 07:54:53 +0000 (08:54 +0100)]
Clean up MCA MSR virtualization and vMCE injection

Remove all virtual MCE related work into a seperated file.
It also try to do some clean-up on the vMCE, including:
a) renmae some function name like mce_init_msr/mce_rdmsr to be
   vmce_init_msr/vmce_rdmsr to make it more straightforward,
b) make the vmca_msrs be a pointer in arch_domain,
    to decrease arch_domain's size
c) extract per-bank MCA MSR access to be seperated function
    (bank_mce_wrmsr/bank_mce_rdmsr) to make it be a bit cleaner.
d) A new file xen/include/asm-x86/mce.h  is added for vmce related
header.

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