Commit Graph
60 Commits
Author SHA1 Message Date
Keir Fraser ca28885fa7 mini-os: export allocate_ondemand
allocate_ondemand can be used to allocate addresse space. Primarily
used for mapping MFNs, it can also be used e.g. to map grant refs.

Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com>
2008-07-18 15:45:06 +01:00
Keir Fraser 16519cc5e8 mini-os: add stack walking debug
Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com>
2008-07-18 14:09:14 +01:00
Keir Fraser 0e5b7a7991 stubdom: fixes for old gcc & binutils
Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com>
2008-07-11 15:37:31 +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 0e05d6cdd8 minios: do not systematically free the page under shared info, as the
guest booted by PV-GRUB will need it.

Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com>
2008-06-20 17:44:50 +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 dbd56b5c30 minios,stubdom: Add OBJ_DIR parameter to compile outside sources,
which permits to easily compile mini-os in various flavors. Also clean
some parts of stubdom build.

Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com>
2008-06-17 09:36:25 +01:00
Keir Fraser ac1bdbe7b9 minios can cope with >4G CR3 since it never uses it
Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com>
2008-06-12 09:24:35 +01:00
Keir Fraser ba65563c1b minios: Fix >4GB machine addresses
Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com>
2008-06-10 16:59:24 +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 28d2d07fde minios: We do not need to pin the page tables, as they implicitly get
pinned when we point the permanent page directory to them.

Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com>
2008-05-27 13:03:05 +01:00
Keir Fraser d18d24fd1e stubdom: fix constructors/destructors in 64bit mode
Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com>
2008-05-23 09:35:57 +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 cf6e75bd08 stubdom: support constructors and destructors
Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com>
2008-05-22 15:09:08 +01:00
Keir Fraser 84d54d5d8b i386: Remove non-PAE hypervisor build target.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2008-05-08 14:32:11 +01:00
Keir Fraser 5991224aff minios: fix and enforce block_domain atomicity
To ensure that the timer event is not lost, block_domain requires that
event delivery is disabled.  SCHEDOP_block re-enables them, so for
coherency (and fixing a bug actually), we should re-disable them
after. Also, make sure that the caller disabled them.

Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com>
2008-05-08 13:14:27 +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 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 eac4b98d11 minios: Fix ia64 build.
Signed-off-by: Akio Takebe <takebe_akio@jp.fujitsu.com>
2008-01-28 12:58:57 +00:00
Keir Fraser f567396727 minios: make allocation of page tables for ondemand mapping lazy
Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com>
2008-01-23 11:20:01 +00:00
Keir Fraser e8c1abd6e7 minios: POSIX fixes
Fixes some functions which are POSIX.  Also make them ifndef HAVE_LIBC.

Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com>
2008-01-22 14:20:22 +00:00
Keir Fraser dfba81d2fc minios: fix case when _text is not 0
Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com>
2008-01-22 11:35:26 +00:00
Keir Fraser afb13d4890 minios: make time interface POSIX
timespec uses tv_sec and tv_nsec too. gettimeofday takes a tz
argument.

Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com>
2008-01-21 11:20:27 +00:00
Keir Fraser 04383f9c0f minios: support COW for a zero page
Permits to support sparse data.
Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com>
2008-01-18 16:20:13 +00:00
Keir Fraser 4eb8e8dc04 minios: extend map_frames into being able to map a series of
contiguous frames, or the same frame several times, aligned, from
another domain, with specific protection, and with potential
failures.

Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com>
2008-01-18 15:22:42 +00:00
Keir Fraser c1ea56152a minios: set text and rodata read-only, free unused pages 0 and 1
Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com>
2008-01-18 15:22:17 +00:00
Keir Fraser 22e39d084e minios: make stack size configurable
Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com>
Signed-off-by: Grzegorz Milos <gm281@cam.ac.uk>
2008-01-17 14:41:44 +00:00
Keir Fraser 85b3f5270f mini-os: No -fpic when building for x86.
Signed-off-by: Samuel Thibault <samuel.thibault@citrix.com>
2007-12-04 10:11:54 +00:00
Keir Fraser 040d9d2287 [Mini-OS] Catch NULL dereferences
Unmap page 0 (only used early at boot) so as to catch NULL dereferences.

Signed-off-by: Samuel Thibault <samuel.thibault@citrix.com>
2007-11-28 12:42:17 +00:00
Keir Fraser 153bf11814 [Mini-OS] Permit x86_64 trap handlers to return
Trap handlers sometimes fix the problem, so they need to be able to
return.

Signed-off-by: Samuel Thibault <samuel.thibault@citrix.com>
2007-11-24 13:31:01 +00:00
Keir Fraser 9ebc5c7ea6 [Mini-OS] Make bind_virq return the port
Make bind_virq() return the port bound to the irq, which is useful
e.g. for masking/unmasking it.

