aboutsummaryrefslogtreecommitdiffstats
path: root/tools/libxc/xc_linux_build.c
Commit message (Collapse)AuthorAgeFilesLines
* Remove old elf-parsing code from tools and from Xen.kfraser@localhost.localdomain2007-02-151-1319/+0
| | | | Signed-off-by: Keir Fraser <keir@xensource.com>
* Comment fix.Steven Hand2007-01-151-1/+1
| | | | Signed-off-by: Steven Hand <steven@xensource.com>
* Introduce _DOMF_compat and infrastructure as well as several conditionalsEmmanuel Ackaouy2007-01-051-0/+2
| | | | | | | dealing with operations that need to distinguish between native and compatibility mode guests. Signed-off-by: Jan Beulich <jbeulich@novell.com>
* Improve consistency of type-attribute usage (volatile/const).kfraser@localhost.localdomain2006-12-211-1/+1
| | | | | From: Christoph Egger <Christoph.Egger@amd.com> Signed-off-by: Keir Fraser <keir@xensource.com>
* Allow loading of ELF kernel images that support both PAE and non-PAE.kfraser@localhost.localdomain2006-12-141-5/+11
| | | | | | Also change the elf loader to not look for a strings section unless it is needed. Signed-off-by: Bruce Rogers <brogers@novell.com>
* [BUILDER] Enable shadow mode for shadow translate guests much earlier.Ian Campbell2006-12-111-99/+65
| | | | Signed-off-by: Ian Campbell <ian.campbell@xensource.com>
* [IA64] Map shared_info into guest pseudo physical address spaceawilliam@xenbuild2.aw2006-12-071-8/+12
| | | | | | Allows libxc to map from dom0. This is used by domain builder. Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
* merge with xen-unstable.hgawilliam@xenbuild2.aw2006-12-081-7/+9
|\
| * [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>
| * [LIBXC] Add an error reporting API to the libxc library.kfraser@localhost.localdomain2006-12-071-5/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - An 'xc_error' struct is used to pass around error details. Currently contains two members 'code' an enumeration of error types, and 'message' a free text description of the specific problem. - The xc_get_last_error() method returns a const pointer to the internal instance of this struct manged by libxc. By returning a const pointer we can add extra members to the end of the struct at any time without worrying about ABI of callers. This will let us provide more fine-grained info if needed in the future. - The xc_error instance is statically defined inside libxc and marked __thread. This ensures that errors are recorded per-thread, and that when dealing with errors we never need to call malloc - all storage needed is statically allocated. - The xc_clear_last_error() method resets any currently recorded error details - The xc_error_code_to_desc() method converts the integer error code into a generic user facing messsage. eg "Invalid kernel". Together with the 'message' field from xc_error, this provides the user visible feedback. eg "Invalid kernel: Non PAE-kernel on PAE host." - A callback can be registered with xc_set_error_handler to receive notification whenever an error is recorded, rather than querying for error details after the fact with xc_get_last_error - If built with -DDEBUG set, a default error handler will be registered which calls fprintf(stderr), thus maintaining current behaviour of logging errors to stderr during developer builds. - The python binding for libxc is updated to use xc_get_last_error to pull out error details whenever appropriate, instead of returning info based on 'errno' - The xc_set_error method is private to libxc internals, and is used for setting error details - The ERROR and PERROR macros have been updated to call xc_set_error automatically specifying XC_INTERNAL_ERROR as the error code. This gives a generic error report for all current failure points - Some uses of the ERROR macro have been replaced with explicit calls to xc_set_error to enable finer grained error reporting. In particular the code dealing with invalid kernel types uses this to report about PAE/architecture/wordsize mismatches The patch has been tested by calling xm create against a varietry of config files defining invalid kernels of various kinds. It has also been tested with libvirt talking to xend. In both cases the error messages were propagated all the way back up the stack. There is only one place where I need to do further work. The suspend & restore APIs in Xend invoke external helper programs rather than calling libxc directly. This means that error details are essentially lost. Since there is already code in XenD which scans STDERR from these programs I will investigate adapting this to extract actual error messages from these helpers. Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
* | [IA64] changed foreign domain page mapping semantic.awilliam@xenbuild.aw2006-12-051-3/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | x86 foreign HVM domain page mapping semantic was changed to use gmfn instead mfn. It applies to domains with auto_translated_mode enabled, and all ia64 domains enable auto_translated_mode. This patch changes ia64 foreign domain page mapping to use gmfn and fixes ia64 domU buidler. However this patch breaks domain save/restore/dump-core. They should also be fixed-up Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
* | [IA64][LIBXC] prep for fixesawilliam@xenbuild.aw2006-12-051-0/+3
|/ | | | | | | | Groundwork for real fixes to follow Signed-off-by: Alex Williamson <alex.williamson@hp.com>
* [XEN] Cleanups to phys/mach address handling.kfraser@localhost.localdomain2006-11-271-6/+0
| | | | | | | | | | 1. Balloon driver does not need to set M2P entry. This is done by the populate_physmap hypercall. 2. Xen now translates foreign mappings from GMFN->MFN. Tools are simplified because of this. Signed-off-by: Keir Fraser <keir@xensource.com>
* [IA64] Fix build breakage.kaf24@firebug.cl.cam.ac.uk2006-11-161-1/+0
| | | | Signed-off-by: Alex Williamson <alex.williamson@hp.com>
* [XEN] Various selector and callback cleanups to simplify the toolskfraser@localhost.localdomain2006-11-151-16/+3
| | | | | | and assumptions about callback selector values on x86/32. Original patch from Jan Beulich <jbeulich@novell.com> Signed-off-by: Keir Fraser <keir@xensource.com>
* [BUILDER] Simplify vcpu context initialisation by pre-zeroingkfraser@localhost.localdomain2006-11-151-28/+3
| | | | | the context structure. Signed-off-by: Jan Beulich <jbeulich@novell.com>
* [IA64] IA64 counter part of the change 12204:e6fdb32b786c of xen-unstable.hgawilliam@xenbuild.aw2006-11-101-43/+31
| | | | | | | | | Remove xc_ia64_get_pfn_list() from setup_guest() in xc_linux_build.c, use xc_domain_populate_physmap() and xc_domain_translate_gpfn_list(). Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
* [IA64] fix ia64 linux domain builder broken by 12009:4a320d26fc24 of ↵awilliam@xenbuild.aw2006-11-101-16/+32
| | | | | | | | xen-unstable.hg. Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
* [TOOLS] Paravirt guests have their memory allocated in thekfraser@localhost.localdomain2006-11-021-61/+27
| | | | | | | | libxenguest builder function. Again, PPC and IA64 will need to do some fixing up. Signed-off-by: Keir Fraser <keir@xensource.com>
* [TOOLS] Uncompress and allocate memory for gzipped kernel and initrd images onIan Campbell2006-10-261-41/+58
| | | | | | | | | the fly. We cannot rely on the length contained in the gzip trailer to determine the length of the decompressed data because images have been observed which have trailing junk. Signed-off-by: Ian Campbell <ian.campbell@xensource.com>
* [LIBXC][IA64] fix build warningawilliam@xenbuild.aw2006-10-251-2/+0
| | | | | | | | With warnings becoming errors, this fixes the libxc build on ia64 Signed-off-by: Alex Williamson <alex.williamson@hp.com>
* [LIBXC] Add -Wmissing-prototypes to CFLAGS, fix warnings resulting from that.kfraser@localhost.localdomain2006-10-251-1/+1
| | | | Signed-off-by: Gerd Hoffmann <kraxel@suse.de>
* [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>
* Revert 11728:30f13007be. Breaks Solaris guests.kaf24@localhost.localdomain2006-10-101-8/+12
| | | | | Will need a new method for handling padded gzip files. Signed-off-by: Keir Fraser <keir@xensource.com>
* [XEND] No need to decompress the initrd when building a domain.kfraser@localhost.localdomain2006-10-091-12/+8
| | | | | | | | | The guest OS should be capable of parsing an image file in whatever format was produced by that OS's tools. Furthermore, we have seen initrd images with trailing garbage. This causes us to calculate the wrong size for the uncompressed data and hence fail to build the guest. Signed-off-by: Keir Fraser <keir@xensource.com>
* Replace dom0_ops hypercall with three new hypercalls:kfraser@localhost.localdomain2006-08-251-28/+27
| | | | | | | | | | | | | | | | | | | | | | 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] Allow tools to load kernels which use an ELF notes segment.Ian Campbell2006-08-231-13/+12
| | | | | | Compatability with kernels using the __xen_guest section is retained. Signed-off-by: Ian Campbell <ian.campbell@xensource.com>
* [x86_64] Guests no longer set _PAGE_USER on kernel mappings.kfraser@localhost.localdomain2006-08-221-6/+2
| | | | | | | | | This may allow guest kernels to be run outside ring 3 in future, and also provides scope for optimisations today (e.g., using global bit on user mappings). Signed-off-by: Jun Nakajima <jun.nakajima@intel.com> Signed-off-by: Keir Fraser <keir@xensource.com>
* Replace shadow pagetable code with shadow2.tdeegan@york.uk.xensource.com2006-08-161-1/+1
|
* Clean up console fields in start_info structure. Add compat code forkfraser@localhost.localdomain2006-08-151-4/+4
| | | | | | | older kernels so they can use the old start_info API. Signed-off-by: Keir Fraser <keir@xensource.com>
* [XEN] Add a warning about changeable size of shared_info structure.kaf24@localhost.localdomain2006-08-121-2/+2
| | | | | | | | | | | sizeof(shared_info_t) can change even in compatible hypervisor versions. Add a clear warning about this, and fix the few places relying on it. In addition, add some padding to arch_shared_info, to allow future additions to the structure without breaking known offsets of members following it in the shared info. Signed-off-by: John Levon <john.levon@sun.com>
* [LIBXC] Do not gzclose() after close() on a gzdopen()'ed fd.kaf24@firebug.cl.cam.ac.uk2006-08-081-3/+3
| | | | | Signed-off-by: Steven Rostedt <srostedt@redhat.com>
* [IA64] Save & restore.awilliam@xenbuild.aw2006-07-111-0/+1
| | | | | | | | | | | xc_ia64_linux_save.c and xc_ia64_linux_restore.c added. vcpu context has more registers and states (eg: tr registers). Per cpu irqs are deallocated when cpu is switched off. #if/#endif added in reboot.c for ia64. Signed-off-by: Tristan Gingold <tristan.gingold@bull.net>
* merge with xen-unstable.hgawilliam@xenbuild.aw2006-07-051-10/+10
|\
| * [XEN] Hypercall-init dom0_op takes GMFN, not MFN.kfraser@localhost.localdomain2006-07-051-1/+2
| | | | | | | | | | Signed-off-by: Steven Smith <sos22@cl.cam.ac.uk>
| * Merge with xen-ia64-unstable.hgkaf24@firebug.cl.cam.ac.uk2006-07-031-9/+8
| |\
| | * Allow 32-bit libxc to load 64-bit ELF files.kaf24@firebug.cl.cam.ac.uk2006-06-301-9/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - use 64-bit integral types for addresses in struct domain_start_info - use stroull() to parse 64-bit values - remove redundant _p(a) definition and add a comment - printf format changes for the new types Signed-off-by: Jimi Xenidis <jimix@watson.ibm.com> Signed-off-by: Hollis Blanchard <hollisb@us.ibm.com>
* | | [IA64] Implement and use DOM0_DOMAIN_STEUP.awilliam@xenbuild.aw2006-07-051-18/+41
|/ / | | | | | | | | | | | | | | | | | | | | | | DOM0_GETMEMLIST now reads ptes and use gpfn. Domain builder reworked: calls DOMAIN_SETUP, setup start_info page. SAL data are now in domain memory. is_vti field added in domain.arch. Many cleanups (indentation, static, warnings). Signed-off-by: Tristan Gingold <tristan.gingold@bull.net>
* | merge with xen-unstable.hgawilliam@xenbuild.aw2006-06-281-7/+1
|\|
| * [TOOLS] Remove plan9 loader code. Latest plan9 port uses linux builder.kfraser@dhcp93.uk.xensource.com2006-06-271-7/+1
| | | | | | | | | | Signed-off-by: Keir Fraser <keir@xensource.com>
* | [IA64] enable xenctx on ia64awilliam@xenbuild.aw2006-06-191-4/+4
|/ | | | | | Signed-off-by: Tristan Gingold <tristan.gingold@bull.net>
* [TOOLS] Fix domain builder to carefully check that mapped memory areakaf24@firebug.cl.cam.ac.uk2006-06-081-11/+50
| | | | | | does not overflow and wrap to zero. 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-19/+19
| | | | | | | 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-10/+11
| | | | | | ('long' changes size and alignment between 32- and 64-bit ABIs.) Signed-off-by: Hollis Blanchard <hollisb@us.ibm.com>
* Create new vmassist type 'pae_extended_cr3'. Only advertisekaf24@firebug.cl.cam.ac.uk2006-06-051-10/+27
| | | | | | | | | pae_pgdir_above_4gb tp guests that have enabled this vmassist. Control tools ensure all PAE page directories are below 4GB unless the vmassist is enabled (triggered via an extended-cr3 option in guest Elf header). Signed-off-by: Keir Fraser <keir@xensource.com>
* [PAE] Fix tools to properly pack/unpack >4GB PAE CR3 values.kaf24@firebug.cl.cam.ac.uk2006-06-021-9/+9
| | | | | Signed-off-by: Keir Fraser <keir@xensource.com>
* Use a global build configuration file, and rework libxc Makefile for PPC.kfraser@dhcp93.uk.xensource.com2006-05-311-8/+0
| | | | | Signed-off-by: Hollis Blanchard <hollisb@us.ibm.com>
* [PAE] Allow pgdirs above 4GB for paravirt guests.kaf24@firebug.cl.cam.ac.uk2006-05-261-12/+1
| | | | | | | | **NOTE**: This obviates the need for lowmem_emergency_pool. Unpriv guests no longer need to be able to allocate memory below 4GB for PAE PDPTs. Signed-off-by: Keir Fraser <keir@xensource.com>
* merge with xen-unstable.hgawilliam@xenbuild.aw2006-05-221-11/+23
|\
| * [BUILDER] Always build initial PAE pagetables with a fourth mid-levelkaf24@firebug.cl.cam.ac.uk2006-05-201-10/+20
| | | | | | | | | | | | | | | | | | | | | | pgdir. This is required for Xen to be able to insert its own protected mappings. At the same time, clean up 32b and pae pagetable-size calculations to use the helper macro already used for x86/64. Based on an original patch from Bruce Rogers at Novell. Signed-off-by: Keir Fraser <keir@xensource.com>