Commit Graph
41 Commits
Author SHA1 Message Date
Olaf Hering aa1355f971 tools: merge several bitop functions into xc_bitops.h
Bitmaps are used in save/restore, xenpaging and blktap2.  Merge the code into a
private xc_bitops.h file. All users are single threaded, so locking is not an
issue. The array of bits is handled as volatile because the x86 save/restore
code passes the bitmap to the hypervisor which in turn modifies the bitmap.

blktap2 uses a private bitmap. There was a possible overflow in the
bitmap_size() function, the remainder was not considered.

ia64 save/restore uses a bitmap to send the number of vcpus to the host.

x86 save/restore uses a bitmap to track dirty pages. This bitmap is shared with
the hypervisor. An unused function count_bits() was removed and a new
bitmap_size() function is now used.

xenpaging uses 3 private bitmaps to track the gfns which are in paged-out
state.  It had a copy of some Linux bitops.h, which is now obsolete. Also the
BITS_PER_LONG macro was hardcoded to 64 which made it impossible to run 32bit
tools on a 64bit host. Wether this works at all has to be tested, yet.

Signed-off-by: Olaf Hering <olaf@aepfle.de>
Committed-by: Ian Jackson <ian.jackson.citrix.com>
2011-06-10 10:47:03 +02:00
Ian Campbell 0bba6abe98 libxc: rename safe_strerror to xc_strerror and pass in an XC handle for future use.
Make the function public since I have future patches which depend on this.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
committer: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
2010-12-02 12:49:00 +00:00
KUWAMURA Shin'ya f0188031b6 libxc, ia64: ia64 counterpart of 22275:e95dc0eb152d and 22285:36a317494429
This patch fixes compilation errors by 22275:e95dc0eb152d:
  ia64/xc_ia64_linux_save.c:797: error: too few arguments to function 'callbacks->switch_qemu_logdirty'
and applies 22285:36a317494429 to ia64.

Signed-off-by: KUWAMURA Shin'ya <kuwa@jp.fujitsu.com>
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
2010-11-03 12:27:00 +00:00
Ian Campbell 231c316091 libxc: convert shadow domctl interfaces and save/restore over to hypercall buffers
Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Signed-off-by: Ian Jackson <ian.jackson.citrix.com>
2010-10-22 15:14:51 +01:00
Ian Campbell a050657a54 tools: cleanup domain save switch_qemu_logdirty callback
Move the function into struct save_callbacks with the others and add
the void *closure to the callback arguments.

Add and propagate an error return code from the callback.

Use this in libxl to pass the save context to
libxl__domain_suspend_common_switch_qemu_logdirty allowing us to reuse
the parent's xenstore handle, gc context etc.

Also add an apparently missing libxl__free_all to
libxl__domain_suspend_common.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
2010-10-21 18:46:32 +01:00
Ian Campbell 4f3b2fdaae libxc: add xc_domain_maximum_gpfn to wrap XENMEM_maximum_gpfn
Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
2010-10-18 17:16:13 +01:00
Ian Campbell 6993e9f5ce # HG changeset patch
# User Ian Campbell <ian.campbell@citrix.com>
# Date 1282671421 -3600
# Node ID d1dd29a470ef1b9d2c77478a123326036dfe90bb
# Parent  d7a4adad9c328decbd384d87b23001aea8951b86
tools/libxc, tools/libelf: Relicense under LGPL v2.1

Relicense these two libraries under LGPL v2.1 only except where
individual files already included the "or later" provision.

Copyright holders have been contacted by Stephen Spector and have all
agreed this change.

Removed tools/libxc/ia64/aclinux.h since it appeared to be
unused. There is a separate, more up to date, copy in
xen/include/acpi/platform/aclinux.h which does appear to be used.

Clarify the license of MiniOS privcmd.h under the same terms as other
tools/include/xen-sys headers.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Stephen Spector <stephen.spector@citrix.com>
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
2010-08-24 18:42:59 +01:00
Ian Jackson ddf97d4db8 libxc: Fix ia64 build for interface change
This patch fixes ia64 by the following method:
- rename xc_handle xch
- rename guest_xc xch
- add xc_interface *xch to arguments of some functions
- replace xc_dom_printf with macros
- Add *xch argument to corresponding x86 functions [iwj]

Signed-off-by: KUWAMURA Shin'ya <kuwa@jp.fujitsu.com>
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
2010-06-25 15:43:50 +01:00
Keir Fraser 20ad53b196 ia64: Fix xc_save error reporting
This is the patch for error reporting on ia64 that has a special
handling in comparison with i386/x86_64 platforms. This is pretty
straight-forward just to fail on "cannot map mfn page" message instead
of continue since the memory is not being correctly mapped using the
xc_map_foreign_range() function.

