Commit Graph

349 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 6e7f7bdad4 base: move crt0.h and elf.h to base/internal
Those headers remained unused outside the internal framework. So it is
better to remove them from the public API.

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
Adrian-Ken Rueegsegger 3a9e5cbd8c Relax tool checks of Muen port
The gnat and gprbuild tools are not necessarily in the PATH when
preparing the port since the effective location is specified by the
--image-muen-gnat-path RUN_OPT.
2016-02-26 11:36:55 +01:00
Reto Buerki 3c23ddb2d5 hw_x86_64_muen: Add support for MSI
Use the new Sinfo::get_dev_info function to retrieve device information
in the platform-specific get_msi_params function. If the requested
device supports MSI, set the IRQ and MSI address/data register values to
enable MSIs in remappable format (see VT-d specification, section
5.1.2.2).

Currently only one MSI per device is supported as the subhandle in the
data register is always set to 0.
2016-02-26 11:36:54 +01:00
Reto Buerki d137f0f2bf hw_x86_64_muen: Extend sinfo API with device info
The new Sinfo::get_dev_info function can be used to retrieve information
for a PCI device with given source-id (SID). The function returns false
if no device information for the specified device exists.
2016-02-26 11:36:54 +01:00
Reto Buerki 3350c6bf53 hw: Introduce platform-specifc MSI function
The platform-specific get_msi_params function returns MSI parameters for
a device identified by PCI config space address. The function returns
false if either the platform or the device does not support MSI mode of
operation.
2016-02-26 11:36:54 +01:00
Reto Buerki 11ee72eaa6 hw: Add MSI variables to Irq_session_component
Extend the base-hw Irq_session_component class with _is_msi, _address
and _value variables required to support MSI mode of operation.

Return MSI configuration in info() function if _is_msi is set to true.
2016-02-26 11:36:54 +01:00
Reto Buerki ed54bb2724 hw_x86_64_muen: Adjust _ram_regions function
The available RAM region starts at 25 MiB, not 2 MiB. Also, increase the
region size to 256 MiB.
2016-02-26 11:36:53 +01:00
Reto Buerki 1abff01c66 Update hw_x86_64_muen doc for Muen release 0.7.0 2016-02-26 11:36:53 +01:00
Reto Buerki aa8e5c5016 Update Muen port to release version 0.7.0 2016-02-26 11:36:53 +01:00
Sebastian Sumpf 1ff7de62f6 muen: remove depenency to ports for make target all 2016-02-26 11:36:52 +01:00
Sebastian Sumpf d17134baef ldso: Support for RISC-V
issue #1880
2016-02-26 11:36:51 +01:00
Mark Vels 1668983efa base-hw: RISC-V Rocket Core on Zynq
This commit adds rocket core on the Zynq FPGA support to base HW. It also takes
advantage of the new timer infrastructure introduced with the privileged 1.8 and
adds improved TLB flush support.

fixes #1880
2016-02-26 11:36:51 +01:00
Sebastian Sumpf c246a0d194 base-hw: initial RISC-V support
using the spike instruction emulator

issue #1880
2016-02-26 11:36:51 +01:00
Stefan Kalkowski 5fc9f68941 hw_x86_64: do not reference any muen specifics
Do not build core-muen_on library without the muen soecifier set.
Do not reference files of the muen contrib directory in the first
pass of make's rule analysis, when parding the muen specific kernel
makefile.

Fix #1859
2016-01-26 16:20:47 +01:00
Stefan Kalkowski c3d4802ac8 hw: re-implement lazy FPU context switch
The new implementation of the FPU and FPU context is taken out to
separate architecture-dependent header files. The generic Cpu_lazy_state
is deleted. There is no hint about the existence of something like an
FPU in the generic non-architexture-dependent code anymore. Instead the
architecture-dependent CPU context of a thread is extended by an FPU
context where supported.

Moreover, the current FPU implementations are enhanced so that threads
that get deleted now release the FPU when still obtaining it.

