Commit Graph

523 Commits

Author SHA1 Message Date
Norman Feske b3727a9b46 Add missing override annotations
Issue #3159
2019-02-19 11:12:11 +01:00
Norman Feske aa66b5d62f base: remove dependency from deprecated APIs
This patch adjusts the implementation of the base library and core such
that the code no longer relies on deprecated APIs except for very few
cases, mainly to keep those deprecated APIs in tact for now.

The most prominent changes are:

- Removing the use of base/printf.h

- Removing of the log backend for printf. The 'Console' with the
  format-string parser is still there along with 'snprintf.h' because
  the latter is still used at a few places, most prominently the
  'Connection' classes.

- Removing the notion of a RAM session, which does not exist in
  Genode anymore. Still the types were preserved (by typedefs to
  PD session) to keep up compatibility. But this transition should
  come to an end now.

- Slight rennovation of core's tracing service, e.g., the use of an
  Attached_dataspace as the Argument_buffer.

- Reducing the reliance on global accessors like deprecated_env() or
  core_env(). Still there is a longish way to go to eliminate all such
  calls. A useful pattern (or at least a stop-gap solution) is to
  pass the 'Env' to the individual compilation units via init functions.

- Avoiding the use of the old 'Child_policy::resolve_session_request'
  interface that returned a 'Service' instead of a 'Route'.

Issue #1987
2019-02-19 11:08:17 +01:00
Alexander Boettcher 0c24e1efdc vm_session: extensions
- support to create multiple vCPUs
- support to implement Vm_session methods client side within base library
- adjust muen specific virtualbox4 version to compile/link

Issue #3111
2019-02-19 11:08:17 +01:00
Ehmry - 38ab456c78 Remove pointers from Genode::Fifo interface
Replace methods of Genode::Fifo returning pointers with methods which
call lambdas with references.

Ref #3135
2019-02-19 11:08:17 +01:00
Norman Feske 6b289a1423 base/core: use references instead of pointers
This patch replaces the former prominent use of pointers by references
wherever feasible. This has the following benefits:

* The contract between caller and callee becomes more obvious. When
  passing a reference, the contract says that the argument cannot be
  a null pointer. The caller is responsible to ensure that. Therefore,
  the use of reference eliminates the need to add defensive null-pointer
  checks at the callee site, which sometimes merely exist to be on the
  safe side. The bottom line is that the code becomes easier to follow.

* Reference members must be initialized via an object initializer,
  which promotes a programming style that avoids intermediate object-
  construction states. Within core, there are still a few pointers
  as member variables left though. E.g., caused by the late association
  of 'Platform_thread' objects with their 'Platform_pd' objects.

* If no pointers are present as member variables, we don't need to
  manually provide declarations of a private copy constructor and
  an assignment operator to avoid -Weffc++ errors "class ... has
  pointer data members [-Werror=effc++]".

This patch also changes a few system bindings on NOVA and Fiasco.OC,
e.g., the return value of the global 'cap_map' accessor has become a
reference. Hence, the patch touches a few places outside of core.

Fixes #3135
2019-02-12 10:33:13 +01:00
Norman Feske 237d2bff3a base: fix deadlock during signal-context dissolve
This patch moves the removal of the signal context from the
'_platform_finish_dissolve' to the '_platform_begin_dissolve'
method. This is needed because the removal involves taking
the signal-registry lock. The latter must adhere the same
locking order as the code path used for signal delivery.

Fixes #3109
2019-01-30 13:55:19 +01:00
Christian Prochaska 4b805ccde9 base: move 'Buffered_output' class into public header
Fixes #3128
2019-01-30 13:49:55 +01:00
Alexander Boettcher 9a2bdf8798 vm_session: move from base-hw to base
Issue #3111
2019-01-30 13:35:28 +01:00
Alexander Boettcher 9f8198d946 hw: deny to attach managed dataspaces to VMs
Issue #3111
2019-01-30 13:35:28 +01:00
Stefan Kalkowski c65860ee53 enable i.MX6 Quad Sabrelite board for hw and foc 2019-01-30 13:35:28 +01:00
Norman Feske bf62d6b896 Move timer from os to base repository
Since the timer and timeout handling is part of the base library (the
dynamic linker), it belongs to the base repository.

