Commit Graph
20552 Commits
Author SHA1 Message Date
Keir Fraser e2e6a280af libxl: include signal.h, required for SIGKILL definition
...makes libxl build on NetBSD.

Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
2009-12-02 08:44:10 +00:00
Keir Fraser 738530292f x86: Correctly allocate module-relocation area and bzimage headroom.
Without this patch, loading a bzimage dom0 kernel while also
requesting a dynamically-allocated crashkernel area is broken.

Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2009-12-01 14:19:28 +00:00
Keir Fraser 0dfc46719e hvmloader: Fix bug in 20510:749b5d46e7a9 (GPE notifications)
The GPE notification decision tree was inverted.

Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2009-12-01 14:08:27 +00:00
Keir Fraser 6a56a7c67b libxenlight: wait for pv qemu initialization
this patch makes libxl_create_stubdom wait for pv qemu to be properly
initialized before unpausing the stubdom.
A new libxl_device_model_starting pointer is used to wait for pv qemu
initialization while the libxl_device_model_starting pointer given by
the user is initialized to a new structure with an empty for_spawn
member, because nothing that was spawn has to be waited for anymore.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
2009-12-01 14:03:42 +00:00
Keir Fraser 95b697252f x86: fix MCE/NMI injection
This attempts to address all the concerns raised in
http://lists.xensource.com/archives/html/xen-devel/2009-11/msg01195.html,
but I'm nevertheless still not convinced that all aspects of the
injection handling really work reliably. In particular, while the
patch here on top of the fixes for the problems menioned in the
referenced mail also adds code to keep send_guest_trap() from
injecting multiple events at a time, I don't think the is the right
mechanism - it should be possible to handle NMI/MCE nested within
each other.

Another fix on top of the ones for the earlier described problems is
that the vCPU affinity restore logic didn't account for software
injected NMIs - these never set cpu_affinity_tmp, but due to it most
likely being different from cpu_affinity it would have got restored
(to a potentially random value) nevertheless.

Signed-off-by: Jan Beulich <jbeulich@novell.com>
2009-12-01 14:02:00 +00:00
Keir Fraser 22b984ae9a xen: turn numa=on by default
I did some benchmark runs (lmbench & kernel compile) with a number of
guests running in parallel to compare the performance of numa=on vs.
numa=off.  As soon as one starts to load the machine, the performance
goes down in the numa=off case.  The tests were done on an 8-node
machine (4 cores each).  lmbench (actually copying large amounts of
memory) shows a dramatic dropdown, but I even noticed significant
performance decrease for a tmpfs based Linux kernel compile. Here a
summary of the data:

lmbench's rd benchmark (normalized to native Linux (=100)):
guests    numa=off       numa=on       avg increase
        min  avg  max  min  avg  max
     1       78.0           102.3
     7  37.4 45.6 62.0 90.6 102.3 110.9 124.4%
    15  21.0 25.8 31.7 41.7 48.7 54.1    88.2%
    23  13.4 17.5 23.2 25.0 28.0 30.1    60.2%

kernel compile in tmpfs, 1 VCPU, 2GB RAM, average of elapsed time:
guests    numa=off   numa=on   increase
      1    480.610    464.320    3.4%
      7    482.109    461.721    4.2%
     15    515.297    477.669    7.3%
     23    548.427    495.180    9.7%
again with 2 VCPUs and make -j2:
      1    264.580    261.690    1.1%
      7    279.763    258.907    7.7%
     15    330.385    272.762   17.4%
     23    463.510    390.547   15.7% (46 VCPUs on 32pCPUs)

Selected tests on a 4-node machine showed similar behavior (7.9 %
increase with 6 parallel guests on the 2 VCPU kernel compile
benchmark).

Note that this does not affect non-NUMA machines at all, since NUMA
will be turned off again by the code if no NUMA topology is detected.

