Commit Graph

261 Commits

Author SHA1 Message Date
Martin Stein
901b3e2bb4 hw: ease usage of the kernel log
ref #989
2014-02-25 14:58:02 +01:00
Christian Helmuth
3234e4f775 Make Deallocator::need_size_for_free() pure virtual 2014-01-30 10:05:43 +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
Martin Stein
49eeb485d9 hw: mark caller when printing an activity-table
ref #989
2013-12-20 14:48:06 +01:00
Martin Stein
906b4dc90a hw: format fix in activity table
ref #989
2013-12-20 14:48:06 +01:00
Martin Stein
f4bd2368f6 hw: cancel unresolved faults before pager dissolve
If an RM client gets dissolved the RM server tries to first
dissolve and then destruct the according pager object. As pager objects
previously cancelled unresolved faults only in destructor the dissolve
operation blocked forever when an unresolved fault existed.
As every pager object should get dissolved before it gets destructed
(signal-context complains otherwise) no more unresolved-fault cancelling
is needed in the destructor.

ref #989
2013-12-20 14:48:06 +01:00
Martin Stein
8eef91f2ac hw: do not block on destruction of signal receiver
As synchronization of signal contexts is now the users business instead of
cores and the signal framework ensures that every context of a receiver gets
synchronously destructed before the destruction of the receiver itself
synchronization and thus blocking at the destruction of a kernel
receiver-object isn't necessary anymore.

ref #989
2013-12-20 14:48:06 +01:00
Martin Stein
1c8c30e1f4 hw: sync signal contexts directly as user
Kernel::signal_context_kill can be used by any program to halt the processing
of a signal context synchronously to prevent broken refs when core destructs
the according kernel object. In turn, Kernel::bin_signal_context doesn't block
anymore and destructs a signal context no matter if there are unacknowledged
signals. This way, cores entrypoint doesn't depend on signal acks of a
untrustworthy client anymore.

ref #989
2013-12-20 14:48:06 +01:00
Martin Stein
2bdf0e70e9 hw: fix bug in Kernel::Thread::_print_activity
ref #989
2013-12-20 14:48:06 +01:00
Martin Stein
3bdf70f771 hw: rename kill_* functions in bin_*
In the future bin_* means the direct destruction of a kernel object
without any blocking. kill_* in contrast is used for bringing a
kernel object such as signal contexts synchronized into a sleeping
state from where they can be destructed without the risk of getting
broken refs in userland.

ref #989
2013-12-20 14:48:06 +01:00
Martin Stein
6aa0ab1bf9 hw: communicate UTCB dataspace through start info
To remap its UTCB to its context area later, a main thread needs
to know the according dataspace capability. This is done through
the start-info it receives from its creator at startup.

