Commit Graph
172 Commits
Author SHA1 Message Date
Emmanuel Ackaouy 8f2348c03c Introduce _DOMF_compat and infrastructure as well as several conditionals
dealing with operations that need to distinguish between native and
compatibility mode guests.

Signed-off-by: Jan Beulich <jbeulich@novell.com>
2007-01-05 17:32:00 +00:00
kfraser@localhost.localdomain f9396bbfe8 Improve consistency of type-attribute usage (volatile/const).
From: Christoph Egger <Christoph.Egger@amd.com>
Signed-off-by: Keir Fraser <keir@xensource.com>
2006-12-21 13:58:51 +00:00
kfraser@localhost.localdomain e6be7d74b9 Allow loading of ELF kernel images that support both PAE and non-PAE.
Also change the elf loader to not look for a strings section unless it
is needed.
Signed-off-by: Bruce Rogers <brogers@novell.com>
2006-12-14 10:29:44 +00:00
Ian Campbell c4644b811d [BUILDER] Enable shadow mode for shadow translate guests much earlier.
Signed-off-by: Ian Campbell <ian.campbell@xensource.com>
2006-12-11 11:57:36 +00:00
awilliam@xenbuild2.aw 2f96a266fe [IA64] Map shared_info into guest pseudo physical address space
Allows libxc to map from dom0. This is used by domain builder.

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
2006-12-07 14:49:00 -07:00
awilliam@xenbuild2.aw 0741834153 merge with xen-unstable.hg 2006-12-08 09:09:18 -07:00
kfraser@localhost.localdomain b65f717688 [LIBXC] Clean up use of sterror(). Define a thread-safe
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>
2006-12-08 11:57:06 +00:00
kfraser@localhost.localdomain b07ced9c1f [LIBXC] Add an error reporting API to the libxc library.
- 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>
2006-12-07 11:36:26 +00:00
awilliam@xenbuild.aw 0013d074cd [IA64] changed foreign domain page mapping semantic.
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>
2006-12-05 10:59:32 -07:00
awilliam@xenbuild.aw f77ef48c1d [IA64][LIBXC] prep for fixes
Groundwork for real fixes to follow

Signed-off-by: Alex Williamson <alex.williamson@hp.com>
2006-12-05 09:09:44 -07:00
kfraser@localhost.localdomain b63e5446b8 [XEN] Cleanups to phys/mach address handling.
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>
2006-11-27 14:20:44 +00:00
kaf24@firebug.cl.cam.ac.uk f8e7741960 [IA64] Fix build breakage.
Signed-off-by: Alex Williamson <alex.williamson@hp.com>
2006-11-16 07:48:37 +00:00
kfraser@localhost.localdomain 6c483f95f8 [XEN] Various selector and callback cleanups to simplify the tools
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>
2006-11-15 18:41:06 +00:00
kfraser@localhost.localdomain ede52a632e [BUILDER] Simplify vcpu context initialisation by pre-zeroing
the context structure.
Signed-off-by: Jan Beulich <jbeulich@novell.com>
2006-11-15 16:53:43 +00:00
awilliam@xenbuild.aw c1d815ef9b [IA64] IA64 counter part of the change 12204:e6fdb32b786c of xen-unstable.hg
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>
2006-11-10 11:14:32 -07:00
awilliam@xenbuild.aw 07a795b0f8 [IA64] fix ia64 linux domain builder broken by 12009:4a320d26fc24 of xen-unstable.hg.
Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
2006-11-10 11:14:26 -07:00
kfraser@localhost.localdomain 7554501778 [TOOLS] Paravirt guests have their memory allocated in the
libxenguest builder function.

Again, PPC and IA64 will need to do some fixing up.

Signed-off-by: Keir Fraser <keir@xensource.com>
2006-11-02 11:11:28 +00:00
Ian Campbell 1459957f98 [TOOLS] Uncompress and allocate memory for gzipped kernel and initrd images on
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>
2006-10-26 16:56:16 +01:00
awilliam@xenbuild.aw 6d58273da8 [LIBXC][IA64] fix build warning
With warnings becoming errors, this fixes the libxc build on ia64

Signed-off-by: Alex Williamson <alex.williamson@hp.com>
2006-10-25 15:29:00 -06:00
kfraser@localhost.localdomain 429764f760 [LIBXC] Add -Wmissing-prototypes to CFLAGS, fix warnings resulting from that.
Signed-off-by: Gerd Hoffmann <kraxel@suse.de>
2006-10-25 15:25:13 +01:00
kfraser@localhost.localdomain a3fc4d842e [SOLARIS] Don't mlock() hypercall buffers.
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>
2006-10-23 09:52:51 +01:00
kaf24@localhost.localdomain 83a53cd75c Revert 11728:30f13007be. Breaks Solaris guests.
Will need a new method for handling padded gzip files.
Signed-off-by: Keir Fraser <keir@xensource.com>
2006-10-10 22:04:01 +01:00
kfraser@localhost.localdomain 5000a6a1e0 [XEND] No need to decompress the initrd when building a domain.
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>
2006-10-09 13:50:00 +01:00
kfraser@localhost.localdomain 1df421476a Replace dom0_ops hypercall with three new hypercalls:
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>
2006-08-25 18:39:10 +01:00
Ian Campbell 15d8f355a2 [TOOLS] Allow tools to load kernels which use an ELF notes segment.
Compatability with kernels using the __xen_guest section is retained.