Besides moving the timer and its related infrastructure (alarm, timeout
libs, tests) to the base repository, this patch also moves the timer
from the 'drivers' subdirectory directly to 'src' and disamibuates the
timer's build locations for the various kernels. Otherwise the different
timer implementations could interfere with each other when using one
build directory with multiple kernels.

Note that this patch changes the include paths for the former os/timer,
os/alarm.h, os/duration.h, and os/timed_semaphore.h to base/.

Issue #3101
2019-01-14 12:33:57 +01:00
Stefan Kalkowski 7f1692b3ca core: support unmap of managed dataspace generally
This commit solves several issues:

* correct calculation of overlap region when detaching regions
  in managed dataspaces
* prevent unmap of Fiasco.OC's core log buffer
* calculate the core-local address of regions in managed dataspaces
  if possible at all and use it to unmap on kernels where this is
  needed

Fix #976
Fix #3082
2019-01-07 12:33:56 +01:00
Christian Helmuth 600a5ecdaf hw: log stack pointer on x86 CPU exception 2019-01-07 12:25:46 +01:00
Alexander Boettcher 7536b665f1 core: avoid null pointer reference warning
Issue #3022
2019-01-07 12:25:44 +01:00
Stefan Kalkowski 8e13b376b0 hw: improve cross-cpu synchronization
This commit addresses several multiprocessing issues in base-hw:

* it reworks cross-cpu maintainance work for TLB invalidation by
  introducing a generic Inter_processor_work and removes the so
  called Cpu_domain_update
