Commit Graph

119 Commits

Author SHA1 Message Date
Norman Feske 9b0eb720b0 base: remove 'Native_utcb' from public API
Fixes #1905
2016-03-17 17:02:04 +01:00
Norman Feske 9a3185f8ed base-linux: remove chroot support
Fixes #1903
2016-03-08 17:00:54 +01:00
Norman Feske 76db3b9c06 base: retire 'Native_config'
This commit moves the parameters of the stack area to the base-internal
header 'stack_area.h'.

Issue #1832
2016-03-08 17:00:54 +01:00
Norman Feske 7f73e5e879 base: hide internals of the Thread API
This patch moves details about the stack allocation and organization
the base-internal headers. Thereby, I replaced the notion of "thread
contexts" by "stacks" as this term is much more intuitive. The fact that
we place thread-specific information at the bottom of the stack is not
worth introducing new terminology.

Issue #1832
2016-03-07 12:34:46 +01:00
Norman Feske 3473955212 base-linux/nova: unify include/rm_session/client.h
By moving the stub implementation to rm_session_client.cc, we can use
the generic base/include/rm_session/client.h for base-linux and
base-nova and merely use platform-specific implementations.

Issue #1832
2016-03-07 12:34:45 +01:00
Norman Feske 2e701f9afa base: update include guards
This patch cleans up the include guards, assisted by the
tool/fix_include_ifndef script.
2016-03-07 12:34:45 +01:00
Norman Feske e6729316ff base: uniform base-internal header structure
This patch establishes a common organization of header files
internal to the base framework. The internal headers are located at
'<repository>/src/include/base/internal/'. This structure has been
choosen to make the nature of those headers immediately clear when
included:

  #include <base/internal/lock_helper.h>

Issue #1832
2016-03-07 12:34:45 +01:00
Norman Feske be496c6dc1 base: remove kernel-specific base/sleep.h
With this patch, the platform differences reside solely in the
implementation of the base library.

Issue #1832
2016-03-07 12:34:44 +01:00
Norman Feske 62b1c55399 Integrate CAP session into PD session
This patch integrates the functionality of the former CAP session into
the PD session and unifies the approch of supplementing the generic PD
session with kernel-specific functionality. The latter is achieved by
the new 'Native_pd' interface. The kernel-specific interface can be
obtained via the Pd_session::native_pd accessor function. The
kernel-specific interfaces are named Nova_native_pd, Foc_native_pd, and
Linux_native_pd.

The latter change allowed for to deduplication of the
pd_session_component code among the various base platforms.

To retain API compatibility, we keep the 'Cap_session' and
'Cap_connection' around. But those classes have become mere wrappers
around the PD session interface.

Issue #1841
2016-03-07 12:34:44 +01:00
Norman Feske b1910cdd54 Integrate SIGNAL session into PD session
This patch removes the SIGNAL service from core and moves its
functionality to the PD session. Furthermore, it unifies the PD service
implementation and terminology across the various base platforms.

Issue #1841
2016-03-07 12:34:44 +01:00
Martin Stein ff10687a6c toolchain: report missing ports at once
Previously, ports that were needed for a scenario and that were not
prepared or outdated, triggered one assertion each during the second
build stage. The commit slots a mechanism in ahead that gathers all
these ports during the first build stage and reports them in form of a
list before the second build stage is entered.  This list can be used
directly as argument for tool/ports/prepare_port to prepare respectively
update the ports. If, however, this mechanism is not available, for
example because a target is build without the first build stage, the old
assertion still prevents the target from running into troubles with a
missing port.

Fixes #1872
2016-03-07 12:34:43 +01:00
Alexander Boettcher e5eb1000c7 nova: remove obsolete parts of documentation 2016-02-26 12:19:25 +01:00
Alexander Boettcher f572cf8a05 nova: stop submitting signals on dead sm caps
Fixes #1877
2016-02-05 10:57:04 +01:00
Alexander Boettcher 7598f09295 nova: check for valid platform_pd pointer 2016-01-26 16:20:38 +01:00
Alexander Boettcher a258caa7ab nova: propagate bdf for assign_pci properly
Now, the right PCI bus:device:function (BDF) is reported to the kernel
during assign_pci syscall - beforehand it was ever 0:0.0. The BDF is
needed to lookup the correct DMAR unit the kernel has to configure. This
was revealed as the DMAR unit for Intel graphics on x201 is not the same
as for all other PCI devices we have drivers for on this platform.

Fixes #1848
2016-01-13 14:57:02 +01:00
Alexander Boettcher 1d5aa4ca7e nova: avoid warnings because of oom handling
Use kernel branch which is more accurate in accounting memory, which avoids
kernel messages of following form:

[0] warning: insufficient resources ...