Signed-off-by: Andre Przywara <andre.przywara@amd.com>
2009-12-01 13:59:47 +00:00
Keir Fraser 2ee2c0396c libxc: pass the restore_context through function and allocate the context on the restore function stack.
Signed-off-by: Vincent Hanquez <vincent.hanquez@eu.citrix.com>
2009-12-01 13:57:02 +00:00
Keir Fraser 086bbf2057 libxc: pass the suspend_context through function and allocate the context on the save function stack.
Signed-off-by: Vincent Hanquez <vincent.hanquez@eu.citrix.com>
2009-12-01 13:56:26 +00:00
Keir Fraser 97901ff3a8 libxc: move the domain_info_context into the restore_context
Signed-off-by: Vincent Hanquez <vincent.hanquez@eu.citrix.com>
2009-12-01 13:55:50 +00:00
Keir Fraser 54439bd307 libxc: move domain_info_context into the save_context
Signed-off-by: Vincent Hanquez <vincent.hanquez@eu.citrix.com>
2009-12-01 13:55:15 +00:00
Keir Fraser a87d572ea4 libxc: move restore global variable to a global static context
Signed-off-by: Vincent Hanquez <vincent.hanquez@eu.citrix.com>
2009-12-01 13:54:36 +00:00
Keir Fraser 4f5897528d libxc: create a global context structure to record global variables in save
Signed-off-by: Vincent Hanquez <vincent.hanquez@eu.citrix.com>
2009-12-01 13:54:01 +00:00
Keir Fraser 60999322eb libxc: create a domain_info_context structure to store guest_width and p2m_size for macros.
Macro now refers to guest_width and p2m_size through a dinfo pointer.

Signed-off-by: Vincent Hanquez <vincent.hanquez@eu.citrix.com>
2009-12-01 13:53:14 +00:00
Keir Fraser d47a8e863a libxenlight: enables less than maximum vcpus
Enable turning on a different amount of vcpus than
the maximum during domain creation/restore.

Signed-off-by: Andres Lagar-Cavilla <andres@lagarcavilla.com>
2009-12-01 13:49:33 +00:00
Keir Fraser c21dd92b58 libxenlight: allow domain to publish its suspend evtchn
Allow domain to publish its suspend event channel.
Otherwise, the fast event-channel-based suspend
path is disabled.

Signed-off-by: Andres Lagar-Cavilla <andres@lagarcavilla.com>
2009-12-01 13:48:48 +00:00
Keir Fraser 571a9ed2e7 libxenlight: write vcpu availability paths in xenstore
Write cpu availability paths to xenstore. Otherwise,
no vcpus other than the first are enabled.

Signed-off-by: Andres Lagar-Cavilla <andres@lagarcavilla.com>
2009-12-01 13:48:03 +00:00
Keir Fraser 02ff283025 libxenlight: remove vss and xapi patch on domain destroy
Signed-off-by: Andres Lagar-Cavilla <andres@lagarcavilla.com>
2009-12-01 13:47:18 +00:00
Keir Fraser aaea89803b libxenlight: set domain handle
Set domain handle much like xend does, identical to
the uuid. This allows obtaining the uuid of a domain
from the handle in the dominfo struct.

Signed-off-by: Andres Lagar-Cavilla <andres@lagarcavilla.com>
2009-12-01 13:46:31 +00:00
Keir Fraser ca2b264d69 libxenlight: fix uuid code
- Use proper constants
- Use functions from the uuid library
- Fix broken pointer handling in libxl_dominfo

Signed-off-by: Andres Lagar-Cavilla <andres@lagarcavilla.com>
2009-12-01 13:45:45 +00:00
Keir Fraser 491a51514a libxenlight: avoid writing empty values to xenstore
Prevent segmentation fault caused by empty values
in key-value pairs for the /vm/ subdirectory
when creating a pv domain.

Signed-off-by: Andres Lagar-Cavilla <andres@lagarcavilla.com>
2009-12-01 13:44:13 +00:00
Keir Fraser 421b4ddbc1 sysctl: Fix mis-allocation of number for XEN_SYSCTL_lockprof_op
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2009-12-01 13:41:38 +00:00
Keir Fraser c9ee7a756b Revert 20523:bd52fff29e6e "Remove redundant tests in __start_xen()"
Consensus is that code is clearer with the tests, even though they are
redundant.

Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2009-12-01 13:39:51 +00:00
Keir Fraser fc50aaf0d8 xentop: Add tmem-freeable info when tmem is active
(No change to xentop output when tmem is inactive.)

Signed-off-by: Dan Magenheimer <dan.magenheimer@oracle.com>
2009-12-01 13:38:18 +00:00
Keir Fraser 1fd93d4f8c xenstat: Linux dom0 statistics for case we use network bonding
I've created a patch that alters dom0 statistics (if empty like in
case of network bonding) and puts network bridge statistics
instead. It's been tested with network bonding both enabled and
disabled and also by creating a standalone network bridge without
bonding... It was working fine in all my tests...

