Commit Graph

284 Commits

Author SHA1 Message Date
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
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
Stefan Kalkowski 8c168d7943 hw: use weak pointer when resolving a page-fault
Fix #1674
2015-09-30 12:20:35 +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
Johannes Schlatow 40b31876d2 base-hw: Add basic Zynq-7000 support (QEMU)
Ref #1599
2015-09-09 15:14:28 +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
Martin Stein 555835c95b hw: unlock kernel before context propagation
Propagating the user context-pointer from C++ code to the mode
transition assembly doesn't touch any CPU global data. Thus, we can
reduce the in-sync window.

Fixes #1223
2015-09-09 15:14:27 +02:00
Martin Stein 91cb3decdb hw_x86_64: move Cpu_context stuff to extra unit
Other platforms implement Kernel::Cpu_context stuff in
kernel/cpu_context.cc. On x86_64, it was implemented in
kernel/thread.cc. The commit fixes this inconsistency to the other
platforms.

Ref #1652
2015-09-09 15:14:27 +02:00
Martin Stein 4e98a0f64a hw: get rid of kernel/thread_* files
The distinction between Kernel::Thread and Kernel::Thread_base is
unnecessary as currently all Hw platforms would have the same content in
the latter class. Thus I've merged Kernel::Thread_base into
Kernel::Thread. Thereby, Kernel::Thread_event can be moved to
kernel/thread.h.

Ref #1652
2015-09-09 15:14:27 +02:00
Alexander Boettcher dd9793cdc7 hw: show ip and sp during unresolvable pagefault
Issue #1652
2015-09-09 15:14:27 +02:00
Alexander Boettcher c5877b5575 hw: remove access_thread_regs syscall
Issue #1652
2015-09-09 15:14:27 +02:00
Christian Helmuth 30db0c5364 hw: prevent compiler warning 2015-08-31 09:09:23 +02:00
Stefan Kalkowski 9f1beaa036 hw_x86_64: use 'muen' SPEC to implement aspect 2015-08-31 09:09:22 +02:00
Reto Buerki ad411e1a90 hw_x86_64_muen: Implement PIC take_request()
The Muen-specific PIC implementation provides the irq_occurred()
function which is used to register an IRQ with the PIC upon thread
exception.

The occurred IRQs are stored in a boolean array internally and handed
out to a CPU via take_request().
2015-08-27 13:48:25 +02:00
Reto Buerki fa26805fd7 hw_x86_64_muen: Implement paravirt timer driver
The driver uses the timer page containing a vector and timer value to
implement the start_one_shot() and value() functions. The timer value
designates the absolute tick count of the next event.

The address of the time page is acquired using the get_memregion_info
Sinfo API function.
2015-08-27 13:48:25 +02:00
Reto Buerki 4a51f933ce hw_x86_64_muen: Add initial pagetables file
The initial pagetables for hw_x86_64_muen specify an identity mapping
from 2MiB to 1GiB plus mappings for the paravirt pages (sinfo, timer,
...).
2015-08-27 13:48:25 +02:00
Reto Buerki c434a5ceec hw_x86_64_muen: Add C++ implementation of Sinfo API
The Muen Sinfo API is used to retrieve information about the execution
environment of a subject running on the Muen Separation Kernel.

While the C++ API is defined in sinfo.h, musinfo.h specifies the
internal format of the information stored in the Sinfo pages provided by
the Muen SK. It is a copy of the file contained in the libmusinfo
library of the Muen project. That is the reason why the coding style in
this file differs from the official style.
2015-08-27 13:48:25 +02:00
Reto Buerki 5036b96c11 hw_x86_64_muen: Add fake Timer::ms_to_tics impl
This makes the scheduler happy and it starts scheduling threads:

Booting Muen kernel v0.6.0-329-gdd545fe-UNCLEAN
0004|kernel initialized
0004|Genode 14.11-400-gecee95b
0004|int main(): --- start init ---
0004|[init -> test-printf] -1 = -1 = -1
2015-08-27 13:48:25 +02:00
Adrian-Ken Rueegsegger 21fb356cd4 hw_x86_64_muen: Provide Muen-specific serial
Subjects on Muen are not allowed to access the BIOS data area. Instead a
serial console is emulated on the fixed I/O port 0x3f8.
2015-08-27 13:48:25 +02:00
Reto Buerki 96a0820e89 Add Muen-specific platform_support.cc
The file specifies Muen-specific MMIO regions: Sinfo and paravirt timer
pages.
2015-08-27 13:48:25 +02:00
Adrian-Ken Rueegsegger c310e335ae hw_x86_64: Enable more specialized setup_irq_mode()
Move Platform::setup_irq_mode function from x86 platform_support.cc to
x86_64 specific file. This will enable the upcoming x86_64_muen platform
to provide a separate implementation.
2015-08-27 13:48:25 +02:00
Reto Buerki dcd20f1566 hw: skeleton for building x86_64_muen
The hw_x86_64_muen platform is a x86/64 base-hw kernel which runs as
isolated subject (guest) on the Muen Separation Kernel (SK) [1].

The platform is implemented as an extension to hw_x86_64 replacing the
PIC and timer drivers with paravirtualized variants. The skeleton
contains a dummy PIC and timer implementation for now.