Fix #1855
2016-01-26 16:20:38 +01:00
Stefan Kalkowski f539cf1231 hw: adjust core's signal thread's stack size
The stack size should be architecture dependent.

Fix #1854
2016-01-26 16:20:37 +01:00
Stefan Kalkowski 5afad64586 hw: preserve core's context-area (Fix #1853)
Remove core's context-area from its virtual memory allocator
2016-01-26 16:20:37 +01:00
Stefan Kalkowski 7aff1895bf hw: enable SMP for ARM Cortex A9
This commit enables multi-processing for all Cortex A9 SoCs we currently
support. Moreover, it thereby enables the L2 cache for i.MX6 that was not
enabled until now. However, the QEMU variants hw_pbxa9 and hw_zynq still
only use 1 core, because the busy cpu synchronization used when initializing
multiple Cortex A9 cores leads to horrible boot times on QEMU.

During this work the CPU initialization in general was reworked. From now
on lots of hardware specifics were put into the 'spec' specific files, some
generic hook functions and abstractions thereby were eliminated. This
results to more lean implementations for instance on non-SMP platforms,
or in the x86 case where cache maintainance is a non-issue.

Due to the fact that memory/cache coherency and SMP are closely coupled
on ARM Cortex A9 this commit combines so different aspects.

Fix #1312
Fix #1807
2016-01-26 16:20:18 +01:00
Martin Stein 2b2007bc3f hw: add Pl310::Debug register definitions
Ref #1312
2016-01-15 16:42:12 +01:00
Martin Stein c58de0d80e hw_panda: driver for Cortex-A9 wakeup generator
Ref #1312
2016-01-15 16:42:12 +01:00
Martin Stein 5755245609 hw: end interrupts SMP-safe on ARM (Ref #1312) 2016-01-15 16:42:12 +01:00
Stefan Kalkowski 166672fe16 hw: l2 cache initialization is platform specific
On ARM Cortex A9 platforms the external PL310 L2 cache controller
needs to be initialized dependent on the SoC. For instance on Pandaboard
it needs to call the firmware running in TrustZone's secure world,
on i.MX6 it initializes it directly, on other boards it doesn't need
to be initialized at all, because the bootloader already did so.
Therefore, we should implement the PL310 intialization in board specific
code and not in the base class implementation.

Ref #1312
2016-01-15 16:42:12 +01:00
Stefan Kalkowski e05d26567d hw: make 'smp' property an aspect (Ref #1312)
This commit separates certain SMP aspects into 'spec/smp' subdirectories.
Thereby it simplifies non-SMP implementations again, where no locking
and several platform specific maintainance operations are not needed.
Moreover, it moves several platform specifics to appropriated places,
removes dead code from x86, and starts to turn global static pointers
into references that are handed over.
2016-01-15 16:42:12 +01:00
Adrian-Ken Rueegsegger b1b3c7bf34 doc: Extend Muen tutorial to match new build process 2016-01-08 14:37:57 +01:00
Adrian-Ken Rueegsegger cb68f9a320 hw: Add kernel/spec/muen/target.mk to build Muen SK
This adds the automated compilation of the Muen Separation Kernel and
the required components to the hw_x86_64_muen build process.
2016-01-08 14:37:56 +01:00
Adrian-Ken Rueegsegger 8d2f2b0101 hw: Add port for Muen Separation Kernel
For additional information about the Muen SK refer to the project page
at [1].

[1] - http://muen.codelabs.ch/
2016-01-08 14:37:56 +01:00
Stefan Kalkowski 2316937e58 hw: remove main thread's initial UTCB from vm area
The main thread's UTCB, used during bootstrap of the main thread before
it allocates its context area, needs to be outside the virtual memory
area controlled by the RM session, because it is needed before the main
thread can access its RM session.

Fix #1804
2015-12-10 13:16:27 +01:00
Martin Stein 227b539193 cpu_quota x86_64: fix RAM quota and stack size
The test threads previously used a stack size independent from the machine
word width. Qemu was previously configured to provide 64Mb of RAM which isn't
sufficient for x86_64.

Ref #1805
2015-12-10 13:16:26 +01:00
Martin Stein 02ef3d13a3 hw: explain misleading "Quota exceeded"
Upgrading the quota of a PD session on HW always triggers a "Quota
exceeded" warning. To prevent unecessary debugging effort in the future,
we explain in an in-code comment that the warning is normal.

Ref #1805
2015-12-10 13:16:26 +01:00
Stefan Kalkowski 60ba210a6b hw: reference count capabilities in UTCBs
When capabilities are delegated to components, they are added to the UTCB of the
target thread. Before the thread is able to take out the capability id out of
the UTCB and adapt the user-level capability reference counter, it might happen
that another thread of the same component deletes the same capability because
its user-level reference counter reached zero. If the kernel then destroys the
capability, before the same capability id is taken out of all UTCBs, an
inconsitent view in the component is the result.  To keep an consistent view in
the multi-threading scenario, the kernel now counts how often it puts a
capability into a UTCB. The threads on the other hand hint the kernel when they
took capabilities out of the UTCB, so the kernel can decrement the counter
again. Only when the counter is zero, capabilities can get destructed.

Fix #1623
2015-12-10 13:16:25 +01:00
Stefan Kalkowski ee4619687b hw: remove 1:1 I/O mappings from virtual memory
Likewise on the x86 branch, we have to remove all virtual memory ranges from the
virtual memory allocator that are used by one-by-one mappings of I/O regions
used by the kernel.

Fix #1797
2015-12-10 13:16:24 +01:00
Martin Stein bed04f1f16 hw & imx53: kernel Trustzone config for USB armory
On the USB Armory, we want to secure different devices than on other i.MX53
implementations. Thus, add a board specific configuration that is interpreted
by the kernel Trustzone initialization.

Ref #1497
2015-11-29 18:17:04 +01:00
Martin Stein 85ba3259f8 hw & imx53: IRQ injection via Vm::proceed
Enhance the VM state, that can be accessed by a VMM, by a member
'unsigned irq_injection'. In Kernel::Vm::proceed check, whether
irq_injection is set.  If so, check whether irq_injection is a
non-secure IRQ.  If so, let the PIC raise this IRQ in the VM and reset
irq_injection.

Ref #1497
2015-11-29 18:17:04 +01:00
Sebastian Sumpf 0c3dfbad65 base-hw: use signal context list for pending signals
'block_for_signal' and 'pending_signal' now set pending flag in signal context
in order to determine pending signal. The context list is also used by the
'Signal_receiver' during destruction.

Fixes #1738
2015-11-27 12:18:50 +01:00
Alexander Boettcher 826c81ac18 hw_x86: discover all physical memory in core
Fixes #1741
2015-11-04 14:09:28 +01:00
Sebastian Sumpf 2b429ee84c base: Dispatch server signal in entry point
Currently, when a signal arrives in the main thread, the signal dispatcher is
retrieved and called from the main thread, the dispatcher uses a proxy object
that in turn sends an RPC to the entry point. This becomes a problem when the
entry point destroys the dispatcher object, before the dispatch function has
been called by the main thread. Therefore, the main thread should simply send an
RPC to the entry point upon signal arrival and the dispatching should be handled
solely by the entry point.

Issue #1738
2015-10-28 15:06:22 +01: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 53eb666ed0 hw: invalidate all caps of a thread in destruction
Fix #1682
2015-09-30 12:20:39 +02:00
Stefan Kalkowski 37bae7bc1f hw: simplify IPC node's state model (fix #1691)
Merge the Ipc_node class' state PREPARE_AND_AWAIT_REPLY and AWAIT_REPLY,
as well as PREPARE_REPLY ans INACTIVE into one.
2015-09-30 12:20:39 +02:00