ref #989
2013-12-20 14:48:05 +01:00
Martin Stein
42f51cd802 hw: use core-PD class to prevent singleton clashes
ref #989
2013-12-20 14:48:05 +01:00
Martin Stein
77130a9404 hw: replace unsynchronized by unmanaged singleton
ref #989
2013-12-20 14:48:05 +01:00
Stefan Kalkowski
7b49dbf2f3 hw: basic support for ODROID XU board (Fix #991) 2013-12-03 11:30:07 +01:00
Martin Stein
31b4062688 hw: optionally provide activity table on RM faults
ref #964
2013-12-03 08:33:25 +01:00
Martin Stein
f356ad2bdf hw: print activity table via Kernel::print_char(0)
ref #964
2013-12-03 08:33:25 +01:00
Martin Stein
e35d7c979f hw: IPC nodes provide protected accessors
ref #964
2013-12-03 08:33:25 +01:00
Martin Stein
16d48eaf1e hw: signalling roles provide protected accessors
ref #964
2013-12-03 08:33:25 +01:00
Martin Stein
da116c66ba hw: public access to idle item of a scheduler
ref #964
2013-12-03 08:33:25 +01:00
Martin Stein
b5922fb7f1 hw: dissolve signal context in Pager_entrypoint
ref #964
2013-12-03 08:33:24 +01:00
Martin Stein
54610247ad hw: don't communicate main-thread UTCB via SP
When using the initial SP of a main thread for the UTCB
startup-argument, fork_trampoline in libc_noux gets broken.
The function expects the SP to be initialized already in contrast
to the _start function in crt0.s that is called for processes that
are not forked. As the main-thread UTCB is located at the same virtual
address for every PD anyways, we can circumvent this problem by
defining it statically.

ref #964
2013-12-03 08:33:24 +01:00
Martin Stein
2b8e5d7b19 hw: turn Native_utcb into restrictive class
fix #958
2013-12-03 08:33:24 +01:00
Martin Stein
5e3d505ef4 hw: bin stupid case in Thread::_await_ipc_failed
ref #958
2013-12-03 08:33:24 +01:00
Martin Stein
dc8cbbf022 hw: rename Startup_msg in Start_info
ref #958
2013-12-03 08:33:24 +01:00
Martin Stein
4359b99c4f hw: rename Ipc_msg in Message
ref #958
2013-12-03 08:33:23 +01:00
Martin Stein
575a81a633 hw: turn Ipc_msg into restrictive class
ref #958
2013-12-03 08:33:23 +01:00
Martin Stein
f128a52e8b hw: get rid of struct Msg and Msg::Type
Struct Msg was introduced due to the handling of pagefaults
and interrupts via synchronous IPC. Its only purpose was to provide
the message type in front of the typed message. Now pagefaults and
interrupts are handled via signals and struct Msg is not necessary
anymore.

ref #958
2013-12-03 08:33:23 +01:00
Martin Stein
d46b30a711 hw: clarify names of messaging kernel-calls
ref #958
2013-12-03 08:33:23 +01:00
Stefan Kalkowski
c70bc350e8 tz_vmm: make scenario reproducible by everyone 2013-11-28 08:22:25 +01:00
Stefan Kalkowski
23ce6dad50 hw_vea9x4: re-enable TrustZone support 2013-11-28 08:22:25 +01:00
Stefan Kalkowski
7bf73fb0c1 hw_imx53: use same link address with or without TZ 2013-11-28 08:22:25 +01:00
Martin Stein
2124b4b9c2 hw_panda: provide EHCI interrupt for USB driver
fix #981
2013-11-28 08:22:24 +01:00
Martin Stein
9bca6bfb0d hw: provide Signal_context::submit
fix #980
2013-11-28 08:22:24 +01:00
Martin Stein
4697e0e07d hw: make bootstrap save against multiple calls
In programs with dynamic linker, _main and thus also platform_main_bootstrap
are called twice. By now, platform_main_bootstrap tried to always access the
startup message in the UTCB of the main thread that gets overridden till the
second call.

fix #967
2013-11-26 14:32:07 +01:00
Martin Stein
5b90113d86 hw: no default values for kernel-call args
ref #967
2013-11-26 14:32:07 +01:00
Martin Stein
07aa56fffb hw: re-add priority down-scaling
This is a follow-up commit for "hw: beautify scheduling-priority code".

ref #960
2013-11-25 09:50:27 +01:00
Norman Feske
1d5c11c7af rpi: Allow the access to videocore memory as MMIO 2013-11-25 09:46:09 +01:00
Norman Feske
5b5ea76039 hw_rpi: Hand out IRQ for USB host controller 2013-11-25 09:46:08 +01:00
Stefan Kalkowski
ae5e5cefc1 hw: initialize sctrl register appropriately
Fixes #916
2013-11-25 09:46:08 +01:00
Stefan Kalkowski
6f136bef7a hw: add TrustZone support for i.MX53 (ref #954) 2013-11-25 09:46:08 +01:00
Stefan Kalkowski
238430a362 hw: save MMU registers for TrustZone VMM (ref #954)
When saving/resuming translation table base registers, and data fault register
a VMM is able to translate the VM's virtual addresses, and to analyse aborts
it has generated.
2013-11-25 09:46:08 +01:00
Martin Stein
b694045bd9 hw: get rid of Kernel::current_thread_id
Every thread receives a startup message from its creator through the initial
state of its userland thread-context. The thread-startup code remembers the
kernel name of the new thread by reading this message before the userland
thread-context gets polluted. This way, Kernel::current_thread_id becomes
unnecessary.

fix #953
2013-11-25 09:46:08 +01:00
Martin Stein
fde150b052 hw: rename delete_thread in kill_thread
ref #953
2013-11-25 09:45:31 +01:00
Martin Stein
f054b70e33 hw: spelling fix in kernel/thread.cc
ref #953
2013-11-25 09:45:31 +01:00
Martin Stein
84e05e0653 hw: don't provide thread base via platform thread
ref #953
2013-11-25 09:45:31 +01:00
Martin Stein
99c649c42f hw: simplify Kernel::new_thread
Don't set priority and label in platform thread and then communicate this
core object via Kernel::new_thread but communicate priority and label directly.
This way kernel doesn't need to know anymore what a platform thread is.

ref #953
2013-11-25 09:45:31 +01:00
Martin Stein
210216e5e1 hw: simplify Kernel::start_thread
Instead of writing initial thread context to the platform-thread members
and then communicating this core object to kernel, core calls
Kernel::access_thread_regs first to initialize thread context and then
Kernel::start_thread without a platform-thread pointer. This way
the frontend as well as the backend of Kernel::start_thread loose
complexity and it is a first step to remove platform thread from the
vocabulary of the kernel.

ref #953
2013-11-25 09:45:31 +01:00
Martin Stein
77f55232fd hw: remove Kernel::get_thread
ref #953
2013-11-25 09:45:31 +01:00
Martin Stein
3b2590b65a hw: identify core threads through stack pointer
ref #953
2013-11-25 09:45:30 +01:00
Martin Stein
87da21d967 hw: use platform-thread pointer as pager badge
ref #953
2013-11-25 09:45:30 +01:00
Martin Stein
e0419b2401 hw: clearer naming scheme in kernel API
Rename kernel syscall in kernel call and the kernel-API
files in kernel/interface* .

ref #953
2013-11-25 09:45:30 +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
e450602196 hw: missing initialization in signal handler
fix #951
2013-11-18 11:01:45 +01:00
Martin Stein
653e14b74f hw: adjust SIGNAL SLAB sizes to new conditions
fix #950
2013-11-18 11:01:45 +01:00
Martin Stein
909ab8dcd0 hw: communicate page faults via signals
Enable routing of thread events to signal contexts via
Kernel::route_thread_event.

Replace Kernel::set_pager by Kernel::route_thread_event.

In base-hw a pager object is a signal context and a pager activation
is a signal receiver. If a thread wants to start communicating its page
faults via a pager object, the thread calls Kernel::route_thread_event with
its thread ID, event ID "FAULT", and the signal context ID of the pager object.
If a pager activation wants to start handling page faults of a pager object,
the pager activation assigns the corresponding signal context to its signal
receiver. If a pager activation wants to stop handling page faults of a pager
object, the pager activation dissolves the corresponding signal context from
its signal receiver. If a thread wants to start communicating its page faults
via a pager object, the thread calls Kernel::route_thread_event with its
thread ID, event ID "FAULT", and the invalid signal context ID.

Remove Kernel::resume_faulter.

Move all page fault related code from generic kernel sources to CPU
specific cpu_support.h and cpu_support.cc.

fix #935
2013-11-14 19:57:31 +01:00
Martin Stein
ba52529bd6 hw: beautify scheduling-priority code
ref #935
2013-11-14 19:57:31 +01:00
Martin Stein
da49f86f5b hw: provide placement via dedicated header
ref #935
2013-11-14 19:57:30 +01:00
Martin Stein
15a56bd682 hw: provide and use syscall access_thread_regs
ref #935
2013-11-14 19:57:30 +01:00
Martin Stein
d24ed9783b hw: get rid of kernel_support.cc
ref #935
2013-11-14 19:57:30 +01:00
Martin Stein
f4b46fe55c hw: move kernel.cc to core/kernel/
ref #935
2013-11-14 19:57:30 +01:00
Martin Stein
9c1ae1f149 hw: no overloading of Signal_context constructor
ref #935
2013-11-14 19:57:30 +01:00
Martin Stein
47744e0019 hw: handle interrupts via signals
fix #874
2013-11-14 19:57:30 +01:00
Martin Stein
002a5b8978 hw: distinct pagefault and IPC message type
ref #874
2013-11-14 19:56:39 +01:00
Martin Stein
6f935af278 hw: communicate message type through UTCB
ref #874
2013-11-14 19:56:38 +01:00
Martin Stein
1e7eb4512e hw: manage UTCB through use-case specific structs
ref #874
2013-11-14 19:56:38 +01:00
Martin Stein
96bbca6191 hw: send reply size & receive request size by UTCB
ref #874
2013-11-14 19:56:38 +01:00
Martin Stein
45d37e275d hw: send request size through UTCB
ref #874
2013-11-14 19:56:38 +01:00
Martin Stein
6b9376bb01 hw: clean up interface of Kernel::Thread
ref #874
2013-11-14 19:56:38 +01:00
Martin Stein
ffb26eb501 hw: make syscall backend private to Kernel::Thread
ref #874
2013-11-14 19:56:38 +01:00
Martin Stein
5cd2f6ee0b hw: make Kernel::mtc() global
ref #874
2013-11-14 19:56:38 +01:00
Martin Stein
0bb6ffa98d hw: header and source file for Kernel::Vm
ref #874
2013-11-14 19:56:38 +01:00
Martin Stein
22d61c241e hw: remove useless function handle_invalid_excpt
ref #874
2013-11-14 19:56:38 +01:00
Martin Stein
059aba0916 hw: remove unused function handle_invalid_syscall
ref #874
2013-11-14 19:56:38 +01:00
Stefan Kalkowski
265ec48c20 hw: implement priority-based scheduling (fix #945) 2013-11-12 15:01:54 +01:00
Martin Stein
c56927b76e hw: differ ID allocators even with same size
Previously, if two ID allocators for different kernel objects had the
same size, the kernel-object framework managed both objects types
through the same allocator instance. This is caused by the use of
unsynchronized singletons in the accessor functions and can be avoided
by creating new types through inheritance instead of using typedefs.
Anyways, this fix is a little bit ugly and should replaced by avoiding
the use of unsynchronized singletons in the future.

fix #906
2013-10-22 08:00:14 +02:00
Josef Söntgen
afdabe9df8 hw: enable performance counter on ARMv6 and ARMv7
To actually enable the performance counter 'perf_counter' has to be
added to the SPECS make variable.

Fixes #893.
2013-10-17 11:05:53 +02:00
Martin Stein
c117516296 hw: relax signal limits for resource_request test
ref #912
2013-10-16 09:26:11 +02:00
Martin Stein
f88fd35f22 hw: avoid upgrade need of 8192 in signal session
ref #912
2013-10-16 09:26:11 +02:00
Martin Stein
b5c6f2c260 hw: avoid generic exceptions in signal framework
ref #912
2013-10-16 09:26:11 +02:00
Martin Stein
bb9fa16a5e hw: throw expressive exceptions in signal session
ref #912
2013-10-16 09:26:11 +02:00
Martin Stein
0ad655f4be hw: return error code on IPC replies
ref #899
2013-10-16 09:26:10 +02:00
Martin Stein
ae76e441b1 hw: fix bug in Kernel::Thread::resume
ref #899
2013-10-16 09:26:10 +02:00
Martin Stein
b85126a638 hw: enable verbose thread starts
ref #899
2013-10-16 09:26:10 +02:00
Martin Stein
d961b9ae1e hw: enable multiple compilation units in kernel
ref #899
2013-10-16 09:26:10 +02:00
Martin Stein
d6d4938916 hw: fix bug in Kernel::yield_thread
ref #899
2013-10-16 09:26:10 +02:00
Martin Stein
6912e638fb hw: kill signal receivers
ref #899
2013-10-16 09:26:10 +02:00
Martin Stein
26db598fc0 hw: cancel waiting for IPC requests
ref #899
2013-10-16 09:26:10 +02:00
Martin Stein
327cdfdf36 hw: always remove RM client on thread destruction
ref #589
2013-09-26 16:09:56 +02:00
Martin Stein
36111587be hw: don't use assertions in Kernel::get_thread
ref #589
2013-09-26 16:09:56 +02:00
Martin Stein
e5ea660e2e hw: enable to destruct thread after its RM client
ref #589
2013-09-26 16:09:55 +02:00
Martin Stein
d86bf3db64 hw: destruct protection domains
ref #589
2013-09-26 16:09:55 +02:00
Martin Stein
a4f52bec19 hw: enable direct unmap
ref #589
2013-09-26 16:09:55 +02:00
Martin Stein
4f4738427d hw: release pagers from faulting threads
ref #589
2013-09-26 16:09:55 +02:00
Martin Stein
c3be0b417a hw: fix bug in Kernel::Thread::crash
ref #589
2013-09-26 16:09:55 +02:00
Martin Stein
a596fa56a6 hw: destruct scheduling contexts
ref #589
2013-09-26 15:58:05 +02:00
Martin Stein
52ec56c060 hw: destruct abstract interfaces of signal backend
ref #589
2013-09-26 15:58:05 +02:00
Martin Stein
611cd95eb3 hw: destruct IPC end-nodes
ref #589
2013-09-26 15:58:05 +02:00
Martin Stein
de87fa1b5c hw: avoid address overflow in Tlb::remove_region()
ref #589
2013-09-26 15:58:05 +02:00
Martin Stein
909c2dbc95 hw: remove note feature from IPC framework
ref #589
2013-09-26 15:58:04 +02:00