Signed-off-by: Michal Novotny <minovotn@redhat.com>
2009-12-01 13:37:20 +00:00
Keir Fraser d1956b62b0 Report hardware tsc frequency even for emulated tsc
I was starting some documentation for tsc_mode and
realized this discussion was never resolved.  Currently
when TSC is emulated the pvclock algorithm reports
to a PV OS Xen's system clock hz rate (1GHz).  Linux
at boottime samples the TSC rate and shows it in
dmesg and the rate is also shown in the "cpu MHz"
field in /proc/cpuinfo.  So when TSC is emulated,
it appears that the processor MHz is 1000.0, which
is likely to be confusing to many Xen users.

This patch changes the reported hz rate to the
hz rate of the initial machine on which the guest
is booted and retains that reported hz rate across
save/restore/migration.

Jeremy has pointed out that reporting 1000.0 MHz is
useful because it shows that TSC is being emulated.
However, with the new tsc_mode default where
a guest may start with native TSC and switch to
emulated TSC after migration, users are likely to
get even more confused.  And "xm debug-key s"
reveals not only whether TSC is being emulated but
also the frequency so is more descriptive anyway.

Signed-off-by: Dan Magenheimer <dan.magenheimer@oracle.com>
2009-12-01 13:36:22 +00:00
Keir Fraser cfbf78694e tools: avoid cpu over-commitment if numa=on
Signed-off-by: Andre Przywara <andre.przywara@amd.com>
2009-12-01 13:35:28 +00:00
Keir Fraser e4bc73337a libxenlight: fix segfault when reading blktap2 devs
This patch fixes a possible segfault when reading from
/sys/class/blktap2/devices, if the line read is empty.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
2009-12-01 13:34:38 +00:00
Keir Fraser a2bfc84506 libxenlight: fix multiple console with stubdoms
libxenlight doesn't handle properly the multiple pv console case,
needed to support an emulated serial in hvm guests with stubdoms.
This patch fixes it.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
2009-12-01 13:34:10 +00:00
Keir Fraser 9e63fdbdc7 x86: Remove redundant tests in __start_xen()
Signed-off-by: Xiao Guangrong <xiaoguangrong@cn.fujitsu.com>
2009-11-30 11:48:36 +00:00
Keir Fraser d922877f6e ia64: eliminate build warnings
Various warnings appeared since 3.4 - eliminate at least some of them.

Signed-off-by: Jan Beulich <jbeulich@novell.com>
2009-11-30 10:58:23 +00:00
Keir Fraser c1fcbadd2c xend: fix bugs in c/s 20321:7a69f773548e "add a config description item for each guest"
Signed-off-by: james song (wei)<jsong@novell.com>
2009-11-30 10:57:42 +00:00
Keir Fraser 58ca38a652 libxenlight: implement blktap2 support
This patch implements blktap2 support in libxenlight; blktap2 is only
enabled if it is actually supported by the host, otherwise we fall
back to the previous code. Also for the moment we pretend that disk
type file is actually tap:aio.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
2009-11-30 10:54:20 +00:00
Keir Fraser d1c7c3ef99 libxenlight: fix suspend/resume
Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
2009-11-30 10:53:39 +00:00
Keir Fraser 5a602fc8fb libxenlight: add console command
This patch adds "xl console" command similar to "xm console".

Signed-off-by: Tomasz Wroblewski <tomasz.wroblewski@citrix.com>
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
Acked-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
2009-11-30 10:47:36 +00:00
Keir Fraser c5d895be23 libxenlight: fix hvm flag when no hvmloader
Signed-off-by: Tomasz Wroblewski <tomasz.wroblewski@citrix.com>
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
Acked-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
2009-11-30 10:41:28 +00:00
Keir Fraser f0a60fa636 x86/mm: set_p2m_entry() should return 0 on error
set_p2m_entry() ignores halfway errors.
It should return 0 on error.

Signed-off-by: Kouya Shimura <kouya@jp.fujitsu.com>
Acked-by: Tim Deegan <Tim.Deegan@citrix.com>
2009-11-30 10:38:58 +00:00
Keir Fraser ad86c7de55 xm: Allow detaching vif by MAC address
Signed-off-by: Masaki Kanno <kanno.masaki@jp.fujitsu.com>
2009-11-27 08:09:26 +00:00
Keir Fraser d210b9fc62 VT-d: Free unused interrupt remapping table entry
This patch changes the IRTE allocation method, and frees unused
IRTE when device is de-assigned.