From: Michal Novotny <minovotn@redhat.com>
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2010-06-18 14:08:57 +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 22af01be29 [IA64] Remus: ia64 counter part of 07f6d9047af4
This patch adds callbacks to xc_domain_save().

Signed-off-by: KUWAMURA Shin'ya <kuwa@jp.fujitsu.com>
2009-11-23 07:06:10 +00:00
Keir Fraser 0c98ffd10a Fix some issues for HVM log dirty:
* Add necessary logging dirty in qemu to avoid guest error with
intensive disk access when live migration
* Take place of shared memory between qemu and migration tools by new
added hypercall, which is clean and simple

Signed-Off-By: Zhai, Edwin <edwin.zhai@intel.com>
2009-09-07 08:37:58 +01:00
Keir Fraser fb442e2171 x86_64: allow more vCPU-s per guest
Since the shared info layout is fixed, guests are required to use
VCPUOP_register_vcpu_info prior to booting any vCPU beyond the
traditional limit of 32.

MAX_VIRT_CPUS, being an implemetation detail of the hypervisor, is no
longer being exposed in the public headers.

The tools changes are clearly incomplete (and done only so things
would
build again), and the current state of the tools (using scalar
variables all over the place to represent vCPU bitmaps) very likely
doesn't permit booting DomU-s with more than the traditional number of
vCPU-s. Testing of the extended functionality was done with Dom0 (96
vCPU-s, as well as 128 vCPU-s out of which the kernel elected - by way
of a simple kernel side patch - to use only some, resulting in a
sparse
bitmap).

ia64 changes only to make things build, and build-tested only (and the
tools part only as far as the build would go without encountering
unrelated problems in the blktap code).

Signed-off-by: Jan Beulich <jbeulich@novell.com>
2009-06-18 10:14:16 +01:00
Isaku Yamahata 0296f1839a [IA64] libxc clean up.
remove code duplication between xc_ia64_linux_save.c and xc_core_ia64.c
by introducing xc_ia64_copy_memmap().
Later xc_ia64_copy_memmap() will be enhanced.

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
2008-10-02 17:27:57 +09:00
Isaku Yamahata 9dc665723c [IA64] xc_domain_save: Do not poll-wait for guest to shutdown.
This patch is ia64 counter part of 18452:59904b180078.

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
2008-09-25 11:47:53 +09:00
Keir Fraser 112dcc7dd0 xc_save: Clean up (*suspend)() callback hook.
Sigend-off-by: Keir Fraser <keir.fraser@citrix.com>
2008-09-08 11:13:03 +01:00
Isaku Yamahata 3819ac39eb merge with xen-unstable.hg 2008-07-02 11:30:37 +09:00
Keir Fraser 947835578c [IA64] compilation fix caused by 17880:d3a87899985d
Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
2008-06-20 12:26:23 +01:00
Isaku Yamahata 006dff9e04 [IA64] ia64 save/restore new formart. save part.
Introduce ia64 save/restore new formart. save part.
The formart twist is necessary for pv_ops linux support saving/restoring
all of the online vcpu context.

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
2008-06-10 16:00:33 +09:00
Alex Williamson 80e45574b2 [IA64] Cleanup in xc_ia64_linux_save.c
xc_ia64_shadow_control() is not needed any more
since xc_shadow_control() was xencommized.

Signed-off-by: Kouya Shimura <kouya@jp.fujitsu.com>
2008-02-13 10:35:56 -07:00
Alex Williamson c5df471dc7 [IA64] Fix live migration
In live migration, a domain is paused and *entire* memory is copied
after pre-copy phase.
(i.e. live migration is not live)

Signed-off-by: Kouya Shimura <kouya@jp.fujitsu.com>
2008-02-07 09:19:53 -07:00
Alex Williamson 8b74529532 [IA64] Fix maximum_gpfn hypercall
HVM livemigation fails without this patch.

according to x86 side:
http://xenbits.xensource.com/xen-unstable.hg?rev/55d0a5c70986

