aboutsummaryrefslogtreecommitdiffstats
path: root/tools/libxc
Commit message (Collapse)AuthorAgeFilesLines
* libxc: drop relics of running on non-PAE 32-bit hostsJan Beulich2013-01-245-127/+14
| | | | | | | | | Additionally drop unused (and dangerous) defines and typedefs, plus a minor legibility improvement to setup_pgtables_x86_{32_pae,64}(). Signed-off-by: Jan Beulich <jbeulich@suse.com> Acked-by: Keir Fraser <keir@xen.org> Acked-by: Ian Campbell <Ian.Campbell@citrix.com>
* libxc: match types of 'subject' and 'foreigndom' between struct xc_mmu and ↵Dario Faggioli2013-01-242-4/+4
| | | | | | | | | | | | | | | | | | | do_mmu_update In do_mmu_update() (in the hypervisor) the parameter 'foreigndom' is 'unsigned int' and both its high (bits 31-16) and low (bits 15-0) are parts utilised, as explained here: http://xenbits.xen.org/docs/unstable/hypercall/include,public,xen.h.html#Func_HYPERVISOR_mmu_update However, the actual parameter, i.e., the 'subject' field in struct xc_mmu is declared as domid_t, which typedef-s to uint16_t. This means we are never able to pass anything via the higher 16 bits of 'foreigndom', which in turns may cause the hypercall to fail when called on an actual foreign domain. Signed-off-by: Dario Faggioli <dario.faggioli@citrix.com> Acked-by: Ian Campbell <ian.campbell@citrix.com> Committed-by: Ian Campbell <ian.campbell@citrix.com>
* x86/mm: revert 26399:b0e618cb0233 (multiple vram areas)Tim Deegan2013-01-171-14/+6
| | | | | | | | Although this passed my smoke-tests at commit time, I'm now seeing screen corruption on 32-bit WinXP guests. Reverting for now. :( Signed-off-by: Tim Deegan <tim@xen.org> Committed-by: Tim Deegan <tim@xen.org>
* x86/mm: Provide support for multiple frame buffers in HVM guests.Robert Phillips2013-01-171-6/+14
| | | | | | | | | | | | | | | | | | | | | | Support is provided for both shadow and hardware assisted paging (HAP) modes. This code bookkeeps the set of video frame buffers (vram), detects when the guest has modified any of those buffers and, upon request, returns a bitmap of the modified pages. This lets other software components re-paint the portions of the monitor (or monitors) that have changed. Each monitor has a frame buffer of some size at some position in guest physical memory. The set of frame buffers being tracked can change over time as monitors are plugged and unplugged. Signed-off-by: Robert Phillips <robert.phillips@citrix.com> Acked-by: Tim Deegan <tim@xen.org> Removed a stray #include and a few hard tabs. Signed-off-by: Tim Deegan <tim@xen.org> Committed-by: Tim Deegan <tim@xen.org>
* libxc: x86: ensure that the initial mapping fits into the guest's memoryIan Campbell2013-01-112-1/+14
| | | | | | | | | | | | | | In particular we need to check that adding 512KB of slack and rounding up to a 4MB boundary do not overflow the guest's memory allocation. Otherwise we run off the end of the p2m when building the guest's initial page tables and populate them with garbage. Wei noticed this when build tiny (2MB) mini-os domains. Reported-by: Wei Liu <Wei.Liu2@citrix.com> Signed-off-by: Ian Campbell <ian.campbell@citrix.com> Acked-by: Jan Beulich <jbeulich@suse.com> Committed-by: Ian Campbell <ian.campbell@citrix.com>
* HVM firmware passthrough control tools supportRoss Philipson2013-01-104-8/+135
| | | | | | | | | | | | Xen control tools support for loading the firmware passthrough blocks during domain construction. SMBIOS and ACPI blocks are passed in using the new xc_hvm_build_args structure. Each block is read and loaded into the new domain address space behind the HVMLOADER image. The base address for the two blocks is returned as an out parameter to the caller via the args structure. Signed-off-by: Ross Philipson <ross.philipson@citrix.com> Committed-by: Keir Fraser <keir@xen.org>
* libxl: introduce XSM relabel on buildDaniel De Graaf2012-12-132-0/+11
| | | | | | | | | | | | | | | | | | | | | | Allow a domain to be built under one security label and run using a different label. This can be used to prevent the domain builder or control domain from having the ability to access a guest domain's memory via map_foreign_range except during the build process where this is required. Example domain configuration snippet: seclabel='customer_1:vm_r:nomigrate_t' init_seclabel='customer_1:vm_r:nomigrate_t_building' Note: this does not provide complete protection from a malicious dom0; mappings created during the build process may persist after the relabel, and could be used to indirectly access the guest's memory. However, if dom0 correctly unmaps the domain upon building, a the domU is protected against dom0 becoming malicious in the future. Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov> acked-by: Ian Campbell <ian.campbell@citrix.com> Committed-by: Ian Campbell <ian.campbell@citrix.com>
* X86/vMCE: handle broken page with regard to migrationLiu Jinsong2012-12-064-3/+58
| | | | | | | | | | | | | | | | | | | | | | | At the sender xc_domain_save has a key point: 'to query the types of all the pages with xc_get_pfn_type_batch' 1) if broken page occur before the key point, migration will be fine since proper pfn_type and pfn number will be transferred to the target and then take appropriate action; 2) if broken page occur after the key point, whole system will crash and no need care migration any more; At the target Target will populates pages for guest. As for the case of broken page, we prefer to keep the type of the page for the sake of seamless migration. Target will set p2m as p2m_ram_broken for broken page. If guest access the broken page again it will kill itself as expected. Suggested-by: George Dunlap <george.dunlap@eu.citrix.com> Signed-off-by: Liu Jinsong <jinsong.liu@intel.com> Acked-by: Ian Campbell <ian.campbell@citrix.com> Acked-by: Tim Deegan <tim@xen.org> Committed-by: Ian Campbell <ian.campbell@citrix.com>
* docs: document/mark-up SCHEDOP_*Ian Campbell2012-11-192-3/+16
| | | | | | | | | | | | | The biggest subtlety here is there additional argument when op == SCHEDOP_shutdown and reason == SHUTDOWN_suspend and its interpretation by xc_domain_{save,restore}. Add some clarifying comments to libxc as well. This patch moves some structs around but there is no functional change other than improved documentation. Signed-off-by: Ian Campbell <ian.campbell@citrix.com> Acked-by: Ian Jackson <ian.jackson@eu.citrix.com> Committed-by: Ian Campbell <ian.campbell@citrix.com>
* tools: Synchronize privcmd header constantsAndres Lagar-Cavilla2012-11-121-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | Since Linux's git commit ceb90fa0a8008059ecbbf9114cb89dc71a730bb6, the privcmd.h interface between Linux and libxc specifies two new constants, PRIVCMD_MMAPBATCH_MFN_ERROR and PRIVCMD_MMAPBATCH_PAGED_ERROR. These constants represent the error codes encoded in the top nibble of an mfn slot passed to the legacy MMAPBATCH ioctl. In particular, libxenctrl checks for the equivalent of the latter constant when dealing with paged out frames that might be the target of a foreign map. Previously, the relevant constant was defined in the domctl hypervisor interface header (XEN_DOMCTL_PFINFO_PAGEDTAB). Because this top-nibble encoding is a contract between the dom0 kernel and libxc, a domctl.h definition is misplaced. - Sync the privcmd.h header to that now available in upstream Linux - Update libxc appropriately - Remove the unnecessary constant in domctl.h Signed-off-by: Andres Lagar-Cavilla <andres@lagarcavilla.org> Acked-by: Ian Campbell <ian.campbelL@citrix.com> Committed-by: Ian Campbell <ian.campbell@citrix.com>
* tools: Make restore work properly with PV superpage flagDave McCracken2012-11-121-29/+101
| | | | | | | | | | | | | | For PV guests, the superpage flag means to unconditionally allocate all pages as superpages, which is required for Linux hugepages to work. Support for this on restore was not supported. This patch adds proper support for the superpage flag on restore. For HVM guests, the superpage flag has been used to mean attempt to allocate superpages if possible on restore. This functionality has been preserved. Signed-off-by: Dave McCracken <dave.mccracken@oracle.com> Acked-by: George Dunlap <george.dunlap@eu.citrix.com> Committed-by: Ian Campbell <ian.campbell@citrix.com>
* libxc: builder: limit maximum size of kernel/ramdisk.Ian Jackson2012-10-263-9/+150
| | | | | | | | | | | | | | | | | | | | | | Allowing user supplied kernels of arbitrary sizes, especially during decompression, can swallow up dom0 memory leading to either virtual address space exhaustion in the builder process or allocation failures/OOM killing of both toolstack and unrelated processes. We disable these checks when building in a stub domain for pvgrub since this uses the guest's own memory and is isolated. Decompression of gzip compressed kernels and ramdisks has been safe since 14954:58205257517d (Xen 3.1.0 onwards). This is XSA-25 / CVE-2012-4544. Also make explicit checks for buffer overflows in various decompression routines. These were already ruled out due to other properties of the code but check them as a belt-and-braces measure. Signed-off-by: Ian Campbell <ian.campbell@citrix.com> Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
* Revert 26109:6ccfe4d29f95Ian Jackson2012-10-263-128/+9
| | | | | | | This changeset was contaminated by changes hanging around in my working tree. Sorry :-(. Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
* xl: Do not leak events when a domain exits.Ian Campbell2012-10-253-9/+128
| | | | | | | | | | | | | | | | | | | | | | | | The goto in both of these places misses the event free which would normally clean up. ==8655== 80 bytes in 1 blocks are definitely lost in loss record 1 of 1 ==8655== at 0x4024370: calloc (vg_replace_malloc.c:593) ==8655== by 0x406EAAE: libxl__zalloc (libxl_internal.c:83) ==8655== by 0x4078173: libxl__event_new (libxl_event.c:1167) ==8655== by 0x4056373: domain_death_occurred (libxl.c:958) ==8655== by 0x4058D06: domain_death_xswatch_callback (libxl.c:1038) ==8655== by 0x4078EB5: watchfd_callback (libxl_event.c:458) ==8655== by 0x407839E: afterpoll_internal (libxl_event.c:949) ==8655== by 0x4079142: eventloop_iteration (libxl_event.c:1371) ==8655== by 0x40799BB: libxl_event_wait (libxl_event.c:1396) ==8655== by 0x805CC67: create_domain (xl_cmdimpl.c:1698) ==8655== by 0x805E001: main_create (xl_cmdimpl.c:3986) ==8655== by 0x804D43D: main (xl.c:285) Signed-off-by: Ian Campbell <ian.campbell@citrix.com> Acked-by: Ian Jackson <ian.jackson@eu.citrix.com> Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
* libxc/arm: allocate xenstore and console pagesStefano Stabellini2012-10-091-6/+27
| | | | | | | | | | | | | | Allocate two additional pages at the end of the guest physical memory for xenstore and console. Set HVM_PARAM_STORE_PFN and HVM_PARAM_CONSOLE_PFN to the corresponding values. Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com> Acked-by: Ian Campbell <ian.campbell@citrix.com> [ ijc -- pass correct p2m array to populate physmap in alloc_magic_pages ] Committed-by: Ian Campbell <ian.campbell@citrix.com>
* arm: implement VGCF_onlineIan Campbell2012-10-091-0/+2
| | | | | | Signed-off-by: Ian Campbell <ian.campbell@citrix.com> Acked-by: Tim Deegan <tim@xen.org> Committed-by: Ian Campbell <ian.campbell@citrix.com>
* libxc: add ARM support to xc_dom (PV domain building)Ian Campbell2012-10-096-10/+339
| | | | | | | | Includes ARM zImage support. Signed-off-by: Ian Campbell <ian.campbell@citrix.com> Acked-by: Stefano Stabellini <Stefano.Stabellini@eu.citrix.com> Committed-by: Ian Campbell <ian.campbell@citrix.com>
* x86: Expose TSC adjust to HVM guestLiu, Jinsong2012-09-262-1/+3
| | | | | | | | | | Intel latest SDM (17.13.3) release a new MSR CPUID.7.0.EBX[1]=1 indicates TSC_ADJUST MSR 0x3b is supported. This patch expose it to hvm guest. Signed-off-by: Liu, Jinsong <jinsong.liu@intel.com> Committed-by: Jan Beulich <jbeulich@suse.com>
* libxl: Enable -Wshadow.Ian Campbell2012-09-171-16/+20
| | | | | | | | | | | | | | | | | | | | | | It was convenient to invent $(CFLAGS_LIBXL) to do this. Various renamings to avoid shadowing standard functions: - index(3) - listen(2) - link(2) - abort(3) - abs(3) Reduced the scope of some variables to avoid conflicts. Change to libxc is due to the nested hypercall buf macros in set_xen_guest_handle (used in libxl) using the same local private vars. Build tested only. Signed-off-by: Ian Campbell <ian.campbell@citrix.com> Acked-by: Ian Jackson <ian.jackson@eu.citrix.com> Committed-by: Ian Campbell <ian.campbell@citrix.com>
* tools: drop ia64 supportIan Campbell2012-09-1223-4584/+5
| | | | | | | | | | | | | | | | | Removed support from libxc and mini-os. This also took me under xen/include/public via various symlinks. Dropped tools/debugger/xenitp entirely, it was described upon commit as: "Xenitp is a low-level debugger for ia64" and doesn't appear to be linked into the build anywhere. 99 files changed, 14 insertions(+), 32361 deletions(-) Signed-off-by: Ian Campbell <ian.campbell@citrix.com> Acked-by: Keir Fraser <keir@xen.org> Committed-by: Ian Campbell <ian.campbell@citrix.com>
* libxc: Support save/restore of up to 4096 VCPUs (increase from 64 VCPUs).Keir Fraser2012-08-223-20/+24
| | | | Signed-off-by: Keir Fraser <keir@xen.org>
* tools/python: Clean python correctlyAndrew Cooper2012-08-172-19/+17
| | | | | | | | | | Cleaning the python directory should completely remove the build/ directory, otherwise subsequent builds may be short-circuited and a stale build installed. Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com> Acked-by: Ian Campbell <ian.campbell@citrix.com> Committed-by: Ian Campbell <ian.campbell@citrix.com>
* libxc/Linux: Add VM_DONTCOPY flag of the VMA of the hypercall bufferWangzhenguo2012-08-172-13/+35
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This avoids the hypercall buffer becoming CoW on fork. In multi-threads and multi-processes environment, e.g. the process has two threads, thread A may call hypercall, thread B may call fork() to create child process. After forking, all pages of the process including hypercall buffers are cow. It will cause a write protection and return EFAULT error if hypervisor calls copy_to_user in hypercall in thread A context, Fix: 1. Before hypercall: use MADV_DONTFORK of madvise syscall to make the hypercall buffer not to be copied to child process after fork. 2. After hypercall: undo the effect of MADV_DONTFORK for the hypercall buffer by using MADV_DOFORK of madvise syscall. 3. Use mmap/nunmap for memory alloc/free instead of malloc/free to bypass libc. Note: Child processes must not use the opened xc_{interface,evtchn,gnttab,gntshr} handle that inherits from parents. They should reopen the handle if they want to interact with xc. Otherwise, it may cause segment fault to access hypercall buffer caches of the handle. Signed-off-by: Zhenguo Wang <wangzhenguo@huawei.com> Signed-off-by: Xiaowei Yang <xiaowei.yang@huawei.com> Acked-by: Ian Campbell <ian.campbell@citrix.com> [ ijc -- s/ptr/p/ to fix build & tweaked the wording of the comments slightly. ] Committed-by: Ian Campbell <ian.campbell@citrix.com>
* x86/PoD: prevent guest from being destroyed upon early access to its memoryJan Beulich2012-08-161-14/+21
| | | | | | | | | | | | | | | | | | | | When an external agent (e.g. a monitoring daemon) happens to access the memory of a PoD guest prior to setting the PoD target, that access must fail for there not being any page in the PoD cache, and only the space above the low 2Mb gets scanned for victim pages (while only the low 2Mb got real pages populated so far). To accomodate for this - set the PoD target first - do all physmap population in PoD mode (i.e. not just large [2Mb or 1Gb] pages) - slightly lift the restrictions enforced by p2m_pod_set_mem_target() to accomodate for the changed tools behavior Tested-by: Jürgen Groß <juergen.gross@ts.fujitsu.com> (in a 4.0.x based incarnation) Signed-off-by: Jan Beulich <jbeulich@suse.com> Acked-by: George Dunlap <george.dunlap@eu.citrix.com>
* xenstore: don't print an error when gntdev cannot be openedRoger Pau Monne2012-07-231-1/+1
| | | | | | | | | NetBSD doesn't have a gntdev, but we should not print an error when falling back to the previous implementation. Signed-off-by: Roger Pau Monne <roger.pau@citrix.com> Acked-by: Ian Campbell <ian.campbell@citrix.com> Committed-by: Ian Campbell <ian.campbell@citrix.com>
* libxc: restore: bounds check for start_info.{store_mfn,console.domU.mfn}Ian Campbell2012-07-231-0/+12
| | | | | | | | | | These fields are canonicalised by the guest on suspend and therefore must be valid pfns during restore. Reported-by: Jonathan Ludlam <Jonathan.Ludlam@eu.citrix.com> Signed-off-by: Ian Campbell <ian.campbell@citrix.com> Acked-by: Ian Jackson <ian.jackson@eu.citrix.com> Committed-by: Ian Campbell <ian.campbell@citrix.com>
* libxl,libxc: introduce libxl_get_numainfo()Dario Faggioli2012-07-062-0/+20
| | | | | | | | | | | | | Make some NUMA node information available to the toolstack. Achieve this by means of xc_numainfo(), which exposes memory size and amount of free memory of each node, as well as the relative distances of each node to all the others. For properly exposing distances we need the IDL to support arrays. Signed-off-by: Dario Faggioli <dario.faggioli@citrix.com> Acked-by: Ian Campbell <ian.campbell@citrix.com> Committed-by: Ian Campbell <ian.campbell@citrix.com>
* libxc: Do not segfault if (e.g.) switch_qemu_logdirty failsIan Jackson2012-06-281-1/+1
| | | | | | | | | | | | | | In xc_domain_save the local variable `ob' is initialised to NULL. There are then various startup actions. Some of these `goto out' on failure; for example the call to callbacks->switch_qemu_logdirty on l.978. However, out is used both by success and error paths. So it attempts (l.2043) to flush the current output buffer. If ob has not yet been assigned a non-NULL value, this segfaults. So make the call to outbuf_flush conditional on ob. Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com> Acked-by: Ian Campbell <ian.campbell@citrix.com> Committed-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
* libxc: xc_domain_restore, make toolstack_restore const-correctIan Jackson2012-06-281-1/+1
| | | | | | | Update the one provider of this callback, in libxl. Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com> Acked-by: Ian Campbell <ian.campbell@citrix.com>
* libxc: do not "panic" if a kernel is not a bzImage.Ian Campbell2012-06-081-4/+2
| | | | | | | | | | Up until the point where we think this is a bzImage there is no point in printing panicy messages -- some other loader will have a go (probably the compressed ELF one) Signed-off-by: Ian Campbell <ian.campbell@citrix.com> Acked-by: Ian Jackson <ian.jackson@eu.citrix.com> Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
* Rename: inslen -> insn_lenKeir Fraser2012-05-302-3/+3
| | | | Signed-off-by: Keir Fraser <keir@xen.org>
* Add instruction length and trap type in HVMOP_inject_trap.Xudong Hao2012-05-302-3/+7
| | | | | | Signed-off-by: Xudong Hao <xudong.hao@intel.com> Signed-off-by: Xiantao Zhang <xiantao.zhang@intel.com> Signed-off-by: Keir Fraser <keir@xen.org>
* arm: compile libxenguestStefano Stabellini2012-05-305-3/+162
| | | | | | | | | | | | | | Introduce an empty implementation of the arch specific ARM functions in xc_dom_arm.c. Provide empty implementations of xc_domain_save and xc_domain_restore when CONFIG_MIGRATE is not set. Move xc_hvm_build.c to xc_hvm_build_x86.c because the implementation is x86 specific, introduce xc_hvm_build_arm.c with empty stubs. Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com> Acked-by: Ian Jackson <Ian.Jackson@eu.citrix.com> Acked-by: Ian Campbell <Ian.Campbell@citrix.com> Committed-by: Ian Campbell <ian.campbell@citrix.com>
* libxl: Remus - suspend/postflush/commit callbacksShriram Rajagopalan2012-05-181-2/+21
| | | | | | | | | | | | | | | | | | | | | * Add libxl callback functions for Remus checkpoint suspend, postflush (aka resume) and checkpoint commit callbacks. * suspend callback is a stub that just bounces off libxl__domain_suspend_common_callback - which suspends the domain and saves the devices model state to a file. * resume callback currently just resumes the domain (and the device model). * commit callback just writes out the saved device model state to the network and sleeps for the checkpoint interval. * Introduce a new public API, libxl_domain_remus_start (currently a stub) that sets up the network and disk buffer and initiates continuous checkpointing. * Future patches will augment these callbacks/functions with more functionalities like issuing network buffer plug/unplug commands, disk checkpoint commands, etc. Signed-off-by: Shriram Rajagopalan <rshriram@cs.ubc.ca> Acked-by: Ian Campbell <ian.campbell@citrix.com> Committed-by: Ian Campbell <ian.campbell@citrix.com>
* libxc: implement gnttab.set_max_grants for LinuxJan Beulich2012-05-141-0/+22
| | | | | | | | | | Legacy (non-pvops) gntdev drivers may require this operation to be performed when the number of grants intended to be used simultaneously exceeds a certain driver specific default limit, and qemu's qdisk driver is an example of needing to do so. Signed-off-by: Jan Beulich <jbeulich@suse.com> Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
* libxc: introduce XC_SAVE_ID_TOOLSTACKStefano Stabellini2012-05-114-2/+92
| | | | | | | | Introduce a new save_id to save/restore toolstack specific extra information. Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com> Committed-by: Ian Jackson <ian.jackson.citrix.com>
* libxc: Document the sharing interfaceAndres Lagar-Cavilla2012-04-241-22/+179
| | | | | | | | (also make note about AMD support's experimental status) Signed-off-by: Andres Lagar-Cavilla <andres@lagarcavilla> Acked-by: Tim Deegan <tim@xen.org> Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
* x86/mem_sharing: Clean up debugging callsAndres Lagar-Cavilla2012-04-242-17/+0
| | | | | | | | | - Remove debug_mfn from the user-space interface - Clean up errno codes Signed-off-by: Andres Lagar-Cavilla <andres@lagarcavilla.org> Acked-by: Tim Deegan <tim@xen.org> Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
* libxc: Replace alloca() with mmap() for large array sizesAravindh Puthiyaparambil2012-04-241-4/+38
| | | | | | | | | | | | | | | | | | | | | Replace alloca() with mmap() for array sizes greater than a page in xc_linux_osdep.c. When mapping in large amounts of pages (in the GB range) from a guest in to Dom0 using xc_map_foreign_bulk(), a segfault occurs in the libxc client application. This is because the pfn array in linux_privcmd_map_foreign_bulk() is being allocated using alloca() and the subsequent memcpy causes the stack to blow. This patch replaces the alloca() with mmap() for pfn array sizes greater than a page. Fix an error print with the correct function name. Do the same for the map array in linux_gnttab_grant_map() Signed-off-by: Aravindh Puthiyaparambil <aravindh@virtuata.com> Acked-by: Andres Lagar-Cavilla <andres@lagarcavilla.org> Acked-by: Ian Campbell <ian.campbell@citrix.com> Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
* tools: Correct PTHREAD options in config/StdGNU.mkIan Jackson2012-04-111-1/+3
| | | | | | | | | | | | | | | | | | | | | | It is not correct to say -lpthread. The correct option is -pthread, which may have sundry other effects on code generation etc. It needs to be passed both to compilation and linking. Fix the configure test to test -pthread, and plumb the resulting flag through to PTHREAD_{CFLAGS,LDFLAGS} in Tools.mk; also substitute PTHREAD_LIBS (although this will currently always be empty). Remove PTHREAD_LIBS setting from StdGNU.mk. Fix the one user (libxc) to use PTHREAD_{CFLAGS,LDFLAGS} too. There are still some other users in tree which pass -pthread or -lpthread by adding it as a literal to their own compiler options. These will be fixed in a later patch. Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com> Cc: Roger Pau Monne <roger.pau@entel.upc.edu> Acked-by: Roger Pau Monne <roger.pau@entel.upc.edu> Committed-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
* tools/libxc: send page-in requests in batches in linux_privcmd_map_foreign_bulkOlaf Hering2012-03-261-15/+57
| | | | | | | | | | | | | | | One of the bottlenecks with foreign page-in request is the poor retry handling in linux_privcmd_map_foreign_bulk(). It sends one request per paged gfn at a time and it waits until the gfn is accessible. This causes long delays in mmap requests from qemu-dm and xc_save. Instead of sending one request at a time, walk the entire gfn list and send batches of mmap requests. They will eventually end up in the pager's request ring (if it has room again), and will fill up this ring so that in turn the pager can also process page-in in batches. Signed-off-by: Olaf Hering <olaf@aepfle.de> Committed-by: Ian Jackson <ian.jackson.citrix.com>
* autoconf: add missing compression checks for libxcRoger Pau Monne2012-03-141-14/+1
| | | | | | | | | Move missing checks from tools/libxc/Makefile to configure script. Signed-off-by: Roger Pau Monne <roger.pau@entel.upc.edu> Acked-by: Ian Jackson <ian.jackson@eu.citrix.com> Acked-by: Jan Beulich <JBeulich@suse.com> Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
* Tools: libxc side for setting up the mem sharing ringTim Deegan2012-03-082-0/+30
| | | | | | | | This ring is used to report failed allocations in the unshare path. Signed-off-by: Andres Lagar-Cavilla <andres@lagarcavilla.org> Acked-by: Ian Campbell <ian.campbell@citrix.com> Committed-by: Tim Deegan <tim@xen.org>
* Use a reserved pfn in the guest address space to store mem event ringsTim Deegan2012-03-088-19/+107
| | | | | | | | | | | | | | | | | | This solves a long-standing issue in which the pages backing these rings were pages belonging to dom0 user-space processes. Thus, if the process would die unexpectedly, Xen would keep posting events to a page now belonging to some other process. We update all API-consumers in tree (xenpaging and xen-access). This is an API/ABI change, so please speak up if it breaks your accumptions. The patch touches tools, hypervisor x86/hvm bits, and hypervisor x86/mm bits. Signed-off-by: Andres Lagar-Cavilla <andres@lagarcavilla.org> Acked-by: Tim Deegan <tim@xen.org> Acked-by: Ian Campbell <ian.campbell@citrix.com> Committed-by: Tim Deegan <tim@xen.org>
* Tools: Remove shared page from mem_event/access/paging interfacesTim Deegan2012-03-084-12/+26
| | | | | | | | | | | | | | | | | | | | | | Don't use the superfluous shared page, return the event channel directly as part of the domctl struct, instead. In-tree consumers (xenpaging, xen-access) updated. This is an ABI/API change, so please voice any concerns. Known pending issues: - pager could die and its ring page could be used by some other process, yet Xen retains the mapping to it. - use a saner interface for the paging_load buffer. This change also affects the x86/mm bits in the hypervisor that process the mem_event setup domctl. Signed-off-by: Andres Lagar-Cavilla <andres@lagarcavilla.org> Acked-by: Tim Deegan <tim@xen.org> Acked-by: Olaf Hering <olaf@aepfle.de> Acked-by: Ian Campbell <ian.campbell@citrix.com> Committed-by: Tim Deegan <tim@xen.org>
* arm: compile libxcStefano Stabellini2012-03-015-0/+174
| | | | | | | | | | Introduce an empty implementation of the arch specific ARM functions in xc_core_arm.c and xc_core_arm.h; define barriers on ARM. Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com> Committed-by: Ian Jackson <ian.jackson.citrix.com> Acked-by: Ian Campbell <ian.campbell@citrix.com> Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
* x86,tools/libxc: expose HLE/RTM features to pv and hvmLiu, Jinsong2012-03-012-0/+6
| | | | | | | | | Intel recently release 2 new features, HLE and TRM. Refer to http://software.intel.com/file/41417. This patch expose them to pv and hvm Signed-off-by: Liu, Jinsong <jinsong.liu@intel.com> Committed-by: Keir Fraser <keir@xen.org>
* xenpaging: remove obsolete XENMEM_paging_op_resumeOlaf Hering2012-03-012-10/+0
| | | | | | | | | | | | | | | | | | | | With changeset 24364:0964341efd65 an event channel based notification of new responses in the ringbuffer is implemented. This makes the memevent interface obsolete. Currently a call to p2m_mem_paging_resume() is triggered twice by xenpaging, once per memevent and once per even channel. In practice this double call does not lead to issues because p2m_mem_paging_resume() processes only available events. xenpaging used the event channel notification since the beginning, but it was a no-op until changeset mentioned above. This change removes the unneeded XENMEM_paging_op_resume functionality. Pagers are notified via an event channel of new requests, and now they are required to notify the hypervisor about their responses also with an event channel. Signed-off-by: Olaf Hering <olaf@aepfle.de> Acked-by: Tim Deegan <tim@xen.org> Acked-by: Ian Jackson <ian.jackson@eu.citrix.com> Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
* libxc: add MMIO hole size parameter to xc_hvm_build()David Vrabel2012-03-012-11/+19
| | | | | | | | | | | | | | | | | Add a parameter for the MMIO hole size when building a HVM domain. This is useful for specifying a larger than normal MMIO hole to ensure that no PCIe device's MMIO region overlaps with RAM in a guest's physical address space. This is needed on certain systems with PCIe switches with a broken ACS capability. On these systems, if a device downstream of the switch attempts a DMA to a guest physical address that overlaps with the MMIO region of another downstream device, then the switch routes the transfer directly to the device and the read or write never hits RAM. Signed-off-by: David Vrabel <david.vrabel@citrix.com> Acked-by: George Dunlap <george.dunlap@eu.citrix.com> Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
* libxc: pass arguments to xc_hvm_build() in a structureDavid Vrabel2012-03-014-104/+62
| | | | | | | | | | | | | | | To allow new parameters to be added to the xc_hvm_build*() family of functions, pass them in a structure. Make the other variants fill in the structure and call xc_hvm_build() (except for xc_hvm_build_mem() which had no users and is removed). The units of the mem_size and mem_target arguments are in bytes (not MiB like the old functions). Signed-off-by: David Vrabel <david.vrabel@citrix.com> Acked-by: George Dunlap <george.dunlap@eu.citrix.com> Acked-by: Ian Jackson <ian.jackson@eu.citrix.com> Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>