aboutsummaryrefslogtreecommitdiffstats
path: root/extras/mini-os/lib
Commit message (Collapse)AuthorAgeFilesLines
* mini-os: fix various memory leaks in various locationsMatthew Daley2013-09-211-0/+2
| | | | | | | | | | Coverity-ID: 1055827 Coverity-ID: 1055828 Coverity-ID: 1055829 Coverity-ID: 1055830 Coverity-ID: 1055831 Signed-off-by: Matthew Daley <mattjd@gmail.com> Acked-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
* mini-os: fix use-after-free in xs_daemon_close event iterationMatthew Daley2013-09-131-2/+5
| | | | | | | | We need to get the next pointer before the freeing of the event. Coverity-ID: 1056173 Signed-off-by: Matthew Daley <mattjd@gmail.com> Acked-By: Samuel Thibault <samuel.thibault@ens-lyon.org>
* mini-os: implement poll(2)Wei Liu2013-04-111-1/+116
| | | | | | | | It is just a wrapper around select(2). This implementation mimics Linux's do_poll. Signed-off-by: Wei Liu <wei.liu2@citrix.com> Acked-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
* 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
* mini-os: build fixes for lwip 1.3.2David Vrabel2013-01-301-1/+11
| | | | | | | | | | | | | Various fixes to mini-os needed to build lwip 1.3.2: - Don't build the tests. - Add BSD-style endianness macros to endian.h. - free() is called via a function pointer so it needs to be a real function. Do the same for malloc() and realloc(). Signed-off-by: David Vrabel <david.vrabel@citrix.com> Acked-by: Samuel Thibault <samuel.thibault@ens-lyon.org> Committed-by: Keir Fraser <keir@xen.org>
* minios: fix bug in lseek for mini-osMatthew Fioravante2012-11-191-29/+38
| | | | | | | | | | lseek always used files[fd].file.offset. It should use the offset of whatever union member is actually being used. Signed-off-by: Matthew Fioravante <matthew.fioravante@jhuapl.edu> Acked-by: Ian Campbell <ian.campbell@citrix.com> Committed-by: Ian Campbell <ian.campbell@citrix.com>
* minios: add tpmfront, tpm_tis, and tpmback driversMatthew Fioravante2012-11-131-0/+48
| | | | | | | | | | | | | | | | | | | | This patch adds 3 new drivers to mini-os. tpmfront - paravirtualized tpm frontend driver tpmback - paravirtualized tpm backend driver tpm_tis - hardware tpm driver Unfortunately these drivers were derived from GPL licensed linux kernel drivers so they must carry the GPL license. However, since mini-os now supports conditional compilation, hopefully these drivers can be included into the xen tree and conditionally removed from non-gpl projects. By default they are disabled in the makefile. Signed-off-by: Matthew Fioravante <matthew.fioravante@jhuapl.edu> Acked-by: Ian Campbell <ian.campbell@citrix.com> Committed-by: Ian Campbell <ian.campbell@citrix.com>
* minios: add posix io for blkfrontMatthew Fioravante2012-10-091-2/+44
| | | | | | | | | This patch adds posix io support (read,write,lseek) to block devices using blkfront. Signed-off-by: Matthew Fioravante <matthew.fioravante@jhuapl.edu> Acked-by: Samuel Thibault <samuel.thibault@ens-lyons.org> Committed-by: Ian Campbell <ian.campbell@citrix.com>
* minios: add CONFIG_XC conditionalMatthew Fioravante2012-10-081-1/+6
| | | | | | | | | This patch adds a CONFIG_XC option to mini-os, to allow conditional support for libxc for mini-os domains. Signed-off-by: Matthew Fioravante <matthew.fioravante@jhuapl.edu> Acked-by: Samuel Thibault <samuel.thibault@ens-lyons.org> Committed-by: Ian Campbell <ian.campbell@citrix.com>
* tools: drop ia64 supportIan Campbell2012-09-121-5/+0
| | | | | | | | | | | | | | | | | 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>
* nstore: rename public xenstore headersIan Campbell2012-05-142-2/+2
| | | | | | | | | | | | | | | | | | | | | | The xenstore header xs.h is producing conflicts with other software[1]. xs is a too short identifier and does not matche the library. Renaming the headers to xenstore.h and xenstore_lib.h is the easiest way to make them easy recognizable and prevent furthe problems. [1]: http://bugs.debian.org/668550 [ Also update QEMU_TAG, to bring in corresponding change to qemu-xen-traditional. -iwj ] Signed-off-by: Bastian Blank <waldi@debian.org> Signed-off-by: Ian Campbell <ian.campbell@citrix.com> Acked-by: Ian Jackson <ian.jackson@eu.citrix.com> Committed-by: Ian Jackson <ian.jackson@eu.citrix.com> --HG-- rename : tools/xenstore/xs.h => tools/xenstore/xenstore.h rename : tools/xenstore/xs_lib.h => tools/xenstore/xenstore_lib.h
* mini-os: make frontends and xenbus optionalDaniel De Graaf2012-02-091-0/+59
| | | | | | | | | | | | | | | | | This adds compile-time logic to disable certain frontends in mini-os: - pcifront is disabled by default, enabled for ioemu - blkfront, netfront, fbfront, kbdfront, consfront are enabled by default - xenbus is required for any frontend, and is enabled by default If all frontends and xenbus are disabled, mini-os will run without needing to communicate with xenstore, making it suitable to run the xenstore daemon. The console frontend is not required for the initial console, only consoles opened via openpt or ptmx. 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>
* mini-os: use BSD sys/queue.h instead of Linux list.hIan Campbell2012-01-312-40/+41
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The latter is GPL which makes the whole of mini-os GPL rather than BSD as intended. In tree users are all GPL or GPL-compatible but we should fix this so that mini-os is BSD. Do so by using the same BSD sys/queue.h as we use in libxl. Tested with the builtin mini-os test app and qemu stubdomain, both of which appear to still function as expected. Move tools/libxl/external and the associated sed script to tools/include/xen-external to allow more sensible access from mini-os. Also add s/NULL/0/ in the sed script due to NULL not always being defined in stubdom code when mini-os/wait.h is included. As well as the obvious ABI changes there are a few API updates associated with the change: - struct rw_semaphore.wait_list is unused - remove_waiter needs to take the wait_queue_head The latter requires a qemu update, so there is also a QEMU_TAG update in this changeset. I sprinkled some extra-emacs local variables around the files I edited which didn't have them. I think this should be backported to the stable branches since external users of mini-os may have been mislead into thinking they could safely link mini-os against GPL-incompatible code. Signed-off-by: Ian Campbell <ian.campbell@citrix.com> Committed-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
* mini-os: lib/math.c: import FreeBSD 8 functionsSamuel Thibault2011-05-011-44/+65
| | | | | | | | | Import lib/math.c functions (and thus licence) from FreeBSD 8, and re-apply a few of our changes. Whitespaces left aside, this leads to almost no source change except s/int64_t/quad_t/ and s/uint64_t/u_quad_t/. Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
* mini-os: Fix printf.c licenceSamuel Thibault2011-05-011-38/+31
| | | | | | | | | Changeset df1348e72390 actually completely replaced the freebsd printf implementation with the Linux printf implementation. Further changes are extremely minor and thus don't pose IP issue. Fix the licence accordingly. Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
* minios: Fix bug/build problem introduced in c/s 22799John Weekes2011-01-271-3/+3
| | | | | | | | With "debug=n", "make stubdom" currently fails in xen-unstable. This patch addresses this through minor fixups. Signed-off-by: John Weekes <lists.xen@nuclearfallout.net> Acked-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
* libxl, minios: stubdom console based save/restoreStefano Stabellini2011-01-211-1/+38
| | | | | | | | | | | | | | | | Add two "special" PV consoles to stubdoms that are going to be used to send and receive the qemu-xen save files on save/restore. Use the second PV console to send the qemu-xen save file and the third PV console to receive the qemu-xen save file on restore. Fix the console shutdown function free_consfront that is called when the qemu save file is closed. Stubdom save/restore is still broken with xend. Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com> Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
* tools: remove fs-front/fs-backTim Deegan2011-01-111-208/+13
| | | | | | | | | | | | | | | | Its access controls are really not OK. In particular, it's not good for libxl, which stores per-VM config blobs in a directory that is exported to all VMs. This will break stub-qemu save/restore, which is the only user of fs-front that I'm aware of, but: - It's currently broken anyway (fs-back isn't run by default and crashes if it is run manually); and - Stefano has a plan to plumb qemu save records through a dedicated console channel instead. Signed-off-by: Tim Deegan <Tim.Deegan@citrix.com> Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
* stubdom/minios: use correct sized types for software floating pointSamuel Thibault2011-01-111-20/+16
| | | | | | | | | Replace long/int/short sizes with proper exact-size types for 64bit architectures. As well as making the code correct, this eliminates a compiler warning about an uninitialised variable. Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org> Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
* minios: reverse layering of xc vs minios fd closeKeir Fraser2010-12-031-7/+6
| | | | | | | | | | | | 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>
* libxc: eliminate static variables, use xentoollog; API changeKeir Fraser2010-05-281-2/+3
| | | | | | | | | | | | | | | | | | | | 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-2/+2
| | | | | | | 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>
* mini-os: Fix build error when !HAVE_LIBCKeir Fraser2009-12-181-1/+1
| | | | Signed-off-by: Yu Zhiguo <yuzg@cn.fujitsu.com>
* mini-os: Fix memory leaks in xs_read() and xs_write()Keir Fraser2009-12-111-0/+2
| | | | | | | | xenbus_read() and xenbus_write() will allocate memory for error message if any error occurs, this memory should be freed. Signed-off-by: Yu Zhiguo <yuzg@cn.fujitsu.com> Acked-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
* minios: xmalloc and realloc fixesKeir Fraser2009-10-291-3/+9
| | | | | | | | | - xmalloc currently faults if xmalloc_new_page fails due to OOM - realloc treats xmalloc_hdr.size as the size of just the data region rather than the total size of data region + headers + padding. From: James Pendergrass <James.Pendergrass@jhuapl.edu> Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
* minios: Optimize mmap(open("/dev/mem"))Keir Fraser2009-10-231-5/+2
| | | | | | | Set map_frames_ex's stride parameter to 0 and increment to 1 to avoid building an explicit list of mfns. Signed-Off-By: Samuel Thibault <samuel.thibault@ens-lyon.org>
* stubdom: mmap on /dev/mem supportKeir Fraser2009-10-211-1/+11
| | | | | | | | | | This patch adds support for mmap on /dev/mem in a stubdom; it is secure because it only works for memory areas that have been explicitly allowed by the toolstack (xc_domain_iomem_permission). Incidentally this is all that is needed to make MSI-X passthrough work with stubdoms. Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
* stubdom/minios: re-structure headersKeir Fraser2009-10-015-22/+22
| | | | | | | | | 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>
* minios: switch to C99 integer typesKeir Fraser2009-07-152-15/+15
| | | | | | This is a necessary step to make minios build on NetBSD. Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
* minios: Use posix_openpt() rather than non-standard openpty().Keir Fraser2009-06-181-2/+9
| | | | Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
* minios: support secondary guest consoles.Keir Fraser2009-06-171-3/+19
| | | | Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
* minios: implement ffs, ffsl and ffsll.Keir Fraser2009-05-281-0/+50
| | | | | | | | | | | The first function is compiled only in case minios is compiled without newlib, since newlib already provides an implementation for ffs. On the other hand ffsl and ffsll are always compiled because newlib misses those functions. This patch also provides an implementation for __ffsti2 and __ffsdi2 because they are needed by gcc in order to successfully link ffsll. Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
* minios: Implement some extra lib functions for ocaml xenstored stubdomKeir Fraser2009-05-191-0/+32
| | | | | | | We could stub them out as unsupported, but we may as well implement them as they are very simple. Signed-off-by: Alex Zeffertt <alex.zeffertt@eu.citrix.com>
* minios: Define extra stub functions to allow build of ocaml xenstored stubdomKeir Fraser2009-05-191-1/+58
| | | | | | | These are referenced by the libs that ocamlopt links xenstored to, but ought not actually get called. Signed-off-by: Alex Zeffertt <alex.zeffertt@eu.citrix.com>
* stubdom: drop lwip supportKeir Fraser2009-04-231-7/+9
| | | | | | | | | | | | | | | | | | | | Network support is still provided the same way: using the tap interface, created in qemu using netfront. The lwip stack is still available to avoid additional compilation issues. However the stubdom is not going to have its own vif anymore, this means that the only vnc server supported is the one in dom0. You can still enable the vnc server in a stubdom at compile time, if you want so. Probably the most important change caused by this patch to xen users is that you don't have to specify two vif in the stubdom config file anymore, but just one: -vif = [ '', 'ip=10.0.1.1,mac=aa:00:00:12:23:34'] +vif = ['ip=10.0.1.1,mac=aa:00:00:12:23:34'] Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
* minios: _chk_fail and _chk canaries for minios and newlibKeir Fraser2009-03-311-0/+8
| | | | | | | | Add __stack_chk_fail to mini-os and __sprintf_chk __fprintf_chk to newlib, to cope with ocaml runtimes compiled with -fstack-protector. From: "George S. Coker, II" <gscoker@alpha.ncsc.mil> Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
* minios: add ioremap/iounmapKeir Fraser2009-03-021-37/+5
| | | | | | | | Add ioremap and iounmap functions to minios. Also move some unmapping code from and clean up mem_test. Signed-off-by: Rolf Neugebauer <rolf.neugebauer@netronome.com> Acked-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
* minios: add a barebone net/if.hKeir Fraser2008-11-111-0/+7
| | | | | | | | net/if.h is a standard header but unfortunately lwip doesn't provide it for any target but linux. Therefore I am adding a net/if.h, with an empty implementation of the declared functions. Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
* mini-os: adding some missing posix function declarationsKeir Fraser2008-09-171-0/+1
| | | | | | | Adding some missing posix function declarations, to get rid of some qemu-remote compile time warnings. Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
* stubdom: fix munmap's update_va_mapping flag passing, thus fixingKeir Fraser2008-08-281-4/+7
| | | | | | INVLPG passing Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com>
* stubdom: add v?errx? and v?warnx? functionsKeir Fraser2008-08-271-0/+62
| | | | Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com>
* mini-os: Fix build failure with void* arithmetic.Keir Fraser2008-08-271-1/+1
| | | | Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
* stubdom: make munmap work in batches to fix stack overflowKeir Fraser2008-08-271-22/+32
| | | | Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com>
* stubdom: add syslog functionsKeir Fraser2008-08-271-0/+28
| | | | Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com>
* prefix mini-os lists with minios_, drop QEMU_ prefix from QEMU_LIST_*Keir Fraser2008-08-081-10/+10
| | | | | | That permits to reduce the amount of difference with upstream. Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com>
* stubdom: turn off_t 64bit on x86Keir Fraser2008-08-081-9/+0
| | | | | | | | We can decide to make off_t 64bit instead of implementing the LFS tricks. Name corresponding functions foo64 to permit simple caml programs linking. Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com>
* FSIF: extend protocol to multi-grant requests and multi-page ringKeir Fraser2008-08-011-4/+4
| | | | | | | To improve throughput and inline the stat response. Signed-off-by: Grzegorz Milos <gm281@cam.ac.uk> Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com>
* minios: Fix build on some gcc versions.Keir Fraser2008-07-241-0/+1
| | | | Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
* minios: grant table map (gntdev) for miniosKeir Fraser2008-07-241-0/+3
| | | | | | | | 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>
* stubdom: add functions for caml runtimeKeir Fraser2008-07-171-0/+7
| | | | Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com>