aboutsummaryrefslogtreecommitdiffstats
path: root/tools/libxc
Commit message (Collapse)AuthorAgeFilesLines
...
* libxenctrl: Build fix after gnttab_v2 changes.Keir Fraser2009-10-073-15/+15
| | | | Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
* Introduce a grant_entry_v2 structure.Keir Fraser2009-10-073-12/+69
| | | | Signed-off-by: Steven Smith <steven.smith@citrix.com>
* Rename the struct grant_entry to struct grant_entry_v1, so that itKeir Fraser2009-10-073-7/+7
| | | | | | isn't in the way when we introduce struct grant_entry_v2. Signed-off-by: Steven Smith <steven.smith@citrix.com>
* stubdom/minios: re-structure headersKeir Fraser2009-10-011-7/+7
| | | | | | | | | As part of making stubdom usable on NetBSD, it is necessary to restructure the minios headers to avoid conflicts with NetBSD's crossbuild toolchain. Signed-off-by: Christoph Egger <Christoph.Egger@amd.com> Acked-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
* vmx: add the support of XSAVE/XRSTOR to VMX guestKeir Fraser2009-09-291-1/+1
| | | | | | | | | | | | | | | XSAVE/XRSTOR manages the existing and future processor extended states on x86 architecture. The XSAVE/XRSTOR infrastructure is defined in Intel SDMs: http://www.intel.com/products/processor/manuals/ The patch uses the classical CR0.TS based algorithm to manage the states on context switch. At present, we know 3 bits in the XFEATURE_ENABLED_MASK: FPU, SSE and YMM. YMM is defined in Intel AVX Programming Reference: http://software.intel.com/sites/avx/ Signed-off-by: Dexuan Cui <dexuan.cui@intel.com>
* x86: Allow TSC mode (emulate vs native) to be configured per domain.Keir Fraser2009-09-282-0/+11
| | | | | | | | The default is to emulate. Old saved images will be restored with legacy behaviour however (native TSC, no emulation). Signed-off-by: Dan Magenheimer <dan.magenheimer@oracle.com> Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
* Fix some issues for HVM log dirty:Keir Fraser2009-09-073-70/+12
| | | | | | | | | * 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>
* libxenguest: Remove unused static inline function is_loadable_phdr()Keir Fraser2009-09-021-6/+0
| | | | Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
* libxc: Avoid a constant-zero-sized memset().Keir Fraser2009-08-311-1/+2
| | | | | | Some environments warn about this, which fails the build. Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
* [HVM] add super page support for HVM migrationKeir Fraser2009-08-271-24/+343
| | | | | | | | | | | | | | | | | | This patch try to allocate 2M pages on target side based on analysis of pfn sequence sent from source side for HVM migration. The algorithm is: If pseudo-phys page is not yet populated in target domain, AND it is first page of a 2MB extent, AND no other pages in that extent are yet populated, AND the next pages in the save-image stream populate that extent in order, THEN allocate a super page. If the next 511 pages (to make the 2MB extent) are split across a batch boundary, we have to optimistically allocate a super page in this batch, and then break it into several 4K pages in the next batch, which is speculative. This patch is also friendly to PV guest migration. Signed-Off-By: Zhai Edwin <edwin.zhai@intel.com>
* libxc: More LZMA/BZIP fixes.Keir Fraser2009-08-242-22/+16
| | | | | | | | | - Fix an error message in xc_try_bzip2_decode() - Check library installation on demand using a Makefile function, rather than generating a dependency file. Cleaner and avoids a race on generating the dep file. Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
* Revert 20105:979fd420311bKeir Fraser2009-08-211-1/+6
|
* libxc: Remove minios-specific hack for generating .zlib.deps fileKeir Fraser2009-08-211-6/+1
| | | | | | It's not needed if one relative path is replaced. Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
* libxenguest: Fix libbz2/liblzma dependency computation.Keir Fraser2009-08-201-1/+6
| | | | | | | 1. Create an empty dep file if neither lib is installed 2. Forcibly disable support for libs if building minios Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
* domain builder: Implement bzip2 and LZMA loadersKeir Fraser2009-08-202-58/+350
| | | | | | | | | | | Recent upstream kernels can be compressed using either gzip, bzip2, or LZMA. However, the PV kernel loader in Xen currently only understands gzip, and will fail on the other two types. The attached patch implements kernel decompression for gzip, bzip2, and LZMA so that kernels compressed with any of these methods can be launched. Signed-off-by: Chris Lalancette <clalance@redhat.com> Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
* x86 hvm: Remove vendor-specific feature masking of 0x1:ECX.Keir Fraser2009-08-191-12/+0
| | | | | | Vendors are respecting each others bits. Signed-off-by: Andre Przywara <andre.przywara@amd.com>
* tmem: save/restore/migrate/livemigrate and shared pool authenticationKeir Fraser2009-08-064-8/+420
| | | | | | | | | | | | | Attached patch implements save/restore/migration/livemigration for transcendent memory ("tmem"). Without this patch, domains using tmem may in some cases lose data when doing save/restore or migrate/livemigrate. Also included in this patch is support for a new (privileged) hypercall for authorizing domains to share pools; this provides the foundation to accomodate upstream linux requests for security for shared pools. Signed-off-by: Dan Magenheimer <dan.magenheimer@oracle.com>
* libxenguest: Revert domain builder interface changes for 'superpages'Keir Fraser2009-07-206-46/+39
| | | | | | | parameter, and place the flag in a pad byte of 'struct xc_dom_image' instead. Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
* libxc: Use a single mmap interface to LinuxKeir Fraser2009-07-201-50/+21
| | | | | | | | Modify xc_map_foreign_range and xc_map_foreign_ranges to call mmap_map_foreign_batch. This eliminates the need for multiple privcmd mmap ioctls. Now only IOCTL_PRIVCMD_MMAPBATCH is required. Signed-off-by: Patrick Colp <Patrick.Colp@citrix.com>
* libxc: Fix bugs in xc_exchange_page: pfn_type indexed by gpfn.Keir Fraser2009-07-021-2/+2
| | | | Signed-off-by: Jiang, Yunhong <yunhong.jiang@intel.com>
* x86_64: allow more vCPU-s per guestKeir Fraser2009-06-1812-63/+127
| | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* tmem: fix 32-on-64 supportKeir Fraser2009-06-171-5/+5
| | | | | | | | | This implicitly required coverting the tmem_op structure from anonymous to standard struct/union sub-fields, and extending the get-fields.sh helper script to deal with typedef-ed guest handles used as types of translated compound type fields. Signed-off-by: Jan Beulich <jbeulich@novell.com>
* libxc: fix link error on ia64Keir Fraser2009-06-041-1/+1
| | | | | | | | | | | | On ia64, xen-unstable 19698:f72d26c00002 cannot be built: ../../tools/libxc/libxenguest.so: undefined reference to `xc_core_arch_map_p2m_writable' ../../tools/libxc/libxenguest.so: undefined reference to `xc_map_m2p' Because xc_offline_page.c requires xc_map_m2p() in xc_domain_save.c, xc_offline_page.c must be compiled only if CONFIG_MIGRATE=3Dy. Signed-off-by: KUWAMURA Shin'ya <kuwa@jp.fujitsu.com>
* libxc: Implement stub xc_gnttab_map_table() for non-linux.Keir Fraser2009-06-013-0/+15
| | | | Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
* libxc: Exchange a page for PV guestKeir Fraser2009-06-013-1/+667
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch support exchange a page for a suspended PV guest from user space. The basic idea to offline a page is: 1) mark a page offline pending 2) If the page is owned by a HVM domain, user have to live migrate it. In future, with stub-domain support, we can also exchange the page without migration. 3) If the page is owned by a PV domain, we will try to exchange the offline pending page to a new one and free the old page. This patch achieves item 3. The method to exchange the offline pending page for PV domain is: 1) Suspend the guest. 2) If the page is being granted out, return with offline pending. 3) Get a copy for the content 4) Scan all page table page to see if any reference to the offending page, if yes, make the entry to be non-present to reduce the reference count. 5) After update all page tables, user space tools will try to exchange the old page. If the new mfn has no reference anymore (i.e. count_info & count_mask =3D 1), the exchange will allocate a new page, update the m2p and return success, otherwise it will return fail. 6) If step 5 is success, user space tools will update the content of the new page change the p2m table, and change all entries scaned in step 4 to point to new entry. if step failed, it will try to undo step 4 to revert page table. 7) Resume the guest. Please refer to thread in http://www.mailinglistarchive.com/xen-devel@lists.xensource.com/msg63084.html for more information. Signed-off-by: Jiang, Yunhong <yunhong.jiang@intel.com>
* libxc: Export xc_core_arch_map_p2m_writable()Keir Fraser2009-06-012-5/+28
| | | | | | | | | This patch firstly change the xc_core_arch_map_p2m() to map the p2m to be writable, then it export this function. One notice for this patch is, caller should make sure change the p2m in flight will not cause trouble. Signed-off-by: Jiang, Yunhong <yunhong.jiang@intel.com>
* libxc: Add a function to map a domain's grant table.Keir Fraser2009-06-012-0/+111
| | | | Signed-off-by: Jiang, Yunhong <yunhong.jiang@intel.com>
* libxc: export xc_map_m2p() so that it can be called outside.Keir Fraser2009-06-012-4/+19
| | | | Signed-off-by: Jiang, Yunhong <yunhong.jiang@intel.com>
* Export page offline hypercalls to user space tools.Keir Fraser2009-06-013-0/+110
| | | | Signed-off-by: Jiang, Yunhong <yunhong.jiang@intel.com>
* [IA64] adjust ia64 xc_domain_restore() signatureKeir Fraser2009-05-271-3/+3
| | | | | | | | | | | This patch fixes the following error. ia64/xc_ia64_linux_restore.c:546: error: conflicting types for xc_domain_restore ./xenguest.h:49: error: previous declaration of xc_domain_restore was here make[4]: *** [ia64/xc_ia64_linux_restore.o] Error 1 Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
* Transcendent memory ("tmem") for Xen.Keir Fraser2009-05-263-0/+95
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* Add support for superpages (hugepages) in PV domainKeir Fraser2009-05-267-143/+177
| | | | | | | | | | | | | | | | | | This patch adds the option "superpages" to the domain configuration file. If it is set, the domain is populated using 2M pages. This code does not support fallback to small pages. If the domain can not be created with 2M pages, the create will fail. The patch also includes support for saving and restoring domains with the superpage flag set. However, if a domain has freed small pages within its physical page array and then extended the array, the restore will fill in those freed pages. It will then attempt to allocate more than its memory limit and will fail. This is significant because apparently Linux does this during boot, thus a freshly booted Linux image can not be saved and restored successfully. Signed-off-by: Dave McCracken <dcm@mccr.org>
* restore: sign extend p2m when restoring on a host with pfn width <Keir Fraser2009-04-081-1/+1
| | | | | | | | | | | guest pfn width (i.e. 32on64 domain 0 and 64 bit guest domain). Otherwise P2M entries which were INVALID_P2M_ENTRY (==0xffffffffffffffff) become 0xffffffff after a migrate. Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
* xenpm: Set scheduler vcpu_migration_delay by xenpmKeir Fraser2009-04-062-0/+32
| | | | | Signed-off-by: Yu Ke <ke.yu@intel.com> Signed-off-by: Yang Xiaowei <xiaowei.yang@intel.com>
* libxc: Fix xc_translate_foreign_address in non-paged modeKeir Fraser2009-03-311-1/+1
| | | | | | | Returns paddr rather than gfn when in non-paged mode. Add a shift to fix it. Signed-off-by: George Dunlap <george.dunlap@eu.citrix.com>
* cpuidle: export max_cstate access via libxcKeir Fraser2009-03-312-0/+36
| | | | Signed-off-by: Wei Gang <gang.wei@intel.com>
* libxc: fix link error of xc_save on ia64Keir Fraser2009-03-243-110/+118
| | | | | | | | | | The suspend event channel functions are arch independent code which xc_save uses. The changeset of 19382:a5f497f02e34 cause link error on ia64. This patch moves the functions into arch common file from x86 specific file xc_domain_save.c Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
* xenpm: Add a small scheduler knob "sched_smt_power_savings"Keir Fraser2009-03-202-0/+19
| | | | | | | | | 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>
* Deliver cpufreq actual average freq to libxc interfaceKeir Fraser2009-03-202-0/+19
| | | | | | | Calculate cpu actual average freq according to aperf and mperf MSR and then deliver to libxc interface Signed-off-by: Liu, Jinsong <jinsong.liu@intel.com>
* x86 dom builder: Allocate domU pages in batches.Keir Fraser2009-03-191-4/+10
| | | | | | | Allows a 32-bit dom0 to create very large guests. Signed-off-by: Mukesh Rathor <mukesh.rathor@oracle.com> Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
* libxc: Use write_exact() in lock_suspend_event().Keir Fraser2009-03-181-3/+3
| | | | Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
* Move the suspend event channel function to libxc, it will use theKeir Fraser2009-03-182-0/+113
| | | | | | /var/lib/xen/suspend_evtchn_lock.d to protect the access. Signed-off-by: Jiang Yunhong <yunhong.jiang@intel.com>
* xenpm: Add CPU topology info (thread/core/socket)Keir Fraser2009-03-132-0/+38
| | | | | | | | | | | | 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>
* Domain core-dumping fixesKeir Fraser2009-03-122-1/+11
| | | | | | | | | | | | | | The code was attempting to use the domain's current number of pages (info.nr_pages) as a maximum index. We then walk the memory map and can easily over-write past the end of the nr_pages-sized array, if the domain has more pages mapped in than earlier (live dump). Restrict ourselves to the current number of pages. Also fix the dump core method in xend to actually implement the crash and live options. In particular this means that xend clients other than xm now get non-live dumps by default. Signed-off-by: John Levon <john.levon@sun.com>
* Fix solaris xc_map_foreign_ranges()Keir Fraser2009-03-121-0/+2
| | | | Signed-off-by: John Levon <john.levon@sun.com>
* libxc: Replace bzero() usage with memset().Keir Fraser2009-03-122-2/+2
| | | | Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
* x86: Mask X86_FEATURE_XSAVE in cpuid leaf 1, ecx, as we don't allowKeir Fraser2009-03-092-0/+2
| | | | | | | | | | guests to use it (by setting cr4.OSXSAVE). This prevents crashes in pvops kernels, as new versions of Linux try to use this feature. Signed-off-by: Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com> Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
* hvm: passthrough MSI-X mask bit accelerationKeir Fraser2009-03-022-2/+5
| | | | | | | | | | Add a new parameter to DOMCTL_bind_pt_irq to allow Xen to know the guest physical address of MSI-X table. Also add a new MMIO intercept handler to intercept that gpa in order to handle MSI-X vector mask bit operation in the hypervisor. This reduces the load of device model considerably if the guest does mask and unmask frequently Signed-off-by: Qing He <qing.he@intel.com>
* libxc: xc_ptrace cleanupKeir Fraser2009-02-201-220/+19
| | | | | | | | There are some bugs in PTRACE_PEEK/POKE. - can't track 2MB pages in 32bit pae mode. - leakage of mmap/munmap. Signed-off-by: Kouya Shimura <kouya@jp.fujitsu.com>
* libxenctrl: adds xc_domain_unbind_msi_irq to libxc.Keir Fraser2009-02-052-0/+32
| | | | | | | The function is needed to unbind MSI/MSI-X on transition from D3hot state to D0 state. Signed-off-by: Yuji Shimada <shimada-yxb@necst.nec.co.jp>