Commit Graph
64 Commits
Author SHA1 Message Date
Ian Campbell 443701ef0c Replace FSF street address with canonical URL
As recommended in http://www.gnu.org/licenses/gpl-howto.en.html.

This is the result of:
$ git grep -El Mass\|Temple\|Franklin | xargs ./fsf.pl

Where fsf.pl is:
    #!/usr/bin/perl -w -pi.bak -0777
    my $repl = 'If not, see <http://www.gnu.org/licenses/>.';
    my $br = qr/(?:\s*\n\s*(?:[\*\#]|\/\/|\.\\" )?\s*|\s+)/;

    my $inwt = qr/[Ii]f${br}not,${br}write${br}(?:to${br})?the${br}Free${br}Software${br}Foundation,(?:${br}Inc\.,)?/;

    my $mass = qr/675${br}Mass${br}Ave,?${br}Cambridge,?${br}MA${br}02139,?${br}USA,?\.?/;
    my $franklin = qr/51${br}Franklin${br}St(?:reet)?(?:,${br}| - )Fifth${br}Floor,?${br}Boston,?${br}MA,?${br}02110-1301,?${br}USA,?\.?/;
    my $temple = qr/59${br}Temple${br}Place(?:,${br}| - )Suite${br}330,?${br}Boston,?${br}MA,?${br}021110?-1307,?${br}USA,?\.?/;

    s|$inwt$br$mass|$repl|m;
    s|$inwt$br$franklin|$repl|m;
    s|$inwt$br$temple|$repl|m;

The only remaining mentions of these addresses are in COPYING files which I
haven't touched.

Some of the changed files are imports from elsewhere, however
filtering them out is tricky, I think it is tolerable to have these
files be modified here and then perhaps reverted on the next sync,
since it's only 1-2 lines and obvious what is going on.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
2015-07-29 11:14:07 +01:00
David Vrabel 82639998a5 Fix emacs local variable block to use correct C style variable.
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
2013-02-21 16:12:46 +00:00
Shriram Rajagopalan de869779a0 tools/libxc: introduce xc_memalign in xc_{minios,linux,solaris,netbsd}.c
Move (page aligned) buffer allocations in {os}_privcmd_alloc_hypercall_buffer
into a global function xc_memalign. This API is also used by Remus
compression code to allocate compression caches that need to be page aligned.

Signed-off-by: Shriram Rajagopalan <rshriram@cs.ubc.ca>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Brendan Cully <brendan@cs.ubc.ca>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
2011-12-01 15:35:02 +00:00
Ian Jackson 9f187767c5 libxc: Do not use dom0 physmem as parameter to lzma decoder
It's not clear why a userspace lzma decode would want to use that
particular value, what bearing it has on anything or why it would
assume it could use 1/3 of the total RAM in the system (potentially
quite a large amount of RAM) as opposed to any other limit number.

Instead, hardcode 32Mby.

This reverts 22830:c80960244942, removes the xc_get_physmem/physmem
function entirely, and replaces the expression at the call site with a
fixed constant.

Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
Acked-by: Ian Campbell <Ian.Campbell@eu.citrix.com>
Cc: Christoph Egger <Christoph.Egger@amd.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
2011-01-28 19:37:49 +00:00
Christoph Egger e464320268 libxc: break xc_get_physmem out into os-dependent files
NetBSD doesn't have sysconf(_SC_PHYS_PAGES).

Factor physmem() out into os-dependent files and rename it to
xc_get_physmem() so as not to pollute the namespace.

Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
2011-01-27 19:03:42 +00:00
Ian Campbell d2c71cadc5 libxc: refactor Linux OS interface into a separate file.
This helps ensure that the osdep abstraction is complete by
allowing us to avoid including xc_private.h.

All the other OS backends could benefit from the same treatment but
since I cannot compile test I did not do this.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Signed-off-by: Ian Jackson <ian.jackson.citrix.com>
2010-12-03 09:36:47 +00:00
Ian Campbell 0ccceacd05 libxc: osdep: Use XC_PAGE_{SHIFT,MASK}.
Avoid dependency on xc_private.h

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Signed-off-by: Ian Jackson <ian.jackson.citrix.com>
2010-12-03 09:36:47 +00:00
Ian Campbell 2de6889919 libxc: drop fd from xc_interface
Transition to xc_osdep_handle is now complete and nothing uses
(or should be using) it.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Signed-off-by: Ian Jackson <ian.jackson.citrix.com>
2010-12-03 09:36:47 +00:00
Ian Campbell 048f6a9497 libxc: add ability to query OS interface for "fakeness"
i.e. not running on a real hypervisor

Allows users of the library to adjust behaviour. I don't especially
like this violation of the abstraction but both oxenstored and xapi
use this to avoid difficult to simulate operations when running on the
simulator.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Signed-off-by: Ian Jackson <ian.jackson.citrix.com>
2010-12-03 09:36:47 +00:00
Ian Campbell fa0eebfd1b libxc: osdep: convert xc_gnttab_set_max_grants()
Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Signed-off-by: Ian Jackson <ian.jackson.citrix.com>
2010-12-03 09:36:47 +00:00
Ian Campbell e4371c99d8 libxc: osdep: convert xc_gnttab_munmap()
Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Signed-off-by: Ian Jackson <ian.jackson.citrix.com>
2010-12-03 09:36:47 +00:00
Ian Campbell fcc007081b libxc: osdep: convert xc_gnttab_map_{grant_ref,grant_refs,domain_grant_refs}()
Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Signed-off-by: Ian Jackson <ian.jackson.citrix.com>
2010-12-03 09:36:47 +00:00
Ian Campbell 3361a9deea libxc: osdep: convert xc_evtchn_{pending,unmask}()
Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Signed-off-by: Ian Jackson <ian.jackson.citrix.com>
2010-12-03 09:36:47 +00:00
Ian Campbell dbb5c70a0d libxc: osdep: convert xc_evtchn_unbind()
Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Signed-off-by: Ian Jackson <ian.jackson.citrix.com>
2010-12-03 09:36:47 +00:00
Ian Campbell 1fd1a4254d libxc: osdep: convert xc_evtchn_bind_virq()
Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Signed-off-by: Ian Jackson <ian.jackson.citrix.com>
2010-12-03 09:36:47 +00:00
Ian Campbell b491e4e05d libxc: osdep: convert xc_evtchn_bind_interdomain()
Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Signed-off-by: Ian Jackson <ian.jackson.citrix.com>
2010-12-03 09:36:47 +00:00
Ian Campbell cb1325b0d5 libxc: osdep: convert xc_evtchn_bind_unbound_port()
Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Signed-off-by: Ian Jackson <ian.jackson.citrix.com>
2010-12-03 09:36:47 +00:00
Ian Campbell 660aa26bec libxc: osdep: convert xc_evtchn_notify()
Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Signed-off-by: Ian Jackson <ian.jackson.citrix.com>
2010-12-03 09:36:47 +00:00
Ian Campbell 5cdff1952e libxc: osdep: convert xc_evtchn_fd()
Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Signed-off-by: Ian Jackson <ian.jackson.citrix.com>
2010-12-03 09:36:47 +00:00
Ian Campbell d52853b78c libxc: osdep: convert xc_map_foreign_ranges()
Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Signed-off-by: Ian Jackson <ian.jackson.citrix.com>
2010-12-03 09:36:47 +00:00
Ian Campbell 3143748ef6 libxc: osdep: convert xc_map_foreign_range()
Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Signed-off-by: Ian Jackson <ian.jackson.citrix.com>
2010-12-03 09:36:47 +00:00
Ian Campbell f32797d331 libxc: osdep: convert xc_map_foreign_{batch,bulk}
Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Signed-off-by: Ian Jackson <ian.jackson.citrix.com>
2010-12-03 09:36:47 +00:00
Ian Campbell 2e04f9622f libxc: osdep: convert do_xen_hypercall()
do_privcmd() was only ever used by do_xen_hypercall() so remove it.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Signed-off-by: Ian Jackson <ian.jackson.citrix.com>
2010-12-03 09:36:46 +00:00
Ian Campbell 02e4f47747 libxc: osdep: add framework for abstracting access to dom0 OS hypervisor interfaces.
This patch introduces the basic infrastructure and uses it for open
and close operations on privcmd, evtchn and gnttab devices.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Signed-off-by: Ian Jackson <ian.jackson.citrix.com>
2010-12-03 09:36:46 +00:00
Ian Campbell 94705cc4bf libxc: convert gnttab interfaces to use an opaque handle type
The xc_interface previously passed to xc_gnttab_* was only used for
logging which can now be done via the xc_gnttab handle instead.

This makes the interface consistent with the changes made to the main
interface in 21483:779c0ef9682c.

Also update QEMU_TAG to pull in the corresponding qemu change.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
2010-12-23 15:32:52 +00:00
Ian Campbell 3e446a35ee libxc: convert evtchn interfaces to use an opaque handle type
This makes the interface consistent with the changes made to the main
interface in 21483:779c0ef9682c.

Also fix some references to "struct xc_interface" which should have
been simply "xc_interface" in tools/xenpaging, and update QEMU_TAG to
pull in the corresponding qemu change.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
2010-12-23 15:25:57 +00:00
Ian Campbell 252cb308e3 libxc: some xc_gnttab_* functions are not Linux specific
They simply make hypercalls and perform other operations via the
abstract interface. Create xc_gnttab.c and move those functions there.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Christoph Egger <Christoph.Egger@amd.com>
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
2010-12-23 15:08:21 +00:00
Ian Campbell 4fd0fc305b libxc: finalise transition to hypercall buffers.
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>
2010-10-22 15:14:51 +01:00
Ian Campbell 0236a3e4c3 libxc: convert gnttab interfaces over to hypercall buffers
Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Signed-off-by: Ian Jackson <ian.jackson.citrix.com>
2010-10-22 15:14:51 +01:00
Ian Campbell f114466a23 libxc: pass an xc_interface handle to page locking functions
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>
2010-10-18 16:43:58 +01:00
Ian Campbell 6993e9f5ce # HG changeset patch
# 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>
2010-08-24 18:42:59 +01:00
Keir Fraser ffd4db9a68 tools: assume that special Xen devices have been created by the platform
Remove all the magic surrounding the special Xen devices in Linux
specific code whereby we attempt to figure out what the correct
major:minor number is and check the the existing device has these
numbers etc. In 2010 we really should be able to trust that the
platform has created the devices correctly or provide correct
configuration settings such that they are without resorting to tearing
down the platform configured state and rebuilding it.

tools/hotplug/Linux/xen-backend.rules already contains the necessary
udev rules to create /dev/xen/evtchn and friends in the correct place.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
2010-06-02 10:54:32 +01:00
Keir Fraser f6a50a21e5 xc: deal with xen/evtchn and xen/gntdev device names
This patch makes xc_linux properly deal with:
 1. discovering and creating device nodes if necessary
 2. the new form of xen/<dev> device names soon to be used by the
 kernel

This changes the logic slightly:
 - If a device node already exists with the proper name, then it uses
 it as-is, assuming it has already been correctly created.
 - If the path doesn't exist, or it exists but isn't a device node,
 and
   it has successfully found the major/minor for the device, then
   (re)create the device node.

Since this logic is identical for gntdev and evtchn, make a common
function to handle both.

Signed-off-by: Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>
2010-06-01 07:04:35 +01:00
Keir Fraser 5cc436c1d2 libxc: eliminate static variables, use xentoollog; API change
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>
2010-05-28 09:30:19 +01:00
Keir Fraser 7848a26a97 libxc: mmapbatch-v2 adjustments
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>
2010-01-22 10:59:51 +00:00
Keir Fraser 2d8eb0f62d libxc: Fix IOCTL_PRIVCMD_MMAPBATCH_V2 fallback check
privcmd_ioctl returns EINVAL if the type is not supported.
This fixes the guest booting issue caused by C/S 20791.

Signed-off-by: Dongxiao Xu <dongxiao.xu@intel.com>
Signed-off-by: Jan Beulich <jbeulich@novell.com>
2010-01-14 14:10:40 +00:00
Keir Fraser 9fececad98 libxc: use new (replacement) mmap-batch ioctl
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>
2010-01-13 08:12:56 +00:00
Keir Fraser 7e31226c7a Support for -EAGAIN from xc_gnttab_map_grant_ref.
Signed-off-by: Grzegorz Milos <Grzegorz.Milos@citrix.com>
2009-12-17 06:27:56 +00:00
Keir Fraser 0645e0177f libxc support of memory paging.
libxc accepts the new return code from privcmd mmap, which indicates a page
being mapped is actually paged out. Spin until the page is paged in and return
as normal to the caller. This allows memory paging to work transparently with
existing tools.

Since libxc runs in user-space, as does the pager, both processes will be
scheduled and run. This enables the page to be paged in without needing to
spin in kernel mode (which would cause a dead-lock).

Signed-off-by: Patrick Colp <Patrick.Colp@citrix.com>
2009-12-17 06:27:55 +00:00
Keir Fraser 322c096f9c General code clean-up of xc_linux.c.
Signed-off-by: Patrick Colp <Patrick.Colp@citrix.com>
2009-12-17 06:27:55 +00:00
Keir Fraser 7de68b1611 libxc: fix a few memory leaks
running qemu with valgrind I found I couple of small memory leaks in
libxc, this patch fixes them.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
2009-10-23 10:00:22 +01:00
Keir Fraser 0faacacb2f libxenctrl: Build fix after gnttab_v2 changes.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2009-10-07 10:26:39 +01:00
Keir Fraser a98dc13703 Introduce a grant_entry_v2 structure.
Signed-off-by: Steven Smith <steven.smith@citrix.com>
2009-10-07 07:46:36 +01:00
Keir Fraser 1766cdc32b Rename the struct grant_entry to struct grant_entry_v1, so that it
isn't in the way when we introduce struct grant_entry_v2.

Signed-off-by: Steven Smith <steven.smith@citrix.com>
2009-10-07 07:46:14 +01:00
Keir Fraser 07a34def02 libxc: Use a single mmap interface to Linux
Modify xc_map_foreign_range and xc_map_foreign_ranges to call
mmap_map_foreign_batch. This eliminates the need for multiple privcmd
mmap ioctls. Now only IOCTL_PRIVCMD_MMAPBATCH is required.

Signed-off-by: Patrick Colp <Patrick.Colp@citrix.com>
2009-07-20 10:58:06 +01:00
Keir Fraser 8b9c6bce94 libxc: Add a function to map a domain's grant table.
Signed-off-by: Jiang, Yunhong <yunhong.jiang@intel.com>
2009-06-01 14:13:20 +01:00
Keir Fraser 28f8960f3e libxc: Fix after xc_map_foreign_ranges() patch.
Must munmap() region after loading elf image.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2008-07-24 11:18:53 +01:00
Keir Fraser ce29ad450c libxc: Clean up xc_map_foreign_ranges() interface to hide the
underlying mmap() invocation.

From: Christoph Egger <Christoph.Egger@amd.com>
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2008-07-23 16:39:46 +01:00
Keir Fraser 19aa4a65a3 libxc: add xc_gnttab_map_domain_grant_refs.
xc_gnttab_map_domain_grant_refs permits to simply map several pages
from the same domain.

Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com>
2008-07-21 14:02:53 +01:00
Keir Fraser 86d8fe5e6a libxc: Variable-size gntdev support
This patch adds the ability to set the number of slots that may be
used for mapping grant references, using the gntdev user-space grant
reference mapping driver.

Signed-off-by: Derek Murray <Derek.Murray@cl.cam.ac.uk>
2008-03-18 15:00:33 +00:00