aboutsummaryrefslogtreecommitdiffstats
path: root/tools/libxc/xc_misc.c
Commit message (Collapse)AuthorAgeFilesLines
* xen, libxc: introduce xc_nodemap_tDario Faggioli2013-04-171-0/+15
| | | | | | | | | And its handling functions, following suit from xc_cpumap_t. Signed-off-by: Dario Faggioli <dario.faggioli@citrix.com> Acked-by: George Dunlap <george.dunlap@eu.citrix.com> Acked-by: Juergen Gross <juergen.gross@ts.fujitsu.com> Acked-by: Keir Fraser <keir@xen.org>
* Fix emacs local variable block to use correct C style variable.David Vrabel2013-02-211-1/+1
| | | | | | | The emacs variable to set the C style from a local variable block is c-file-style, not c-set-style. Signed-off-by: David Vrabel <david.vrabel@citrix.com
* libxl,libxc: introduce libxl_get_numainfo()Dario Faggioli2012-07-061-0/+14
| | | | | | | | | | | | | 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>
* Rename: inslen -> insn_lenKeir Fraser2012-05-301-2/+2
| | | | Signed-off-by: Keir Fraser <keir@xen.org>
* Add instruction length and trap type in HVMOP_inject_trap.Xudong Hao2012-05-301-2/+5
| | | | | | 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>
* Rename inj_msi -> inject_msiKeir Fraser2011-05-261-3/+3
| | | | Signed-off-by: Keir Fraser <keir@xen.org>
* libxc: add new operation in HVMOP to deliver emulated MSI.Wei Liu2011-05-261-0/+29
| | | | Signed-off-by: Wei Liu <liuw@liuw.name>
* mem_access: added trap injection to libxcJoe Epstein2011-01-071-0/+32
| | | | | | | | * Carries forward the trap injection hypercall into libxc Signed-off-by: Joe Epstein <jepstein98@gmail.com> Acked-by: Keir Fraser <keir@xen.org> Acked-by: Ian Campbell <Ian.Campbell@citrix.com>
* mem_access: HVMOPs for setting mem accessJoe Epstein2011-01-071-0/+60
| | | | | | | | | | | | | | * Creates HVMOPs for setting and getting memory access. The hypercalls can set individual pages or the default access for new/refreshed pages. * Added functions to libxc to access these hypercalls. Signed-off-by: Joe Epstein <jepstein98@gmail.com> Reviewed-by: Ian Campbell <ian.campbell@citrix.com> Acked-by: Ian Jackson <ian.jackson@eu.citrix.com> Acked-by: Keir Fraser <keir@xen.org> Acked-by: Tim Deegan <Tim.Deegan@citrix.com>
* libxc: move foreign memory functions to xc_foreign_memory.cIan Campbell2010-12-031-72/+0
| | | | | | | Now that this file exists it is a better home for these than xc_misc.c Signed-off-by: Ian Campbell <ian.campbell@citrix.com> Signed-off-by: Ian Jackson <ian.jackson.citrix.com>
* libxc: osdep: convert xc_map_foreign_{batch,bulk}Ian Campbell2010-12-031-6/+3
| | | | | Signed-off-by: Ian Campbell <ian.campbell@citrix.com> Signed-off-by: Ian Jackson <ian.jackson.citrix.com>
* libxc: correct bounce direction for debug-key handlingJan Beulich2010-12-101-1/+1
| | | | | | Signed-off-by: Jan Beulich <jbeulich@novell.com> Acked-by: Ian Campbell <Ian.Campbell@citrix.com> Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
* libxc: correct dirty_bitmap bounce size in xc_hvm_track_dirty_vramIan Campbell2010-11-101-1/+1
| | | | | | | | | | | The size should be in bytes not 32-bit words. Fixes graphics corruption issues for HVM guests due to bouncing too little data. Also the dirty_bitmap buffer is output only and therefore only needs bouncing in one direction. Signed-off-by: Ian Campbell <ian.campbell@citrix.com> Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
* tools: change cpumaps to uint8_tJuergen Gross2010-11-031-0/+15
| | | | | | | | | | | | | | | | | | | | Cpumap types in tools (libxc and libxl) are changed to be based on bytes like in the interface to the hypervisor. To make handling easier the size of used cpumaps is always based on the number of physical cpus supported by the hypervisor. This eliminates the need to keep track of the cpumap size in external interfaces. In libxl a macro for cycling through a cpumap is added (libxl_for_each_cpu). Interfaces changed: libxl_set_vcpuaffinity() libxl_cpumap_alloc() xc_vcpu_setaffinity() xc_vcpu_getaffinity() xc_cpupool_freeinfo() Signed-off-by: Juergen Gross <juergen.gross@ts.fujitsu.com> Acked-by: Ian Campbell <ian.campbell@citrix.com> Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
* libxc: finalise transition to hypercall buffers.Ian Campbell2010-10-221-13/+13
| | | | | | | | | | | | | | | | | | | | | Rename xc_set_xen_guest_handle to set_xen_guest_handle[0] and remove now unused functions: - xc_memalign - lock_pages - unlock_pages - hcall_buf_prep - hcall_buf_release [0] sed -i -e 's/xc_set_xen_guest_handle/set_xen_guest_handle/g' \ tools/libxc/*.[ch] \ tools/python/xen/lowlevel/xc/xc.c \ tools/python/xen/lowlevel/acm/acm.c \ tools/libxc/ia64/xc_ia64_stubs.c \ tools/security/secpol_tool.c \ tools/misc/xenpm.c Signed-off-by: Ian Campbell <ian.campbell@citrix.com> Signed-off-by: Ian Jackson <ian.jackson.citrix.com>
* libxc: convert mca interface over to hypercall buffersIan Campbell2010-10-221-6/+7
| | | | | Signed-off-by: Ian Campbell <ian.campbell@citrix.com> Signed-off-by: Ian Jackson <ian.jackson.citrix.com>
* libxc: convert hvmop interfaces over to hypercall buffersIan Campbell2010-10-221-64/+73
| | | | | Signed-off-by: Ian Campbell <ian.campbell@citrix.com> Signed-off-by: Ian Jackson <ian.jackson.citrix.com>
* libxc: convert sysctl interfaces over to hypercall buffersIan Campbell2010-10-221-32/+38
| | | | | Signed-off-by: Ian Campbell <ian.campbell@citrix.com> Signed-off-by: Ian Jackson <ian.jackson.citrix.com>
* tools: cpupools: Support arbitrary numbers of physical cpusJuergen Gross2010-10-211-0/+14
| | | | | | | | | | | | | | To be able to support arbitrary numbers of physical cpus it was necessary to include the size of cpumaps in the xc-interfaces for cpu pools. These were: definition of xc_cpupoolinfo_t xc_cpupool_getinfo() xc_cpupool_freeinfo() xc_cpupool_getinfo() and xc_cpupool_freeinfo() are changed to allocate the needed buffer and return it. Signed-off-by: juergen.gross@ts.fujitsu.com Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
* libxc: simplify lock profiling APIIan Campbell2010-10-181-8/+32
| | | | | | | | Current function has heavily overloaded semantics for the various arguments. Separate out into more specific functions. Signed-off-by: Ian Campbell <ian.campbell@citrix.com> Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
* libxc: simplify performance counters APIIan Campbell2010-10-181-9/+32
| | | | | | | | Current function has heavily overloaded semantics for the various arguments. Separate out into more specific functions. Signed-off-by: Ian Campbell <ian.campbell@citrix.com> Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
* libxc: use correct size of struct xen_mcIan Campbell2010-10-181-2/+2
| | | | | | | | We want the size of the struct not the pointer (although rounding up to page size in lock_pages probably saves us). Signed-off-by: Ian Campbell <ian.campbell@citrix.com> Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
* libxc: remove unnecessary double indirection from xc_readconsoleringIan Campbell2010-10-181-2/+1
| | | | | | | | The double indirection has been unnecessary since 9867:ec61a8c25429, there is no possibility of the buffer being reallocated now. Signed-off-by: Ian Campbell <ian.campbell@citrix.com> Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
* libxc: pass an xc_interface handle to page locking functionsIan Campbell2010-10-181-20/+20
| | | | | | | | | Not actually used here but useful to confirm that a handle is passed down to each location where it will be required once we switch to hypercall buffers. Signed-off-by: Ian Campbell <ian.campbell@citrix.com> Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
* # HG changeset patchIan Campbell2010-08-241-0/+14
| | | | | | | | | | | | | | | | | | | | | | | | | # 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>
* libxc: remove \n from strings passed to PERRORKeir Fraser2010-05-281-1/+1
| | | | | | | | Previously, the code was inconsistent: some calls to PERROR passed \n and some did not. With the new logging arrangements, passing \n is definitely incorrect. Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
* libxc: eliminate static variables, use xentoollog; API changeKeir Fraser2010-05-281-36/+36
| | | | | | | | | | | | | | | | | | | | 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>
* Host Numa information in dom0Keir Fraser2010-04-071-0/+37
| | | | | | | | | | 'xm info' command now also gives the cpu topology & host numa information. This will be later used to build guest numa support. The patch basically changes physinfo sysctl, and adds topology_info & numa_info sysctls, and also changes the python & libxc code accordingly. Signed-off-by: Nitin A Kamble <nitin.a.kamble@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: Export do_mca hypercall to user space tools.Keir Fraser2010-02-031-0/+21
| | | | | | | 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-221-3/+4
| | | | | | | | | | | | | | | 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-221-25/+25
| | | | | | | | | | 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: use new (replacement) mmap-batch ioctlKeir Fraser2010-01-131-14/+55
| | | | | | | | | | | | | | | | | | | | 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>
* Spinlock profiling (enable in build with lock_profile=y)Keir Fraser2009-10-141-0/+24
| | | | | | | 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>
* x86 hvm: New hvm_op "set_mem_type" which allows marking ram pageKeir Fraser2008-07-101-0/+30
| | | | | | ranges as ro, rw, or mmio_dm. Signed-off-by: Trolle Selander <trolle.selander@eu.citrix.com>
* stubdom: add live migration support by having ioemu just notify theKeir Fraser2008-06-301-0/+28
| | | | | | | | | | hypervisor about memory changes. The impact on disk performance is typically making it from 71.5MBps down to 70.5Mbps during the live migration. The impact on network performance is actually even hard to measure. Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com>
* shadow: track video RAM dirty bitsKeir Fraser2008-05-021-0/+31
| | | | | | | | | | This adds a new HVM op that enables tracking dirty bits of a range of video RAM. The idea is to optimize just for the most common case (only one guest mapping, with sometimes some temporary other mappings), which permits to keep the overhead on shadow as low as possible. Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com>
* Allow incremental access to hypervisor console log.Keir Fraser2007-10-291-3/+13
| | | | Signed-off-by: Keir Fraser <keir@xensource.com>
* xc_map_foreign_pages(), a convenient alternative to xc_map_foreign_batch()kfraser@localhost.localdomain2007-09-071-0/+33
| | | | | | | | | xc_map_foreign_batch() can succeed partially. It is awkward to use when you're only interested in complete success. Provide new xc_map_foreign_pages() convenience function for that kind of use. Also convert two obvious calls to use it. Signed-off-by: Markus Armbruster <armbru@redhat.com>
* Extended the physinfo sysctl to export NUMA cpu_to_node topology info.kfraser@localhost.localdomain2007-07-061-0/+2
| | | | | | Print this in 'xm info'. Signed-off-by: Ryan Harper <ryanh@us.ibm.com> Signed-off-by: Keir Fraser <keir@xensource.com>
* More getcpuinfo sysctl cleanup.Keir Fraser2007-06-271-12/+17
| | | | Signed-off-by: Keir Fraser <keir@xensource.com>
* Add new sysctl to return runtime information about physical CPU utilization.Steven Hand2007-06-271-0/+19
| | | | Signed-off-by: Steven Hadn <steven@xensource.com>
* xm: New command 'debug-keys' to inject debug-key events into Xen.kfraser@localhost.localdomain2007-03-091-0/+19
| | | | Signed-off-by: Keir Fraser <keir@xensource.com>
* Replace mlock() calls with lock_pages().kaf24@localhost.localdomain2007-01-261-9/+9
| | | | Signed-off-by: Russell Blaine <russell.blaine@sun.com>
* [HVM] Reworked interrupt distribution logic.kfraser@localhost.localdomain2006-11-211-6/+70
| | | | | | | | | | | | | TODO: 1. Fix IO-APIC ID to not conflict with LAPIC IDS. 2. Fix i8259 device model (seems to work already though!). 3. Add INTSRC overrides in MPBIOS and ACPI tables so that PCI legacy IRQ routing always ends up at an IO-APIC input with level trigger. Restricting link routing to {5,6,10,11} and setting overrides for all four of those would work. Signed-off-by: Keir Fraser <keir@xensource.com>
* [HVM] Replace shared-memory PIC state with a set-irq-level hypercall.kfraser@localhost.localdomain2006-11-071-0/+28
| | | | | | | | | | | | | | This simplifies the IRQ logic significantly and avoids the bogus hvm_pic_assist() on domain resume path. There is more work to be done here. At least: 1. set-irq-level should really be set-interrupt-wire-level. Wire state needs to be distinguished from PIC (in particular, PIC IRR) state. 2. Hypercalls can be batched in qemu and pushed down in one multicall. Signed-off-by: Keir Fraser <keir@xensource.com>
* [SOLARIS] Don't mlock() hypercall buffers.kfraser@localhost.localdomain2006-10-231-2/+2
| | | | | | | On solaris mlock requires a page aligned address and mlock doesn't ensure the pages won't minor page fault. Signed-off-by: Mark Johnson <mark.johnson@sun.com>
* Replace dom0_ops hypercall with three new hypercalls:kfraser@localhost.localdomain2006-08-251-25/+23
| | | | | | | | | | | | | | | | | | | | | | 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>
* [TOOLS] Remove the 'cpuperf' misc tool. Xenoprof is thekfraser@localhost.localdomain2006-08-231-34/+0
| | | | | | correct tool to use for hardware perfctr monitoring now. Also remove unused xc_msr MSR accessor functions from libxenctrl. Signed-off-by: Keir Fraser <keir@xensource.com>
* Change DOM0_PERFCCONTROL: remove array limit.kaf24@firebug.cl.cam.ac.uk2006-08-071-2/+11
| | | | | | | Descriptors and values are passed by two distinct buffers. Signed-off-by: Tristan Gingold <tristan.gingold@bull.net>