Commit Graph

186 Commits

Author SHA1 Message Date
Alexander Boettcher 80a15fde30 NOVA: update NOVA@github revision
Use latest NOVA github revision. Fixes sporadic in-kernel page faults.
2012-07-04 14:56:47 +02:00
Alexander Boettcher f8c97e7189 NOVA: Deadlock fix in pager/rm_session interaction
Following deadlock happens when a Rm_client/Pager_object handles a page-fault
and concurrently the same object is dissolved (triggered by parent killing
the client).

The situation is as follows:

Page fault handling  :
base-nova/src/base/pager/pager.cc    : pf_handler() - lock pf_lock
base/.../core/rm_session_component.cc: pager()      - lock rm_session
  (in reverse_lookup())

Dissolve of Rm_client:
base/src/core/rm_session_component.cc: dissolve()   - lock rm_session
base-nova/src/base/pager/pager.cc    : dissolve()   - lock pf_lock

The pf_lock is not required here during normal page fault handling,
since this pager object @NOVA is executed only by one and the same
thread and all critical operations inside the rm_session_object itself
are locked anyway. The only critical point is the destruction of the
Pager_object which is already handled in the both dissolve functions
of the rm-session_component (locking) and the pager_object (finalize
in-flight page faults).
2012-07-04 14:56:46 +02:00
Alexander Boettcher 1d6a00f01a Cleanup: cap allocation
Allocate exc_pt_sel inside Thread_base object
instead of pager object, since it is a thread
specific characteristic.

Same for freeing of the thread capabilities:
- ec, sc, rs, exc_pt_sel is thread specific
and has nothing to do in server nor pager object.
2012-07-04 14:56:46 +02:00
Alexander Boettcher 1a94c3b623 Fix: thread identifier comparator
The invalid thread is specified as 0,0,-1 (ec cap, sc cap, sem cap).
The main thread is specified as 0,0,0.

The comparator identified "tid_main == tid_invalid" as equal,
which is obviously wrong.

The patch compares at least ec and sem cap.
2012-07-04 14:56:46 +02:00
Alexander Boettcher 86921c2e12 Use down-to-zero semaphore feature to block thread
Use semaphore down feature of NOVA to set the counter to zero.
If the semaphore was up()ed more than one time by impatient callers
(e.g. guys calling cancel_blocking) we make sure that the thread
really stops.
2012-07-04 14:56:46 +02:00
Alexander Boettcher cd886bff6a Move semaphore op codes to generic syscall 2012-07-04 14:56:45 +02:00
Alexander Boettcher d033b450f5 Sanity resetting of Utcb words/items field.
Don't send words or mappings by accident. Reset the word/item
counter.
2012-07-04 14:56:45 +02:00
Alexander Boettcher 7f93dae3ff Pager/Thread_start cleanups
Don't allocate ec cap twice, in pager.cc and thread_start.cc.
Unmap of utcb has to be done in destructor of thread class, not
in pager class. Free capability selectors of ec and rs.
2012-07-04 14:56:45 +02:00
Alexander Boettcher 2a3b0d72b3 Don't deallocate invalid cap
SC slot is unused here.
2012-07-04 14:56:45 +02:00
Alexander Boettcher 33334b4f4b Fix: Avoid deadlock during cleanup of entrypoint
Invoke cancel_blocking before calling the
cleanup portal of the rpc_entrypoint. If a rpc_entrypoint
is blocked in a semaphore the cleanup call gets
stuck forever.
2012-07-04 14:56:45 +02:00
Alexander Boettcher c873faa390 Fix: reset word counter in case of failed IPC.
If IPC fails for some reasons, reset received counter of items+words.
This operation is not performed by the kernel.
2012-07-04 14:56:44 +02:00
Alexander Boettcher c56c9f586d NOVA: use grub instead of pxe
Make pxe optional and use by default grub.
For that to work we use objcopy to repack the elf64
file into elf32.