Fixes #1830
2016-01-08 14:37:57 +01:00
Alexander Boettcher 7ee3e98551 nova: update kernel to fix assertion
Some special pages (0-page, 1-page) in the kernel must not be freed up
during PD destruction.

Fixes #1828
2015-12-18 15:04:25 +01:00
Alexander Boettcher a73c6470f6 nova: handle hip/mb memory region of size 0
Fixes #1814
2015-12-10 13:16:28 +01:00
Alexander Boettcher 1aa6a2a4a1 nova: fix kernel freezing
Fixes #1815
2015-12-10 13:16:28 +01:00
Alexander Boettcher 5b376188da nova: disable super pages for DMAR units 2015-11-29 18:17:09 +01:00
Alexander Boettcher 18130e3120 nova: limit user virtual address space on 64bit 2015-11-29 18:17:08 +01:00
Alexander Boettcher f92a6a9594 nova: use kernel with DMAR quirk for Lenovo X250
Issue #1764
2015-11-29 18:17:08 +01:00
Alexander Boettcher 7857e830a3 nova: fix write-combing support
Issue #1764
2015-11-29 18:17:08 +01:00
Christian Prochaska 6bf4fd3340 nova: 64-bit guest support
Issue #1791
2015-11-29 18:17:06 +01:00
Alexander Boettcher 9ada3d3178 nova: sanity check parent pd assignments
Issue #1778
2015-11-18 12:22:09 +01:00
Alexander Boettcher 4b6b759739 nova: handle dissolve of not-activated entrypoints
Dissolve calls on not-yet-activated entrypoints will block forever in the
portal cleanup call without this commit.

Issue #1778
2015-11-18 12:22:08 +01:00
Alexander Boettcher eb236a1a10 nova: re-add server object IPC cleanup call
Accidentally removed by #1658. We need to make the cleanup call for server
objects - otherwise we may get in capability identifier re-use trouble.

Issue #1778
2015-11-18 12:22:08 +01:00
Alexander Boettcher 91b69edb72 nova: adjust kernel warning/error messages
- extend one overmap message case
- show by default more error messages

Issue #1779
2015-11-18 12:22:08 +01:00
Alexander Boettcher 5c63f7003e nova: evalute pending irqs si->sm association
Fixes ps/2 driver bring-up if already some irqs are pending but not delivered
to the Genode signal(Nova semaphore) - reported by @nfeske.

Fixes #1779
2015-11-18 12:22:08 +01:00
Christian Helmuth 9730c7e333 base-nova: cleanup specific Rm_session_client
- Align implementation to the current generic implementation
- Document NOVA-specific implementation of dataspace() (as in the
  original commit message)
2015-11-04 14:37:55 +01:00
Alexander Boettcher ffbbf69959 nova: update kernel branch to avoid tlb issues
Following page fault sympton in core gets fixed:

PAGE-FAULT IN CORE (WRITE pf_addr=1000000 pf_ip=14361c from 00 <NULL>)

stack pointer 0xa01fec30, qualifiers 0x6 irUWp

faulter utcb a01ff000, last message item count 1

0 - type=1 rights=0x3 region=0x1000000+0x1000000 hotspot 0(801) - delegated

   1 a01fec30 0014361c
   2 a01fec68 001401d5
2015-10-28 15:06:23 +01:00
Alexander Boettcher d6bae1a9a3 nova: speedup clearing dataspace in core 2015-10-28 15:06:23 +01:00
Alexander Boettcher ceb04d3c11 nova: avoid race in pager_object destruction
Don't skip the cleanup call if a pager object is marked as blocked.

It happens that the pager_object is in destruction but it is also used
concurrently by the pager thread. The pager thread handling code may set the
pager object to blocked but still uses the pointer to the pager object. Avoid
locking at the state of the pager object and make the cleanup call everytime.

Error output looks like this, where the pf_ip is within

  void Pager_object::_page_fault_handler(addr_t pager_obj)

method and the pf_addr is the stale pointer to the already released pager_object.

no RM attachment (READ pf_addr=xxx pf_ip=xxx from 00 <NULL>)
static void Genode::Pager_object::_page_fault_handler(Genode::addr_t): page fault, thread '<NULL>', cpu x, ip=xxx, fault address=xxx

PAGE-FAULT IN CORE (READ pf_addr=b10e0090 pf_ip=132dbc from 00 <NULL>)
2015-10-28 15:06:22 +01:00
Alexander Boettcher 6c30bf2667 nova: interpret write page fault correctly
Fixes #1722
2015-10-09 16:38:48 +02:00
Alexander Boettcher 2e62543fdb nova: use remote revoke
Fixes #1733
2015-10-09 16:38:48 +02:00
Alexander Boettcher c0e88ec69e nova: adjust kernel quota calculation
Too less memory quota for a PD may be calculated, which leads to too early
punishment for a Genode process.