Signed-off-by: Kouya Shimura <kouya@jp.fujitsu.com>
2008-02-05 09:36:48 -07:00
Keir Fraser c316590403 libxc: Consolidate read()/write() syscall wrappers to read/write an
exact number of bytes. The consolidated versions are more watertight
than the various versions previously distributed around the library
source code.
Signed-off-by: Keir Fraser <keir@xensource.com>
2007-11-11 18:22:33 +00:00
Alex Williamson f0ed01dec3 [IA64] vti save-restore: ia64 hvm builder clean up with respect to hvm params.
Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
2007-11-07 10:34:09 -07:00
Alex Williamson 44d78108bf [IA64] vti domain save/restore: libxc: implement vti domain save/restore
Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
2007-10-21 14:57:13 -06:00
Alex Williamson 567b053811 [IA64] Foreign p2m: rewrite save/restore with foreign p2m
Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
2007-09-06 15:36:13 -06:00
Alex Williamson c811f1fa77 [IA64] memmap: save/restore: support save/restore with domain memmap
Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
2007-05-24 15:54:52 -06:00
Alex Williamson 00eb2b2ff1 [IA64] Fix xen/ia64 save/restore error recovery path.
Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
2007-05-20 21:28:48 -06:00
Alex Williamson fc073c9c01 [IA64] Replace mlock()/munlock() in ia64 libxc with un/lock_pages()
For Consistency.  Also add some missing unlock_pages().

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
2007-05-20 21:23:35 -06:00
Alex Williamson 2360010187 [IA64] Rewrite ia64 vcpu_guest_context_regs structure
All registers and the rbs are now declared in the structure.
Minimal updates to other parts.

Signed-off-by: Tristan Gingold <tgingold@free.fr>
2007-05-07 10:37:16 -06:00
Tim Deegan d11bec8a19 [HVM] Save/restore: merge xc_linux_save and xc_hvm_save
into xc_domain_save, like we did for xc_domain_restore
Signed-off-by: Tim Deegan <Tim.Deegan@xensource.com>

--HG--
rename : tools/libxc/xc_linux_save.c => tools/libxc/xc_domain_save.c
2007-04-11 14:45:14 +01:00
awilliam@xenbuild2.aw ab41734c62 [IA64] Domain save fix for foreign domain page mapping semantics change
Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
2006-12-07 14:56:01 -07:00
kfraser@localhost.localdomain b65f717688 [LIBXC] Clean up use of sterror(). Define a thread-safe
version which uses strerror_r(), and tries to cope with
the POSIX and GNU versions of that function.
Signed-off-by: Keir Fraser <keir@xensource.com>
2006-12-08 11:57:06 +00:00
awilliam@xenbuild.aw b5f74534ce merge with xen-unstable.hg 2006-10-22 15:23:52 -06:00
kfraser@localhost.localdomain cf1aa17df0 Remove ERR() macro from libxc. Use ERROR/PERROR as appropriate.
Signed-off-by: Keir Fraser <keir@xensource.com>
2006-10-17 18:05:42 +01:00
awilliam@xenbuild.aw 5f90eb60c6 [IA64] Use xencomm for hypercalls.
With xencomm metaphysical addresses are passed to the hypervisor instead
of virtual addresses.
This patch breaks compatibility.

Signed-off-by: Tristan Gingold <tristan.gingold@bull.net>
2006-10-02 14:03:42 -06:00
awilliam@xenbuild.aw 22932bd03c merge with xen-unstable.hg 2006-08-27 10:24:41 -06:00
kfraser@localhost.localdomain 1df421476a Replace dom0_ops hypercall with three new hypercalls:
1. platform_op -- used by dom0 kernel to perform actions on the
    hardware platform (e.g., MTRR access, microcode update, platform
    quirks, ...)
 2. domctl -- used by management tools to control a specified domain
 3. sysctl -- used by management tools for system-wide actions

Benefits include more sensible factoring of actions to
hypercalls. Also allows tool compatibility to be tracked separately
from the dom0 kernel. The assumption is that it will be easier to
replace libxenctrl, libxenguest and Xen as a matched set if the
dom0 kernel does not need to be replaced too (e.g., because that
would require vendor revalidation).

From here on we hope to maintain dom0 kernel compatibility. This
promise is not extended to tool compatibility beyond the existing
guarantee that compatibility will not be broken within a three-level
stable release [3.0.2, 3.0.3, etc.].

Signed-off-by: Keir Fraser <keir@xensource.com>
2006-08-25 18:39:10 +01:00
awilliam@xenbuild.aw 0c6850e965 [IA64] update xc_shadow_control call with new parameters
Signed-off-by: Alex Williamson <alex.williamson@hp.com>
2006-08-23 11:16:26 -06:00
awilliam@xenbuild.aw 2ac4721161 [IA64] live migration
Shadow mode and live migration.

Virtualize Dirty bit.

Signed-off-by: Tristan Gingold <tristan.gingold@bull.net>
2006-07-26 09:36:36 -06:00
awilliam@xenbuild.aw 89b0862b3a [IA64] Save & restore.
xc_ia64_linux_save.c and xc_ia64_linux_restore.c added.
vcpu context has more registers and states (eg: tr registers).
Per cpu irqs are deallocated when cpu is switched off.
#if/#endif added in reboot.c for ia64.

Signed-off-by: Tristan Gingold <tristan.gingold@bull.net>
2006-07-11 12:51:18 -06:00