Commit Graph
33 Commits
Author SHA1 Message Date
John McDermott 299466515f mini-os: stop compiler complaint about unused variables
gcc (GCC) 4.6.2 20111027 (Red Hat 4.6.2-1) complains about unused variables
in mini-os drivers

Signed-off-by: John McDermott <john.mcdermott@nrl.navy.mil>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
2012-02-09 16:03:05 +00:00
Gianni Tedesco c761b54d7c minios: use constant expression to size arrays
Fixes a compile error in gcc-4.5 which is the reason __CONST_RING_SIZE()
was introduced. Let's just use it in minios netfront.

Signed-off-by: Gianni Tedesco <gianni.tedesco@citrix.com>
Acked-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
2011-01-07 18:01:18 +00:00
Samuel Thibault 0ad4600ac7 MiniOS: Fix continue; in netfront receive loop
To properly ignore some requests through the use of continue;, indexes need to
be updated.

Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
committer: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
2010-10-12 10:27:56 +01:00
Keir Fraser 7203b89c15 mini-os: Revert 21106:b20f897d6010 "Fix xenbus initialisation"
Jeremy Fitzhardinge (jeremy@goop.org) reports that this fixes HVM+stubdom.

Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2010-05-04 12:15:28 +01:00
Keir Fraser 15d5739ea9 mini-os: Fix crash on frontend shutdown failures
Do not free frontend resources if some error happened, since the
backend may not have finished properly restarting in such case.

Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
2010-04-07 08:16:15 +01:00
Keir Fraser 42e3a21b11 mini-os: Fix frontend shutdown wait loop
minios frontends must wait for backends to be shut down and
reinitialized before freeing resources.

Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
2010-04-07 08:15:55 +01:00
Keir Fraser 453c7b6442 mini-os: Fix xenbus initialisation
This fixes xenbus initialization of blkfront, netfront and pcifront
by uniformizing with fbfront: after writing parameters, set state to
initialised, then wait for backend to switch to connect state, and
then only read its parameter and switch to the connect state.

Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
2010-04-06 07:13:19 +01:00
Keir Fraser 453414b284 mini-os: Fix memory leaks in blkfront, netfront, pcifront, etc.
The return value of Xenbus routines xenbus_transaction_start(),
xenbus_printf(), xenbus_transaction_end(), etc.  is a pointer of error
message.  This pointer should be passed to free() to release the
allocated memory when it is no longer needed.

Signed-off-by: Yu Zhiguo <yuzg@cn.fujitsu.com>
2009-12-14 09:51:07 +00:00
Keir Fraser 375f53964b minios: Fix xenbus_unwatch_path calls
In a lot of places in MiniOS frontends, xenbus_watch_path_token is
used instead of xenbus_watch_path to get more precise wake ups.  To
free those, xenbus_unwatch_path_token has to be used instead of
xenbus_unwatch_path, else the unwatch operation will fail.  This fixes
spurious watch events left by pv-grub.

Signed-Off-By: Samuel Thibault <samuel.thibault@ens-lyon.org>
2009-11-23 07:21:58 +00: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 8323478d5b minios: refactor xenbus state machine
Implement xenbus_wait_for_state_change and xenbus_switch_state and
change the various frontends to use the two functions and do proper
error checking.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
2009-06-03 11:09:14 +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 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 639f3f1a22 minios: fix add_id_to_freelist(0)
add_id_to_freelist(0) would make get_id_from_freelist() always return 0.

Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com>
2008-06-20 17:45:23 +01:00
Keir Fraser a2c7db64f5 Add PV-GRUB
This fetches GRUB1 sources, applies the {graphical, print function,
save default, and ext3_256byte} patches from debian, and applies a
patch to make it work on x86_64 and port it to Mini-OS.  By using
libxc, PV-GRUB can then "kexec" the loaded kernel from inside the
domain itself, hence permitting to avoid the security-concerned
pygrub.

Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com>
2008-06-18 09:36:47 +01:00
Keir Fraser 0a9b2d786b stubdom: fix using minios frontends directly when libc is actived
Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com>
2008-06-18 09:32:50 +01:00
Keir Fraser c68ffdc4fa minios: add proper shutdown facilities
Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com>
2008-06-09 13:26:30 +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 cc489fb3c4 minios: fix thread safety of xenbus watches by requiring callers to
provide their own queue of events, because else we can not dispatch to
watchers running in parallel.

Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com>
2008-05-06 13:34:52 +01:00
Keir Fraser aecea1aa65 minios: more assertions
- assert that we never allocate or free the same grant twice
- assert that network packets do not exceed a page
- assert that incoming network event IDs make sense

Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com>
2008-03-26 13:13:50 +00:00
Keir Fraser df4e524d8d minios: Automatically set IP from XenStore information
Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com>
2008-03-19 16:20:14 +00:00
Keir Fraser b9d1950675 minios: Fix lost events
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>
2008-03-18 11:29:18 +00:00
Keir Fraser 0243b256d6 Add stubdomain support. See stubdom/README for usage details.
- 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>
2008-02-12 14:35:39 +00:00
Keir Fraser 563f5ebfcc minios: Support net/block backend in domU
Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com>
2008-02-07 09:15:59 +00:00
Keir Fraser bdd22133fc minios: support several netfronts
Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com>
2008-01-17 15:50:48 +00:00
Keir Fraser 08d9a2612a minios: add xenbus token support and separate watch event queues
Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com>
2008-01-17 15:20:02 +00:00
Keir Fraser 1c0c172695 [Mini-OS] Make gnttab allocation/free safe
Add a semaphore to protect gnttab_list from exhaustion, and disable
callbacks during allocation/free.  Fix the network frontend accordingly.

Signed-off-by: Samuel Thibault <samuel.thibault@citrix.com>
2007-11-28 12:40:57 +00:00
Keir Fraser cf64298141 [Mini-OS] Fix netfront xmit overflow
Fix xmit overflow by making netfront_xmit sleep until
network_tx_buf_gc() frees an xmit request.

Signed-off-by: Samuel Thibault <samuel.thibault@citrix.com>
2007-11-24 13:28:54 +00:00
Keir Fraser 051f29b827 [Mini-OS] Fix net backend path leak
Free backend path after use.

Signed-off-by: Samuel Thibault <samuel.thibault@citrix.com>
2007-11-24 13:28:27 +00:00
kfraser@localhost.localdomain 15587769c8 minios: Fix netfront for ia64.
Signed-off-by: Dietmar Hahn <dietmar.hahn@fujitsu-siemens.com>
2007-02-06 23:12:59 +00:00
kaf24@localhost.localdomain 9e73f98968 minios : netfront driver fixes.
- Handle returned backend==NULL || mac==NULL, this leads sometimes to a crash.
- Remove unnecessary (and bogus) initialisation of np->rx.req_prod_pvt

Signed-off-by: Dietmar Hahn <dietmar.hahn@fujitsu-siemens.com>
Signed-off-by: Keir Fraser <keir@xensource.com>
2007-01-26 13:51:00 +00:00
kfraser@localhost.localdomain 2b68aee829 [MINIOS] Fix compile warnings with -O.
Signed-off-by: Dietmar Hahn <dietmar.hahn@fujitsu-siemens.com>
2007-01-19 15:08:15 +00:00
kfraser@localhost.localdomain 2cf1159751 [MINIOS] Implement a network frontend driver.
Signed-off-by: Jacob Gorm Hansen <jacobg@diku.dk>
2007-01-12 15:18:24 +00:00