Commit Graph

142 Commits

Author SHA1 Message Date
Alexander Boettcher 03ce614c23 base: add cpu_session parameter to thread creation
Fixes #1114
2014-04-14 12:32:31 +02:00
Christian Helmuth cd0d378142 Provide Genode version information in log
Fixes #551
2014-04-01 16:38:49 +02:00
Stefan Kalkowski 0dece91973 core: re-design memory allocator (fix #1091)
* Core_mem_allocator: implement Range_allocator interface
* Core_mem_allocator: allocate with page-granularity only
* Use slab allocators in core where meaningful (e.g. dataspace objects)
2014-03-18 14:24:55 +01:00
Sebastian Sumpf b4612d24ce base-linux: Repair hybrid programs
Do not link 'startup' and 'cxx' libraries against hybrid programs.
2014-02-28 10:11:12 +01:00
Martin Stein 4f0a75b0bc linux: clean-up lib-files of base and base-common
Issue #1042
2014-02-25 14:58:08 +01:00
Martin Stein 523791b361 base: generic implementation of Context_allocator
ref #989
2014-02-25 14:58:05 +01:00
Martin Stein 0b64328944 base: setup thread object for main thread in CRT0
For a main thread a thread object is created by the CRT0 before _main gets
called so that _main can already run in a generic environment that, e.g.,
catches stack overflows as a page-fault instead of corrupting the BSS.
Additionally dynamic programs have only one CRT0 - the one of the LDSO -
which does the initialization for both LDSO and program.

ref #989
2014-02-25 14:58:05 +01:00
Christian Prochaska 4b420f6e71 Fix stack pointer alignment for x86_64 platforms
The x86_64 ABI requires the stack pointer to be 16-byte aligned before the
call of a function and decreased by 8 at the function entrypoint (after
the return address has been pushed to the stack).

Currently, when a new Genode thread gets created, the initial stack
pointer is aligned to 16 byte. On Genode/Linux, the thread entry function
is entered by a 'call' instruction, so the stack pointer alignment at the
function entrypoint is correct. On Fiasco.OC and NOVA, however, the thread
entry function gets executed without a return address being pushed to the
stack, so at the function entrypoint the stack pointer is still aligned to
16 byte, which can cause problems with compiler-generated SSE
instructions.

With this patch, the stack pointer given to a new thread gets aligned to
16 bytes and decreased by 8 by default, since most of the currently
supported base platforms execute the thread entry function without pushing
a return address to the stack. For base-linux, the stack pointer gets
realigned to 16 bytes before the thread entry function gets called.

Fixes #1043.
2014-02-03 11:34:30 +01:00
Christian Helmuth 3234e4f775 Make Deallocator::need_size_for_free() pure virtual 2014-01-30 10:05:43 +01:00
Christian Prochaska ddc79d5563 base-linux: fix race condition in IPC code
Fixes #1013.
2014-01-27 18:54:09 +01:00
Stefan Kalkowski 5447c406e5 thread: rearrange thread context management
Use a bit allocator for the allocation management of thread contexts,
instead of holding allocation information within the Thread_base objects,
which lead to race conditions in the past.

Moreover, extend the Thread_base class interface with the ability to
to add additional stacks to a thread, and associate the context they're
located in with the corresponding Thread_base object. Additional stacks
can be used to do user-level scheduling with stack switching, without breaking
Genode's API.

Fixes #1024
Fixes #1036
2014-01-27 18:54:09 +01:00
Christian Helmuth 7e517179c9 Unify stack alignment among all platforms
The alignment is now done in Thread_base::Context. Implementations are
forced to use Context::stack_top(), which aligns the stack top.
2014-01-27 18:54:08 +01:00
Christian Prochaska ca9ae43e50 base-linux: round up RM session size to page size
Since RM sessions can be used as dataspaces and dataspace sizes are
supposed to have page granularity, RM session sizes should have page
granularity, too.

Fixes #972.
2013-11-26 14:32:08 +01:00
Christian Helmuth eda44d6154 base-linux: hybrid file-system server
The current implementation is missing support for symbolic links.

Fixes #944.
2013-11-26 14:32:06 +01:00
Alexander Boettcher a6af6c80ab base: count caps replied by a rpc function
Issue #905
2013-11-18 11:01:45 +01:00
Martin Stein ee5d213c1f base: do not allow unnamed threads
fix #901
2013-10-22 08:00:07 +02:00
Christian Prochaska 8a2e543b69 run: use 'wait_for_output' for Linux, too
With this patch, the Linux-specific 'run_genode_until' function uses
'wait_for_output' as it gets already used for other run targets.

Fixes #863.
2013-10-17 11:02:23 +02:00
Christian Helmuth f845be8c23 base-linux: support hybrid mode in lx_rmap test
In hybrid mode, all programs are dynamic executables and ld.lib.so is
not supported. Therefore, only the "static" variant of the test can be
build and executed.
2013-10-16 09:26:11 +02:00
Norman Feske 65c4246f95 base/env: Implementation of 'Expanding_parent' 2013-10-14 09:45:14 +02:00
Norman Feske ae40cb545c base: Unify 'Platform_env' across platforms 2013-10-05 12:44:36 +02:00
Stefan Kalkowski 339193a887 Linux: compile lx_hybrid_ctors test for correct ARCH
Fixes #900
2013-10-04 10:13:07 +02:00
Christian Helmuth 385b7cdd31 base-linux: revised region management
Revised region management detects region conflicts by using _soft_
mappings per default. Overmapping is activated for population of managed
dataspaces only. For more information see header documentation of
base-linux/src/base/env/rm_session_mmap.cc.

Fixes #883.
2013-09-26 15:07:08 +02:00
Christian Helmuth f763e5ec2a Move main bootstrap to platform-specific object
To prevent multiple execution of main-bootstrap, I moved the code to a
statically initialized object. The reason for this change is that
_main() is exeuted twice when starting dynamic binaries. Now, the object
is part of the base-common library which is linked with ld.lib.so.
2013-09-26 15:00:16 +02:00
Christian Helmuth a7c5417369 base-linux: ld.lib.so loads dynamic binaries
For ARM support on N900, commit 4a9b1c6 changed the process library to
start dynamic binaries directly depending on the Linux kernel to comply
to the interp section info ("ld.lib.so"). This seems not required on
more recent platforms or kernel versions and also introduced challenging
corner cases in region handling on Linux. Therefore, this commit
restores the original behavior.
2013-09-24 09:44:32 +02:00
Christian Prochaska b0bfe6bfa7 base-linux: fix ELF dataspace execution
With this patch, if an ELF dataspace to be executed does not have a path
in the host file system, the dataspace content gets copied into a
temporary file whose path can be given to 'execve()'.

Fixes #879.
2013-09-23 14:26:00 +02:00
Christian Prochaska 3e8e55ec16 CPU affinity configuration fixes
- if no affinity was set for a new thread before calling
  Cpu_session::start(), the CPU session's affinity gets set for this
  thread
- documentation fix: <affinity_space> -> <affinity-space>

Fixes #873.
2013-09-02 19:43:36 +02:00
Josef Söntgen 32e3eee48c linux: add expanding Cpu_session_client 2013-08-15 09:22:48 +02:00
Norman Feske 149356f7ab core: TRACE service interface and implementation 2013-08-15 09:22:47 +02:00
Norman Feske fe4a6d7d81 base: User-level tracing support 2013-08-14 18:43:19 +02:00
Norman Feske a2b15349fd base: Add tracing support to CPU session interface 2013-08-13 17:27:40 +02:00
Christian Prochaska fd11bd489e base: increase maximum file name length
This patch increases the maximum file name length to support
'qt5_qnitpickerviewwidget.lib.so'.

Issue #345.
2013-08-13 17:08:26 +02:00
Norman Feske 35723d813d core: evaluate CPU session affinity argument 2013-08-13 17:08:25 +02:00
Norman Feske 6d837c9e26 Attach affinity information to session requests
This patch extends the 'Parent::session()' and 'Root::session()'
functions with an additional 'affinity' parameter, which is inteded to
express the preferred affinity of the new session. For CPU sessions
provided by core, the values will be used to select the set of CPUs
assigned to the CPU session. For other services, the session affinity
information can be utilized to optimize the locality of the server
thread with the client. For example, to enable the IRQ session to route
an IRQ to the CPU core on which the corresponding device driver (the IRQ
client) is running.
2013-08-13 17:08:25 +02:00
Norman Feske 5fe29e8e4a Express affinities via Cartesian coordinates
This patch introduces new types for expressing CPU affinities. Instead
of dealing with physical CPU numbers, affinities are expressed as
rectangles in a grid of virtual CPU nodes. This clears the way to
conveniently assign sets of adjacent CPUs to subsystems, each of them
managing their respective viewport of the coordinate space.

By using 2D Cartesian coordinates, the locality of CPU nodes can be
modeled for different topologies such as SMP (simple Nx1 grid), grids of
NUMA nodes, or ring topologies.
2013-08-13 17:08:24 +02:00
Alexander Boettcher 4dd9172888 run: add success message to lx_hybrid_pthread_ipc 2013-07-11 12:44:24 +02:00
Christian Prochaska c962240922 crt0 cleanup
- use the generic 'crt0.s' for Linux
- move the read-only '__dso_handle' definition into the '.text' section
- move the '__initial_sp' definition into the '.bss' section
- remove the '_main_utcb' definition

Part of #766.
2013-07-05 12:37:43 +02:00
Josef Söntgen dad3f32d0b linux: thread name wrongly truncated by one byte
The terminating NUL char was not considerd in the calculation of
the space needed for storing the string.

Fixes #790.
2013-07-05 12:37:42 +02:00
Christian Prochaska 4a9b1c6aab base-linux: add ARM support
This patch introduces a new platform 'linux_arm' for building and running
Genode/Linux on an ARM device.

Known limitations:

- libc 'setjmp()'/'longjmp()' doesn't currently save/restore floating
  point registers

Fixes #746.
2013-05-24 14:55:37 +02:00
Alexander Boettcher 2a761c7fea run: extend genode_until_run by a spawn id
genode_until_run can be called now with a spawn id to able to reattach to a
spawned process (amt, serial output). Run scripts can now call genode_until_run
multiple times.
2013-05-08 09:42:44 +02:00
Norman Feske c54fef9274 Add missing route to lx_uid.run 2013-05-07 21:56:07 +02:00
Norman Feske 0355591445 lx_hybrid: Safety check when freeing thread
Try to free the metadata of a thread only if created by Genode. The code
did not cause any actual problems. I just stumbled over the inconsistency
while reviewing the code.
2013-05-07 21:56:06 +02:00
Norman Feske 5d969cffaf base-linux: Fix condition in ~Reply_channel
Issue #717
2013-05-07 21:56:06 +02:00
Norman Feske e39ff055ba base-linux: Fix use-after-free problem of ds fds
Fixes #717
2013-05-07 21:56:06 +02:00
Norman Feske 6f294eddc2 Fix warning about initializer of 'Local_addr'
Fixes #726
2013-05-06 11:11:03 +02:00
Christian Prochaska a99193ad90 Rework the internal lock interface
With this patch, the 'futex' syscall gets used for blocking and unblocking
of threads in the Linux-specific lock implementation.

The 'Native_thread_id' type, which was previously used in the
lock-internal 'Applicant' class to identify a thread to be woken up,
was not suitable anymore for implementing this change. With this patch,
the 'Thread_base*' type gets used instead, which also has the positive
effect of making the public 'cancelable_lock.h' header file
platform-independent.

Fixes #646.
2013-02-25 22:14:21 +01:00
Norman Feske 26e8e0ebdd Add the 'cxx' lib in base.mk for 64-bit Linux
This is a follow-up fix for fae63f4fa9.
Thanks to Christian Prochaska for the patch.
2013-02-25 16:45:49 +01:00
Torsten Hilbrich ab89304ffd base-linux: Don't busywait if lx_pollpid returns 0
This happened when I killed one of the genode clients which was
tracked via an expception_handler. In this case the wait4 syscall
returned 0 and the for(;;) was looped eternally. This caused an
100% CPU utilization for the core binary.
2013-02-25 16:45:49 +01:00
Torsten Hilbrich 257cf4800d Fixed some unused parameters warnings
They cause problems when using -Werror in your compilation.
2013-02-25 16:45:49 +01:00
Martin Stein 0f8803245a base: make signal framework usable for base-hw
ref #641
2013-02-22 20:28:28 +01:00
Norman Feske fae63f4fa9 Merge base libraries into a single library
This patch simplifies the way of how Genode's base libraries are
organized. Originally, the base API was implemented in the form of many
small libraries such as 'thread', 'env', 'server', etc. Most of them
used to consist of only a small number of files. Because those libraries
are incorporated in any build, the checking of their inter-dependencies
made the build process more verbose than desired. Also, the number of
libraries and their roles (core only, non-core only, shared by both core
and non-core) were not easy to capture.

Hereby, the base libraries have been reduced to the following few
libraries:

- startup.mk contains the startup code for normal Genode processes.
  On some platform, core is able to use the library as well.
- base-common.mk contains the parts of the base library that are
  identical by core and non-core processes.
- base.mk contains the complete base API implementation for non-core
  processes

Consequently, the 'LIBS' declaration in 'target.mk' files becomes
simpler as well. In the most simple case, only the 'base' library must
be mentioned.

Fixes #18
2013-02-19 14:45:55 +01:00