aboutsummaryrefslogtreecommitdiffstats
path: root/tools/libxc/xc_core.c
Commit message (Collapse)AuthorAgeFilesLines
* libxc: introduce xc_domain_get_guest_width()Dario Faggioli2013-09-131-19/+1
| | | | | | | | | | | | | | As a wrapper to XEN_DOMCTL_get_address_size, and use it wherever the call was being issued directly via do_domctl(), saving quite some line of code. Actually, the function returns the guest width in bytes, rather than directly what XEN_DOMCTL_get_address_size provides (which is a number of bits), since that is what it is useful almost everywhere. Signed-off-by: Dario Faggioli <dario.faggioli@citrix.com> Acked-by: Ian Campbell <ian.campbell@citrix.com>
* 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
* tools: drop ia64 supportIan Campbell2012-09-121-4/+0
| | | | | | | | | | | | | | | | | 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: obtain correct length of p2m during core dumpingMarkus Gross2011-05-241-2/+1
| | | | | | | | | | | | | | | | | | | | | | while implementing core dumping functionality for the libxl driver of libvirt, I discovered an issue with mapping pages of a pv guest. After dumping the core of a pv guest the domain was not cleared up properly and some pages were not unmapped. This issue is similar to the one reported here: http://lists.xensource.com/archives/html/xen-devel/2011-05/msg01314.html In xc_domain_dumpcore_via_callback in the file xc_core.c the function xc_core_arch_map_p2m is called to map P2M_FL_ENTRIES pages to the variable p2m. But to unmap the pages later, the dinfo->p2m_size has to be set accordingly. This was not done, instead a variable named p2m_size was set. This way P2M_FL_ENTRIES was always zero and the pages were left mapped. [ This change should be considered for backport to relevant trees. ] Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com> Acked-by: Ian Jackson <ian.jackson@eu.citrix.com> Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
* # HG changeset patchIan Campbell2010-08-241-0/+16
| | | | | | | | | | | | | | | | | | | | | | | | | # 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: Fix ia64 build for interface changeIan Jackson2010-06-251-2/+2
| | | | | | | | | | | | 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>
* libxc: eliminate static variables, use xentoollog; API changeKeir Fraser2010-05-281-74/+79
| | | | | | | | | | | | | | | | | | | | 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>
* libxc: create a domain_info_context structure to store guest_width and ↵Keir Fraser2009-12-011-6/+7
| | | | | | | | 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>
* 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>
* 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>
* x86_64: allow more vCPU-s per guestKeir Fraser2009-06-181-1/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* Domain core-dumping fixesKeir Fraser2009-03-121-0/+10
| | | | | | | | | | | | | | 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>
* libxc: Support cross-bitness guest when core-dumpingKeir Fraser2009-01-151-13/+55
| | | | | | | | | | | This patch allows core-dumping to work on a cross-bit host/guest configuration, whereas previously that was not supported. It supports both PV and FV guests. The core file format generated by the host, needs to match that of the guest, so an alignment issue is addressed, along with the p2m frame list handling being done according to the guest size. Signed-off-by: Bruce Rogers <brogers@novell.com>
* libxc: The following patch replace the libxc interface to useKeir Fraser2008-06-191-4/+4
| | | | | | | vcpu_guest_context_any_t (which is both 32 and 64 bits) instead of vcpu_guest_context_t. Signed-off-by: Jean Guyader <jean.guyader@eu.citrix.com>
* stubdom: complete libxc supportKeir Fraser2008-05-231-9/+9
| | | | Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com>
* libxc: Minor clean up of xc_core, and fix for -fstrict-overflow.Keir Fraser2007-11-221-5/+11
| | | | Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
* libxc: Consolidate read()/write() syscall wrappers to read/write anKeir Fraser2007-11-111-9/+5
| | | | | | | 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>
* [IA64] Don't share privregs with hvm domainAlex Williamson2007-10-221-1/+1
| | | | | | | | | | | | | | | | Don't share privregs with hvm domain and twist IA64 xen dump core format slightly. Xen shares privregs pages with IA64 HVM domain for xm dump-core to dump the pages. However sharing the page allows hvm guest domain peek/destroy the page contents that might cause xen crash. And the xen dump core file doesn't need privregs page because cpu context should be obtained from vcpu context in case of IA64 HVM domain. Although this patch modify xen dump core format, current crash utility (at least crash 4.0-4.7) doesn't look into .xen_ia64_mmapped_regs section and I don't know any other tools to understand xen dump core file. So this format modification doesn't cause incompatibility issue. Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
* libxc: Avoid overflow in xc_domain_dumpcore_via_callback().Keir Fraser2007-10-151-3/+3
| | | | | | nr_pages*PAGE_SIZE can overflow a 32-bit long. From: Daisuke Nishimura <nishimura@mxp.nes.nec.co.jp> Signed-off-by: Keir Fraser <keir@xensource.com>
* [TOOLS] Make xc_domain_{save, restore} understand compat guestsTim Deegan2007-09-191-0/+3
| | | | Signed-off-by: Tim Deegan <Tim.Deegan@xensource.com>
* Introduce xc_core_arch_gpfn_may_present() hook.kfraser@localhost.localdomain2007-08-301-2/+6
| | | | | | | On ia64 trying to map a foreign domain page which isn't allocated cause annoying warning message. xm dump-core results in too many warnings. With this hook, ia64 dump-core can suprress warning. Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
* Optimize xc_core.c implementation.kfraser@localhost.localdomain2007-08-301-112/+121
| | | | | | | | Optimize out unnecessary map/unmap foreign domain page by moving p2m/pfn talbe after pages array. This patch doesn't change the xm dump-core format. Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
* Some minor cleanup of xc_core.c.kfraser@localhost.localdomain2007-08-301-70/+128
| | | | Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
* tools: Fix compiler warning.kfraser@localhost.localdomain2007-06-191-1/+1
| | | | | From: Charles Coffing <ccoffing@novell.com> Signed-off-by: Keir Fraser <keir@xensource.com>
* Some save/restore cleanups.Steven Hand2007-04-021-2/+2
| | | | Signed-off-by: Steven Hand <steven@xensource.com>
* coredump: Allow mmap of shinfo to fail for any HVM guest (x86 or ia64).kfraser@localhost.localdomain2007-03-191-5/+1
| | | | Signed-off-by: Keir Fraser <keir@xensource.com>
* dump-core: always use elfclass64 format to support x86_32pae.kfraser@localhost.localdomain2007-03-071-13/+13
| | | | | | Without this patch xen dump-core format can't handle over 4GB case. Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
* [TOOLS] fix sizeof() usage in xc_coreTim Deegan2007-02-261-1/+1
| | | | Signed-off-by: Tim Deegan <Tim.Deegan@xensource.com>
* Resolve conflict over use of name xen_elfnote.kfraser@localhost.localdomain2007-02-261-1/+1
| | | | Signed-off-by: Keir Fraser <keir@xensource.com>
* Reduce impact of saving/restoring/dumping large domains on Dom0 memoryKeir Fraser2007-02-241-0/+9
| | | | | | | usage by means of fadvise64() to tell the OS to discard the cache pages used for the save/dump file. Signed-off-by: Simon Graham <Simon.Graham@stratus.com>
* Xen coredump format: ELF formatified with note section.Keir Fraser2007-02-241-41/+698
| | | | | | | | | | | | | | | | | | added PFN-GMFN table for non-auto translated physmap added PFN table for auto translated physmap. HVM domain support. IA64 support Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp> Use the guest's own p2m table instead of xc_get_pfn_list(), which cannot handle PFNs with no MFN. Dump a zeroed page for PFNs with no MFN. Clearly deprecate xc_get_pfn_list(). Do not include a P2M table with HVM domains. Refuse to dump HVM until we can map its pages with PFNs. Signed-off-by: John Levon <john.levon@sun.com>
* Make domctl/sysctl interfaces 32-/64-bit invariant.kfraser@localhost.localdomain2007-01-241-4/+4
| | | | | | | This kills off a fair amount of unpleasant CONFIG_COMPAT shimming and avoids needing to keep the compat paths in sync as these interfaces continue to develop. Signed-off-by: Keir Fraser <keir@xensource.com>
* [LIBXC] Clean up use of sterror(). Define a thread-safekfraser@localhost.localdomain2006-12-081-2/+2
| | | | | | 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>
* [XEN] Remove VGCF_hvm_guest, replace with XEN_DOMINF_hvm_guest.kfraser@localhost.localdomain2006-11-031-1/+1
| | | | | | Rename DOMFLAGS_* to XEN_DOMINF_*. Clean up tools to deal with flags changes. Signed-off-by: Keir Fraser <keir@xensource.com>
* [LIBXC] Convert all printf/fprintf uses to use a macro instead.kaf24@firebug.cl.cam.ac.uk2006-06-071-2/+2
| | | | | | | Thus all can be disabled at compile time. It would be easy to make enabling/disabling a run-time option too. Signed-off-by: Keir Fraser <keir@xensource.com>
* Represent PFNs with their own type, rather than 'unsigned long'.kaf24@firebug.cl.cam.ac.uk2006-06-061-4/+4
| | | | | | ('long' changes size and alignment between 32- and 64-bit ABIs.) Signed-off-by: Hollis Blanchard <hollisb@us.ibm.com>
* Use a global build configuration file, and rework libxc Makefile for PPC.kfraser@dhcp93.uk.xensource.com2006-05-311-2/+0
| | | | | Signed-off-by: Hollis Blanchard <hollisb@us.ibm.com>
* Fix whitespace in libxc. Tabs are manually fixed.kaf24@firebug.cl.cam.ac.uk2006-04-151-8/+8
| | | | | | | | Trailing whitespace removed with: perl -p -i -e 's/\s+$/\n/g' tools/libxc/*.[ch] Signed-off-by: Hollis Blanchard <hollisb@us.ibm.com>
* Remove unnecessary zlib includes.kaf24@firebug.cl.cam.ac.uk2006-03-231-1/+0
| | | | | | Signed-off-by: Hollis Blanchard <hollisb@us.ibm.com>
* Fix memory leak in xc_domain_dumpcore and simplify copy_from_domain_page.kaf24@firebug.cl.cam.ac.uk2006-03-141-9/+10
| | | | | | Signed-off-by: Keir Fraser <keir@xensource.com>
* The existing xc_domain_dumpcore is very specific to disk/file basedkaf24@firebug.cl.cam.ac.uk2006-03-131-42/+94
| | | | | | | | | | | | | output. Refactor the code slightly to allow more user-specified control. This is done by adding a parallel xc_domain_dumpcore_via_callback, which allows the specification of a callback routine and an opaque argument block. The existing dumpcore routine is modified to use the callback for all write operations and to turn the single seek into a small write (it's for page alignment). Signed-off-by: Ben Thomas <bthomas@virtualiron.com>
* Fix a few small issues in xc_domain_dumpcore:kaf24@firebug.cl.cam.ac.uk2006-03-091-2/+7
| | | | | | | | | | | | xc_domain_getinfo returns information about a domain, but not necessarily the one you asked about. Add check for this. max_vcpu_id in xc_domain_getinfo is really an ID, not a count, so make the loop include the last VCPU Signed-off-by: Ben Thomas <ben@virtualiron.com>
* Fix order-of-evaluation issue in xc_domain_dumpcore. The intent iskaf24@firebug.cl.cam.ac.uk2006-03-091-1/+1
| | | | | | | | | | | to move blocks of memory 4096 pages at a time, and a buffer is allocated for this. Unfortunately, the #define is without parentheses and %/* are the same order and evaluated left to right. Result: very big buffer being used 4 pages at a time. Signed-off-by: Ben Thomas (bthomas@virtualiron.com)
* libxc: Verify Magic number when reading dumpkaf24@firebug.cl.cam.ac.uk2006-03-061-1/+1
| | | | | | | | | | The xen core files record a magic number, but when they are loaded it isn't checked. This patch resolves this. Signed-Off-By: Horms <horms@verge.net.au>
* Fix libxc warnings with gcc-4.1 and glibc-2.3.90.kaf24@firebug.cl.cam.ac.uk2006-03-021-3/+11
| | | | | | Signed-off-by: Charles Coffing <ccoffing@novell.com>
* Fix a couple of bogus dom0_op names:kaf24@firebug.cl.cam.ac.uk2006-01-061-1/+1
| | | | | | | | | setdomaininfo -> setvcpucontext pincpudomain -> setvcpuaffinity Signed-off-by: Keir Fraser <keir@xensource.com>
* Plumb GETVCPUINFO dom0_op through to Python. Removekaf24@firebug.cl.cam.ac.uk2005-10-171-9/+10
| | | | | | | | | | | | | | | | | n_vcpu field from GETDOMAININFO: replaced with nr_online_vcpus and max_vcpu_id (both plumbed through to Python). TODO: Remove 'vcpus' entry in getdomaininfo Python dictionary. TODO: Don't represent 'cpumap' as a bitmap in Python. It would be more sensible to represent as a list of integer CPU numbers. Signed-off-by: Keir Fraser <keir@xensource.com>
* Store an opaque handle (tools uuid) in the domain structurekaf24@firebug.cl.cam.ac.uk2005-10-141-13/+4
| | | | | | | | | | within Xen. Refactor GETVCPUCONTEXT into an op of the same name plus a new op GETVCPUINFO. Move the cpumap and cpu info arrays from GETDOMAININFO and move into new GETVCPUINFO. Signed-off-by: Keir Fraser <keir@xensource.com>
* Fix Xen public interfaces and the tools to consistentlykaf24@firebug.cl.cam.ac.uk2005-10-121-2/+2
| | | | | | | | use stdint-format bitsize types (uint32_t and friends). Signed-off-by: Keir Fraser <keir@xensource.com>
* Re-indent libxc to avoid hard tabs. Also, fix the PAEkaf24@firebug.cl.cam.ac.uk2005-09-191-82/+92
| | | | | | | | | domain builder to correctly write PTEs that map pages above 4GB. Signed-off-by: Keir Fraser <keir@xensource.com>