Commit Graph
387 Commits
Author SHA1 Message Date
Keir Fraser 6b0b6e01b9 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>
2010-06-07 15:45:56 +01:00
Keir Fraser 16c22751fa xenwatchdogd: Fix build errors
Signed-off-by: Patrick Colp <pjcolp@cs.ubc.ca>
2010-06-07 07:16:43 +01:00
Keir Fraser 78c8506e77 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>
2010-06-04 11:35:23 +01:00
Keir Fraser 5cc436c1d2 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>
2010-05-28 09:30:19 +01:00
Keir Fraser 785effb80a xen-hptool: A few usage cleanups.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2010-05-19 14:18:56 +01:00
Keir Fraser e926e7d1a9 xenpm: remove wrong and pointless "current" indicator
Using the CPU number to compare with an index into an array containing
only a subset of CPUs isn't valid. And indicator isn't necessary here
at all since the CPU number being dealt with gets printed right before
this line.

Signed-off-by: Jan Beulich <jbeulich@novell.com>
2010-05-07 09:50:17 +01:00
Keir Fraser df2edff1aa xen-hptool: Fix after interface change to xc_suspend_evtchn_release().
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2010-05-04 22:19:35 +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 645f5ea7cb Topology-info sysctl cleanups.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2010-04-13 09:38:54 +01:00
Keir Fraser 002c5bcdbe Refactor Xen Support for Intel Turbo Boost
Refactor the existing code that supports the Intel Turbo feature to
move all the driver specific bits in the cpufreq driver.  Create
a tri-state interface for the Turbo feature that can distinguish
amongst enabled Turbo, disabled Turbo, and processors that don't
support Turbo at all.

Signed-off-by: Mark Langsdorf <mark.langsdorf@amd.com>
2010-04-09 08:52:43 +01:00
Keir Fraser 38c433d0c7 tmem: add page deduplication with optional compression or trailing-zero-elimination
Add "page deduplication" capability (with optional compression
and trailing-zero elimination) to Xen's tmem.

(Transparent to tmem-enabled guests.)  Ephemeral pages
that have the exact same content are "combined" so that only
one page frame is needed.  Since ephemeral pages are essentially
read-only, no C-O-W (and thus no equivalent of swapping) is
necessary.  Deduplication can be combined with compression
or "trailing zero elimination" for even more space savings.

Signed-off-by: Dan Magenheimer <dan.magenheimer@oracle.com>
2010-04-06 07:11:48 +01:00
Keir Fraser d2a92c94a1 xenpm: Allow user to enable/disable dbs governor turbo mode.
Signed-off-by: Lu Guanqun <guanqun.lu@intel.com>
2010-02-08 08:48:40 +00:00
Keir Fraser 1921835bf4 tools/xen-detect: fix printing xen version
check_for_xen() should return xen version rather than
boolean true if signature XenVMM is found.

Signed-off-by: Yu Zhiguo <yuzg@cn.fujitsu.com>
2010-02-03 09:42:45 +00:00
Keir Fraser 8c3afa67ee tools/gtraceview: fix SIGFPE
If there are 0 or 1 valid record in xentrace file,
SIGFPE will occur. Fix it.

Signed-off-by: Yu Zhiguo <yuzg@cn.fujitsu.com>
2010-01-29 08:59:46 +00:00
Keir Fraser f145152e22 xen-detect: Add command-line arguments.
- Usage info
 - Quiesce normal output
 - Affect exit status if running in unexpected context

Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2009-12-23 08:22:13 +00:00
Keir Fraser 154d93f466 Make Citrix copyright strinsg consistent.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2009-12-18 07:42:09 +00:00
Keir Fraser 420820e830 xen-detect: Avoid dumping core
F12 introduces a tool to automatically report bugs when there are core
dumps.  Since xen-detect relies on fork+waitpid in order to trap a
SIGILL from a child, every time someone runs xen-detect on a bare
metal kernel a bug is reported into Red Hat's Bugzilla. :-)

However, even without this contingent need, leaving core dumps around
is not nice.  So this patch just traps SIGILL using
signal/sentjmp/longjmp, without the need to fork.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2009-12-14 11:58:45 +00:00
Keir Fraser 45c3fa3c2d xen-hvmctx: add recently added gtsc_khz field to output
Signed-off-by: Dan Magenheimer <dan.magenheimer@oracle.com>
2009-11-03 08:37:52 +00:00
Keir Fraser 01dbe55471 lockprof: Fix x86_32 build and clean up coding style
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2009-10-15 08:29:33 +01:00
Keir Fraser 0482af4d96 Spinlock profiling (enable in build with lock_profile=y)
Adds new tool xenlockprof to run from dom0.

