Commit Graph

92 Commits

Author SHA1 Message Date
Stefan Kalkowski 73eb7a8d4b hw: map core on demand (fix #723)
Instead of mapping all physical memory 1:1 into core/kernel's address space,
this commit limits the 1:1 mapping to the binary image, and I/O memory
regions used by the kernel only. All subsequent memory accesses of core
are done by mapping the corresponding memory on demand, and not necessarily
1:1.

This commit has several side effects:

The page table code had to be revisited completely. The kernel inserts no
longer anything into the page tables, apart from the initial translations
to have the core/kernel image available when enabling the MMU. The page
tables and higher level translation tables are no longer named Tlb, but
Translation_table instead. There is no indirection class required to define
the translation tables of a concrete SoC, the appropriated ARM specifier
is sufficient.
The ability to map core's memory the same way like it's done for all other
protection domains, makes a special treatment of core's threads (no context
area) obsolete.

Ref #567 (partly solves it)
Fix #723
Fix #1068
2014-05-07 10:37:39 +02:00
Martin Stein a9521853bd hw: provide Kernel::update_instr_region
fix #1115
2014-04-14 12:28:16 +02:00
Martin Stein 3f14defd9d hw: don't restrict update_data_region to core
ref #1115
2014-04-14 12:28:16 +02:00
Martin Stein e856158824 hw: no msg_base argument to Ipc_node::send_request
ref #1108
2014-04-07 17:10:53 +02:00
Martin Stein b34ce7d2b0 hw: handier names for IPC methods
ref #1108
2014-04-07 17:10:45 +02:00
Martin Stein 02c16e7106 hw: split resume_local_thread from resume_thread
Kernel::resume_thread was restricted to core when the targeted thread was in
another domain. Now there are two kernel calls, resume_local_thread and
resume_thread, where the former is never restricted and is provided via
public kernel/interface.h and the latter is always restricted to core and
is provided via core-local kernel/core_interface.h.

ref #1101
2014-04-07 17:09:52 +02:00
Martin Stein c72f91fefb hw: simplify return value of Kernel::resume_thread
ref #1101
2014-04-07 17:09:33 +02:00
Martin Stein fba4f54571 hw: split pause_current_thread from pause_thread
Kernel::pause_current_thread can be implemented much simpler and is not
restricted to core threads, in contrast to Kernel::pause_thread which
also benefits from the split and can be moved to core_interface.h.

ref #1101
2014-04-07 17:07:24 +02:00
Martin Stein abd55fda9a hw: don't return a result in Kernel::pause_thread
ref #1101
2014-04-07 17:06:09 +02:00
Martin Stein e2268c09a0 hw: move core-restricted interface to local header
fix #1096
2014-04-07 17:02:50 +02:00
Martin Stein 395e955756 hw: set affinity of core threads
ref #1076
2014-03-14 13:16:05 +01:00
Stefan Kalkowski 3b69dc2a58 TrustZone: reenable memory protection (fix #1060) 2014-02-28 10:11:08 +01:00
Martin Stein e68eadf57b hw: fix bug in IPC message-size calculation
ref #989
2014-02-25 14:58:02 +01:00
Martin Stein 901b3e2bb4 hw: ease usage of the kernel log
ref #989
2014-02-25 14:58:02 +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
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 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 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
Stefan Kalkowski 7b49dbf2f3 hw: basic support for ODROID XU board (Fix #991) 2013-12-03 11:30:07 +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 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 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
Martin Stein 5b90113d86 hw: no default values for kernel-call args
ref #967
2013-11-26 14:32:07 +01:00
Stefan Kalkowski 6f136bef7a hw: add TrustZone support for i.MX53 (ref #954) 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 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 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
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 15a56bd682 hw: provide and use syscall access_thread_regs
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
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 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