Commit Graph

167 Commits

Author SHA1 Message Date
Martin Stein ea7ed5947a base: hand over Pd_connection label to Platform_pd
fix: #656
2013-04-08 11:42:24 +02:00
Alexander Boettcher 8bc719ee1d nova: show badge as name during page fault message 2013-03-18 13:10:21 +01:00
Norman Feske 21de42c45d core: Introduce 'Address_space' interface
The new core-internal 'Address_space' interface enables cores RM service
to flush mappings of a PD in which a given 'Rm_client' thread resides.
Prior this patch, each platform invented their own way to flush mappings
in the respective 'rm_session_support.cc' implementation. However, those
implementations used to deal poorly with some corner cases. In
particular, if a PD session was destroyed prior a RM session, the RM
session would try to use no longer existing PD session. The new
'Address_space' uses the just added weak-pointer mechanism to deal with
this issue.

Furthermore, the generic 'Rm_session_component::detach' function has
been improved to avoid duplicated unmap operations for platforms that
implement the 'Address_space' interface. Therefore, it is related to
issue #595. Right now, this is OKL4 only, but other platforms will follow.
2013-03-12 21:53:08 +01:00
Alexander Boettcher 8f204ffd26 nova: improve page fault debugging messages
Ease debugging.

Fixes #674
2013-03-08 12:15:02 +01:00
Alexander Boettcher 38b2a3dbb4 nova: support to run script automatically with AMT
This enables us to use the run scripts applied to a native machine equipped
with Intel's AMT. If the environment variables are correctly set up, the remote
test machine is reseted via 'amttool', then via 'amtterm' the serial output
is collected and the normal run script matching pattern for success/failure of
the run script are applied.

'amttool' and 'amtterm' are part of the package called 'amtterm' shipped with
the Linux distributions like Ubuntu, Debian and lot more.

Following environment variables are required, to run the run scripts with a
native AMT test machine:

PXE_TFTP_DIR_BASE   - absolute path of TFTP directory
PXE_TFTP_DIR_OFFSET - relative path to PXE_TFTP_DIR_BASE where the config file
                      will be generated - named 'config-00-00-00-00-00-00'

AMT_TEST_MACHINE_IP  - TCP/IP address of target AMT test machine
AMT_TEST_MACHINE_PWD - password of target AMT test machine

Issue #679
2013-03-08 12:09:10 +01:00
Alexander Boettcher 48ea3c35b5 nova: zero out space behind rom modules
Fixes #675
2013-02-27 16:50:40 +01:00
Alexander Boettcher b2d92f3d94 nova: optimize unmap path
Directly unmap memory range instead of looking first it up and then unmap it.

Prerequisite for #675
2013-02-27 16:50:27 +01:00
Alexander Boettcher 974c5442c6 nova: don't try to prepare UTCB in case of vCPU
vCPU has no UTCB.

Fixes #673
2013-02-27 16:47:21 +01:00
Norman Feske 4fbd74f3aa nova: Support upgrading kernel via 'make prepare' 2013-02-25 22:14:22 +01:00
Norman Feske fb3933faf3 nova: use bender by default
Bender fixes the serial output on modern PC hardware. Prior this patch,
it was used only when combined with pulsar. Now, we also use it when
booting via GRUB.
2013-02-25 22:14:22 +01:00
Alexander Boettcher 0ac6be3c70 nova: fix boot modules and command line bootstrap
Allocate ever an extra page behind the commandline pointer. If it turns out
that this page is unused, because commandline was short enough, unmap the
memory and put the virtual and physical regions back to the allocator.

Fix #664
2013-02-25 22:14:21 +01: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
Alexander Boettcher b4805af5bc nova: update kernel revision to r2
Fix #667
2013-02-25 16:45:50 +01:00
Alexander Boettcher 801d09f166 nova: revoke set portal id right
Revoke the right to set the portal id (aka label) when it is not needed
anymore. Otherwise everybody in the system having a mapping of the portal can
reset the label to something we don't expect.

