aboutsummaryrefslogtreecommitdiffstats
path: root/tools/libxc/xc_minios.c
Commit message (Collapse)AuthorAgeFilesLines
* 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-16/+4
| | | | | | | | | | | | | | | | | 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>
* mini-os: remove per-fd evtchn limitAlex Zeffertt2012-02-091-66/+74
| | | | | | | | | | | | | This changes the minios evtchn implementation to use a list instead of an array which ahis allows it to grow as necessary to support any number of ports, only limited by Xen (NR_EVS is 1024, should be enough for now). Signed-off-by: Diego Ongaro <diego.ongaro@citrix.com> Signed-off-by: Alex Zeffertt <alex.zeffertt@eu.citrix.com> Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov> Acked-by: Ian Campbell <ian.campbell@citrix.com> Cc: Stefano Stabellini <stefano.stabellini@eu.citrix.com> Committed-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
* tools/libxc: introduce xc_memalign in xc_{minios,linux,solaris,netbsd}.cShriram Rajagopalan2011-12-011-1/+6
| | | | | | | | | | | 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>
* libxc: add xc_gnttab_map_grant_ref_notifyDaniel De Graaf2011-10-061-39/+15
| | | | | | | | | | | | | | | Normally, when a userspace process mapping a grant crashes, the domain providing the reference receives no indication that its peer has crashed, possibly leading to unexpected freezes or timeouts. This function provides a notification of the unmap by signalling an event channel and/or clearing a specific byte in the page. This also unifies the 3 very similar grant-mapping osdep interfaces into a single function instead of introducing yet another minor variation. Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov> Committed-by: Ian Jackson <ian.jackson@eu.citrix.com> Acked-by: Ian Campbell <ian.campbell@citrix.com>
* libxc: osdep: convert hypercall buffer allocationIan Campbell2011-03-111-0/+14
| | | | | | | This will allow us to use OS specific interfaces to ensure that the allocated memory is safe for use as a hypercall buffer in the future. Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
* libxc: osdep: Use XC_PAGE_{SHIFT,MASK}.Ian Campbell2010-12-031-2/+2
| | | | | | | Avoid dependency on xc_private.h Signed-off-by: Ian Campbell <ian.campbell@citrix.com> Signed-off-by: Ian Jackson <ian.jackson.citrix.com>
* libxc: drop fd from xc_interfaceIan Campbell2010-12-031-3/+0
| | | | | | | | 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>
* libxc: add ability to query OS interface for "fakeness"Ian Campbell2010-12-031-0/+1
| | | | | | | | | | | | 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>
* libxc: osdep: convert xc_gnttab_set_max_grants()Ian Campbell2010-12-031-2/+4
| | | | | Signed-off-by: Ian Campbell <ian.campbell@citrix.com> Signed-off-by: Ian Jackson <ian.jackson.citrix.com>
* libxc: osdep: convert xc_gnttab_munmap()Ian Campbell2010-12-031-4/+6
| | | | | Signed-off-by: Ian Campbell <ian.campbell@citrix.com> Signed-off-by: Ian Jackson <ian.jackson.citrix.com>
* libxc: osdep: convert xc_gnttab_map_{grant_ref,grant_refs,domain_grant_refs}()Ian Campbell2010-12-031-17/+26
| | | | | Signed-off-by: Ian Campbell <ian.campbell@citrix.com> Signed-off-by: Ian Jackson <ian.jackson.citrix.com>
* libxc: osdep: convert xc_evtchn_{pending,unmask}()Ian Campbell2010-12-031-8/+11
| | | | | Signed-off-by: Ian Campbell <ian.campbell@citrix.com> Signed-off-by: Ian Jackson <ian.jackson.citrix.com>
* libxc: osdep: convert xc_evtchn_unbind()Ian Campbell2010-12-031-5/+7
| | | | | Signed-off-by: Ian Campbell <ian.campbell@citrix.com> Signed-off-by: Ian Jackson <ian.jackson.citrix.com>
* libxc: osdep: convert xc_evtchn_bind_virq()Ian Campbell2010-12-031-5/+7
| | | | | Signed-off-by: Ian Campbell <ian.campbell@citrix.com> Signed-off-by: Ian Jackson <ian.jackson.citrix.com>
* libxc: osdep: convert xc_evtchn_bind_interdomain()Ian Campbell2010-12-031-5/+7
| | | | | Signed-off-by: Ian Campbell <ian.campbell@citrix.com> Signed-off-by: Ian Jackson <ian.jackson.citrix.com>
* libxc: osdep: convert xc_evtchn_bind_unbound_port()Ian Campbell2010-12-031-5/+7
| | | | | Signed-off-by: Ian Campbell <ian.campbell@citrix.com> Signed-off-by: Ian Jackson <ian.jackson.citrix.com>
* libxc: osdep: convert xc_evtchn_notify()Ian Campbell2010-12-031-1/+2
| | | | | Signed-off-by: Ian Campbell <ian.campbell@citrix.com> Signed-off-by: Ian Jackson <ian.jackson.citrix.com>
* libxc: osdep: convert xc_evtchn_fd()Ian Campbell2010-12-031-2/+6
| | | | | Signed-off-by: Ian Campbell <ian.campbell@citrix.com> Signed-off-by: Ian Jackson <ian.jackson.citrix.com>
* libxc: osdep: convert xc_map_foreign_ranges()Ian Campbell2010-12-031-3/+5
| | | | | Signed-off-by: Ian Campbell <ian.campbell@citrix.com> Signed-off-by: Ian Jackson <ian.jackson.citrix.com>
* libxc: osdep: convert xc_map_foreign_range()Ian Campbell2010-12-031-3/+5
| | | | | Signed-off-by: Ian Campbell <ian.campbell@citrix.com> Signed-off-by: Ian Jackson <ian.jackson.citrix.com>
* libxc: osdep: convert xc_map_foreign_{batch,bulk}Ian Campbell2010-12-031-4/+9
| | | | | Signed-off-by: Ian Campbell <ian.campbell@citrix.com> Signed-off-by: Ian Jackson <ian.jackson.citrix.com>
* libxc: osdep: convert do_xen_hypercall()Ian Campbell2010-12-031-22/+26
| | | | | | | 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>
* libxc: osdep: add framework for abstracting access to dom0 OS hypervisor ↵Ian Campbell2010-12-031-14/+63
| | | | | | | | | | 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>
* libxc: convert gnttab interfaces to use an opaque handle typeIan Campbell2010-12-231-17/+17
| | | | | | | | | | | | | 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>
* libxc: convert evtchn interfaces to use an opaque handle typeIan Campbell2010-12-231-44/+47
| | | | | | | | | | | | 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>
* libxc: some xc_gnttab_* functions are not Linux specificIan Campbell2010-12-231-12/+0
| | | | | | | | | 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>
* minios: reverse layering of xc vs minios fd closeKeir Fraser2010-12-031-8/+24
| | | | | | | | | | | | Having minios close() call back into the libxc core close routines is backwards and unexpected. On every other OS the libxc core close routine calls close(). Export minios specific functions from the minios libxc code to implement fd closing for each type of xc file handle and simply call close() in the core close routine. Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
* # HG changeset patchIan Campbell2010-08-241-4/+13
| | | | | | | | | | | | | | | | | | | | | | | | | # 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: Remove obsolete xc_find_device_number() declaration.Keir Fraser2010-06-041-6/+0
| | | | Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
* libxc: eliminate static variables, use xentoollog; API changeKeir Fraser2010-05-281-18/+18
| | | | | | | | | | | | | | | | | | | | 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>
* minios: implement xc_map_foreign_bulkKeir Fraser2010-01-181-3/+27
| | | | | | | In order to do so it modifies map_frames_ex and do_map_frames to take an int *err as parameter and return any error that way. Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
* libxenctrl: Fix non-Linux definitions of xc_gnttab_map_table*().Keir Fraser2009-10-071-1/+8
| | | | Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
* stubdom/minios: re-structure headersKeir Fraser2009-10-011-7/+7
| | | | | | | | | As part of making stubdom usable on NetBSD, it is necessary to restructure the minios headers to avoid conflicts with NetBSD's crossbuild toolchain. Signed-off-by: Christoph Egger <Christoph.Egger@amd.com> Acked-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
* libxc: Implement stub xc_gnttab_map_table() for non-linux.Keir Fraser2009-06-011-0/+5
| | | | Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
* stubdom: make xc_map_foreign_ranges use malloc instead of stack spaceKeir Fraser2008-08-281-2/+7
| | | | Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com>
* stubdom: drop debugging messageKeir Fraser2008-08-271-1/+0
| | | | Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com>
* minios: Error case when unbinding unknown port in xc_evtchn_unbind isKeir Fraser2008-08-011-1/+4
| | | | | | missing a return statement. Signed-off-by: Diego Ongaro <diego.ongaro@citrix.com>
* stubdom: fix do_xen_hypercall error reportKeir Fraser2008-07-251-2/+2
| | | | | | call.result is an unsigned long Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com>
* minios: grant table map (gntdev) bug fixesKeir Fraser2008-07-241-5/+17
| | | | | | | | | | | * Uninitialized dev_bus_addr argument to GNTTABOP_unmap_grant_ref results in an angry hypervisor. * Set errno in libxc and return -1 on error. * op.status is a int16_t, so it should be printed with PRId16. * Don't print domids[0] or refs[0] if the ptr is NULL. It's more polite to crash later, after the message has been printed. Signed-off-by: Diego Ongaro <diego.ongaro@citrix.com>
* minios: grant table map (gntdev) for miniosKeir Fraser2008-07-241-0/+71
| | | | | | | | I've implemented a grant map for mini-os to support the xc_gnttab_*() functions, the equivalent of gntdev in linux. This is useful for my work in putting xenstored in a stub domain. Signed-off-by: Diego Ongaro <diego.ongaro@citrix.com>
* mini-os: select call incorrectly reports xce_handle as readyKeir Fraser2008-07-241-8/+14
| | | | | | | | | The current implementation in minios of xc_evtchn_pending doesn't set read=0 when there is exactly one port pending. This resulted in select() incorrectly reporting the file descriptor as ready. Signed-off-by: Diego Ongaro <diego.ongaro@citrix.com> Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com>
* pv-grub: re-implement xc_map_foreign_rangesKeir Fraser2008-07-241-14/+17
| | | | | | | Also get rid of va and npages members of privcmd_mmap_entry since we do not need them any more. Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com>
* libxc: Clean up xc_map_foreign_ranges() interface to hide theKeir Fraser2008-07-231-0/+11
| | | | | | | underlying mmap() invocation. From: Christoph Egger <Christoph.Egger@amd.com> Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
* stubdom: fix missing evtchn.h headerKeir Fraser2008-07-091-1/+0
| | | | | | We actually do not need any since we include MiniOS' headers. Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com>
* stubdom: complete libxc supportKeir Fraser2008-05-231-3/+14
| | | | Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com>
* minios: let events get mixedKeir Fraser2008-05-061-2/+2
| | | | | | since events do not need to be counted Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
* minios: Fix lost eventsKeir Fraser2008-03-181-11/+3
| | | | | | | | | | | | | | | evtchn_bind_interdomain used to clear any already pending event before binding a handler, because else the handler may be called before it is ready. That however leads to missed events, which I had to workaround for the HVM case. This changes the semantics of bind_evtchn, and thus of all the event channel binding functions (bind_virq, evtchn_alloc_unbound, evtchn_bind_interdomain) into not unmasking the event itself, hence letting the caller initialize properly before unmasking the port (e.g. record the port number in an appropriate place). Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com>
* Add stubdomain support. See stubdom/README for usage details.Keir Fraser2008-02-121-0/+313
- Move PAGE_SIZE and STACK_SIZE into __PAGE_SIZE and __STACK_SIZE in arch_limits.h so as to permit getting them from there without pulling all the internal Mini-OS defines. - Setup a xen-elf cross-compilation environment in stubdom/cross-root - Add a POSIX layer on top of Mini-OS by linking against the newlib C library and lwIP, and implementing the Unixish part in mini-os/lib/sys.c - Cross-compile zlib and libpci too. - Add an xs.h-compatible layer on top of Mini-OS' xenbus. - Cross-compile libxc with an additional xc_minios.c and a few things disabled. - Cross-compile ioemu with an additional block-vbd, but without sound, tpm and other details. A few hacks are needed: - Align ide and scsi buffers at least on sector size to permit direct transmission to the block backend. While we are at it, just page-align it to possibly save a segment. Also, limit the scsi buffer size because of limitations of the block paravirtualization protocol. - Allocate big tables dynamically rather that letting them go to bss: when Mini-OS gets installed in memory, bss is not lazily allocated, and doing so during Mini-OS is unnecessarily trick while we can simply use malloc. - Had to change the Mini-OS compilation somehow, so as to export Mini-OS compilation flags to the Makefiles of libxc and ioemu. Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com>