aboutsummaryrefslogtreecommitdiffstats
path: root/xen/common
Commit message (Collapse)AuthorAgeFilesLines
...
* Use RCU for domain_list and domain_hash.kfraser@localhost.localdomain2007-02-215-35/+60
| | | | | Signed-off-by: Jose Renato Santos <jsantos@hpl.hp.com> Signed-off-by: Keir Fraser <keir@xensource.com>
* [LIBELF] Prefer PT_NOTE segments to SHT_NOTE sections for ELF notes.Ian Campbell2007-02-192-22/+98
| | | | | | | | | | | | | | | | | | | | | | | | It's always an error to try to use sections on an executable; the segments in the phdr are definitive. Unfortunately we cannot drop SHT_NOTE support completely due to a binutils bug which causes kernels to have the offset field of the PT_NOTE phdr set to zero: http://sourceware.org/bugzilla/show_bug.cgi?id=594 This bug is present in binutils 2.17 although some distros have backported the fix. Therefore we simply prefer a PT_NOTE segment if we find one otherwise we still use the SHT_NOTE section (and then the old __xen_guest section). Based on a patch from Jeremy Fitzhardinge. Also added XEN_ELFNOTE_HV_START_LOW to readnotes. Signed-off-by: Ian Campbell <ian.campbell@xensource.com>
* Fix grant-table initialisation so that domain destruction does not barf.kfraser@localhost.localdomain2007-02-161-0/+1
| | | | Signed-off-by: Keir Fraser <keir@xensource.com>
* Dynamic grant-table sizing.kfraser@localhost.localdomain2007-02-152-111/+383
| | | | | | Signed-off-by: Christopher CLark <christopher.clark@cl.cam.ac.uk> Signed-off-by: Andrei Petrov <andrei.petrov@xensource.com> Signed-off-by: Keir Fraser <keir@xensource.com>
* Remove old elf-parsing code from tools and from Xen.kfraser@localhost.localdomain2007-02-151-520/+0
| | | | Signed-off-by: Keir Fraser <keir@xensource.com>
* Merge with xenppc-unstable.hgkfraser@localhost.localdomain2007-02-147-533/+600
|\
| * libelf: use xen code style.kfraser@localhost.localdomain2007-02-145-526/+592
| | | | | | | | Signed-off-by: Keir Fraser <keir@xensource.com>
| * Make libelf not fail on unknown elf notes.kfraser@localhost.localdomain2007-02-141-2/+2
| | | | | | | | Signed-off-by: Gerd Hoffmann <kraxel@suse.de>
| * [XEN] kexec: Remove asm/kexec.h. Move the single inline function intoIan Campbell2007-02-081-1/+0
| | | | | | | | | | | | | | | | | | arch specific machine_kexec.c with the other arch specific kexec functions. IA64 already had a stub in both kexec.h and machine_kexec.c. Signed-off-by: Ian Campbell <ian.campbell@xensource.com>
| * [XEN] When removing pages, drop shadow refs before complaining about refcount.Tim Deegan2007-02-081-4/+6
| | | | | | | | Signed-off-by: Tim Deegan <Tim.Deegan@xensource.com>
* | [LIBELF] Print phdr addresses when loading.Hollis Blanchard2007-02-091-0/+2
|/ | | | Signed-off-by: Hollis Blanchard <hollisb@us.ibm.com>
* [XEN] Extend the range returned by KEXEC_RANGE_MA_XEN to cover theIan Campbell2007-02-011-2/+2
| | | | | | | | | | heap as well as code+data. This makes kdump work again after 13546:d86a96ca47a3 Also fix sizeof_note to correctly calculate the length of the name field. Signed-off-by: Ian Campbell <ian.campbell@xensource.com>
* Allocate Xen kexec/kdump elfnote sections of the correct size.kfraser@localhost.localdomain2007-02-011-6/+15
| | | | Signed-off-by: Keir Fraser <keir@xensource.com>
* safe_str*() functions check their destination argument is akfraser@localhost.localdomain2007-02-011-1/+1
| | | | | character-array type. Fix two bad callers. Signed-off-by: Keir Fraser <keir@xensource.com>
* [XEN] Fix perfc after 13756:56377f5ce588Ian Campbell2007-01-311-4/+13
| | | | | | | 64 bit guest handles can no longer be passed as parameters to functions. Extract such parameters into a regular guest handle first. Signed-off-by: Ian Campbell <ian.campbell@xensource.com>
* [XEN] Fix XENVER_capabilities hypercall.Ian Campbell2007-01-311-2/+2
| | | | | | | | | | | Passing an array to a function turns it into a pointer which confuses safe_strcat. Also fix 54->64 typo in ia64 tree. Thanks to Alex Williamson for pointing out the problem. Signed-off-by: Ian Campbell <ian.campbell@xensource.com>
* Remove sprintf() from Xen. Use snprintf() and friends.Keir Fraser2007-01-301-23/+0
| | | | Signed-off-by: Keir Fraser <keir@xensource.com>
* Remove unused implementation of vsprintf().kfraser@localhost.localdomain2007-01-291-29/+0
| | | | Signed-off-by: Keir Fraser <keir@xensource.com>
* Remove little-endian assumption from library code.kfraser@localhost.localdomain2007-01-291-1/+8
| | | | Signed-off-by: Keir Fraser <keir@xensource.com>
* Remove strcat/strncat/strcmp/strncmp. Replaced with saferkfraser@localhost.localdomain2007-01-291-77/+20
| | | | | alternatives (including a new implementation of strlcat). Signed-off-by: Keir Fraser <keir@xensource.com>
* Remove uses of strcpy and strncpy from common and x86 code.kfraser@localhost.localdomain2007-01-296-24/+17
| | | | | | | | Retain safe_strcpy(). It can hide the third argument to strlcpy() in most cases. Based on patches from Christoph Egger <Christoph.Egger@amd.com> Signed-off-by: Keir Fraser <keir@xensource.com>
* libelf cannot rely on the strlcpy() BSD-ism.kfraser@localhost.localdomain2007-01-292-8/+18
| | | | | Make a private definition based on strncpy and strlen. Signed-off-by: Keir Fraser <keir@xensource.com>
* Replace sprintf with snprintf and strncpy with strlcpy.kfraser@localhost.localdomain2007-01-297-23/+21
| | | | | | | | There are various cases where no NULL-terminated strings are guaranteed and eventual possible overflows. This patch fixes them. From: Christoph Egger <Christoph.Egger@amd.com> Signed-off-by: Keir Fraser <keir@xensource.com>
* Clean up libelf endian macros and includes.kaf24@localhost.localdomain2007-01-282-18/+22
| | | | | Based on a patch from John Levon <john.levon@sun.com> Signed-off-by: Keir Fraser <keir@xensource.com>
* Rename find_domain_by_id() to get_domain_by_id().kaf24@localhost.localdomain2007-01-268-38/+38
| | | | Signed-off-by: Keir Fraser <keir@xensource.com>
* Add RCU support to Xen.kaf24@localhost.localdomain2007-01-263-0/+354
| | | | Signed-off-by: Jose Renato Santos <jsantos@hpl.hp.com>
* xen: Remove unused elf32.c.kaf24@localhost.localdomain2007-01-262-21/+0
| | | | Signed-off-by: Keir Fraser <keir@xensource.com>
* libelf: use for x86 dom0 builder.Emmanuel Ackaouy2007-01-251-2/+2
| | | | | | | | | | | This patch switches the x86 dom0 builder over to libelf. Signed-off-by: Gerd Hoffmann <kraxel@suse.de> --- xen/arch/ia64/xen/domain.c | 79 +++++------ xen/arch/x86/domain_build.c | 303 +++++++++++++++----------------------------- xen/common/Makefile | 4 3 files changed, 148 insertions(+), 238 deletions(-)
* add libelf: an ELF binary parser library.Emmanuel Ackaouy2007-01-258-0/+1204
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch adds a library with a small collection of helper functions to parse and load elf binaries. The library handles endianess and elfsize at runtime. The patch also shuffles around the include files a bit. Now there is *one* include file holding all the elf structures (xen/include/public/elfstructs.h) which is included by everyone who needs them. It's dead code with this patch only, putting the code into use happens in followup patches. Signed-off-by: Gerd Hoffmann <kraxel@suse.de> --- tools/libxc/xc_elf.h | 525 ----------------------------------- xen/arch/x86/boot/mkelf32.c | 2 xen/common/Makefile | 2 xen/common/libelf/Makefile | 4 xen/common/libelf/README | 1 xen/common/libelf/libelf-dominfo.c | 420 ++++++++++++++++++++++++++++ xen/common/libelf/libelf-loader.c | 156 ++++++++++ xen/common/libelf/libelf-private.h | 51 +++ xen/common/libelf/libelf-relocate.c | 345 +++++++++++++++++++++++ xen/common/libelf/libelf-tools.c | 225 +++++++++++++++ xen/include/public/elfstructs.h | 527 ++++++++++++++++++++++++++++++++++++ xen/include/public/libelf.h | 238 ++++++++++++++++ xen/include/xen/elf.h | 490 --------------------------------- 13 files changed, 1972 insertions(+), 1014 deletions(-)
* Fix perfc=y build.kfraser@localhost.localdomain2007-01-251-2/+2
| | | | Signed-off-by: Keir Fraser <keir@xensource.com>
* Make domctl/sysctl interfaces 32-/64-bit invariant.kfraser@localhost.localdomain2007-01-246-395/+63
| | | | | | | 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>
* Fix crash if some secondary CPUs cannot be initialised.kfraser@localhost.localdomain2007-01-241-0/+3
| | | | Signed-off-by: Keir Fraser <keir@xensource.com>
* [XEN] Consolidate multiple defintions of ELFNOTE_* accessor macrosIan Campbell2007-01-222-13/+2
| | | | Signed-off-by: Ian Campbell <ian.campbell@xensource.com>
* [XEN] Avoid void* arithmetic in kexec ELF note manipulations.Ian Campbell2007-01-221-5/+5
| | | | | From: Christoph Egger <Christoph.Egger@amd.com> Signed-off-by: Ian Campbell <ian.campbell@xensource.com>
* Fix byte-to-long bitmap conversions.kaf24@localhost.localdomain2007-01-211-2/+1
| | | | Signed-off-by: Keir Fraser <keir@xensource.com>
* [XEN] Remove bogus include reference.kaf24@localhost.localdomain2007-01-191-1/+0
| | | | Signed-off-by: Keir Fraser <keir@xensource.com>
* [XEN] Move hvm get/set domctl() commands to arch/x86/domctl.c.kfraser@localhost.localdomain2007-01-191-73/+0
| | | | Signed-off-by: Keir Fraser <keir@xensource.com>
* [XEN] Support VCPU reset via DOMCTL_setvcpucontext.kfraser@localhost.localdomain2007-01-191-1/+37
| | | | Signed-off-by: Andrei Petrov <andrei.petrov@xensource.com>
* [XEN] New event-channel reset operation.kfraser@localhost.localdomain2007-01-191-0/+31
| | | | | | | Plumbed through libxenctrl to python. From: Andrei Petrov <andrei.petrov@xensource.com> Signed-off-by: Keir Fraser <keir@xensource.com>
* Add resumedomain domctl to resume a domain after checkpoint.kfraser@localhost.localdomain2007-01-191-0/+17
| | | | | | Export resumedomain domctl to libxc, xend. Signed-off-by: Brendan Cully <brendan@cs.ubc.ca>
* [XEN] Avoid void* arithmetic in elfnote code.kfraser@localhost.localdomain2007-01-191-5/+5
| | | | | From: Christoph Egger <Christoph.Egger@amd.com> Signed-off-by: Keir Fraser <keir@xensource.com>
* [XEN] Convert between long-based and byte-based bitmap arrays.kfraser@localhost.localdomain2007-01-192-8/+62
| | | | | | | Use this for conversion of the domctl_cpumap type on big-endian systems. Original patch from Jimi Xenidis <jimix@watson.ibm.com> Signed-off-by: Keir Fraser <keir@xensource.com>
* [XEN] Revert change to vcpu_guest_context which breaks guest ABI.kfraser@localhost.localdomain2007-01-191-8/+0
| | | | | | | HVM save/restore needs to save/restore vcpu state via the new stream-based load/save hypercalls. Signed-off-by: Keir Fraser <keir@xensource.com>
* [HVM] save restore: shadow fixTim Deegan2007-01-181-0/+9
| | | | | | | | | | | Signed-off-by: Zhai Edwin <edwin.zhai@intel.com> fix 2 shadow issues: * restored guest's mem type_info are not correct * remove annoying warnings when restore enable smp: turn on the vcpu when set_vcpu_context in restore as cpu hotplug is not feasible for HVM
* [HVM] save restore: new hyper-callTim Deegan2007-01-181-0/+73
| | | | | | Signed-off-by: Zhai Edwin <edwin.zhai@intel.com> add a pair of hyper-call for hvm guest context
* [XEN] Clean up long division code, fix for C99-mandatedkaf24@localhost.localdomain2007-01-131-335/+291
| | | | | truncation-towards-zero. Signed-off-by: Keir Fraser <keir@xensource.com>
* [XEN] 'd' key dumps both host and guest state.kfraser@localhost.localdomain2007-01-121-3/+10
| | | | Signed-off-by: Keir Fraser <keir@xensource.com>
* [PATCH] kexec/kdump: allow zero start for crashkernelIan Campbell2007-01-121-14/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Some architectures, notably ia64, can automatically place the crash kernel into an appropriate place if the start address for crashkernel is specified as zero or omitted. E.g. crashkernel=256M or crashkernel=256M@0 While xen does not actually have support for ia64 kexec, I am working on it. And in any case this change should be harmless. Just a small bit of infastructure that will make things easier in the future. This should also be possible on x86, now relocatable kernels are reloacatble on x86. So once xen moves up to using linux ~2.6.19 it would make sense to look into implementing this. The patch does 3 things. * Firstly, parse_crashkernel() is modified to allows the size and start elements of kexec_crash_area to be set to any value, including zero. Previously if either size or start were specified as zero, they would both end up as zero. * Secondly, when kexec_get() is called, if either the size or start elements of kexec_crash_area are zero, then zero is passed back to the hypercall caller for both values. This gives the same behaviour as having parse_crashkernel() set size and start to zero if either of them are zero, but it allows architecture sepcific code called between the invocation of parse_crashkernel() and kexec_get() to modify start (and size if there was a reason). In particular, this allows the architecture specific code to find a good start point if 0 is specified. * Lastly, it ads an additional check to the x86 setup code. As this code currently does not know how to deal with a 0 start address, it doesn't reserve memory if start is 0. This is neccessary as previously if start was specified as zero, parse_crashkernel() would set size to zero, but that is no longer the case, so a stronger check is needed. I would really appreciate it if this patch was merged, as I don't believe it harms anything, and it does allow a nice path for moving forwards. Signed-off-by: Simon Horman <horms@verge.net.au>
* Fix xencomm_copy_{from, to}_guest.kfraser@localhost.localdomain2007-01-121-2/+2
| | | | | | It should not call paddr_to_maddr() with invalid address. Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
* Use strstr() to look for "bimodal" string in ELF notes, to allow guests to usejohn.levon@sun.com2007-01-081-1/+1
| | | | | | "yes,bimodal", so they are correctly identified as PAE on older hypervisors. Signed-off-by: John Levon <john.levon@sun.com>