Commit Graph
20587 Commits
Author SHA1 Message Date
Keir Fraser 1f29decb33 libxenlight: physmap slack for pv domains
Contemplate a memory space slack for PV domains,
since they do ballooning (or flipping network rx)
and need some extra room in their pfn space.

Note that this does not allocate any extra memory
to the domain, it simply extends the physmap with
some extra room for "bounce bufffering back" pfn's
that are yielded to dom0.

The default slack is set at 8MB.

Signed-off-by: Andres Lagar-Cavilla <andres@lagarcavilla.com>
Acked-by: Vincent Hanquez <vincent.hanquez@eu.citrix.com>
2009-12-05 12:30:46 +00:00
Keir Fraser a05bf36813 Update QEMU_TAG to 91ae19a7cc445030614bd0ae91548162cf0befbe 2009-12-05 12:29:48 +00:00
Keir Fraser 88cd47fe0f libxenlight: get state for one domain
Simple function to get the dominfo state of a single domain.

Signed-off-by: Andres Lagar-Cavilla <andres@lagarcavilla.com>
2009-12-04 07:11:44 +00:00
Keir Fraser 6eb9ddda17 libxenlight: domain resume
Added libxenlight implementation for resume domain.
This brings back a cooperative pv domain from the
shutdown state after save, enabling checkpointing.

Signed-off-by: Andres Lagar-Cavilla <andres@lagarcavilla.com>
2009-12-04 07:11:06 +00:00
Keir Fraser 69535954d1 libxenlight: Destroy device model only for domains that have it
Destroy device model only for domains that have it.

Signed-off-by: Andres Lagar-Cavilla <andres@lagarcavilla.com>
2009-12-04 07:10:22 +00:00
Keir Fraser 91064f9e07 libxenlight: avoid writing empty values to xenstore
Prevent segmentation fault caused by empty values
in key-value pairs for the /vm/ subdirectory
when restoring a pv domain.

Signed-off-by: Andres Lagar-Cavilla <andres@lagarcavilla.com>
2009-12-04 07:09:44 +00:00
Keir Fraser 1835885f4f libxenlight: disk and nic destroy calls
Expose disk and nic device destroy calls

Also removes the obsolete device shutdown calls.

Signed-off-by: Andres Lagar-Cavilla <andres@lagarcavilla.com>
2009-12-04 07:06:47 +00:00
Keir Fraser e7a1488520 libxenlight: refactor libxl destroy code
Refactor libxl device destroy code. Abstract function
waiting for the watch on the state node to fire.
Create a generic device delete function.

Only a single LIBXL_DESTROY_TIMEOUT elapses when
waiting for destruction of all the devices of a
domain.

Signed-off-by: Andres Lagar-Cavilla <andres@lagarcavilla.com>
2009-12-04 07:03:45 +00:00
Keir Fraser 88de8df0dc libxenlight: fix GC when cloning contexts
Provide a function to clone a context. This is necessary
because simply copying the structs will eventually
corrup the GC: maxsize is updated in the cloned context
but not in the originating, yet they have the same array
of referenced pointers alloc_ptrs.

Signed-off-by: Andres Lagar-Cavilla <andres@lagarcavilla.com>
2009-12-04 07:02:49 +00:00
Keir Fraser 78eed7d044 xend: Fix parameters to PyArg_ParseTupleAndKeywords()
The kwd_list parameter PyArg_ParseTupleAndKeywords() must be a
NULL-terminated list.