Signed-Off-By: Zhai Edwin <edwin.zhai@intel.com>
2009-11-27 08:05:18 +00:00
Keir Fraser dd14c75ad4 build: Execute mk_dsdt with path
Signed-off-by: Simon Horman <horms@verge.net.au>
2009-11-27 07:56:38 +00:00
Keir Fraser c7679119e4 hvmloader: Auto-generate IRQ routing tables in ACPI DSDT.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2009-11-26 15:27:00 +00:00
Keir Fraser b549d6e6e3 libxenlight: implement pause and unpause
this patch adds domain pause and unpause commands to xl, implementing
them using the already exiting functions libxl_domain_pause and
libxl_domain_unpause.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
2009-11-26 14:49:40 +00:00
Keir Fraser c3517d3d2a hvmloader: Auto-generate the lengthy pattern-based sections of ACPI DSDT.
At the same time, replace a lengthy linear GPE notification method,
with a logarithmic binary chop. Based on a patch by Simon Horman.

Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2009-11-26 13:51:16 +00:00
Keir Fraser 74127b5e90 x86: Remove redundant logic for mp_register gsi.
For xen's irq and gsi, they are identity mapped, and doesn't
need to record the irq and gsi mapping in this array, in addition
the mapping maybe not correct, since dom0 may not figure the GSI
from 16 on.

Signed-off-by: Xiantao Zhang <xiantao.zhang@intel.com>
2009-11-26 11:35:27 +00:00
Keir Fraser 3e64b93244 x86 shadow: don't try to unsshadow for p2m changes after the shadows
have been torn down.

Signed-off-by: Tim Deegan <Tim.Deegan@citrix.com>
2009-11-26 11:31:16 +00:00
Keir Fraser 38457bf1f8 Revert 20505:44ea369eefc1 2009-11-26 11:30:42 +00:00
Keir Fraser c6560c9861 x86: Always respect guest setting CR4.TSD
Also fix guest reads of CR4.

Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2009-11-26 11:24:50 +00:00
Keir Fraser 833cce002f x86 shadow: fix race when domain is dying
There are some cases that shadow_write_p2m_entry() is called after
the domain is killed. It causes Xen to crash.

- Race between xc_map_foreign_batch from qemu-dm and "xm destroy"
  command.
- The hypervisor calls domain_crash when PoD fails.

Signed-off-by: Kouya Shimura <kouya@jp.fujitsu.com>
2009-11-26 11:02:30 +00:00
Keir Fraser 8978cc08d9 Implement rdtscp emulation and rdtscp_aux "support"
The rdtscp instruction (and the associated TSC_AUX
msr) are present on most recent AMD processors,
and on the Nehalem and future Intel processors.
Cpuid has a bit to detect the presence of this feature.

Xen intentionally does not expose the cpuid rdtscp bit
to PV OS's or to HVM guests, but PV apps can see this
bit and, as a result, may choose to use the rdtscp
instruction.  When a PV guest with such an app is migrated
to a machine that does not have rdtscp support, the
app will get killed due to an invalid op.  Fix this
by emulating the rdtscp instruction.  We also need
to emulate rdtscp in the case where the machine has
rdtscp support, but rdtsc emulation is enabled (which
is unfortunately a different path: a privileged op).

The rdtscp instruction reads the TSC_AUX register which
presumably is set by the OS (and, in the case of
tsc_mode==pvrdtscp, will be set by Xen).  HV Linux
and PV Linux will not set TSC_AUX because the
cpuid rdtscp bit is not propogated by Xen; I'm told that
Windows always sets TSC_AUX to zero.  So for PV guests
running on rdtscp-capable hardware (that don't use
tsc_mode==pvrdtscp), always set TSC_AUX to zero.

Signed-off-by: Dan Magenheimer <dan.magenheimer@oracle.com>
2009-11-26 11:00:49 +00:00
Keir Fraser 05bafb26f1 libxc: Fix 32-vs-64 bitness issue in saving vcpu contexts in core dump
Signed-off-by: Mukesh Rathor <mukesh.rathor@oracle.com>
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2009-11-26 11:00:15 +00:00
Keir Fraser f0e8b55eb1 xm: Fix maxvcpus support
Signed-off-by: Michal Novotny <minovotn@redhat.com>
2009-11-26 10:57:26 +00:00