With this commit more tests succeed. Most
tests use 64M and with that pulsar even does not start
the hypervisor. With 96M more test run however that would
mean to adjust most of the run scripts ...
2012-06-22 11:38:14 +02:00
Alexander Boettcher a4cac757e2 NOVA: Use right syscall function for ec_ctrl 2012-06-22 11:38:14 +02:00
Alexander Boettcher 0bf642ff9a Establish mappings during reply, #248
Caller thread sends echo thread mapping information. Echo thread
establish during reply the mappings.

Fixes #248
2012-06-20 19:44:08 +02:00
Alexander Boettcher 9ebbf9c9f2 Check that typed item fits on UTCB, issue #248
Check that there is enough room for a typed item on the
UTCB. Otherwise deny to add the item and return false.
Enable explicitly a return unused warning to get the right
attention.
2012-06-20 19:44:08 +02:00
Alexander Boettcher 0c2adf7ddd Msg_words are 16 bit, adjust bit mask. 2012-06-20 19:44:08 +02:00
Alexander Boettcher 67864d35f1 Structures must be dense packed, issue #248
Take care that utcb, hip, crd structure are dense packed by compiler.
2012-06-20 19:44:07 +02:00
Alexander Boettcher 4534d656a8 NOVA: Improve stability of process destruction
The UTCB of the thread cleaning up thread objects has been unmapped.
However the UTCB of the destroyed thread must be unmapped.

Objects must explicitly be made unreachable before cleaning up. The
server and pager objects must be unreachable before they can be freed.
Both object types are threads. Revoking the thread(EC) cap on NOVA
doesn't mean that the thread stops executing. All portals pointing to a
thread are still reachable by clients even if the last EC cap is gone in
user land. So it must be taken care that no portals are pointing anymore
to a thread when the associated objects are getting destroyed. This
commit handles this.

Additionally, even if the last portal is gone - there can be still an
ongoing request handled by such server/pager object/threads. For each
such object an additional portal is created. This object is called
'cleanup portal' and is only local to the object. After all portals are
revoked the cleanup portal is called. When the call returns we know that
nobody is anymore handled by the object since all remotely available
portals are gone.

Fixes #20
2012-06-20 19:44:07 +02:00
Alexander Boettcher ae6257dce1 Use NOVA microkernel from github, add 64bit
Use git to get recent kernels from github. Adjust NOVA patch to compile
with recent github version. Patch and use makefile of NOVA microkernel
to avoid duplicated (and outdated) makefile in Genode

Furthermore, this patch adds support for using NOVA on x86_64. The
generic part of the syscall bindings has been moved to
'base-nova/include/nova/syscall-generic.h'. The 32/64-bit specific
parts are located at 'base-nova/include/32bit/nova/syscalls.h' and
'base-nova/include/64bit/nova/syscalls.h' respectively.

On x86_64, the run environment boots qemu using the Pulsar boot loader
because GRUB legacy does not support booting 64bit ELF executables.

In addition to the NOVA-specific changes in base-nova, this patch
rectifies compile-time warnings or build errors in the 'ports' and
'libports' repositories that are related to NOVA x86_64 (i.e., Vancouver
builds for 32bit only and needed an adaptation to NOVAs changed
bindings)

Fixes #233, fixes #234
2012-06-20 19:44:07 +02:00
Alexander Boettcher 200deec403 Bunch of compiler warning fixes, issue #234 2012-06-20 19:44:07 +02:00
Christian Helmuth 36ae42b8ff Check for required tools on 'make prepare'
Fixes #221.
2012-05-29 13:55:00 +02:00
Christian Prochaska 7a369bc74d Add an 'executable' flag to 'Rm_session::attach()'
With this patch clients of the RM service can state if they want a mapping
to be executable or not. This allows dataspaces to be mapped as
non-executable on Linux by default and as executable only if needed.