Signed-off-by: Samuel Thibault <samuel.thibault@citrix.com>
2007-11-23 16:25:59 +00:00
Keir Fraser fd2f80c255 [Mini-OS] Fix x86 arch_switch_thread
Fix x86 arch_switch_thread by making it pure assembly.
There were missing general register clobbers for x86_64, and BP should
theorically be clobbered too, but gcc does not believe that, so the
only simple safe solution is to use pure assembly.

Signed-off-by: Samuel Thibault <samuel.thibault@citrix.com>
2007-11-23 16:23:28 +00:00
Keir Fraser bb44bead10 [Mini-OS] Fix stack closures
So as to make backtracing tools happy, correctly close x86 stacks for
new threads as well as on callback in the x86_32 case since there is
no unwind marker.

Signed-off-by: Samuel Thibault <samuel.thibault@citrix.com>
2007-11-23 16:22:36 +00:00
Keir Fraser 8d71c3dfb8 [Mini-OS] Fix x86 initial stack alignment
This fixes the initial stack alignment for x86, which is required for
current to return a fine NULL instead of a random value or possibly
crash during initialization.

Signed-off-by: Grzegorz Milos <gm281@cam.ac.uk>
Signed-off-by: Samuel Thibault <samuel.thibault@citrix.com>
2007-11-23 16:22:13 +00:00
Keir Fraser e602447874 minios: Remove unnecessary padding and unused sections from x86/64
linker script.
Signed-off-by: Keir Fraser <keir@xensource.com>
2007-09-25 10:12:49 +01:00
Alex Williamson 087b48842b merge with xen-unstable.hg 2007-08-12 14:50:02 -06:00
Tim Deegan 5c0ffac838 [MINIOS] fix x86_64 p2m map and CFLAGS
Signed-off-by: Tim Deegan <Tim.Deegan@xensource.com>
2007-08-02 09:02:08 +01:00
Alex Williamson a423930e0d [IA64][MINIOS] PKR support
- adds optimization feature for region 7 identity mapping
- adds protection keys to region 5 and region 7 addresses,
  may be used for testing the hypervisor protection key support

Signed-off-by: Dietmar Hahn <dietmar.hahn@fujitsu-siemens.com>
2007-07-30 18:14:29 -06:00
Alex Williamson e57246bd3a [MINIOS][IA64] mini-os without linux-optimization in hypervisor
Make mini-os runnable again without the special linux optimization for the
identity mapping in the hypervisor.

Signed-off-by: Dietmar Hahn <dietmar.hahn@fujitsu-siemens.com>
2007-06-26 16:24:41 -06:00
awilliam@xenbuild2.aw ebdb5845be merge with xen-unstable.hg 2007-03-20 15:19:38 -06:00
awilliam@xenbuild2.aw 52ae27be8a [IA64][MINIOS] Make Endian-ness build changeable on the command line
Now you can do 'BIGENDIAN=y make'

Signed-off-by: Alex Williamson <alex.williamson@hp.com>
2007-03-20 10:07:11 -06:00
awilliam@xenbuild2.aw 048f2c148c [IA64][MINIOS] Fixed some big-endian bugs and add HYPERVISOR_suspend
Signed-off-by: Dietmar Hahn <dietmar.hahn@fujitsu-siemens.com>
2007-03-20 09:51:45 -06:00
kfraser@localhost.localdomain 5f3c8af40d minios: Fix an extern declaration and add an extra 'const' to
definition of a constant set of constant error strings.
Issues identified by Armand Puccetti.
Signed-off-by: Keir Fraser <keir@xensource.com>
2007-03-15 15:27:08 +00:00
awilliam@xenbuild2.aw 5340bb29c5 [IA64][MINIOS] cleanup ia64_boot_paramP and add ARCH_LDFLAGS
Signed-off-by: Dietmar Hahn <dietmar.hahn@fujitsu-siemens.com>
2007-03-12 09:43:48 -06:00
awilliam@xenbuild2.aw 5ac1e3b0f0 merge with xen-unstable.hg 2007-03-07 12:38:28 -07:00
awilliam@xenbuild2.aw 097dd8288c [IA64][MINIOS] Make mini-os ia64 cross compile-able
Signed-off-by: Tristan Gingold <tgingold@free.fr>
2007-02-28 09:40:36 -07:00
awilliam@xenbuild2.aw 645be831a6 [IA64][MINIOS] Build fix
Fix specifier changed in common minios makerules.

Signed-off-by: Dietmar Hahn <dietmar.hahn@fujitsu-siemens.com>
2007-02-23 14:06:08 -07:00
awilliam@xenbuild2.aw 5a0cbf9162 merge with xen-unstable.hg 2007-02-20 12:58:22 -07:00
awilliam@xenbuild2.aw 8a9e0cc712 [IA64][MINIOS] Port of mini-os to ia64
ia64 specific parts of mini-os.

Minimal config:

# Kernel image file.
kernel = "mini-os.gz"
# Initial memory allocation (in megabytes) for the new domain.
memory = 64
# A name for your domain.
name = "Mini-OS"

Signed-off-by: Dietmar Hahn <dietmar.hahn@fujitsu-siemens.com>
2007-02-15 13:13:36 -07:00