Commit Graph
21241 Commits
Author SHA1 Message Date
Keir Fraser a47cb321e9 Remus: move device handling into its own module
Signed-off-by: Brendan Cully <brendan@cs.ubc.ca>
2010-05-04 09:34:23 +01:00
Keir Fraser aeef67a43b Remus: remove obsolete code
Signed-off-by: Brendan Cully <brendan@cs.ubc.ca>
2010-05-04 09:31:13 +01:00
Keir Fraser c6a0974ed9 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>
2010-05-04 09:30:53 +01:00
Keir Fraser 147e14cc8e 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>
2010-04-29 19:38:52 +01:00
Keir Fraser 7720401043 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>
2010-04-26 12:13:23 +01:00
Keir Fraser c1cfb1a358 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>
2010-04-26 12:12:12 +01:00
Keir Fraser efaca454ab 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>
2010-04-26 12:11:30 +01:00
Keir Fraser 6b19626a0e 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>
2010-04-26 06:52:44 +01:00
Keir Fraser bd8daf6035 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>
2010-04-26 06:52:13 +01:00
Keir Fraser 422376d6e2 cpupools, xend: Add missing file sxputils.py
Signed-off-by: Juergen Gross <juergen.gross@ts.fujitsu.com>
2010-04-26 06:50:39 +01:00
Keir Fraser 8149e93337 cpupools, xend: Add missing file XendCPUPool.py
Signed-off-by: Juergen Gross <juergen.gross@ts.fujitsu.com>
2010-04-23 15:04:26 +01:00
Keir Fraser 6cf942ffa2 Add debug-key 'D' to dump EPT p2m table.
Signed-off-by: Dongxiao Xu <dongxiao.xu@intel.com>
2010-04-23 08:40:58 +01:00
Keir Fraser f7167a003c xl: support oos domain parameter
Signed-off-by: Juergen Gross <juergen.gross@ts.fujitsu.com>
Acked-by: Vincent Hanquez <vincent.hanquez@eu.citrix.com>
2010-04-23 08:39:29 +01:00
Keir Fraser bb315e2384 cpupools: optimise domain creation if pool movement is a no-op
Signed-off by: Juergen Gross <juergen.gross@ts.fujitsu.com>
2010-04-23 08:38:35 +01:00
Keir Fraser 261d19559d 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>
2010-04-23 08:37:19 +01:00
Keir Fraser b5e0c9e2a3 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>
2010-04-22 17:43:56 +01:00
Keir Fraser 3dc27ee385 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>
2010-04-22 09:44:29 +01:00
Keir Fraser 77af399e7f 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>
2010-04-22 09:42:37 +01:00
Keir Fraser af277a631b 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>
2010-04-22 09:41:36 +01:00
Keir Fraser 2cb79e82a0 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>
2010-04-22 09:39:58 +01:00
Keir Fraser 63e8bcc364 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>
2010-04-22 09:39:17 +01:00
Keir Fraser 419794de68 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>
2010-04-22 09:38:39 +01:00
Keir Fraser 6de99b587a 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>
2010-04-22 09:37:31 +01:00
Keir Fraser 8c81e1d03f cpupools [6/6]: Documentation changes
Signed-off-by: Juergen Gross <juergen.gross@ts.fujitsu.com>
2010-04-21 12:51:53 +01:00
Keir Fraser c64f368519 cpupools [5/6]: xm-test add-ons
Signed-off-by: Juergen Gross <juergen.gross@ts.fujitsu.com>
2010-04-21 12:51:13 +01:00
Keir Fraser 832656a179 cpupools [4/6]: python/xend changes
Signed-off-by: Juergen Gross <juergen.gross@ts.fujitsu.com>
2010-04-21 12:50:32 +01:00
Keir Fraser 6e6a088333 cpupools [3/6]: libxen changes
Signed-off-by: Juergen Gross <juergen.gross@ts.fujitsu.com>
2010-04-21 12:49:41 +01:00
Keir Fraser a5f70e8d92 cpupools [2/6]: libxc changes
Signed-off-by: Juergen Gross <juergen.gross@ts.fujitsu.com>
2010-04-21 12:49:00 +01:00
Keir Fraser 78be3dbbfe cpupools [1/6]: hypervisor changes
Signed-off-by: Juergen Gross <juergen.gross@ts.fujitsu.com>
2010-04-21 12:48:03 +01:00
Keir Fraser b066d6894d docs: Add tmem documentation
Signed-off-by: Dan Magenheimer <dan.magenheimer@oracle.com>
2010-04-21 08:31:31 +01:00
Keir Fraser a92557455d 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>
2010-04-21 08:30:45 +01:00
Keir Fraser 284d5633be 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>
2010-04-21 08:29:26 +01:00
Keir Fraser 3cd0ba42d5 tasklet: Add lock-free exit path from do_tasklet() when no work to do.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2010-04-20 14:32:53 +01:00
Keir Fraser 6da2b1ae55 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>
2010-04-20 07:54:47 +01:00
Keir Fraser 6de4ee40f3 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>
2010-04-19 17:57:28 +01:00
Keir Fraser 265f734a8c 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>
2010-04-19 17:53:10 +01:00
Keir Fraser 346da00456 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>
2010-04-19 17:48:20 +01:00
Keir Fraser b30a2c5426 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>
2010-04-19 17:20:43 +01:00
Keir Fraser 1f437c6231 stopmachine: Implement using tasklets rather than a softirq.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2010-04-19 11:47:59 +01:00
Keir Fraser 5fa9cbb805 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>
2010-04-19 11:34:49 +01:00
Keir Fraser d4f61a069a Cleanups to cpu_disable_scheduler().
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2010-04-19 11:30:51 +01:00
Keir Fraser 2c4a946c0d Revert 21180:11423ce78ee0, 21181:9d5ecf79f1b5, 21185:fddff17c7c74.
Unnecessary now that tasklets run in vcpu context.

Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2010-04-19 11:16:06 +01:00
Keir Fraser f3a1f2d30e 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>
2010-04-19 11:07:14 +01:00
Keir Fraser 10d7e8ed96 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>
2010-04-19 10:12:41 +01:00
Keir Fraser 197965150c 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>
2010-04-19 10:06:42 +01:00
Keir Fraser f770264fe1 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>
2010-04-19 09:00:30 +01:00
Keir Fraser 04dffa0be9 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>
2010-04-19 08:59:14 +01:00
Keir Fraser fc9e443321 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>
2010-04-19 08:58:43 +01:00
Keir Fraser b17520fdb1 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>
2010-04-19 08:55:33 +01:00
Keir Fraser 05dd855d25 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>
2010-04-19 08:54:53 +01:00