Partially fixes #176.
2012-04-20 11:21:19 +02:00
Norman Feske d6e30c19de Replace 'Native_capability::copy_to' by accessor
The 'copy_to' function turned out to be not flexible enough to
accommodate the Noux fork mechanism. This patch removes the function,
adds an accessor for the capability destination and a compound type
'Native_capability::Raw' to be used wherever plain capability
information must be communicated.
2012-03-28 09:58:51 +02:00
Sebastian Sumpf bbce38cb36 Do not marshal invalid capabilities on NOVA/x86
We send a local name of ~0L instead, if this is encountered during the
unmarshalling we generate an invalid 'Native_capability' (Fixes #148).
2012-03-13 16:32:23 +01:00
Stefan Kalkowski ae8cf5f44d Rename tid() to dst() in Native_capability.
As suggested by Norman in the discussion of issue #145, this commit
renames the tid() accessor in Native_capability to dst().
2012-03-10 15:52:19 +01:00
Stefan Kalkowski 42b7c01685 Unify policy name for Native_capability_tpl.
This commit unifies the policy name for the template argument for
Native_capability_tpl to Cap_dst_policy, like suggested by Norman in the
discussion resulting from issue #145. Moreover, it takes the memcpy
operation for copying a Native_capability out of the template, which is
included by a significant bunch of files, and separates it in a library,
analog to the suggestion in issue #145.
2012-03-10 15:52:13 +01:00
Norman Feske 35384faa7a Follow-up tweaks for issue #145
Because we use to pass a policy class to 'Native_capability_tpl'
we can pass the dst type as part of the policy instead of as
a separate template argument. This patch also adds documentation
of the POLICY interface as expected by 'Native_capability_tpl'.
2012-03-08 19:28:32 +01:00
Stefan Kalkowski c9c21ad39c Merge Native_capability implementations (fix #145).
This patch unifies the Native_capability classes for the different kernel
platforms by introducing an appropriate template, and eliminating naming
differences. Please refer issue #145.
2012-03-08 18:42:39 +01:00
Stefan Kalkowski 9992efed03 Don't memcpy the parent capability. Fix #144.
To give the platform developer more freedom in how the Native_capability
class is internally implemented (e.g. turning it into a smart-pointer),
this patch removes the memcpy operation, when transfering the parent-capability
to a new process from the generic code, and let the implementation of the
platform-specific Native_capability decide how the transfer has to be done.
Please refer to issue #144.
2012-03-08 18:41:38 +01:00
Stefan Kalkowski fa377f0df5 Make local capability interface explicit. Fix #139.
Introduce a factory-, and dereference method for local capabilities. These are
capabilities that reference objects of services, which are known to be used
protection-domain internally only. To support the new Capability class methods
a protected constructor and accessor to the local object's pointer is needed
in the platform's capability base-classes. For further discussion details please
refer issue #139.
2012-03-08 18:40:48 +01:00
Norman Feske f3fcb5f56f Facility for reinitializing Platform_env
The new function 'Platform_env::reload_parent_cap' triggers a reload
of the parent capability and its respective resources. It is needed
during the bootstrap of a new process forked from an existing Noux
process.
2012-02-22 15:56:45 +01:00
Christian Prochaska 4b1f182e61 Unlock guarded lock before sending IPC error reply
Sending a reply message does not return, so the guarded lock needs to get
unlocked manually.

This patch fixes #117.
2012-02-15 09:26:21 +01:00
Norman Feske 4b9407a212 Remove stale test_env lib from base-nova
This library was used during the first porting steps of Genode to NOVA
for executing parts of the framework API without core. Those bare-metal
tests are not maintained anymore. So this library can be removed.
2012-01-25 16:08:32 +01:00
Norman Feske 3ea9467343 Removed stale printf_stdio lib from base-nova 2012-01-25 13:04:04 +01:00
Norman Feske 08ce32215d Bump year in copyright headers to 2012 2012-01-03 15:35:05 +01:00
Genode Labs da4e1feaa5 Imported Genode release 11.11 2011-12-22 16:19:25 +01:00