* thereby it solves the cross-cpu thread destruction, when the
  corresponding thread is active on another cpu (fix #3043)
* it adds the missing TLB shootdown for x86 (fix #3042)
* on ARM it removes the TLB shootdown via IPIs, because this
  is not needed on the multiprocessing ARM platforms we support
* it enables the per-cpu initialization of the kernel's cpu
  objects, which means those object initialization is executed
  by the proper cpu
* it rollbacks prior decision to make multiprocessing an aspect,
  but puts back certain 'smp' mechanisms (like cross-cpu lock)
  into the generic code base for simplicity reasons
2019-01-07 12:25:44 +01:00
Stefan Kalkowski aeb7ab4774 hw: prevent potential dead-lock in signal destruction
Fix #3063
2019-01-07 12:25:42 +01:00
Stefan Kalkowski d7fa4cfb8b hw: enable eager FPU context switch for ARM
* Add an ieee754 FPU test
* Remove simple fpu test

Fix #2822
2018-11-29 11:54:31 +01:00
Stefan Kalkowski d56a7beadc hw: increase cpu frequency on Wandboard Quad
Ref #1807
2018-11-16 15:17:06 +01:00
Stefan Kalkowski 8c460b3ea5 hw: enable l2-cache on Wandboard Quad (fix #1807) 2018-11-16 15:17:06 +01:00
Norman Feske 7d641d5f1f base: add Reconstructible::conditional method
The new 'conditional' method simplifies the typical use case for
'Constructible' objects where the constructed/destructed state depends
on a configuration parameter. The method alleviates the need to
re-implement the logic again and again.

The patch also removes the 'Reconstructible' constructor arguments
because they are unused.

Fixes #3006
2018-10-29 09:36:21 +01:00
Alexander Boettcher cf3ff17c50 hw/x86: enable SMP support
Fixes #2929
2018-08-28 16:48:44 +02:00
Alexander Boettcher f0f473392d hw: determine CPU count on x86
Issue #2929
2018-08-28 16:48:44 +02:00
Alexander Boettcher bf340eee91 hw: provide CPU count to core by bootstrap
The count is supposed to provide the actual available CPUs, which may not
be equal to NR_OF_CPUS.

Issue #2929
2018-08-28 16:48:44 +02:00
Alexander Boettcher 538d91ecf2 hw/x86: ACPI tables parsing support
Issue #2929
2018-08-28 16:48:44 +02:00
Alexander Boettcher e6046e0bc1 hw/x86: read out local APIC base dynamically
Issue #2929
2018-08-28 16:48:43 +02:00
Martin Stein fbe9d26c47 trace: initialize trace control in Thread::start
Previously, the trace control of a thread was initialized in its
constructor (which is generic for all components). This has the
disadvantage that the CPU-session-pointer member of the thread might not
be valid at this point. And it cannot be replaced by using the
"deprecated_env" CPU session neither as constructing the deprecated
environment in causes troubles in Core. But as the trace control
shouldn't be needed in Core anyway, the initialization can be moved to
the Thread::start implementation of non-core components. This code
already takes care of the CPU session pointer.

Fixes #2901
2018-08-02 14:36:35 +02:00
Adrian-Ken Rueegsegger 3108b71a89 Update Muen port
- Use device class in system policies to simplify platform-specific
  device assignment
- Increase timed event nr. bits from 5 to 6
2018-05-30 13:36:36 +02:00
Alexander Boettcher e6d20aba93 base: support to attach RAM dataspaces readonly
Fixes #1633
2018-05-30 13:36:27 +02:00
Stefan Kalkowski a9082eb162 hw/panda: fix -O0 / -fno-omit-frame-pointer builds 2018-05-30 12:26:19 +02:00
Reto Buerki 810f59b555 muen: Update sinfo to variant resources API 2018-04-19 12:38:25 +02:00
Alexander Boettcher 26918b82b3 hw: provide svm/vmx features via platform_info
Issue #2710
2018-03-29 14:59:07 +02:00
Reto Buerki 65f1100453 muen: Skip MSI setup for devices with no IRQ
The sinfo API now also exports PCI devices without logical IRQs.
Therefore, explicitly check interrupt count in get_msi_params() function
and ignore such devices.
2018-02-28 11:04:57 +01:00
Martin Stein abf9557bb5 AVL node/tree: make non-copyable
AVL trees can't be copied with the default copy constructor as the
parent pointer of the first item of both of the resulting trees would
point to the original tree. Copying an AVL node, however, generally
violates the integrity of the corresponding tree. The copy constructor
of Avl_tree is used in some places but in those places it can be
replaced easily. So, this commit deletes the copy constructor of
Avl_node_base which makes Avl_node and Avl_tree non-copyable.

Issue #2654
2018-02-09 13:34:23 +01:00
Johannes Schlatow bfe0031304 base-hw: enable SMP support for Zynq-7000 boards
Issue #2641
2018-02-09 13:34:19 +01:00
Norman Feske eba9c15746 Follow practices suggested by "Effective C++"
The patch adjust the code of the base, base-<kernel>, and os repository.
To adapt existing components to fix violations of the best practices
suggested by "Effective C++" as reported by the -Weffc++ compiler
argument. The changes follow the patterns outlined below:

* A class with virtual functions can no longer publicly inherit base
  classed without a vtable. The inherited object may either be moved
  to a member variable, or inherited privately. The latter would be
  used for classes that inherit 'List::Element' or 'Avl_node'. In order
  to enable the 'List' and 'Avl_tree' to access the meta data, the
  'List' must become a friend.

* Instead of adding a virtual destructor to abstract base classes,
  we inherit the new 'Interface' class, which contains a virtual
  destructor. This way, single-line abstract base classes can stay
  as compact as they are now. The 'Interface' utility resides in
  base/include/util/interface.h.

* With the new warnings enabled, all member variables must be explicitly
  initialized. Basic types may be initialized with '='. All other types
  are initialized with braces '{ ... }' or as class initializers. If
  basic types and non-basic types appear in a row, it is nice to only
  use the brace syntax (also for basic types) and align the braces.

* If a class contains pointers as members, it must now also provide a
  copy constructor and assignment operator. In the most cases, one
  would make them private, effectively disallowing the objects to be
  copied. Unfortunately, this warning cannot be fixed be inheriting
  our existing 'Noncopyable' class (the compiler fails to detect that
  the inheriting class cannot be copied and still gives the error).
  For now, we have to manually add declarations for both the copy
  constructor and assignment operator as private class members. Those
  declarations should be prepended with a comment like this:

        /*
         * Noncopyable
         */
        Thread(Thread const &);
        Thread &operator = (Thread const &);

  In the future, we should revisit these places and try to replace
  the pointers with references. In the presence of at least one
  reference member, the compiler would no longer implicitly generate
  a copy constructor. So we could remove the manual declaration.

Issue #465
2018-01-17 12:14:35 +01:00
Johannes Schlatow d4a75ed9bb base-hw: move spec/zynq files to zynq_qemu
This is necessary because in contrast to the zynq boards (see specs in genode-world), only zynq_qemu uses UART_0.
These files should thus fall under the zynq_qemu spec.

Fixes #2615
2017-12-21 15:01:51 +01:00
Norman Feske 552662d594 core: omit allocator info at boot time
Fixes #2549
2017-12-21 15:01:48 +01:00
Alexander Boettcher a36465426b base-<kernel>: export core log as ROM
Issue #2207
2017-12-21 15:01:47 +01:00
Alexander Boettcher 2cb635c3e3 base-*: rename core_log.cc to core_log_out.cc
Issue #2207
2017-12-21 15:01:46 +01:00
Stefan Kalkowski 219615b0eb hw: remove code duplication of core and hw lib
Fix #2593
2017-12-21 15:01:33 +01:00
Stefan Kalkowski 323de9b229 hw: map kernel text segment read-only
Fix #2592
2017-12-21 15:01:33 +01:00
Stefan Kalkowski d1e0e460a1 hw: de-reference deleted kernel objects
Fix #2591
2017-11-30 11:23:20 +01:00
Alexander Boettcher 858f5732ba hw: add mbi2 framebuffer support
Issue #2555
2017-11-30 11:23:09 +01:00
Alexander Boettcher e1ac124a4d hw: evaluate also ACPI RSDP v1 with MBI2
Issue #2526
2017-11-30 11:23:09 +01:00
Martin Stein 8e80c05be7 signal: organize signal contexts as ring list
Ref #2532
2017-11-30 11:23:02 +01:00
Stefan Kalkowski d164cbac8c hw: do not change x86 paging attributes on fly
Instead of changing the attributes (e.g., Xd bit) of the top-level page-tables,
set them to allow everything. Only leafs of the paging hierarchy are set
according to the paging attributes given by core. Otherwise, top-level page-
table attributes are changed during lifetime, which requires a TLB flush
operation (not intended in the semantic of the kernel/core).
This led to problems when using the non-executable features introduced by
issue #1723 in the recent past.
2017-11-09 12:18:44 +01:00
Stefan Kalkowski be4e34b6b5 hw: unify mmu fault handling
Recent work related to issue 1723 showed that there is potential
to get rid of code duplication in MMU fault handling especially
with regard to ARM cpus.
2017-11-06 13:57:22 +01:00
Stefan Kalkowski d6a05245f2 hw: remove User_context
Fix #2540
2017-11-06 13:57:20 +01:00
Stefan Kalkowski 0635d5fffb hw: turn Cpu_idle into a Thread
Fix #2539
2017-11-06 13:57:20 +01:00
Stefan Kalkowski 84331ac0f7 hw: remove obsolete Kernel::Cpu_context
Due to the changes when fixing issue #2091 the Kernel::Cpu_context
became superfluent and is not used anymore.

Fix #2538
2017-11-06 13:57:20 +01:00