Issue #667
2013-02-25 16:45:50 +01:00
Alexander Boettcher 46447d531e nova: add syscall pt_ctrl bindings
Issue #667
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
Alexander Boettcher b35484b8b0 nova: enable iommu in kernel by default 2013-02-22 20:28:27 +01:00
Alexander Boettcher c36f6a04a7 nova: extend pd_session by assign_pci function 2013-02-21 11:52:02 +01:00
Alexander Boettcher c114014c1c nova: kernel patch for assign_pci
Apply lookup of pci config memory address to target pd.
2013-02-21 11:52:02 +01:00
Alexander Boettcher 467eec731f nova: set default receive and translate windows 2013-02-21 11:52:02 +01:00
Alexander Boettcher 250f7b1570 nova: update syscall assign_gsi/_pci for 32/64 bit 2013-02-21 11:52:02 +01:00
Alexander Boettcher ff062f24ff nova: map write_combined ds as dma able 2013-02-21 11:52:02 +01:00
Alexander Boettcher 1c2f76cd2a nova: add support to specify dma mapping flag 2013-02-21 11:52:02 +01:00
Alexander Boettcher 5380c09c6f nova: construct pager name out of client name
Ease debugging to find out which client is dying actually.
2013-02-21 11:52:02 +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
Norman Feske bcdc706f42 Unify 'ipc.h' and 'ipc_generic.h' across platforms
The distinction between 'ipc.h' and 'ipc_generic.h' is no more. The only
use case for platform-specific extensions of the IPC support was the
marshalling of capabilities. However, this case is accommodated by a
function interface ('_marshal_capability', '_unmarshal_capability'). By
moving the implementation of these functions from the headers into the
respective ipc libraries, we can abandon the platform-specific 'ipc.h'
headers.
2013-02-14 13:23:37 +01:00
Norman Feske b1f63e3356 Turn 'platform_env.h' into a private header
This patch removes 'platform_env.h' from the public API headers because
this header was not part of the API anyway.
2013-02-14 13:23:36 +01:00
Alexander Boettcher ee8eea9330 nova: fix lock guard usage in cap selector
Issue #549
2013-02-11 12:11:48 +01:00
Alexander Boettcher 64dbe08359 nova: kill thread with no pager where recall fails
Issue #549
2013-02-11 12:01:27 +01:00
Alexander Boettcher edd30b56a2 nova: fix pager cleanup handling
The cleanup call must be performed already during the _dissolve function
shortly after the object at the cap_session is freed up. Otherwise there
is the chance that an in-flight IPC will find the to be dissolved function
again.

Bomb test triggered the case, that a already dissolved rpc_object was found
by a in-flight IPC. If the rpc_object was already freed up by alloc->destroy
the thread using this stale rpc_object pointer cause page-faults in core.

Fixes partly #549
2013-02-11 12:01:26 +01:00
Alexander Boettcher 28f7cf5dc2 nova: fix cleanup handling in server object
As first step the rpc object must be freed up so that the kernel object
(portal) vanishes. Then the object must be removed from the internal object
pool list so that the object can't be obtained anymore. And then the cleanup
call can be performed (_leave_server_object) since now all names to the
rpc_object are gone.

Doing it in different order (as before the commit) there is a very very little
chance (but the bomb test triggers it occasionally) that the rpc_object can be
obtained again by an incoming IPC - even it is already scheduled for removal.

Fixes partly #549
2013-02-11 12:01:26 +01:00
Alexander Boettcher 08d87adb4b nova: use kernel branch adjusted to Genode
Since we have now more than a handful patches to the vanilla kernel, we
better switch to a separate git repository in order to review and to maintain
the patches more effectively.

Remove the patches, they are already in the kernel branch.

Fixes #394
2013-02-11 12:01:26 +01:00
Alexander Boettcher f762e8e4fd nova: increase number of available cap indexes
Noux test requires some more indexes. We don't free all up because of a missing
reference counting implementation of indexes in base-nova.

Issue #394
2013-02-11 12:01:25 +01:00
Alexander Boettcher 9453d319cb base: add remove_client to rm_session
Fixes #13
2013-02-11 12:01:25 +01:00
Alexander Boettcher 486b27a1b8 nova: ease debugging if no cap indexes are left
If we ran out of capabilities indexes, the bit allocator throws an exception.
If this happens the code seems to hang and nothing happens.