From: Juergen Gross <juergen.gross@ts.fujitsu.com>
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2009-10-14 09:07:51 +01:00
Keir Fraser 91cb4623df x86 hvm: Guests should scan CPUID range 40000000-4000ff00 for Xen leaves.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2009-09-16 08:55:23 +01:00
Keir Fraser 6c6b085bec pygrub: Set path in #! line of pygrub, too
pygrub currently has a hardcoded path of /usr/bin/python which is not
correct if the version of python at install time is not the same as
that at build time.  This patch uses the existing install-wrap and
python/get-path machinery.

(It does not address the currently-existing bug that the get-path
machinery works by assuming that `python' is a symlink, rather than
querying the python interpreter for its version.)

Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
2009-08-25 14:57:45 +01:00
Keir Fraser bad456af01 xen-hvmctx: don't compile for ia64.
xen-hvmctx is a x86 specific tool so that it shouldn't compile for ia64.

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
2009-08-19 14:22:15 +01:00
Keir Fraser 6b55ec4079 xen pm trace utility cleanup
xenpm trace utility gtraceview cleanup

- add gtraceview help info on how to get raw data by xentrace
- make trace_exit_reason compiled in non-debug mode. trace_exit_reason
  can be enable/disabled by xentrace at runtime, so no need to disable
  it at build time.

Signed-off-by: Yu Ke <ke.yu@intel.com>
2009-08-19 13:17:41 +01:00
Keir Fraser b5eb2dabf5 xen-hvmctx: a tool to print the HVM state of a running domain
Signed-off-by: Tim Deegan <Tim.Deegan@citrix.com>
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2009-08-14 17:26:23 +01:00
Keir Fraser 99e7db68f3 tmem: one-liner correcting stat parsing ordering
Signed-off-by: Dan Magenheimer <dan.magenheimer@oracle.com>
2009-08-12 14:06:30 +01:00
Keir Fraser 9fe075decc tools: xenbackendd for NetBSD
Attached patch introduces xenbackendd. It is used on NetBSD
to launch the hotplug scripts. Later xenbackendd can be improved to
also launch qemu-dm as child process and will notice when qemu-dm
crashes.

The changes the patch makes:
- rename hotplug scripts as xenbackendd expects them
  (current names were taken from pkgsrc)
- install hotplug scripts as executable scripts
- introduce xenbackendd
- build/install/launch on NetBSD only

Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
2009-07-22 14:37:30 +01:00
Keir Fraser cfafda4169 tools: Always check for __linux__ not __Linux__
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2009-07-02 21:45:30 +01:00
Keir Fraser 47eb698d53 gtraceview: compile fixes for NetBSD.
Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
2009-07-02 11:36:17 +01:00
Keir Fraser 5dc9ac92ad x86 Cx tracing: adds gtraceview & gtracestat utilities
Signed-off-by: Lu Guanqun <guanqun.lu@intel.com>
2009-06-29 11:03:24 +01:00
Keir Fraser da5e66e536 tmem: extra stats
This patch collects a few additional valuable per-domain
performance stats.

Signed-off-by: Dan Magenheimer <dan.magenheimer@oracle.com>
2009-06-27 10:40:11 +01:00
Keir Fraser d2c78b31b5 tmem: shared ephemeral (SE) pool (clustering) fixes
Tmem can share clean page cache pages for Linux domains
in a virtual cluster (currently only the ocfs2 filesystem
has a patch on the Linux side).  So when one domain
"puts" (evicts) a page, any domain in the cluster can
"get" it, thus saving disk reads.  This functionality
is already present; these are only bug fixes.

- fix bugs when an SE pool is destroyed
- fixes in parsing tool for xm tmem-list output for SE pools
- incorrect locking in one case for destroying an SE pool
- clearer verbosity for transfer when an SE pool is destroyed
- minor cleanup: merge routines that are mostly duplicate

Signed-off-by: Dan Magenheimer <dan.magenheimer@oracle.com>
2009-06-01 18:37:27 +01:00
Keir Fraser 6009f4ddb2 Transcendent memory ("tmem") for Xen.
Tmem, when called from a tmem-capable (paravirtualized) guest, makes
use of otherwise unutilized ("fallow") memory to create and manage
pools of pages that can be accessed from the guest either as
"ephemeral" pages or as "persistent" pages.  In either case, the pages
are not directly addressible by the guest, only copied to and fro via
the tmem interface.  Ephemeral pages are a nice place for a guest to
put recently evicted clean pages that it might need again; these pages
can be reclaimed synchronously by Xen for other guests or other uses.
Persistent pages are a nice place for a guest to put "swap" pages to
avoid sending them to disk.  These pages retain data as long as the
guest lives, but count against the guest memory allocation.

Tmem pages may optionally be compressed and, in certain cases, can be
shared between guests.  Tmem also handles concurrency nicely and
provides limited QoS settings to combat malicious DoS attempts.
Save/restore and live migration support is not yet provided.

Tmem is primarily targeted for an x86 64-bit hypervisor.  On a 32-bit
x86 hypervisor, it has limited functionality and testing due to
limitations of the xen heap.  Nearly all of tmem is
architecture-independent; three routines remain to be ported to ia64
and it should work on that architecture too.  It is also structured to
be portable to non-Xen environments.

Tmem defaults off (for now) and must be enabled with a "tmem" xen boot
option (and does nothing unless a tmem-capable guest is running).  The
"tmem_compress" boot option enables compression which takes about 10x
more CPU but approximately doubles the number of pages that can be
stored.

Tmem can be controlled via several "xm" commands and many interesting
tmem statistics can be obtained.  A README and internal specification
will follow, but lots of useful prose about tmem, as well as Linux
patches, can be found at http://oss.oracle.com/projects/tmem .

Signed-off-by: Dan Magenheimer <dan.magenheimer@oracle.com>
2009-05-26 11:05:04 +01:00
Keir Fraser 35761fcc8b sbdf2devicepath: converts SBDF into device path.
'SBDF' format is "[SEG#:]BUS#:DEV#.FUNC#"
  ex) 0000:0a:1f.3
Device path format is "HID[:UID]-DEV#.FUNC#[-DEV#.FUNC#[...]]"
  ex) PNP0A08:0-2.0-0.0

The command can be executed as follows.

# sbdf2devicepath 0a:1f.3
PNP0A08:0-2.0-0.0

Signed-off-by: Yuji Shimada <shimada-yxb@necst.nec.co.jp>
2009-04-09 09:59:16 +01:00
Keir Fraser 11e1149fe0 tools: Always use sane upstream (`native') python paths
Previously, by default we would install our python modules into
/usr/lib/python/xen, for example /usr/lib/python/xen/__init__.py.
Upstream python's standard install location (a) includes the Python
version number and (b) puts things in site-packages by default.

Our best conjecture for the reason for this was an attempt to make the
installs portable between different python versions.  However, that
doesn't work because compiled python modules (.pyc), and C python
extensions corresponding to one version of python, are not compatible
across different versions of python.

This is why upstream include the version number.

site-packages is the standard location for locally-installed packages
and is automatically included on the python search path.

In this change, we abandon our own unusual python path setup:

 * Invoke setup.py in an entirely standard manner.  We pass
   PREFIX and DESTDIR using the appropriate options provided by
   setup.py for those purposes (adding them to setup.py calls
   which were previously lacking them).

 * Since the installation locations are now on the standard
   python path, we no longer need to add anything to the path
   in any of our python utilities.  Therefore remove all that
   code from every python script.  (Many of these scripts
   unconditionally added /usr/lib/python and /usr/lib64/python which
   is wrong even in the old world.)

 * There is no longer any special `Xen python path'.  xen-python-path
   is no longer needed.  It is no longer called by anything in our
   tree.  However since out-of-tree callers may still invoke it, we
   retain it.  It now prints a fixed string referring to a directory
   which does not to exist; callers (who use it to augment their
   python path) will thus add a nonexistent directory to their python
   path which is harmless.

 * Remove various workarounds including use of setup.py --home
   (which is intended for something completely different).

 * Remove tests for the XEN_PYTHON_NATIVE_INSTALL build-time
   environment variable.  The new behaviour is the behaviour which we
   should have had if this variable had been set.  That is, it is now
   as if this variable was always set but also bugs in the resulting
   install have been fixed.

This should be a proper fix for the bug addressed by c/s 19515.

Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
2009-04-08 19:13:04 +01:00
Keir Fraser e6e6785c99 tools/misc: Remove some obsolete scripts.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2009-04-06 21:12:33 +01:00
Keir Fraser 1a4c39bf21 Revert c/s 19504 -- uses an obsolete sysfs interface.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2009-04-06 20:56:02 +01:00
Keir Fraser fdd33002ee tools: Add device-path command to convert SBDF into device path.
'SBDF' format is "[SEG#:]BUS#:DEV#.FUNC#"
  ex) 0000:0a:1f.3
Device path format is "HID[:UID]-DEV#.FUNC#[-DEV#.FUNC#[...]]"
  ex) PNP0A08:0-2.0-0.0

The command can be executed as follows.

# device_path 0a:1f.3
PNP0A08:0-2.0-0.0

Signed-off-by: Yuji Shimada <shimada-yxb@necst.nec.co.jp>
2009-04-06 13:52:56 +01:00
Keir Fraser 9d82166018 xenpm: Set scheduler vcpu_migration_delay by xenpm
Signed-off-by: Yu Ke <ke.yu@intel.com>
Signed-off-by: Yang Xiaowei <xiaowei.yang@intel.com>
2009-04-06 13:49:16 +01:00
Keir Fraser c8432f0b59 xenpm: add cmd set-max-cstate
Signed-off-by: Wei Gang <gang.wei@intel.com>
2009-03-31 11:19:56 +01:00
Keir Fraser 7b915d3eaf xenpm: Add a small scheduler knob "sched_smt_power_savings"
Current scheduler only care performance, thus always picks pCPU from
the most idle package. This knob provides another option to pick pCPU from
least idle package, for user who want performance power balance.

Signed-off-by: Yu Ke <ke.yu@intel.com>
Signed-off-by: Tian Kevin <kevin.tian@intel.com>
2009-03-20 08:59:47 +00:00
Keir Fraser add6160d7b Add cpufreq actual average freq information to xenpm tools
Signed-off-by: Liu, Jinsong <jinsong.liu@intel.com>
2009-03-20 08:49:17 +00:00
Keir Fraser b21c09a4ff cpuidle and xenpm small cleanups.
Signed-off-by: Guanqun Lu <guanqun.lu@intel.com>
2009-03-19 10:10:31 +00:00
Keir Fraser cb4343bf2e xenpm: add timeout option to 'xenpm start' command.
Thus we can sample a fixed time of period without manual interruption.

Signed-off-by: Guanqun Lu <guanqun.lu@intel.com>
2009-03-19 10:09:59 +00:00
Keir Fraser 550686e4fd 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>
2009-03-13 10:09:25 +00:00
Keir Fraser b985dc0b9e xenpm tool: add average C state residency
Signed-off-by: Yu Ke <ke.yu@intel.com>
2009-02-17 11:08:31 +00:00
Keir Fraser 568aed7d6b xenpm: build fix
Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
2009-01-14 13:43:17 +00:00
Keir Fraser 9f8501582f Use -MMD -MF in tools/* rather than -Wp,-M...
If you use -MMD -MF then the correct .o filename is written to the
.*.d file as the compiler driver arranges everything.  This was done
in 19010:275abe1c5d24 for the hypervisor.

In this patch we do the same elsewhere in the xen-unstable tree,
particularly tools/.  Specifically:
 * Change tools/Rules.mk to add -MMD -MF ... to CFLAGS and set DEPS.
 * Remove -Wp,-MD... from every other Makefile
 * Remove setting of DEPS from every other Makefile
 * Ensure that every Makefile says -include $(DEPS)
 * Ensure that every Makefile's clean target removes $(DEPS)

Some Makefiles were already halfway there, but often for a different
variable name eg PROG_DEP.  The variable name is now standardised in
Rules.mk as DEPS.

I have done a test build with this change, on Debian etch.

Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
2009-01-12 10:16:05 +00:00
Keir Fraser 6df92ebc30 xenpm tool enhancements
Two enhancements are made in this patch:

1. Make cpuid in command line optional: if user does not provide
cpuid, xenpm will operate on all the CPUs. this will easy the xenpm
usage. e.g. to set the cpufreq governor, user usually want to set the
governor on all CPUs. User can accomplish this easily with this
enhancement.

2. Add another option "xenpm start" to calculate the Cx/Px state
residency percentage during specified period. when user issue "xenpm
start", xenpm will start to record the Cx/Px state residency. when
user issue CTRL-C, xenpm will stop and show the Cx/Px state residency
and percentage of this period. this is helpful to measure the xenpm
effect for speficied workload.

Signed-off-by: Guanqun Lu <guanqun.lu@intel.com>Signed-off-by: Ke Yu <ke.yu@intel.com>
2009-01-08 11:21:23 +00:00
Keir Fraser 7784d17ecd CPUIDLE: adjust cstate statistic interface
1. change unit of residency, PM ticks -> ns.
2. output C0 usage & residency.

Signed-off-by: Wei Gang <gang.wei@intel.com>
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2008-12-19 14:44:40 +00:00