Discovered during Turmvilla scenario #1552 and issue #1733.
2015-10-09 16:38:47 +02:00
Alexander Boettcher c7195c8652 nova: sanitize cpu during pager assignment
Additionally print warnings about unavailable CPUs if they are tried to be
used during pager object setup.

Discovered during Turmvilla scenario #1552 and issue #1733.
2015-10-09 16:38:47 +02:00
Alexander Boettcher d7da035115 nova: sanitize priority parameters
threads with prio 0 will not be started and would fail silently.
Happened on Turmvilla for the USBProxy thread in virtualbox.

Discovered during Turmvilla scenario #1552 and issue #1733.
2015-10-09 16:38:47 +02:00
Alexander Boettcher 70a3bb7465 nova: avoid syscall on invalid signal capability
Reduces kernel log message noise when running on kernel-debug branch.
Additionally add a more verbose core message.

Discovered during Turmvilla scenario #1552 and issue #1733.
2015-10-09 16:38:46 +02:00
Alexander Boettcher 94f64ef464 nova: avoid sc_ctrl syscalls on invalid caps
Avoids kernel log messages if TRACE_ERROR is enabled in kernel.

Discovered during Turmvilla scenario #1552 and issue #1733.
2015-10-09 16:38:46 +02:00
Alexander Boettcher ae12f04354 nova: avoid deadlocks by self-destructing threads
Issue #1687
2015-10-06 12:18:50 +02:00
Alexander Boettcher ad24b25af0 nova: avoid buddy allocator assertion in kernel
Fixes #1672
2015-09-30 15:48:11 +02:00
Christian Helmuth 985c01116b nova: PIC compatible syscall_5
Addressing must be PC-relative, so adapt the approach from the other
nova_x86_32 syscall bindings (description by @ssumpf):

  Use call to push the current IP on the stack and add the distance of
  label 0 and label 1 in order to determine the return address, which
  NOVA requires in edx.

The bug only showed up with "-O0" in libc.lib.so in form of a unwanted
text relocation.

Fixes #1721
2015-09-30 15:48:10 +02:00
Stefan Kalkowski b585583ec7 core: do not destroy in object pool's apply scope
Destroying an object within the scope of a lambda/functor executed
in the object pool's apply function leads potentially to memory corruption.
Within the scope the corresponding object is locked and unlocked when
leaving the scope. Therefore, it is illegal to free the object's memory meanwhile.
This commit eliminates several places in core that destroyed wrongly in
the object pool's scope.

Fix #1713
2015-09-30 12:20:40 +02:00
Stefan Kalkowski ccb968ff7d safeguard the synchronized allocator template
* Move the Synced_interface from os -> base
* Align the naming of "synchronized" helpers to "Synced_*"
* Move Synced_range_allocator to core's private headers
* Remove the raw() and lock() members from Synced_allocator and
  Synced_range_allocator, and re-use the Synced_interface for them
* Make core's Mapped_mem_allocator a friend class of Synced_range_allocator
  to enable the needed "unsafe" access of its physical and virtual allocators

Fix #1697
2015-09-30 12:20:39 +02:00
Stefan Kalkowski ed52d5a211 Introduce 'spec' subdirectories to outline aspects
Instead of holding SPEC-variable dependent files and directories inline
within the repository structure, move them into 'spec' subdirectories
at the corresponding levels, e.g.:

  repos/base/include/spec
  repos/base/mk/spec
  repos/base/lib/mk/spec
  repos/base/src/core/spec
  ...

Moreover, this commit removes the 'platform' directories. That term was
used in an overloaded sense. All SPEC-relative 'platform' directories are
now named 'spec'. Other files, like for instance those related to the
kernel/architecture specific startup library, where moved from 'platform'
directories to explicit, more meaningful places like e.g.: 'src/lib/startup'.

Fix #1673
2015-09-16 13:58:50 +02:00
Stefan Kalkowski 458b4d6fc4 base: redesign object pool using lambda interface
Instead of returning pointers to locked objects via a lookup function,
the new object pool implementation restricts object access to
functors resp. lambda expressions that are applied to the objects
within the pool itself.

Fix #884
Fix #1658
2015-09-09 15:14:28 +02:00
Alexander Boettcher 6776d6c9a8 nova: extend platform test by PAT test
Issue #1566
2015-08-31 09:09:22 +02:00
Alexander Boettcher 0f2c2a675a nova: support write combining
Fixes #1566
2015-08-31 09:09:22 +02:00
Alexander Boettcher b438181188 nova: use updated r9 kernel branch
Fixes a kernel regression (because of using builtin_retrun_address)
introduced by the out-of-memory commits.

Issue #1601
2015-08-27 12:02:16 +02:00