Signed-off-by: KUWAMURA Shin'ya <kuwa@jp.fujitsu.com>
2009-12-04 07:00:25 +00:00
Keir Fraser 25c6a4b616 x86: XENMEM_add_to_physmap should propagate errors from guest_physmap_add_page().
Authored-by: David Lively
Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
2009-12-04 06:59:33 +00:00
Keir Fraser 42aac3d370 Add keyhandler 'g' to print all active grant table entries.
Authored-By: Robert Phillips
Signed-off-By: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
2009-12-04 06:58:08 +00:00
Keir Fraser 8cf96a2728 libxenlight: Get rid of the dependency on the LIBCONFIG_SOURCE directory.
Signed-off-by: Jean Guyader <jean.guyader@eu.citrix.com>
2009-12-04 06:51:53 +00:00
Keir Fraser 8e6a4e5326 libxenlight: Delete dep files on 'make clean', and include them in Makefile rules.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2009-12-04 06:50:46 +00:00
Keir Fraser c1488502c9 grant-tables: do not fail attempts to GNTTABOP_set_version to the current version.
...even if there are active grants.

This triggers when checkpoint a guest which essentially resumes
without actually having gone through the suspend so the domain is
already latched to v2 inside Xen.

Also return the current actual version on success and failure. Not
terribly useful with only 2 options but is more robust to future
developments.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
2009-12-03 13:52:02 +00:00
Keir Fraser f5772cd764 xend: Add GPL license stanza to MemoryPool.py
Signed-off-by: James Song (Wei) <jsong@novell.com>
2009-12-03 13:51:20 +00:00
Keir Fraser 0436d361aa Remus: fall back to xenstore if necessary
This is primarily for pvops until it gets a dedicated suspend
event channel.

Signed-off-by: Brendan Cully <brendan@cs.ubc.ca>
2009-12-03 13:50:43 +00:00
Keir Fraser ba4d310958 Remus: fix shadow memory allocation, broken by 20558:4ed3b9b1de3f
This approach is perhaps a little cleaner than directly calling
balloon.free.

Signed-off-by: Brendan Cully <brendan@cs.ubc.ca>
2009-12-03 13:50:14 +00:00
Keir Fraser 40e9da38fd x86 hvm: fix up the unified HAP nested-pagefault handler.
A guest PFN may have been marked dirty and switched to p2m_ram_rw by
another CPU between the VMEXIT and lookup in this handler, so
we can't just check for p2m_ram_logdirty.  Also, handle_mmio
doesn't handle passthrough MMIO.

Signed-off-by: Tim Deegan <Tim.Deegan@citrix.com>
2009-12-02 18:46:14 +00:00
Keir Fraser 422f39c72e xentop: Allow full domain name display
Add a '-f' option to xentop to allow the full domain name to be
displayed. This is the original behavior which can cause the display
to be unaligned. Customers have requested this because only the
trailing characters of their domain names are unique and therefore
cannot be distinguished when the display is limited to a 10 character
width.

Signed-off-by: Charles Arnold <carnold@novell.com>
2009-12-02 18:43:28 +00:00
Keir Fraser 55a64741b6 libxenlight: fix multiple xenstore watches problem
this patch fixes the multiple xenstore watches problem in libxenlight
opening a new xenstore connection to set and read temporary watches on
the device state nodes.  This way they don't interfere with other long
running watches.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
2009-12-02 18:42:36 +00:00
Keir Fraser 18ba65e5f8 libxenlight: use watch and select in libxl_wait_for_device_model
This patch reimplements libxl_wait_for_device_model using a xenstore
watch and a select loop.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
2009-12-02 18:42:03 +00:00
Keir Fraser e510765e70 libxenlight: fix dm_xenstore_record_pid
The function dm_xenstore_record_pid is executed by a child of the main
process and therefore shouldn't use the same xenstore connection:
currently it opens a new connection but still uses the old one.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
2009-12-02 18:41:31 +00:00
Keir Fraser 80d4e9ca77 xenstat: Fixes for 20528:e6e3bf767d16 (stats for dom0 network bonding)
In above c/s I introduced dom0 statistics for case we use network
bonding. The indentation was not good for xenstat C codebase and also
some modifications were done to the logic, mainly not using the parsed
variables we don't care about (as we care only about
{tx|rx}{bytes,packets,errs,drops} and no other variable from
/proc/net/dev) by passing NULLs to variables we don't care about. Also
dom0 statistics alteration was fixed to include {tx|rx}{drop,errs} for
dom0 (previous version of my patch was not having this code applied).