Signed-off-by: Ian Campbell <ian.campbell@xensource.com>
2006-08-23 14:37:39 +01:00
kfraser@localhost.localdomain 314ded7410 [x86_64] Guests no longer set _PAGE_USER on kernel mappings.
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>
2006-08-22 15:26:40 +01:00
tdeegan@york.uk.xensource.com 49f7c7364e Replace shadow pagetable code with shadow2. 2006-08-16 17:02:35 +01:00
kfraser@localhost.localdomain 121ec85fcf Clean up console fields in start_info structure. Add compat code for
older kernels so they can use the old start_info API.

Signed-off-by: Keir Fraser <keir@xensource.com>
2006-08-15 15:50:36 +01:00
kaf24@localhost.localdomain 3321c3c8e9 [XEN] Add a warning about changeable size of shared_info structure.
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>
2006-08-12 16:18:08 +01:00
kaf24@firebug.cl.cam.ac.uk dfcd4f6e10 [LIBXC] Do not gzclose() after close() on a gzdopen()'ed fd.
Signed-off-by: Steven Rostedt <srostedt@redhat.com>
2006-08-08 09:57:24 +01:00
awilliam@xenbuild.aw 89b0862b3a [IA64] Save & restore.
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>
2006-07-11 12:51:18 -06:00
awilliam@xenbuild.aw 989c3fcf11 merge with xen-unstable.hg 2006-07-05 20:11:37 -06:00
kfraser@localhost.localdomain 8f33ca9931 [XEN] Hypercall-init dom0_op takes GMFN, not MFN.
Signed-off-by: Steven Smith <sos22@cl.cam.ac.uk>
2006-07-05 17:16:10 +01:00
awilliam@xenbuild.aw b3b4baa6b8 [IA64] Implement and use DOM0_DOMAIN_STEUP.
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>
2006-07-05 09:28:32 -06:00
kaf24@firebug.cl.cam.ac.uk d2f56f3181 Merge with xen-ia64-unstable.hg 2006-07-03 08:35:12 +01:00
kaf24@firebug.cl.cam.ac.uk f4c633d8ec Allow 32-bit libxc to load 64-bit ELF files.
- 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>
2006-06-30 22:18:01 +01:00
awilliam@xenbuild.aw 5c8c8991da merge with xen-unstable.hg 2006-06-28 07:52:21 -06:00
kfraser@dhcp93.uk.xensource.com 8c01122785 [TOOLS] Remove plan9 loader code. Latest plan9 port uses linux builder.
Signed-off-by: Keir Fraser <keir@xensource.com>
2006-06-27 14:38:58 +01:00
awilliam@xenbuild.aw 832cc7c654 [IA64] enable xenctx on ia64
Signed-off-by: Tristan Gingold <tristan.gingold@bull.net>
2006-06-19 13:26:45 -06:00
kaf24@firebug.cl.cam.ac.uk 7babda9241 [TOOLS] Fix domain builder to carefully check that mapped memory area
does not overflow and wrap to zero.
Signed-off-by: Keir Fraser <keir@xensource.com>
2006-06-08 09:52:04 +01:00
kaf24@firebug.cl.cam.ac.uk 2928514138 [LIBXC] Convert all printf/fprintf uses to use a macro instead.
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>
2006-06-07 14:07:36 +01:00
kaf24@firebug.cl.cam.ac.uk ab8096f27d Represent PFNs with their own type, rather than 'unsigned long'.
('long' changes size and alignment between 32- and 64-bit ABIs.)
Signed-off-by: Hollis Blanchard <hollisb@us.ibm.com>
2006-06-06 09:48:17 +01:00
kaf24@firebug.cl.cam.ac.uk ad2de84676 Create new vmassist type 'pae_extended_cr3'. Only advertise
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>
2006-06-05 10:42:40 +01:00
kaf24@firebug.cl.cam.ac.uk 4f7f661224 [PAE] Fix tools to properly pack/unpack >4GB PAE CR3 values.
Signed-off-by: Keir Fraser <keir@xensource.com>
2006-06-02 14:16:43 +01:00
kfraser@dhcp93.uk.xensource.com 3f2522e1ac Use a global build configuration file, and rework libxc Makefile for PPC.
Signed-off-by: Hollis Blanchard <hollisb@us.ibm.com>
2006-05-31 11:31:52 +01:00
kaf24@firebug.cl.cam.ac.uk c263397874 [PAE] Allow pgdirs above 4GB for paravirt guests.
**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>
2006-05-26 17:22:30 +01:00
awilliam@xenbuild.aw 7e713108be merge with xen-unstable.hg 2006-05-22 14:13:38 -06:00
kaf24@firebug.cl.cam.ac.uk 1dfbe29c87 [BUILDER] Always build initial PAE pagetables with a fourth mid-level
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>
2006-05-20 16:25:28 +01:00
kaf24@firebug.cl.cam.ac.uk 86c03b97cb This patch fixes the Linux builder so that it dies gracefully when
trying to load malformed ELF images.
Signed-off-by: Aravindh Puthiyaparambil <aravindh.puthiyaparambil@unisys.com>
2006-05-17 23:19:18 +01:00
awilliam@xenbuild.aw 0b5ba3777d [IA64] move evtchn_vector to shared_info
Move evtchn_vector from vcpu_info to shared_info.

Signed-off-by: Tristan Gingold <tristan.gingold@bull.net>
2006-05-15 10:53:23 -06:00