aboutsummaryrefslogtreecommitdiffstats
path: root/tools/libxc
Commit message (Collapse)AuthorAgeFilesLines
...
* Remus: increase failover timeout from 500ms to 1sKeir Fraser2010-02-121-3/+3
| | | | | | | | 500ms is aggressive enough to trigger split-brain under fairly ordinary workloads, particularly for HVM. The long-term fix is to integrate with a real HA monitor like linux HA. Signed-off-by: Brendan Cully <brendan@cs.ubc.ca>
* libxc: fix bug in xc_tbuf_get_size()Keir Fraser2010-02-101-3/+15
| | | | | | | The size in pages of trace buffer should be t_info->tbuf_size rather than t_info pages. Signed-off-by: Yu Zhiguo <yuzg@cn.fujitsu.com>
* xenpm: Allow user to enable/disable dbs governor turbo mode.Keir Fraser2010-02-082-0/+27
| | | | Signed-off-by: Lu Guanqun <guanqun.lu@intel.com>
* libxc: Reorder functions in xc_misc.c to avoid weak symbol problemKeir Fraser2010-02-041-31/+31
| | | | | | | | | | | | Using a function, and then declaring it weak later, has undefined behaviour: cc1: warnings being treated as errors xc_misc.c:388: error: weak declaration of 'xc_map_foreign_bulk' after first use results in unspecified behavior So swap the functions xc_map_foreign_pages and xc_map_foreign_bulk. Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
* libxc: Check there's enough memory for segments we're creatingKeir Fraser2010-02-031-1/+12
| | | | | | | | | | | | | | | | | Previously, xc_dom_alloc_segment would go ahead even if the segment we're trying to create is too big for the domain's RAM (or the requested addr is out of range). It would pass invalid parameters to xc_dom_seg_to_ptr giving undefined behaviour. Fixing xc_dom_seg_to_ptr to fail is not sufficient because we want to provide a comprehensible explanation to the caller - which may ultimately be the user. In particular, with this change attempting "xl create" with a ramdisk image bigger than the guest's specified RAM will provide a useful error message mentioning the ramdisk. Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
* libxc: Check full range of pfns for xc_dom_pfn_to_ptrKeir Fraser2010-02-031-1/+3
| | | | | | | | | | | | Previously, passing a valid pfn but an overly large count to xc_dom_pfn_to_ptr, and functions which call it, would run off the end of the pfn array giving undefined behaviour. It is tempting to change this check to an assert, as no callers should be providing invalid parameters here. But this is probably best not done while frozen for 4.0. Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
* libxc: Export do_mca hypercall to user space tools.Keir Fraser2010-02-032-0/+23
| | | | | | | This is mainly for software trigger MCE operation, so that test suites can trigger software MCE. Signed-off-by: Jiang, Yunhong <yunhong.jiang@intel.com>
* libxc: mmapbatch-v2 adjustmentsKeir Fraser2010-01-223-6/+7
| | | | | | | | | | | | | | | Just like the kernel, the fallback implementation of xc_map_foreign_bulk() should clear the error indication array upon success. Also, a few allocations were needlessly using calloc() instead of malloc(). Finally, in xc_domain_save() allocate the error indicator array once (along with the other arrays) instead of using realloc() (without error checking) in the loop body. Signed-off-by: Jan Beulich <jbeulich@novell.com>
* libxc: New hcall_buf_{prep,release} pre-mlock interfaceKeir Fraser2010-01-228-82/+181
| | | | | | | | | | Allow certain performance-critical hypercall wrappers to register data buffers via a new interface which allows them to be 'bounced' into a pre-mlock'ed page-sized per-thread data area. This saves the cost of mlock/munlock on every such hypercall, which can be very expensive on modern kernels. Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
* libxc: Unbreak HVM live migration after 0b138a019292.Keir Fraser2010-01-211-6/+20
| | | | | | | | 0b138a019292 was a little too ambitious replacing xc_map_foreign_batch with xc_map_foreign_pages in xc_domain_restore. With HVM, some of the mappings are expected to fail (as "XTAB" pages). Signed-off-by: Brendan Cully <brendan@cs.ubc.ca>
* xc_domain_save: allocate pfn_err before useKeir Fraser2010-01-191-0/+2
| | | | | | | Due to recent changes related to xc_map_foreign_bulk, xc_domain_save segfaults because it tries to use pfn_err without allocating it first. Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
* minios: implement xc_map_foreign_bulkKeir Fraser2010-01-181-3/+27
| | | | | | | In order to do so it modifies map_frames_ex and do_map_frames to take an int *err as parameter and return any error that way. Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
* libxc: Fix IOCTL_PRIVCMD_MMAPBATCH_V2 fallback checkKeir Fraser2010-01-141-1/+1
| | | | | | | | privcmd_ioctl returns EINVAL if the type is not supported. This fixes the guest booting issue caused by C/S 20791. Signed-off-by: Dongxiao Xu <dongxiao.xu@intel.com> Signed-off-by: Jan Beulich <jbeulich@novell.com>
* x86: add and use XEN_DOMCTL_getpageframeinfo3Keir Fraser2010-01-135-22/+23
| | | | | | | | | | | | | | | | | | To support wider than 28-bit MFNs, add XEN_DOMCTL_getpageframeinfo3 (with the type replacing the passed in MFN rather than getting or-ed into it) to properly back xc_get_pfn_type_batch(). With xc_get_pfn_type_batch() only used internally to libxc, move its prototype from xenctrl.h to xc_private.h. This also fixes a couple of bugs in pre-existing code: - the failure path for init_mem_info() leaked minfo->pfn_type, - one error path of the XEN_DOMCTL_getpageframeinfo2 handler used put_domain() where rcu_unlock_domain() was meant, and - the XEN_DOMCTL_getpageframeinfo2 handler could call xsm_getpageframeinfo() with an invalid struct page_info pointer. Signed-off-by: Jan Beulich <jbeulich@novell.com>
* libxc: use new (replacement) mmap-batch ioctlKeir Fraser2010-01-137-47/+236
| | | | | | | | | | | | | | | | | | | | Replace all calls to xc_map_foreign_batch() where the caller doesn't look at the passed in array to check for errors by calls to xc_map_foreign_pages(). Replace all remaining calls by such to the newly introduced xc_map_foreign_bulk(). As a sideband modification (needed while writing the patch to ensure they're unused) eliminate unused parameters to uncanonicalize_pagetable() and xc_map_foreign_batch_single(). Also unmap live_p2m_frame_list earlier in map_and_save_p2m_table(), reducing the peak amount of virtual address space required. All supported OSes other than Linux continue to use the old ioctl for the time being. Also change libxc's MAJOR to 4.0 to reflect the API change. Signed-off-by: Jan Beulich <jbeulich@novell.com>
* domctl/sysctl: Clean up definitionsKeir Fraser2009-12-222-25/+25
| | | | | | | | - Use fixed-width types only - Use named unions only - Bump domctl version number Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
* Make Citrix copyright strinsg consistent.Keir Fraser2009-12-183-3/+3
| | | | Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
* Support for -EAGAIN from xc_gnttab_map_grant_ref.Keir Fraser2009-12-171-1/+7
| | | | Signed-off-by: Grzegorz Milos <Grzegorz.Milos@citrix.com>
* Interfaces to memshr domctls.Keir Fraser2009-12-174-0/+204
| | | | Signed-off-by: Grzegorz Milos <Grzegorz.Milos@citrix.com>
* libxc interface support for memory paging domctls.Keir Fraser2009-12-173-0/+76
| | | | Signed-off-by: Patrick Colp <Patrick.Colp@citrix.com>
* libxc support of memory paging.Keir Fraser2009-12-171-1/+44
| | | | | | | | | | | | | libxc accepts the new return code from privcmd mmap, which indicates a page being mapped is actually paged out. Spin until the page is paged in and return as normal to the caller. This allows memory paging to work transparently with existing tools. Since libxc runs in user-space, as does the pager, both processes will be scheduled and run. This enables the page to be paged in without needing to spin in kernel mode (which would cause a dead-lock). Signed-off-by: Patrick Colp <Patrick.Colp@citrix.com>
* imported patch mem_event_tools_domctls.patchKeir Fraser2009-12-173-0/+73
|
* General code clean-up of xc_linux.c.Keir Fraser2009-12-171-89/+72
| | | | Signed-off-by: Patrick Colp <Patrick.Colp@citrix.com>
* HVM RDTSCP fixesKeir Fraser2009-12-161-1/+2
| | | | | | | - Put the guest rdtscp cpuid logic in xc_cpuid_x86.c. - MSR_TSC_AUX's high 32bit is reserved, so only write the low 32bit. Signed-off-by: Dongxiao Xu <dongxiao.xu@intel.com>
* xend: Memory pool for pv guest on systems with >128G memoryKeir Fraser2009-12-022-0/+27
| | | | | | | | | | | | | | | | | | | | | | | 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>
* libxc: pass the restore_context through function and allocate the context on ↵Keir Fraser2009-12-011-30/+32
| | | | | | the restore function stack. Signed-off-by: Vincent Hanquez <vincent.hanquez@eu.citrix.com>
* libxc: pass the suspend_context through function and allocate the context on ↵Keir Fraser2009-12-011-13/+14
| | | | | | the save function stack. Signed-off-by: Vincent Hanquez <vincent.hanquez@eu.citrix.com>
* libxc: move the domain_info_context into the restore_contextKeir Fraser2009-12-011-3/+8
| | | | Signed-off-by: Vincent Hanquez <vincent.hanquez@eu.citrix.com>
* libxc: move domain_info_context into the save_contextKeir Fraser2009-12-011-7/+10
| | | | Signed-off-by: Vincent Hanquez <vincent.hanquez@eu.citrix.com>
* libxc: move restore global variable to a global static contextKeir Fraser2009-12-011-78/+73
| | | | Signed-off-by: Vincent Hanquez <vincent.hanquez@eu.citrix.com>
* libxc: create a global context structure to record global variables in saveKeir Fraser2009-12-011-49/+47
| | | | Signed-off-by: Vincent Hanquez <vincent.hanquez@eu.citrix.com>
* libxc: create a domain_info_context structure to store guest_width and ↵Keir Fraser2009-12-019-128/+134
| | | | | | | | 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>
* xentop: Add tmem-freeable info when tmem is activeKeir Fraser2009-12-011-0/+1
| | | | | | (No change to xentop output when tmem is inactive.) Signed-off-by: Dan Magenheimer <dan.magenheimer@oracle.com>
* libxc: Fix 32-vs-64 bitness issue in saving vcpu contexts in core dumpKeir Fraser2009-11-261-3/+3
| | | | | Signed-off-by: Mukesh Rathor <mukesh.rathor@oracle.com> Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
* Replace tsc_native config option with tsc_mode config optionKeir Fraser2009-11-254-7/+99
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | (NOTE: pvrdtscp mode not finished yet, but all other modes have been tested so sooner seemed better than later to submit this fairly major patch so we can get more mileage on it before next release.) New tsc_mode config option supercedes tsc_native and offers a more intelligent default and an additional option for intelligent apps running on PV domains ("pvrdtscp"). For PV domains, default mode will determine if the initial host has a "safe"** TSC (meaning it is always synchronized across all physical CPUs). If so, all domains will execute all rdtsc instructions natively; if not, all domains will emulate all rdtsc instructions but providing the TSC hertz rate of the initial machine. After being restored or live-migrated, all PV domains will emulate all rdtsc instructions. Hence, this default mode guarantees correctness while providing native performance in most conditions. For PV domains, tsc_mode==1 will always emulate rdtsc and tsc_mode==2 will never emulate rdtsc. For tsc_mode==3, rdtsc will never be emulated, but information is provided through pvcpuid instructions and rdtscp instructions so that an app can obtain "safe" pvclock-like TSC information across save/restore and live migration. (Will be completed in a follow-on patch.) For HVM domains, the default mode and "always emulate" mode do the same as tsc_native==0; the other two modes do the same as tsc_native==1. (HVM domains since 3.4 have implemented a tsc_mode=default-like functionality, but also can preserve native TSC across save/restore and live-migration IFF the initial and target machines have a common TSC cycle rate.) ** All newer AMD machines, and Nehalem and future Intel machines have "Invariant TSC"; many newer Intel machines have "Constant TSC" and do not support deep-C sleep states; these and all single-processor machines are "safe". Signed-off-by: Dan Magenheimer <dan.magenheimer@oracle.com>
* libxc: Minor tools bzip2/lzma decompression fixesKeir Fraser2009-11-231-16/+22
| | | | | | | | | | The attached patch cleans up a few minor problems in the bzip2/lzma decompression support, pointed out by Jiri in internal review. In particular, it fixes a possible memory leak on realloc() error, it fixes a shifting typo, and it changes the xc_dom_printf()'s to be a bit clearly about which compression routine is in-use. Signed-off-by: Chris Lalancette <clalance@redhat.com>
* [IA64] Remus: ia64 counter part of 07f6d9047af4Keir Fraser2009-11-231-8/+45
| | | | | | This patch adds callbacks to xc_domain_save(). Signed-off-by: KUWAMURA Shin'ya <kuwa@jp.fujitsu.com>
* Remus: Make checkpoint buffering HVM-awareKeir Fraser2009-11-091-96/+287
| | | | Signed-off-by: Brendan Cully <brendan@cs.ubc.ca>
* Remus: Do bitmap scan word-by-word before bit-by-bit.Keir Fraser2009-11-091-0/+10
| | | | | | For sparse bitmaps and large domains this saves a lot of time. Signed-off-by: Brendan Cully <brendan@cs.ubc.ca>
* Remus: Do not bother with to_skip/to_fix bitmaps after the first final round.Keir Fraser2009-11-091-40/+61
| | | | Signed-off-by: Geoffrey Lefebvre <geoffrey@cs.ubc.ca>
* Remus: Buffer checkpoint data locally until domain has resumed execution.Keir Fraser2009-11-091-1/+112
| | | | Signed-off-by: Brendan Cully <brendan@cs.ubc.ca>
* Remus: Initiate failover if a packet is not received every 500ms.Keir Fraser2009-11-091-1/+51
| | | | | | | This breaks checkpoints at lower frequencies, and should be made optional. Signed-off-by: Brendan Cully <brendan@cs.ubc.ca>
* Remus: Make xc_domain_restore loop until the fd is closed.Keir Fraser2009-11-091-256/+489
| | | | | | | | | | | The tail containing the final PFN table, VCPU contexts and shared_info_page is buffered, then the read loop is restarted. After the first pass, incoming pages are buffered until the next tail is read, completing a new consistent checkpoint. At this point, the memory changes are applied and the loop begins again. When the fd read fails, the tail buffer is processed. Signed-off-by: Brendan Cully <brendan@cs.ubc.ca>
* Remus: Add callbacks for suspend, postcopy and preresume in xc_domain_save.Keir Fraser2009-11-092-13/+60
| | | | | | This makes it possible to perform repeated checkpoints. Signed-off-by: Brendan Cully <brendan@cs.ubc.ca>
* x86, hvm: Make host TscInvariant CPUID flag visible to guest by default.Keir Fraser2009-11-091-0/+8
| | | | Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
* xc_resume: fix modify_returncode when host width != guest widthKeir Fraser2009-11-041-15/+37
| | | | | | | Also improve checking in xc_domain_resume_any(). Signed-off-by: Brendan Cully <brendan@cs.ubc.ca> Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
* libxc: fix a few memory leaksKeir Fraser2009-10-231-2/+8
| | | | | | | running qemu with valgrind I found I couple of small memory leaks in libxc, this patch fixes them. Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
* Add nomigrate config option to disable migration/restoreKeir Fraser2009-10-202-0/+11
| | | | | | | | | | | | | | The new nomigrate option can be set to non-zero in vm.cfg (for both hvm and pvm) to disallow a guest from being migrated or restored. (Save is still allowed for the purpose of checkpointing.) The option persists into a save file and is also communicated into the hypervisor, the latter for the purposes of a to-be-added hypercall for communicating to guests that migration is disallowed (which will be used initially for userland TSC-related sensing, but may find other uses). Signed-off-by: Dan Magenheimer <dan.magenheimer@oracle.com>
* Spinlock profiling (enable in build with lock_profile=y)Keir Fraser2009-10-142-0/+32
| | | | | | | 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>
* libxenctrl: Fix non-Linux definitions of xc_gnttab_map_table*().Keir Fraser2009-10-073-3/+24
| | | | Signed-off-by: Keir Fraser <keir.fraser@citrix.com>