Signed-off-by: Michal Novotny <minovotn@redhat.com>
2009-12-02 13:45:35 +00:00
Keir Fraser fe356defec xend, vt-d: do not reserve vtd_mem if iommu is not enabled
Signed-off-by: Dexuan Cui <dexuan.cui@intel.com>
2009-12-02 13:43:37 +00:00
Keir Fraser a0289c3119 vmx: During task-switch, read instr-len VMCS field only when valid.
Otherwise we can crash on the BUG_ON() in __get_instruction_length().

Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2009-12-02 13:39:07 +00:00
Keir Fraser 29ecb4f1b2 VT-d: Fix indentation to make log messages more readable in dmar.c
Signed-off-by: Weidong Han <weidong.han@intel.com>
2009-12-02 08:52:50 +00:00
Keir Fraser c1e6d23db0 pci: Correct BDF format from B:D:F to B:D.F in log messages.
Signed-off-by: Weidong Han <weidong.han@intel.com>
2009-12-02 08:51:59 +00:00
Keir Fraser e45215a3fe xend: Memory pool for pv guest on systems with >128G memory
The main idea of this patch is:

1) The admin sets aside some memory below 128G for 32-bit paravirtual
domain creation (via dom0_mem=-<value> in kernel comand line).

2) The admin also explicitly states to the tools (i..e xend) how much
memory is supposed to be left untouched by 64-bit domains

3) If a 32-bit pv DomU gets created, no ballooning ought to be
necessary (since if it is, no guarantee can be made about the address
range of the memory ballooned out), and memory gets allocated from the
reserved range.

4) Upon 64-bit (or 32-bit HVM or HVM) DomU creation, the tools
determine the amount of memory to be ballooned out of Dom0 by adding
the amount needed for the new guest and the amount still in the
reserved pool (and then of course subtracting the total amount of
memory the hypervisor has available for guest use).

Signed-off-by: james song (wei) <jsong@novell.com>
2009-12-02 08:51:12 +00:00
Keir Fraser da583c807c VT-d: get rid of hardcode in iommu_flush_cache_entry
Currently iommu_flush_cache_entry uses a fixed size 8 bytes to flush
cache. But it also needs to flush caches with different sizes,
e.g. struct root_entry is 16 bytes. This patch fixes the hardcode by
using a parameter "size" to flush caches with different sizes.

Signed-off-by: Weidong Han <weidong.han@intel.com>
2009-12-02 08:48:36 +00:00
Keir Fraser 2cdc56dff4 xm: fix message in OptionError deprecated since Python 2.6
BaseException.message has been deprecated since Python 2.6.  To
prevent DeprecationWarning from popping up over this pre-existing
attribute, use a new property that takes lookup precedence.

Signed-off-by: Wei Kong <weikong.cn@gmail.com>
2009-12-02 08:47:49 +00:00
Keir Fraser c17b36d5dc docs: new tsc_mode VM configuration option
Signed-off-by: Dan Magenheimer <dan.magenheimer@oracle.com>
2009-12-02 08:46:47 +00:00
Keir Fraser 77c8da6806 remus: Skip Linux-specific build components on other OSes
Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
Acked-by: Brendan Cully <brendan@cs.ubc.ca>
2009-12-02 08:46:11 +00:00
Keir Fraser 07443ee6da libxenlight: write stubdoms logs to file
It turns out that there is a better way to write stubdoms logs to file
than using libxl_console_attach: qemu is the one that provides the
console backend for stubdoms and qemu is able to redirect a serial to
file, so we can use this feature to make sure the first stubdom
console is always redirected to a logfile.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
2009-12-02 08:45:16 +00:00
Keir Fraser f20744517f libxenlight: two small fixes
- set the domid of the guest and not the one of the stubdom in the
libxl_device_model_starting returned to the user;

- check that the length of the two strings matches in
libxl_name_to_domid, otherwise we can get a match for two different
domains that have the same initial part of the name.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
2009-12-02 08:44:40 +00:00
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