Instead one could catch the exception and print some diagnostic message.
This would be nice, but don't work. Printing some diagnostic message itself
tries to do potentially IPC and will allocate new capability indexes at
least for the receive window.

So, catch the exception and let the thread die, so at least the instruction
pointer is left as trace to identify the reason of the trouble.

Fixes #625
2013-01-24 11:09:15 +01:00
Alexander Boettcher e817163f1a nova: use lock guard instead of explicit calls
If an exception is thrown the lock is released automatically, so that
other callers may get a capability index if in between some are freed. Fixes
some deadlocks if Genode is short on capability indexes.

Related to #625
2013-01-24 11:05:41 +01:00
Alexander Boettcher 6cc0d69aa7 nova: recall thread if exception can't be resolved
Recall faulting thread and block pager thread. The pager get resumed as soon
as the fault gets resolved by the rm_session (or never ever).

Fixes #621
2013-01-21 11:40:38 +01:00
Norman Feske 8fe0c6c91c base-nova: Coding style 2013-01-11 23:11:07 +01:00
Norman Feske bef78dd9f8 Core: Fix registration of CPU exception handler 2013-01-11 22:16:25 +01:00
Norman Feske 0ca774592f Fix default base-nova/etc/specs.conf 2013-01-11 20:54:46 +01:00
Norman Feske 73ab30c22c Update copyright headers to 2013 2013-01-10 21:44:47 +01:00
Alexander Boettcher e8c063a8b4 base: release signal context from signal list
Remove signal context object from signal source component list (_signal_queue)
before destruction, otherwise we get a dangling pointer.

On native hardware for base-nova, the signal source thread triggered page
faults in the Signal_source_component::wait_for_signal() method when the signal
context got freed up in Signal_session_component::free_context but was still
enqueued in Signal_source_component::_signal_queue.

Fixes #600
2013-01-10 21:17:42 +01:00
Alexander Boettcher c2d3543e62 base: replace obj_by_* by lookup_and_lock
Add functionality to lookup an object and lock it. Additional the case is
handled that a object may be already in-destruction and the lookup will deny
returning the object.

The object_pool generalize the lookup and lock functionality of the rpc_server
and serve as base for following up patches to fix dangling pointer issues.
2013-01-10 11:13:13 +01:00
Norman Feske 9f82764316 core: Introduce default CPU exception handler
The CPU session interfaces comes with the ability to install an
exception handler per thread. This patch enhances the feature with the
provision of a default signal handler that is used if no thread-specific
handler is installed. The default signal handler can be set by
specifying an invalid thread capability and a valid signal context
capability.

Furthermore, this patch relaxes the requirement of the order of the
calls of 'exception_handler' and 'set_pager'. Originally, the exception
handler could be installed not before setting a pager. Now, we remember
the installed exception handler in the 'Cpu_thread' and propagate to to
the platform thread at a later time.
2013-01-04 15:26:16 +01:00
Alexander Boettcher 1211516c08 nova: decode type of page fault in core
Ease reading debugging messages if a core thread fails.
2012-12-21 14:54:20 +01:00
Alexander Boettcher cef9af1978 nova: set page fault handler for core threads
Ease debugging if a core thread fail.
2012-12-21 14:54:20 +01:00
Alexander Boettcher 2426030c5b nova: extend cap_session to free up portals 2012-12-21 14:54:20 +01:00
Alexander Boettcher 8c4e1b7eb0 base: extend cap_session with memory allocator
Required to allocate memory to remember per session created capabilities.
During session destruction all capabilities have to be freed up.
2012-12-21 14:54:20 +01:00
Christian Prochaska 42cef716e1 CPU session meta data RAM quota upgrade support
Fixes #541.
2012-11-30 16:27:29 +01:00
Alexander Boettcher fa2cbdc7cb Fix: don't deference stale pager pointer in core
Reset pager pointer in platform_thread if pager object is removed.

Fixes #532
2012-11-29 13:44:07 +01:00