Commit Graph

6803 Commits

Author SHA1 Message Date
Norman Feske
ff28ed0f8c base: avoid superfluous postprocessing of ldso
Even though the binary patching of ldso must be performed only once,
this postprocessing step was executed on each run because the
postprocess.tag rule is phony (the tag file is never created).
This patch removes this phony behavior by creating the tag file.

Issue #3974
2021-01-25 14:00:43 +01:00
Tomasz Gajewski
693a4d78dd lib.mk: avoid checking abi on every build
Fixes #3974
2021-01-25 14:00:43 +01:00
Piotr Tworek
8f6b934caa base-hw: Fully define _crt0_start_stack value on arm_64
The _crt0_start_stack label points to a memory location containing the
size of the bootstrap stack. On AArch64 this should be an 8 byte value,
but the code only only defines half of those using asm .long statement.
The other half is expected to be 0, which is true when using GNU as.
This is not the case when using clang's integrated as however. Since
_crt0_stack_size is defined inside .text section clang uses 0xd503201f
value (aarch64 nop instruction) to fill the extra 4 bytes.

Fix this minor incompatibility by explicitly defining both halfs of
this 8 byte quantity.

Fixes #3987
2021-01-25 14:00:43 +01:00
Piotr Tworek
384cf14bee libc: Remove unused variables from Libc::Kernel.
The _dispatch_pending_io_signals and _original_suspended_callback member
variables are not used anywhere in the code. This prompts clang to produce
a warning message about it. Remove both variables to fix it.

Issue #3985
2021-01-25 14:00:42 +01:00
Piotr Tworek
90b20b4daf nitpicker: Fix unsigned long to unsigned int cast.
The "unsigned Nitpicker::Gui_session::layer()" function returns
~0UL. This prompts clang to produce a warning about implicit unsigned
long to unsigned int conversion. Fix it by returning ~0U instead of
~0UL.

Issue #3985
2021-01-25 14:00:42 +01:00
Piotr Tworek
80318b9ae0 libc: Add semicolons after [[fallthrough]]
GCC doesn't care, but clang complains if [[fallthrough]] is not followed
by a semicolon. Existing Genode code is also not consitent in this regard.
This patch adds the extra semicolons since it works in both GCC and
clang.

Issue #3985
2021-01-25 14:00:42 +01:00
Piotr Tworek
fce5c249c2 gems: Drop unused variables from Window_list class
No code in this class uses this private member variable. This prompts
clang to produce a warning message about it. Fix it by dropping the
variable.

Issue #3985
2021-01-25 14:00:42 +01:00
Piotr Tworek
71abfb3b4f libc: Mark Libc::Vfs_plugin class as final.
The class has final destructor, but is not itself final. This prompts
clang to produce the following warning message:

class with destructor marked 'final' cannot be inherited from [-Wfinal-dtor-non-final-class]
                ~Vfs_plugin() final { }
                              ^
vfs_plugin.h:39:13: note: mark 'Libc::Vfs_plugin' as 'final' to silence this warning

Issue #3985
2021-01-25 14:00:42 +01:00
Piotr Tworek
395a9b5bf5 libc: Remove unused print function from select.cc.
This static inline function is not used anywhere. GCC does not care,
but clang warns about this. Remove the function to allow the code to
compile cleanly with both clang and GCC.

Issue #3985
2021-01-25 14:00:42 +01:00
Piotr Tworek
53081ac6b3 libc: Dont't use local_addr in try/catch block.
The code in Libc::Cloned_malloc_heap_range initializes its local_addr
member variable by calling Region_map::attach_at. This function can
throw Region_conflict exception. The handler for this exception uses the
local_addr to produce an error message. Such error log is IHMO
useless, or even incorrect since the value of local_addr is undefined
in such case.

Its also worth noting that clang 12 produces the following warning for
this code:
  "cannot refer to a non-static member from the handler of a constructor
   function try block"

Issue #3985
2021-01-25 14:00:42 +01:00
Piotr Tworek
c6d5b98227 decorator: Remove unused _topped_cnt variable.
This private member variable is not used anywhere in the code. This
produces compilation warning when using clang instead of GCC. Drop the
unused variable.

Issue #3985
2021-01-25 14:00:42 +01:00
Piotr Tworek
c402cc1045 window_layouter: Drop unused code.
The State enum and _state private member variable are not used anywhere.
This produces an extra warning when building the code with clang instead
of GCC. Remove this dead code.

Issue #3985
2021-01-25 14:00:42 +01:00
Piotr Tworek
1edac9730c scout: Instantiate templates in their namespace.
When building the code with clang the following warning message is
prodiced:

  "explicit instantiation of 'Scout::Browser_window' must occur in namespace 'Scout'
   template class Browser_window<Genode::Pixel_rgb888>"

 This happens for several different types. This patch fixes the problem
 by instantiating all those templates using their explicit full name.