[1] - http://muen.sk
2015-08-27 13:48:24 +02:00
Alexander Boettcher 9cd85ddcf7 hw: call lock_for_destruction in platform_pd
Issue #1607
2015-08-25 10:11:07 +02:00
Adrian-Ken Rueegsegger ec92e9c3df hw_x86_64: Only handle masking of I/O APIC IRQs
Ignore toggle requests for vectors not assigned to the I/O APIC.

Fixes #1651
2015-08-21 11:00:59 +02:00
Adrian-Ken Rueegsegger 780863007d hw_x86_64: Use PAUSE instruction in wait_for_interrupt
Add spin loop hint by means of the PAUSE instruction since
wait_for_interrupt is called in a busy loop. This should improve processor
performance and reduce power consumption.

Note: HLT cannot be used since it is a privileged instruction and the idle
      thread is executed in userspace.
2015-08-21 11:00:59 +02:00
Reto Buerki 2a0b6fb541 hw_x86_64: Factor out _core_only_mmio_regions function
Move the _core_only_mmio_regions function to the
x86_64/platform_support.cc file. This is required to make it overridable
for other platforms deriving from x86.
2015-08-21 11:00:59 +02:00
Adrian-Ken Rueegsegger afb827a96f hw_x86_64: Restore kernel SS on MT entry 2015-08-21 11:00:59 +02:00
Adrian-Ken Rueegsegger 0e065c162b hw_x86_64: Log unknown exceptions of Cpu_idle 2015-08-21 11:00:59 +02:00
Adrian-Ken Rueegsegger c2ff0ae9d4 Minor cleanup fixes
- Fix spelling errors
- Remove extra semicolons
- Remove extra spaces

Fixes #1650
2015-08-21 11:00:59 +02:00
Stefan Kalkowski eafe5e81e3 core: unify and simplify paging code (Fix #1641)
For most platforms except of NOVA a distinction between pager entrypoint
and pager activation is not needed, and only exists due to historical
reasons. Moreover, the pager thread's execution path is almost identical
between most platforms excluding NOVA, HW, and Fisco.OC. Therefore,
this commit unifies the pager loop for the other platforms, and removes
the pager activation class.
2015-08-21 10:58:59 +02:00
Martin Stein f3e76b3e9a base: use BDA header in base-nova like base-hw
Moves the Bios Data Area header from base-hw to base. Modifies the
base-nova core console that it uses the header as replacement for
the previous BDA bit logic.

Ref #1625
2015-07-21 09:30:12 +02:00
Adrian-Ken Rueegsegger 2fe0860ba7 hw_x86_64: Extend inital page tables up to 1 GiB
To avoid future issues with regards to non-existent mappings in the
initial pagetables, extend them to cover the memory range of 2 MiB up to
1 GiB.
2015-07-21 09:30:11 +02:00
Alexander Boettcher 73f7a95627 hw: use bios data area to detect com/uart ports
Fixes #1625
2015-07-21 09:30:11 +02:00
Alexander Boettcher 0b019d0508 base: move x86 uart driver from nova to base
So it can be reused by base-hw-x86 instead of re-writing it.

Fixes #1403
2015-07-21 09:30:11 +02:00
Martin Stein bc8a5cbb2a hw: fix CPU-quota bug in Platform_thread
Since the HW-kern-caps commit, there was a bug in the Platform_thread
constructor. When called for a user thread, the constructor stated 0
as CPU quota at the Kernel_object instead of its quota input-paramater.

Fixes #1620
2015-07-07 19:48:08 +02:00
Stefan Kalkowski 89255c3979 remove Versatile Express board (Fix #1611) 2015-07-07 19:48:06 +02:00
Stefan Kalkowski de4a98c777 hw: avoid using RM session in platform thread
Fix #888
2015-07-01 14:46:18 +02:00
Stefan Kalkowski f5d5ed9637 hw: use kernel signal API for page-fault signals
Instead of using the Genode user-level signal API to signal page-faults to
a page-fault handler, use the kernel API directly. Thereby the accounting
of signal contexts needed for each paging subject can be done easily.

Fix #956
2015-07-01 14:46:18 +02:00
Stefan Kalkowski 8abd70e6e7 hw: allocate core's page-tables outside of binary
Moreover, be strict when calculating the page-table requirements of
core, which is architecture specific, and declare the virtual memory
requirements of core architecture-wise.

Ref #1588
2015-07-01 14:46:17 +02:00
Stefan Kalkowski 3ee2997198 hw: remove unused declaration in core
Ref #1588
2015-07-01 14:46:17 +02:00
Stefan Kalkowski 6552d47e60 hw: eliminate missing references for consts
Fix #1606
2015-07-01 14:46:16 +02:00
Norman Feske 281d3ffba9 hw: free correct IRQ when closing IRQ session
The ~Irq_session_component relied on the IRQ number obtained by the
corresponding kernel IRQ object to mark the IRQ as free at the IRQ
allocator. However, since the kernel IRQ object is initialized not
before the 'sigh' function is called, the IRQ of sessions that
never called 'sigh' could not be freed correctly. This patch fixes
the problem by not relying on the kernel IRQ object for obtaining
the number in the destructor but using the '_irq_number' member
variable instead.
2015-07-01 14:46:15 +02:00
Stefan Kalkowski 2a351215f4 base: remove pager code from public API
Fix #1593
2015-07-01 14:46:15 +02:00