Commit Graph
76 Commits
Author SHA1 Message Date
Samuel Thibault 6f9d5eaa91 mini-os: lib/math.c: import FreeBSD 8 functions
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>
2011-05-01 10:10:12 +01:00
Samuel Thibault a6ca982881 mini-os: Fix printf.c licence
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>
2011-05-01 10:09:47 +01:00
John Weekes b920b2c761 minios: Fix bug/build problem introduced in c/s 22799
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>
2011-01-27 09:37:19 +00:00
Stefano Stabellini 648429dc40 libxl, minios: stubdom console based save/restore
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>
2011-01-21 18:06:23 +00:00
Tim Deegan afadd6ac31 tools: remove fs-front/fs-back
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>
2011-01-11 18:13:44 +00:00
Samuel Thibault 53424cba44 stubdom/minios: use correct sized types for software floating point
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>
2011-01-11 16:30:15 +00:00
Keir Fraser d5c277ab26 minios: reverse layering of xc vs minios fd close
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>
2010-12-03 06:37:48 +00: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 6127bd73bd minios: implement xc_map_foreign_bulk
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>
2010-01-18 14:48:18 +00:00
Keir Fraser 963bce5e3c mini-os: Fix build error when !HAVE_LIBC
Signed-off-by: Yu Zhiguo <yuzg@cn.fujitsu.com>
2009-12-18 07:31:02 +00:00
Keir Fraser feb567f210 mini-os: Fix memory leaks in xs_read() and xs_write()
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>
2009-12-11 09:01:15 +00:00
Keir Fraser 4e69eb152e minios: xmalloc and realloc fixes
- 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>
2009-10-29 08:34:51 +00:00
Keir Fraser bee72b5893 minios: Optimize mmap(open("/dev/mem"))
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>
2009-10-23 09:59:45 +01:00
Keir Fraser 05ec439680 stubdom: mmap on /dev/mem support
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>
2009-10-21 16:08:28 +01:00
Keir Fraser 643898034e stubdom/minios: re-structure headers
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>
2009-10-01 12:28:54 +01:00
Keir Fraser 0df54d9807 minios: switch to C99 integer types
This is a necessary step to make minios build on NetBSD.

Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
2009-07-15 09:09:48 +01:00
Keir Fraser 8f771d00bf minios: Use posix_openpt() rather than non-standard openpty().
Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
2009-06-18 10:19:25 +01:00
Keir Fraser c12b25aa7d minios: support secondary guest consoles.
Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
2009-06-17 07:22:18 +01:00
Keir Fraser 7f1f6b865b minios: implement ffs, ffsl and ffsll.
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>
2009-05-28 09:41:59 +01:00
Keir Fraser 0e57a92cc3 minios: Implement some extra lib functions for ocaml xenstored stubdom
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>
2009-05-19 14:15:43 +01:00
Keir Fraser c1861bc6f8 minios: Define extra stub functions to allow build of ocaml xenstored stubdom
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>
2009-05-19 14:14:41 +01:00
Keir Fraser 82ed447498 stubdom: drop lwip support
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>
2009-04-23 12:19:14 +01:00
Keir Fraser 1ecaba192c minios: _chk_fail and _chk canaries for minios and newlib
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>
2009-03-31 11:36:11 +01:00
Keir Fraser 6976b9a7c2 minios: add ioremap/iounmap
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>
2009-03-02 10:50:59 +00:00
Keir Fraser a1ffd2d114 minios: add a barebone net/if.h
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>
2008-11-11 11:03:58 +00:00
Keir Fraser 9a744273ce mini-os: adding some missing posix function declarations
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>
2008-09-17 13:10:36 +01:00
Keir Fraser e388539d78 stubdom: fix munmap's update_va_mapping flag passing, thus fixing
INVLPG passing

Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com>
2008-08-28 13:09:02 +01:00
Keir Fraser 7e0fe5d8f4 stubdom: add v?errx? and v?warnx? functions
Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com>
2008-08-27 14:57:51 +01:00
Keir Fraser 1583e7e448 mini-os: Fix build failure with void* arithmetic.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2008-08-27 13:31:01 +01:00
Keir Fraser fe2998c24a stubdom: make munmap work in batches to fix stack overflow
Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com>
2008-08-27 09:47:24 +01:00
Keir Fraser 6c5aecbf01 stubdom: add syslog functions
Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com>
2008-08-27 09:45:42 +01:00
Keir Fraser a9c83dc720 prefix mini-os lists with minios_, drop QEMU_ prefix from QEMU_LIST_*
That permits to reduce the amount of difference with upstream.

Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com>
2008-08-08 10:48:48 +01:00
Keir Fraser 168d8692c8 stubdom: turn off_t 64bit on x86
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>
2008-08-08 10:45:30 +01:00
Keir Fraser e5ba23a1d9 FSIF: extend protocol to multi-grant requests and multi-page ring
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>
2008-08-01 09:37:10 +01:00
Keir Fraser b45184b0fc minios: Fix build on some gcc versions.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2008-07-24 17:33:40 +01:00
Keir Fraser 7d0b678231 minios: grant table map (gntdev) for minios
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>
2008-07-24 14:14:27 +01:00
Keir Fraser 9415ef36a1 stubdom: add functions for caml runtime
Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com>
2008-07-17 13:21:37 +01:00
Keir Fraser 5c53e82c3f stubdom: add stub functions to reduce qemu patches
Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com>
2008-07-09 15:58:20 +01:00
Keir Fraser d6521a015d stubdom: fix copy/paste typo in select()
Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com>
2008-07-08 16:12:23 +01:00
Keir Fraser ce5c899f22 stubdom: use host's gcc
This makes stubdom use the host's gcc instead of downloading/compiling
binutils+gcc.  That requires a bunch of changes and even uncovered a
few bugs, but saves a lot of time.

Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com>
2008-07-04 17:47:11 +01:00
Keir Fraser b4e6f01f78 stubdom: fix libc-verbose non-lwip compilation
Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com>
2008-06-30 09:51:34 +01:00
Keir Fraser 2aba927207 stubdom: permit compilation without lwip
Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com>
2008-06-09 09:46:32 +01:00
Keir Fraser e49b738ccf stubdom: Add console reading support
Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com>
2008-06-03 09:32:50 +01:00
Keir Fraser b9920f5849 minios: Fix width of shifted 1
Shifting 1 more that 32 bits requires 1 to be long-typed.

Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com>
2008-05-24 09:24:25 +01:00
Keir Fraser 8543c562dd stubdom: complete libxc support
Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com>
2008-05-23 09:35:23 +01:00
Keir Fraser 8e3629845c minios: free netfront resources on error/shutdown
Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com>
2008-05-12 10:36:27 +01:00
Keir Fraser de239d043f pvfb/ioemu: transmit refresh interval advice from backend to frontend
which permits the frontend to avoid useless polls.

Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com>
2008-05-12 10:10:03 +01:00
Keir Fraser 28baa78877 stubdom: sparse application's BSS by linking it separately first, put
markers at its beginning and end, and then link with mini-os.
That permits to stick a bit more to upstream qemu.

Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com>
2008-04-16 10:05:57 +01:00
Keir Fraser 30860b6fe5 minios: Fix xfree() bug.
It has to check first if the memory to free is so big as to be freed
directly by free_pages. mini-os domains crash without this patch if
vfb is misconfigured.

Signed-off-by: INAKOSHI Hiroya <inakoshi.hiroya@jp.fujitsu.com>
2008-04-02 15:32:13 +01:00
Keir Fraser ac23908a0d stubdom: fix compilation
Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com>
2008-03-19 16:21:01 +00:00