Issue #3985
2021-01-25 14:00:14 +01:00
Piotr Tworek
d475015ada launchpad: Fix _spacer member initialization.
The Scout::Spacer constructor requires two arguments. The initialization
of the type in Launchpad_window declaration does not specify them. The
variable is however initialized a second time in class constructor. This is
most likely why GCC accepts this code. Clang on the other hand
complains about it.

Fix this by properly initializing both _spacer and _docview only once at
declaration time.

Issue #3985
2021-01-25 13:58:11 +01:00
Piotr Tworek
ffb931f8b1 nano3d: Fix header guard in sqrt.h
The code fails to build with clang due to the following warning/error:

  error: '_INCLUDE__NANO3D__SQRT_H_' is used as a header guard here,
  followed by #define of a different macro [-Werror,-Wheader-guard]

Fix this by removing the extra underscore from this header guard
definition.

Issue #3985
2021-01-25 13:58:11 +01:00
Piotr Tworek
b4d294f62e os: Drop unused Net::Arp_cache::_init member.
Not used anywhere in the code. Clang 11 complains about this.

Issue #3984
2021-01-25 13:58:11 +01:00
Piotr Tworek
052f678225 os: Add missing override keyword.
The _device_specific_features() implements part of the Virtio_device
interface. Decorate it with override keyword to make this clear and
also satisfy clang which produces warning regarding this.

Issue #3984
2021-01-25 13:58:11 +01:00
Piotr Tworek
3fdf323e6e os: Drop unused Net::Dhcp_client::_alloc member.
Not used for anything so technically a dead code. Clang 11 complains
about this.

Issue #3984
2021-01-25 13:58:11 +01:00
Piotr Tworek
05c36d67ce os: Fix clang constant warning in Port_allocator.
Clang 11 produces the following warning when building port_allocator.cc:

port_allocator.cc:27:21: error: result of comparison of constant 65536 with
expression of type 'const Genode::uint16_t' (aka 'const unsigned short') is
always true [-Werror,-Wtautological-constant-out-of-range-compare]
               (port.value <  (unsigned)(Port_allocator::FIRST +

Basically the code compares Port::value (uint16_t) against a constant
65536 which is larger than UINT16_MAX (65535). This comparison will always
be true.

Issue #3984
2021-01-25 13:58:11 +01:00
Piotr Tworek
ffc2a2f306 os: Disambiguate File_system in ram_file_system.h.
According to clang there are two symbols which File_system can refer to:
1. namespace File_system from ram_fs/chunk.h.
2. Vfs::File_system class from  vfs/file_system.h.
Make it clear we refer to the File_system namespace in this case.

Issue #3984
2021-01-25 13:58:11 +01:00
Piotr Tworek
fc089a1673 nic_dump: Remove unused Net::Interface::_alloc
This private member variable is not used anywhere in the code. This
breaks builds using clang instead of GCC. Drop the variable.

Issue #3984
2021-01-25 13:58:11 +01:00
Piotr Tworek
428de89f9a nic_dump: Disambiguate "Interface" in component.cc.
Clang 12 complains that Interface can both refer to Genode::Interface
and Net::Interface in this case. Explicitly state the code refers to
the latter.

Issue #3984
2021-01-25 13:58:11 +01:00
Piotr Tworek
30429a5228 nic_flood: Drop Dhcp_client::_alloc member.
This private member variable is not used anywhere in the code. This
breaks builds using clang instead of GCC. Drop it.

Issue #3984
2021-01-25 13:58:11 +01:00
Piotr Tworek
e6a9e06f62 base-linux: Drop parentheses from .cfi_undefined.
According to GNU as manual the syntax of this directive is:
  .cfi_undefined register

The manual does not mention the register should be in parentheses.
This works in GNU as even when those are present, but unfortunately
clang integrated-as does not parse this correctly. Both GNU and
clang's integrated assembler work fine when the extra parentheses
are omitted.

Fixes #3986
2021-01-25 13:58:10 +01:00
Piotr Tworek
8b172bf22e base: Explicitly state ELF segment flags
The code in base-hw/src/bootstrap/platform.cc uses segment flags for
identification purposes. Based on this information the code decides
what to do with each segment. Unfortunately the linker script does
not actually ensure the flags for a specific named segment match
expectations. The code relies on implicit linker behaviour.
This implicit behaviour can vary between linkers. This breaks
arm_v7a base-hw builds linked with LLVM's lld linker. The segment
named "ro" ends up having writeable flag set when using LLD.

This patch ensures that all ELF segments in genode.ld have their
required perimssion flags set explicitly.

Fixes #3988
2021-01-25 13:58:10 +01:00
Piotr Tworek
80e8cf99e2 base: Make Genode::List clang friendly.
Clang is generally fine with Genode::List and compiles code using it
without emitting any warnings. There is however one exception. Clang
fails hard when building base-hw/src/core/kernel/object.cc.
This is due to a call to Genode::List::remove made from
Object_identity::invalidate function. The error message clang
produces is:

  list.h:96:33: error: 'Genode::List<Kernel::Object_identity_reference>::Element::_next'
  is not a member of class 'const Kernel::Object_identity'
                              _first = le->List::Element::_next;
                                           ~~~~~~~~~~~~~~~^

When we look at the declaration of the Kernel::Object class on which
the remove method is called. as expected it does inherit Genode::List:

using Object_identity_list
	= Genode::List<Kernel::Object_identity>;

class Kernel::Object : private Object_identity_list
{
...
}

Given the error message we see that List::Element should be resolved to
Genode::List<Kernel::Object_identity>::Element, and not
Genode::List<Kernel::Object_identity_reference>::Element. But how does
clang manage to figure out we're talking about Object_identity_refecence
list here? Well, I admit I don't know the exact steps it takes to arrive
at this conclusion, but it is not entirely wrong. If we take a look at
what Kernel::Object_identity is we'll see:

class Kernel::Object_identity
: public Object_identity_list::Element,
  public Kernel::Object_identity_reference_list
{
...
}

Where as one can guess Object_identity_reference_list is defined as:

using Object_identity_reference_list
	= Genode::List<Object_identity_reference>;

Long story short Kernel::Object has Genode::List of both Kernel::Object_identity
and Kernel::Object_identity_reference in its inheritance chain and clang
is not really sure to which of those the code refers to in
Genode::List::remove method by using List::Element::.

The fix for this is relatively simple, explicitly state the full type of
the base class the code intends to refer to. Replacing List::Element,
with List<LT>::Element makes the code buildable with both clang and GCC.

Fixes #3990
2021-01-25 13:58:10 +01:00
Alexander Boettcher
9d239957bc libc: update seek state on opening O_APPEND fds
If a fd is opened in append mode and just is to be used (so never written by
the parent component) for the to be forked child, the seek state was not
pointing to the end of the file.  The wrong seek value then was used in
File_descriptor_allocator::generate_info().

Issue #3991
2021-01-25 13:58:10 +01:00
Alexander Boettcher
5fa91c573b libc: update O_APPEND fds on joined child
The fds in O_APPEND state may have changed by the child. The local seek
state needs to be valid/current for the next to be forked child, which seek
state is set by File_descriptor_allocator::generate_info().

Issue #3991
2021-01-25 13:58:10 +01:00
Norman Feske
1ccf8a280c base-hw: simplify board support in external repo
Avoid use of REP_DIR in *.mk files to simplify the use of these files as
templates for a board hosted in a separate repository.

Use REP_INC_DIR for searching headers, thereby considering headers
hosted in an external repository.

Issue #3168
2021-01-25 13:58:10 +01:00
Martin Stein
f45aa85e9f nic_router.run: fix redundant IPv4 subnets 2021-01-25 13:58:10 +01:00
Norman Feske
84443d6548 os: div_zero trace policy
This trace policy can be used as a fault-injection mechanism.
Once installed, the next time the traced thread passes a trace point
(e.g., RPC call, RPC request, ...), the policy produces a divide-by-zero
exception.
2021-01-25 13:58:10 +01:00
Norman Feske
a6a923c31b driver manager: restart intel_fb when frozen
This patch introduces heartbeat monitoring and automated restarting
of the intel framebuffer driver.
2021-01-25 13:58:10 +01:00
Norman Feske
f687d4824b sculpt: set lower bound for font size 2021-01-25 13:58:10 +01:00
Norman Feske
0a478dac7f pdf_view: tweaks for showing 16:10 slides
- Shave off two pixels on right, which are rendered white for no reason.
- Adjust resolution to make the slides fit vertically by default.
2021-01-25 13:58:10 +01:00
Martin Stein
d0ac8a6036 cbe_tester.run: use /tmp for image on autopilot 2021-01-25 13:58:09 +01:00
Stefan Kalkowski
bdd923406f base: remove SPEC variables of boards (fix #3971)
* Remove SPEC declarations from mk/spec
* Remove all board-specific REQUIRE declaratiions left
* Replace [have_spec <board>] run-script declarations with have_board where necessary
* Remove addition of BOARD variable to SPECS in toplevel Makefile
* Move board-specific directories in base-hw out of specs
2021-01-25 13:58:09 +01:00
Stefan Kalkowski
5a123e37c9 run: introduce have_board helper function
The new helper function returns a boolean value analoque to 'have_spec' if the
BOARD variable corresponds to the given value. It shall replace [have_spec <board>]
declarations in run-scripts.

Ref #3971
2021-01-25 13:58:09 +01:00
Christian Helmuth
6cfaac182a Remove Cpu_session::Native_cpu definition from API
This type can be a forward declaration in the public API because its
definition is required only in kernel-specific code.

Related to #3979
2021-01-25 13:58:09 +01:00
Christian Helmuth
3e73d8d7b6 drivers_nic-muen: permit Timer access in platform_drv 2021-01-25 13:58:09 +01:00
Pirmin Duss
a4d5687510 base-hw: allow out of tree imx8 platforms
Issue #3911
2021-01-25 13:58:09 +01:00
Alexander Boettcher
2b0170fb6a base-hw: ack thread capability on construction
Fixes #3982
2021-01-25 13:58:09 +01:00
Martin Stein
2d21d04c76 cbe_tester.run: raise timeout to 6 minutes 2021-01-25 13:58:09 +01:00
Martin Stein
f6d195a9de nic drivers: provide optional Uplink-client mode
In order to perform a smooth transition from NIC drivers that act only as NIC
session clients to NIC drivers that act only as Uplink session clients, this
commit introduces an intermediate state in which all NIC drivers support both
modes. That said, a NIC drivers mode is now statically determined through a new
optional 'mode' attribute in the drivers <config> tag that can be set to either
'nic_server' (default value) or 'uplink_client'. Reconfiguring this attribute
at a driver doesn't have any effects. Whithout this attribute being set, all
NIC drivers will behave the same as they did before the commit. When set to
'uplink_client', however, instead of providing a Nic service, they request
an Uplink session whenever their network interface becomes "UP" and close the
session whenever their network interface becomes "DOWN".

Ref #3961
2021-01-25 13:58:09 +01:00
Martin Stein
1d2649b49a nic_router: act as "Uplink" server
Let the NIC router provide an Uplink service besides the Nic service that it
already provided. Requests for an Uplink session towards the NIC router are
assigned to Domains using the same <policy> configuration tags that are used in
order to assign Nic session requests. The MAC addresses of Uplink session
components are _NOT_ considered during the allocation of MAC addresses for NIC
session components at the same Domain. The task of avoiding MAC address clashes
between Uplink session components and Nic session components is therefore left
to the integrator. Apart from that, Uplink session components are treated by
the NIC router like any other interface.

Ref #3961
2021-01-25 13:57:43 +01:00
Martin Stein
cf72d1aac3 os: introduce new "Uplink" session
Adds new Uplink session interface, the corresponding client side (Client,
Connection), and the corresponding API archives. An Uplink session is almost
the same as a NIC session with the difference that the roles of the end points
are swapped. An Uplink client is the one that provides a network interface
(for instance, a NIC driver) whereas an Uplink server is the one that uses
that network interface (for instance, a networking stack).

Therefore, in contrast to the NIC session, MAC address and link state come from
the Uplink client. The link state is reflected through the lifetime of an
Uplink session: The client requests the session only when the link state is
"UP" and closes it whenever the link state becomes "DOWN" again. The MAC
address is transmitted from the Uplink client to the Uplink server as an
argument of the session request.

Ref #3961
2021-01-25 13:48:09 +01:00
Martin Stein
9222463565 run/ping: support running manually on Linux
* Adds documentation how to prepare and finalize a Linux for running the
  scenario ontop of it
* Adds consideration of env variable 'ON_LINUX_WITH_DST_IP' that, if set,
  adapts the run script to running on Linux with the given ping destination IP

Ref #3961
2021-01-25 13:48:09 +01:00
Norman Feske
8ff75346dd sticks_blue_backdrop: inherit roms from backdrop
This patch moves the <content> <rom/> ... </content> declarations that
refer to pkg/backdrop to the runtime file of pkg/backdrop.

Issue #3981
2021-01-25 13:48:09 +01:00
Norman Feske
cae5d380c4 depot_query: inherit pkg rom content from deps
This patch relaxes the need to specify the rom content of all pkg dependencies
in each runtime file. Whenever a dependency features a runtime file, the
contained <content> <rom/> ... </content> nodes are implicitely included.

Fixes #3981
2021-01-25 13:48:09 +01:00
Alexander Boettcher
14d8627186 platform_drv: avoid using Register in Bdf type
Issue #3963
2021-01-25 13:48:09 +01:00
Alexander Boettcher
f358fcbda6 nova: flush Intel IOMMU caches
- when memory is detached

Issue #3963
2021-01-25 13:48:09 +01:00