Compare commits

..

561 Commits

Author SHA1 Message Date
Christian Helmuth
0768185fea depot: update recipe hashes 2022-04-28 11:52:06 +02:00
Josef Söntgen
3e45b8aace pc_wifi_drv: implement kmem_cache_free_bulk
So far this dummy was only triggered on AX devices after the driver
has been used for a few hours.

Issue #4488.
2022-04-28 08:02:33 +02:00
Josef Söntgen
481b4fde25 pc_intel_fb_drv: fix Shuttle DS57U
When using the framebuffer driver on this machine the
'cpu_latency_qos_request_active' dummy is triggered. Removing the
trace-and-stop call makes the driver usable.

In addition, 'cpu_latency_qos_remove_request' is changed as well
although it is guarded by 'cpu_latency_qos_request_active'.

Fixes #4489.
2022-04-28 08:02:33 +02:00
Norman Feske
6cab572b8f sculpt: increase lowest-possible font size
This patch fixes rare freezes of menu view instances, which could happen boot
time whenever the leitzentale GUI happens to get initialized before the display
driver finished setting up a reasonable mode. In this case, the resolution-
dependent font size can temporarily get almost zero, tripping up the glyph
renderer.
2022-04-28 08:02:33 +02:00
Norman Feske
df789b943c Update Sculpt documentation to version 22.04 2022-04-28 08:02:33 +02:00
Josef Söntgen
952c2f2f8b gpt_write: alloc packet with proper alignment
The component wrongly ignored the advertised requst aligment of the
block provider.

Fixes #4486.
2022-04-28 08:02:33 +02:00
Josef Söntgen
b8e2b780e3 nvme_drv: reject requests with unaligned offset
Since the driver relies on all requests being Nvme::MPS_LOG2 aligned
as advertised in its Block::Info the added check will reject any
misaligned requests (using 'gpt_write' led to an IOMMU write fault).

Issue #4486.
2022-04-28 08:02:33 +02:00
Sebastian Sumpf
8d00af1d7b gems/decorators: adjust resources for WQHD displays
2560x1440 resolutions require more RAM resources. Additionally, make
sure that the decorator 'init' receives enough CAPs to service the
decorator configuration.

fixes #4485
2022-04-28 08:02:33 +02:00
Josef Söntgen
754d35244f pc_wifi_drv: do not reset call result
Issue #4983
Issue #4455
2022-04-28 08:02:33 +02:00
Stefan Kalkowski
2df0bbf387 pc_usb_host_drv: implement sysfs dummy function
Due to changes in the lx_emul USB driver, a further function
sysfs_delete_link gets called.

Ref genodelabs/genode#4483
2022-04-28 08:02:33 +02:00
Stefan Kalkowski
af0531398a lx_emul: cleanup URBs in USB driver in release
* Claim and release USB interfaces
* Collect URBs in flight in anchor list
* When releasing interfaces, wait until all
  anchored URBs finally got killed successfully

Fix genodelabs/genode#4483
2022-04-28 08:02:33 +02:00
Stefan Kalkowski
4b983f92c5 lx_emul: support execution till condition applies
In rare cases it is necessary to execute Linux contributed code
until certain work is finished, e.g. when in a synchronous RPC call,
a session construction or destruction a result is needed. Therefore,
we introduce a new lx_emul function called lx_emul_execute_kernel_until.

Ref genodelabs/genode#4483
2022-04-28 08:02:33 +02:00
Stefan Kalkowski
8ca2c597e0 os: extend USB C-API with claim/release
To signal that a device gets used and released by a session
introduce claim, release, and release all callbacks in the
USB interface of the C-API.

Ref genodelabs/genode#4483
2022-04-28 08:02:33 +02:00
Josef Söntgen
2e9e5c37b5 pc_usb_host_drv: supress '__printk_ratelimit' 2022-04-28 08:02:33 +02:00
Josef Söntgen
2fd2b7d628 lx_kit: map I/O mem with proper offset
In case multiple devices shared the same memory-mapped I/O page
we have to take the offset into account. This commit fixes the
'pc_usb_host_drv' on the Thinkpad X201 where the two EHCI host
controller share the some I/O memory page.

Fixes #4477.
2022-04-28 08:02:33 +02:00
Sebastian Sumpf
396cc53020 libc: update download url to archive repo
FreeBSD 12.0 was moved to archive url:
http://ftp-archive.freebsd.org/pub/FreeBSD-Archive/old-releases/amd64/12.0-RELEASE/

fixes #4478
2022-04-25 14:42:43 +02:00
Alexander Boettcher
240ec72086 nova: handle invalid SVM exit correctly
With issue #4391 a regression was introduced, which makes VMs on AMD SVM non
working.
2022-04-25 14:40:04 +02:00
Alexander Boettcher
0d163915d0 nova: avoid hangs on AMD with IOMMUs
With the new usb driver #4399 and usage of the updated dde_linux lx_eml/lx_kit
approach a much higher rate of IRQ session construction/destruction and signal
handler assignment (irq->sigh) are caused. This trickles down to the kernel,
which causes an hang of the AMD IOMMUs due to not setting reserved bits
adequately. The commit fixes the root cause in the kernel and add a guard
into core's to limit such driver behaviour.

Fixes #4482
2022-04-23 22:53:03 +02:00
Johannes Schlatow
260d7aa701 sculpt: fix clipboard routing in deploy/example
Fixes genodelabs/genode#4475
2022-04-13 16:29:19 +02:00
Christian Helmuth
b66650c2e8 lx_emul: remove forward declaration in clocksource 2022-04-13 15:17:49 +02:00
Martin Stein
25eb24299c machine.vbox6: add audio enabledIn/Out options
The file listed only enabled="false" in the audio adapter tag. However,
setting only this option to true isn't sufficient for guest audio to work.
One has to set also enabledIn respectively enabledOut in the same tag. The
new default vbox6 file reflects this.

Fixes #4476
2022-04-13 15:01:46 +02:00
Norman Feske
25ae54223a os/part_block: simplify split block-I/O handling
Issue #4474
2022-04-13 14:08:46 +02:00
Norman Feske
b3678f44b7 libports/fatfs: handle split block I/O jobs
Issue #4474
2022-04-13 14:08:40 +02:00
Norman Feske
68af13bb34 os/vmm: handle split block I/O jobs
Issue #4474
2022-04-13 14:08:34 +02:00
Norman Feske
7d6c592417 vfs/rump: handle split block I/O jobs
This patch fixes a potential data corruption issue that could occur when
issuing large I/O requests to vfs/rump, which don't fit into the default
block I/O buffer of 128 KiB. Note that we haven't observed the problem
in practice (Sculpt hosts vfs/rump in a dedicated vfs server, which
fragments requests) but spotted the issue while reviewing the code. We
could trigger problem by explicitly changing the I/O buffer size to 32
KiB.

Issue #4474
2022-04-13 14:08:25 +02:00
Norman Feske
d815322efe os: simplify split block operations
This patch changes the meaning of the 'offset' parameter of the
'produce_write_content' and 'consume_read_result' hook functions.
The value used to reflect the absolute byte position but in practice,
a job-relative byte offset is desired.

Issue #4474
2022-04-13 14:08:15 +02:00
Christian Helmuth
8ece236635 depot: update recipe hashes 2022-04-13 11:54:46 +02:00
Christian Helmuth
a45aabe68c usb_block: handle block requests in Signal_handler only
Before this commit, the block-request handler was implemented as
Io_signal_handler and, additionally, the USB driver called the
block-request handler on request completion directly on I/O level. This
is generally a bad idea because I/O handlers should avoid to have direct
global side effects. In contrast, application logic should be
implemented in way that it consumes atomic state changes after I/O
completed. Now USB I/O completion locally submits a signal to the
block-request Signal_handler.
2022-04-13 09:29:06 +02:00
Alexander Boettcher
2ec6a8249a pc: intel display driver: avoid sysfs related hang
Issue #4450
2022-04-13 09:29:06 +02:00
Sebastian Sumpf
2a47379ab5 vbox6: display cause of error on failed 'initFromSettings'
Use 'ErrorInfoKeeper' to retrieve current error from XPCOM service and
log message.

fixes #4473
2022-04-13 09:29:06 +02:00
Christian Prochaska
f91ece78e0 dde_rump: move periodic sync into rump kernel thread
Issue #4459
2022-04-13 09:29:06 +02:00
Christian Prochaska
d8211b65a5 dde_rump: fix clock functions
Issue #4459
2022-04-13 09:29:06 +02:00
Christian Prochaska
95aba3feef dde_rump: dispatch I/O signals in Timed_semaphore
Issue #4459
2022-04-13 09:29:05 +02:00
Christian Prochaska
af80ecb651 dde_rump: check blocking condition right before blocking
Issue #4459
2022-04-13 09:29:05 +02:00
Christian Helmuth
2da57613bf depot_deploy: support usb service provider
Now, Usb sessions can be effectively routed to the black-hole component
in Sculpt.

Issue #4419
2022-04-13 09:29:05 +02:00
Norman Feske
4dbe1588a6 sculpt: relax heartbeat rate
This patch reduces the response time of supposedly stuck situations like
an unresponsive part_block component. First, it reduces the heartbeat
rate from 1 to 2 seconds to make it consistent with the frequency of
state reports. Second, it allows up to four skipped heartbeats until
regarding the situation as stuck. With those changes, the prolonged
initialization sequence of a USB ZIP drive succeeds with Sculpt.
2022-04-13 09:29:05 +02:00
Christian Helmuth
02693734d3 black_hole: increase RAM quota in test-black_hole
Issue #4419
2022-04-13 09:29:05 +02:00
Martin Stein
b9141f98af test/black_hole: fix "packet alloc failed"
The Uplink_test used to end in an uncaucht exception about a failed packet
allocation on several x86_32 platforms.

* Destruct and re-construct the corresponding TX packet allocator during a
  link-down-up step in the Uplink test. Fixes the exceptions but results in a
  never ending test.
* Decouple the link-down-up steps from the handling of packet stream signals
  by simply triggering it with a local periodic timeout of 1 sec period.
  This prevents that the Uplink_test never finishes because it destructs the
  Uplink connection too often.
* The test finishes not before at least 3 link-down-up steps were executed.
* Replace the Allocator_avl's used for the TX packet allocators of the Nic
  and Uplink Connection with the better suited Nic::Packet_allocator.

Ref #4419
2022-04-13 09:29:05 +02:00
Martin Stein
6a61b60a5d black_hole: serve real USB sessions
* The server now answers session requests with a session instead of an
  exception#
* The test expects a session but doesn't access it so far

Ref #4419
2022-04-13 09:29:05 +02:00
Alexander Boettcher
40a5eabf88 pc: shadow schedule_timeout in intel_fb_drv
Issue #4450
2022-04-13 09:29:05 +02:00
Christian Helmuth
db90656483 vbox6: sync capslock state on boot / LED change
Thanks to Peter for the initial patch.
2022-04-13 09:29:05 +02:00
Alexander Boettcher
9965b2b72a pc: disable dsb unit in intel_fb_drv (gen12)
The error message
"Command buffer creation failed" in intel_dsb.c repeatedly appears
during connector hotplug. Since the driver works also without this DMA offload
optimization, disable the functionality.

Issue #4450
2022-04-13 09:29:05 +02:00
Martin Stein
ecd4006514 black_hole: initial support for Usb service
The service is merely announced but trying to request a session always causes a
Service_denied exception. This helps in scenarios where the client is
won't open a session anyway but expects the service to be available. This is
considered a temporary solution.

Ref #4419
2022-04-13 09:29:05 +02:00
Norman Feske
78d7a08618 wm: hide child views if top-level view vanishes
This patch handles the corner case of switching virtual desktops while
child views are visible. Examples of such child views are tool tips,
pull-down menus, or the graph of the top-view utility. The switch to
another virtual desktop would implicitely turn the child views into
top-level views of the root nitpicker GUI server until switching back
to the original virtual desktop.

The patch implements the expected behavior of hiding all child views
that belong to a disappearing top-level view.
2022-04-13 09:29:05 +02:00
Christian Helmuth
d21464399f vfs_rump: use dynamic_cast for safe downcasts
As it stands, the implementation requires minimal reflection measures to
implement correct cleanup procedure. static_cast<> cannot be used as it
does not implement runtime type casting as dynamic_cast<> does.
2022-04-13 09:29:05 +02:00
Christian Helmuth
8a4f4fcea9 vfs_rump: reflect resource shortage as return values
The function Vfs::Directory_service::watch() is not expected to throw
Out_of_ram/Out_of_caps but use dedicated Watch_result errors.
2022-04-13 09:29:05 +02:00
Christian Helmuth
eb895975e2 lib/vfs: clear BUILD_ARTIFACTS in dummy targets 2022-04-13 09:29:05 +02:00
Norman Feske
79279b93fb vfs server: fix dangling alloc on watch failure
This patch reverts the vfs-watch-handle creation whenever the subsequent
allocation of the VFS server's 'Watch' object fails. This can happen
when the session RAM or cap quota is depleted.

Fixes #4472
2022-04-13 09:29:05 +02:00
Christian Helmuth
df1767b784 vbox6: tidy up devxhci poweroff
The issue came apparent with Windows Guests and USB passthrough of
smart-card readers. If the VM is powered off, PDMR3Term cleans up all
devices incl. (first) acpi and (later) devxhci. The latter used a
dangling reference to ACPI structs in a indirect call to
apicIsLogicalDest() from xhciR3Destruct().

  VMMR3_INT_DECL(int) PDMR3Term(PVM pVM)
      virtualbox6/src/VBox/VMM/VMMR3/PDM.cpp:817

      "apic" (pDevIns->pReg->szName)

          static void apicR3TermState(PVM pVM)
              virtualbox6/src/VBox/VMM/VMMR3/APIC.cpp:1235

      "qemu-xhci" (pDevIns->pReg->szName)

          static DECLCALLBACK(int) xhciR3Destruct(PPDMDEVINS pDevIns)
              repos/ports/src/virtualbox6/devxhci.cc:431

          void usb_detach(USBPort *port)
              <qemu-usb>/src/lib/qemu/hw/usb/core.c:70

          static void xhci_port_notify(XHCIPort *port, uint32_t bits)
              <qemu-usb>/src/lib/qemu/hw/usb/hcd-xhci.c:2592

          static DECLCALLBACK(void) pciSetIrq(PPDMDEVINS pDevIns, PPDMPCIDEV pPciDev, int iIrq, int iLevel, uint32_t uTagSrc)
              virtualbox6/src/VBox/Devices/Bus/DevPCI.cpp:398

          static bool apicIsLogicalDest(PVMCPUCC pVCpu, uint32_t fDest)
              virtualbox6/src/VBox/VMM/VMMAll/APICAll.cpp:797

The fix removes our Qemu library reset from xhciR3Destruct() and
registers xhciR3Reset() as PowerOff hook.

Thanks to Raphael for the thorough investigation.
2022-04-13 09:29:05 +02:00
Christian Helmuth
e345b56719 vbox6: remove redundant ahci/serial patches
The issue alleviated by the patches was fixed by

  5fed1641a4 virtualbox6: reduce 'Vm_connection' priority

Issue #4361
2022-04-13 09:29:05 +02:00
Norman Feske
ddc83df4b6 sculpt: support leitzentale GUI on 2560x1440
The quota adjustments prevent the leitzentrale's decorator from running
out of RAM, and allow the nitpicker GUI server to preserve buffer
content during resize (reducing flickering artifacts) when using a
screen resolution up to 2560x1440.
2022-04-13 09:29:04 +02:00
Alexander Boettcher
daa6195732 pc: report all modes by intel display driver
Issue #4450
2022-04-13 09:29:04 +02:00
Norman Feske
0c5d8f1156 depot: exclude plugins from vfs src archive
This fixes the following warning when building the binary archive:

  Library-description file vfs_capture.mk is missing
  Library-description file vfs_tap.mk is missing
2022-04-13 09:29:04 +02:00
Sebastian Sumpf
7a06a6ac59 legacy_platform_drv: update quotas on 'attach_dma_mem'
'Platform::Device_pd::attach_dma_mem' may lead to insufficient resources
for meta data, which is reflected to the client via 'Out_of_caps' or
'Out_of_ram'. In case the client upgrades its session the quotas need to
be passed to core as done by
'Platform::Device_pd::Expanding_region_map_client::attach'.

issue #4451
2022-04-13 09:29:04 +02:00
Sebastian Sumpf
abc0bf3220 gpu/intel: account resources using 'avail_' not'used_'
Use 'avail_caps' and 'avail_ram' for resource guards because 'used_caps'
and 'used_ram' do not account for resources given to the platform
driver. This lead to incorrect resource accounting by the GPU
multiplexer.

issue #4451
2022-04-13 09:29:04 +02:00
Christian Helmuth
fd9648f919 vfs/block: correct transfer size allocation
The calculations of packet_size and packet_count in the block_io() did
not consider rounding errors. This resulted in diverging values over
several bisecting operations (/= 2) and wrongly-size packet allocations
as well as memcpy operations.

Related to #2263 (comments about partial block accesses and
_block_io()).

Fixes #4471
2022-04-13 09:29:04 +02:00
Christian Helmuth
dedcd0e294 vbox6: silence debug log in runtime 2022-04-13 09:29:04 +02:00
Josef Söntgen
2e47eb6fb9 dde_linux: use new wifi driver in uplinks test
Issue #4455.
2022-04-13 09:29:04 +02:00
Martin Stein
ef8c98cb71 nic_router: merge packet stream signal handlers
The NIC router used to handle each type of packet-stream signal with a distinct
method in the Interface class. However, merging those methods has advantages.

It ensures that sent packets that were already acknowledged by the counter side
are always released before handling received packets. This frees packet stream
memory which facilitates the potential allocation of response packets while
handling received packets. Furthermore, it simplifies the code and reduces the
number of entry points into the router.

This commit also removes the installation of signal handlers at packet streams
for events that are of no interest for the router (TX-ready-to-ack /
RX-ready-to-submit at NIC sessions and RX-ready-to-ack / TX-ready-to-submit at
Uplink sessions).

Fixes #4470
2022-04-13 09:29:04 +02:00
Christian Helmuth
7e2cfc30f0 sculpt: version 22.04 2022-04-13 09:29:04 +02:00
Christian Helmuth
520a08b205 Remove pkg runtime for pc_wifi_drv/legacy_pc_wifi_drv
Both runtimes were broken due to missing requirement for "Uplink"
service and thus unused.

Issue #4455
2022-04-13 09:29:04 +02:00
Josef Söntgen
b6471a83aa ports: use new wifi driver in netperf
Issue #4455.
2022-04-13 09:29:04 +02:00
Josef Söntgen
dd09e900c0 sculpt: use pc_wifi_drv
Issue #4455.
2022-04-13 09:29:04 +02:00
Josef Söntgen
e7e7893f22 pc: update wifi driver
The driver falls in line with the previous 'legacy_wifi_drv' component
where the ported wireless LAN stack and device driver is encapsulated
in a library. This library in return is used by the 'Libc::Component'
providing the necessary environment for the 'wpa_supplicant'.

In constrast to the old driver a 'wifi' VFS plugin is in charge of
initalizing the 'Lx_kit::Env' prior to executing any static
constructors.

Fixes #4455.
2022-04-13 09:29:04 +02:00
Josef Söntgen
8056811b4f Rename wifi_drv to legacy_wifi_drv
Issue #4455.
2022-04-13 09:29:04 +02:00
Josef Söntgen
0bd1a53326 dde_linux: add linux-firmware port
Move 'linux-firmware' portion from 'dde_linux' into its own port,
while it is used by the upcoming new WLAN driver keep it in place
for the legacy one.

Issue #4455.
2022-04-13 09:29:04 +02:00
Josef Söntgen
838bae964b pc: update framebuffer/intel for new Linux config
This is needed because now 'kobject_uevent.c' pulls netlink related
code in.

Issue #4455.
2022-04-13 09:29:04 +02:00
Josef Söntgen
c9d9ec0d63 pc_linux: add wlan stuff to config
Issue #4455.
2022-04-13 09:29:04 +02:00
Josef Söntgen
0a6baff26d pc: extended pc_linux api archive for wifi driver
Issue #4455.
2022-04-13 09:29:04 +02:00
Josef Söntgen
56427da393 wifi: add interface query functions
Various libraries, like libnl and wpa_driver_nl80211, used hardcoded
values for the interface index (ifindex) and name (ifname).
To accomdate the legacy as well as the upcoming new driver we add
functions to query these information where at least the index differs.

Issue #4455.
2022-04-13 09:29:04 +02:00
Josef Söntgen
c1fea8c002 wpa_supplicant: remove hard lx_printf dependency
Not needed and breaks 'pc_wlan_drv'.

Issue #4455.
2022-04-13 09:29:04 +02:00
Josef Söntgen
447f3fcb35 libnl: use MSG_DONTWAIT
Issue #4455.
2022-04-13 09:29:04 +02:00
Josef Söntgen
f5eddce1d1 wifi/socket_call: add MSG_DONTWAIT
Issue #4455.
2022-04-13 09:29:04 +02:00
Josef Söntgen
24c0bb95ef pc_lx_emul: allow for being used in a library
The location of the used 'source.list' file is hard-coded and will not
work when the ported driver is implemented as a shared library. For
this use-case provide means to set the location differently.

Issue #4455.
2022-04-13 09:29:04 +02:00
Josef Söntgen
7cd8285251 pc_lx_emul: use page alloc shadow implementation
Issue #4455.
2022-04-13 09:29:04 +02:00
Josef Söntgen
b2e11f1e9e pc_lx_emul: add __put_user
Issue #4455.
2022-04-13 09:29:03 +02:00
Josef Söntgen
edb08770dc lx_emul: initialize task members needed by network
Those members are access via static inline functions in the network
core code and from certain protocols, e.g. AF_NETLINK.

Issue #4455.
2022-04-13 09:29:03 +02:00
Josef Söntgen
77cdceabaa lx_emul: add additional atomic64 functions
Needed by the WLAN driver on x86_32.

Issue #4455.
2022-04-13 09:29:03 +02:00
Josef Söntgen
0c617366e5 lx_emul: get pid from task
Issue #4455.
2022-04-13 09:29:03 +02:00
Josef Söntgen
4b43b5c1c1 lx_kit: handle %hu specifier in console
Prevent '<warning unsupported format specifier>' when encountering
'%hu'.

Issue #4455.
2022-04-13 09:29:03 +02:00
Josef Söntgen
ffea0bf857 lx_kit: remove execution of static ctors
In case where the ported driver or protocol stack is executed from
an already managed environment, e.g. the libc, the execution
of the static constructors will be performed at the appropriate
time.

Issue #4455.
2022-04-13 09:29:03 +02:00
Josef Söntgen
aa7303f19f nic_router: drop ARP requests when unconfigured
Whenever the nic_router encounters ARP requests on an interface
that does not have a valid IP config it will ignore them. However,
When increasing the verbosity of the component for diagnostic
purposes the resulting 'Bad network protocol' message is misleading.

Issue #4455.
2022-04-13 09:29:03 +02:00
Christian Prochaska
80f85a854c qt5: fixes and improvements for WebRTC support
Fixes #4453
2022-04-13 09:29:03 +02:00
Christian Prochaska
6c2ac345fd Add 'webcam_vfs' run test
Issue #4458
2022-04-13 09:29:03 +02:00
Christian Prochaska
6a874498f7 vfs: implement plugin for 'Capture' session
Fixes #4458
2022-04-13 09:29:03 +02:00
Martin Stein
9de4ecf8b6 run/nic_router_dhcp: DHCP RENEW and some fixes
* Test DHCP RENEW by the test client in the unmanaged variant.
* Add event IDs to log output of test client in order to prevent false positive
  result in the managed variant.
* Let managed and unmanaged variant have separate string patterns for
  'run_genode_until' because they already had different output and it will
  differ even more as we don't want to test DHCP RENEW with the managed
  variant.
* Delay first test client DHCP in order to fix unexpected sporadic initial IP
  config.
* Remove some unnecessary code from the run script

Fixes #4460
2022-04-13 09:29:03 +02:00
Martin Stein
7fc20e9ae8 NIC router: update IP config on DHCP RENEW/REBIND
The NIC router did update the IP config of a domain on a completed DHCP
REQUEST but not on completed DHCP RENEW or DHCP REBIND. Thus, it didn't adapt
to "real" DHCP servers (not NIC router servers) that got restarted with a
changed configuration by the means of RENEW/REBIND. The commit fixes this.
Note, that testing this is complicated as we don't have the necessary
infrastructure (we cannot simply use the DHCP server of the NIC router as this
would apply a link down/up sequence in order to let the client restart DHCP)

Ref #4460
2022-04-13 09:29:03 +02:00
Sebastian Sumpf
f085fc9dd2 libdrm/iris: free objects in Drm_call destructor
Make sure to remove all buffers, sync objects, and contexts during
destruction.

Fixes #4466
2022-04-13 09:29:03 +02:00
Sebastian Sumpf
d4390adb68 mesa: use 'strdup' for driver names
The 'iris' and 'etnaviv' strings are freed using 'free' by mesa.

issue #4466
2022-04-13 09:29:03 +02:00
Sebastian Sumpf
da1ef67064 base: Allocator_avl cleanup meta data
After reverting unused ranges during allocator destruction
'_meta_data.free_empty_blocks' may lead to more unused ranges because
meta data blocks maybe freed where the meta data for the blocks is
managed by other meta data blocks. This leads to dangling allocation
warnings which are caused by meta data. Therefore, we call
'_revert_unused_ranges' and 'free_empty_blocks' until no more ranges
can be freed.

issue #4466
2022-04-13 09:29:03 +02:00
Christian Helmuth
f704a50e9f prepare_ports: prevent regeneration of aclocal.m4
Related to #4350
Fixes #4467
2022-04-13 09:29:03 +02:00
Christian Helmuth
904c8e3636 vbox6: disable asseertions in depot pkg
Issue #4464
2022-04-13 09:29:03 +02:00
Alexander Boettcher
6994354b8f platform(x86): avoid multiple assignment messages
The new ported linux drivers multiple times trigger this assignment,
whereby exactly one time is sufficient.

Issue #4416
Issue #4450
Issue #4455
2022-04-13 09:29:03 +02:00
Josef Söntgen
1dc92c49ed genode_c_api/usb: report iface class and protocol
Enrich the device report with interface class and protocol information
for the current active setting of the device.

Fixes #4463.
2022-04-13 09:29:03 +02:00
Alexander Boettcher
664676a2b4 intel/gpu: support 64bit pci bars
by using the io_mem RPC of the platform session instead of parsing the
bar resources manually. This commits avoids and breakage on systems where
the Intel graphic cards just uses 64bits with addresses above 4G.

Issue #4450
2022-04-13 09:29:03 +02:00
Johannes Schlatow
e955444302 ports/coreutils: ignore inodes when copying
genodelabs/genode#4461
2022-04-13 09:29:03 +02:00
Johannes Schlatow
410099df70 base/memset: speedup implementation
Compared to the bytewise memset, a wordwise memset (or even multi-word)
achieves a speedup of ~6.

On Zynq-7000/Cortex-A9:
317 MiB/s -> 2040 MiB/s

On base-linux x86_64:
3580 MiB/s -> 23700 MiB/s

genodelabs/genode#4456
2022-04-13 09:29:03 +02:00
Johannes Schlatow
9409f814a4 memcpy (x86): implement memcpy_cpu
By changing the bytewise copy into a wordwise copy, we get a speedup of
~3 (on base-linux x86_64).

genodelabs/genode#4456
2022-04-13 09:29:02 +02:00
Johannes Schlatow
0104a74028 memcpy (arm): cache align and use pld for speedup
Preloading a few cache lines ahead brings a significant speedup in
memcpy throughput. Note, the particular (optimal) value was empirically
determined on a Cortex-A9 (Zynq-7000) SoC @ 666Mhz. It is best combined
with L2 prefetching enabled (including double linefills and prefetch
offset 7). Yet, even without L2 prefetching this seems to be the sweet
spot.

genodelabs/genode#4456
2022-04-13 08:08:01 +02:00
Johannes Schlatow
4dcc095e5e memcpy (arm): remove unused vfp implementation
The implementation is not in use any more. Furthermore, on typical ARM
cores such as the Cortex-A9, the cached read appears to be the
bottleneck rather than instruction density. On a Zynq-7000 SoC, the vfp
implementation performed significantly worse than the standard load/store
multiple implementation with preloading.

genodelabs/genode#4456
2022-04-13 08:08:01 +02:00
Johannes Schlatow
052c33fc8c test/cache: refine test pattern
- run multiple access patterns (touch words, touch lines, memcpy)
- add make file for linux

genodelabs/genode#4454
2022-04-13 08:08:01 +02:00
Johannes Schlatow
5a0e22eb98 test/memcpy: tweak test timing
add some log calls to give run script a bit more time to catch the next
output

genodelabs/genode#4454
2022-04-13 08:08:01 +02:00
Johannes Schlatow
92bcc50c0a test/memcpy: test with a more consistent alignment
On some platforms, the page index affects the measurements.

genodelabs/genode#4454
2022-04-13 08:08:01 +02:00
Johannes Schlatow
07736d1689 test/memcpy: fix optimistic results on Linux
When executed on Linux, the test was impaired by the copy-on-write
optimisation since the source buffer was never initialised. By default,
Linux only maps a zeroed page until the first write access to the page
occurs. Since the source buffer was never written, the corresponding
page was always present in the physically-indexed data cache. In
consequence, the test merely measured write performance (similar to memset).

genodelabs/genode#4454
2022-04-13 08:08:01 +02:00
Johannes Schlatow
62f37c5b1b test/memcpy: disable Thumb when compiled on linux
genodelabs/genode#4454
2022-04-13 08:08:01 +02:00
Johannes Schlatow
85daf1b3b2 cpu_bench: disable Thumb when compiled on linux
genodelabs/genode#4454
2022-04-13 08:08:01 +02:00
Johannes Schlatow
d372afd81e base-hw: add bitfield to pl310
Enabling double linefills improves memcpy throughput.

genodelabs/genode#4456
2022-04-13 08:08:01 +02:00
Christian Helmuth
d1f9434fd5 qemu-usb: send usb ctrl transfers with timeout
Send usb ctrl transfers with one second timeout as some devices (e.g.,
smartcard readers) do not response to certain control transfers.

Thanks to Peter for the investigation.
2022-04-13 08:08:00 +02:00
Alexander Boettcher
00479aea29 lx_emul(x86): shadow cpu_relax to advance jiffies
The i2c code has a busy loop (see commit for the location), which expects that
the jiffies advances without a cooperative scheduling decision.

Issue #4450
2022-04-13 08:08:00 +02:00
Christian Helmuth
18c5f1e90d tool/run: improve disk image size automatic
Set disk size to 1.5 times the run folder size and shrinked later to
real content.

Thanks to Roland for the patch.
2022-04-13 08:08:00 +02:00
Christian Helmuth
108fe84f5a Remove SIGNAL/CAP/RAM services from run scripts
Related to #2407
2022-04-13 08:08:00 +02:00
Christian Helmuth
77b572f36a platform: distinct USB4 from other USB PCI devices
Our usb_host driver supports UHCI, OHCI, EHCI, and XHCI host
controllers. The USB4 host interface / Thunderbolt is currently not
supported and must therefore not be passed to the USB host driver.
2022-04-13 08:08:00 +02:00
Christian Helmuth
1b4cd93dc2 lx_kit/x86: clamp PCI interrupt PIN to 1
If any PCI device reports 0 as interrupt PIN, drivers may try to force
MSI setup (e.g., xhci). So, we clamp the interrupt PIN to 1 to let
drivers finish initialization and don't bother the platform driver.
2022-04-13 08:08:00 +02:00
Josef Söntgen
afe02efb8f pc_usb_host: implement 'dma_pool_destroy'
Encountered on the Fuji5 where for reasons currently unknown the
first xHCI HC (0:0d.0) could not be initialize due to incomplete
interupt informations. The other HCs appear to work fine (tested
with a USB low-speed mouse).
2022-04-13 08:08:00 +02:00
Josef Söntgen
c6cc43f0e4 lx_kit/x86: use virtual information for PCI
This commit removes all physical notions from the information given
to the Linux kernel regarding PCI BARs.

With the exception for the host bridge that needs to be located at
'0:00.0' as required by the Intel FB driver, all other devices are
announced at the PCI BUS in an ascending order.

Additionally the MMIO regions start at 1 GiB and are capped at 32 bit
to prevent unnecessary access to 64 bit addresses.
2022-04-13 08:08:00 +02:00
Christian Helmuth
1c79c95868 acpi_drv: skip tables outside predefined region
With this fix, the driver no longer aborts on the Tigerlake notebook and
just skips the out-of-region ACPI table. Issue #4452 is not fixed by
this commit, but in this specific case the table is not used anyway.
2022-04-13 08:08:00 +02:00
Sebastian Sumpf
49b8232ebd libdrm: simplify resource accounting
Upgrade to the well known worst cases by the GPU multiplexer. Do not
keep track of resources locally, in case resources are exceeded the
remain so anyway.

issue #4451
2022-04-13 08:08:00 +02:00
Sebastian Sumpf
105e82ad84 gpu/intel: check resources before any operation
Check if there are a least 4 caps + 2MB (heap) + possible buffer size
available before any resource allocation. Only account resources that are
actually used.

issue #4451
2022-04-13 08:08:00 +02:00
Christian Helmuth
7f0403c8c1 tool/run: multiple attempt for AMT SOL connection
Some devices do not answer connection attempts timely, which leads
amtterm to time out (after 60s). Using multiple attempts in 500 ms
intervals results in timely connection and complete boot logs.

Issue #4429
2022-04-13 08:08:00 +02:00
Christian Helmuth
c1c94d37d7 microcode_intel: update to version 20220207 2022-04-13 08:08:00 +02:00
Alexander Boettcher
c0560ab0cb pc: update intel display driver
Fixes #4450
2022-04-13 08:08:00 +02:00
Alexander Boettcher
7813fca946 gpu/intel: report all devices via next_device
The former implementation relied on the behaviour of how the old
intel fb driver requested the pci devices. The new lxkit however actually
really want to have all available pci devices.

Issue #4450
2022-04-13 08:07:59 +02:00
Alexander Boettcher
2548830140 pc_linux: add ACPI config
required by the upcoming update of the intel display driver. Make this addition
explicit, because it triggers adjustment also on the new pc_usb_host_drv.

Issue #4450
2022-04-13 08:07:59 +02:00
Alexander Boettcher
6d924d3285 lx_kit(x86): restrict usb heuristics to usb
Issue #4450
2022-04-13 08:07:59 +02:00
Alexander Boettcher
cda0fafbd1 lx_emul: remove sw_width/height from common_dummies
required by the new upcoming intel display driver. Make the step explicit,
because it needs adjustment on the new usb driver as well.

Issue #4450
2022-04-13 08:07:59 +02:00
Alexander Boettcher
b6c1b7806b lx_kit: io_mem_map with write combined support (x86)
Issue #4450
2022-04-13 08:07:59 +02:00
Alexander Boettcher
6f64917e8f lx_emul: add ioremap_cache/_wc to shadow/asm/io.h
used by intel_fb for write combined allocation

Issue #4450
2022-04-13 08:07:59 +02:00
Alexander Boettcher
8dbcda9943 lx_emul: x86_32 shadow header adaptations
required for upcoming intel display driver in 32bit

Issue #4450
2022-04-13 08:07:59 +02:00
Alexander Boettcher
7c3f010cd6 lx_emul: shadow asm/uaccess_32/64.h
Issue #4450
2022-04-13 08:07:59 +02:00
Alexander Boettcher
cdf1b39c5e lx_emul: shadow asm/special_insns.h
wbinvd is not supported in user mode

Issue #4450
2022-04-13 08:07:59 +02:00
Alexander Boettcher
88a6a9d628 lx_emul: add missing fpu/api.h to shadow pgtable.h
Issue #4450
2022-04-13 08:07:59 +02:00
Alexander Boettcher
279f038b9e lx_emul: shadow asm/cpufeature and asm/page_64
Issue #4450
2022-04-13 08:07:58 +02:00
Josef Söntgen
fd8df3a623 lx_emul: handle page refcount 2022-04-13 08:07:58 +02:00
Alexander Boettcher
4474460377 lx_emul: __alloc_pages support in shadow/mm/page_alloc.c 2022-04-13 08:07:58 +02:00
Alexander Boettcher
a222df31ba platform_drv(x86): avoid exception in alloc_dma
If size is zero, the platform goes out of service by:

[init -> platform_drv] Error: Uncaught exception of type 'Genode::Ram_allocator::Denied'
[init -> platform_drv] Warning: abort called - thread: e

Issue #4450
2022-04-13 08:07:58 +02:00
Alexander Boettcher
dd10e5d977 intel_fb: move to legacy_intel_fb
Move the depot recipe and consistently name the old drivers with a legacy_
prefix as done with the old usb_host driver.

Issue #4450
2022-04-13 08:07:58 +02:00
Christian Helmuth
42fed1a16c tool/run: retry with optional timeout utility
Issue #4429
2022-04-13 08:07:58 +02:00
Christian Helmuth
2723614d58 tool/run: restrict close to amtterm spawn_id
Issue #4429
2022-04-13 08:07:58 +02:00
Christian Helmuth
fec5c03612 tool/run: option to skip AMT SOL availability test
Issue #4429
2022-04-13 08:07:58 +02:00
Christian Helmuth
1a2677ebe6 dde_ipxe: update Intel NIC support list from upstream
Also, the repository URL was adapted to the permanent redirect to github
to prevent the following warning.

  dde_ipxe  download http://git.ipxe.org/ipxe.git
  dde_ipxe  git Cloning into 'src/lib/dde_ipxe'...
  dde_ipxe  git warning: redirecting to https://github.com/ipxe/ipxe/
  dde_ipxe  update src/lib/dde_ipxe
2022-04-13 08:07:58 +02:00
Christian Helmuth
ad4fb2b088 nova: fix IOTLB flush for global mode
Issue alex-ab/nova#6
2022-04-13 08:07:58 +02:00
Christian Helmuth
c56ac3e909 nova: support extended addresses in FADT
Issue alex-ab/nova#5
2022-04-13 08:07:58 +02:00
Martin Stein
50fc2aa251 black_hole: provide Gpu service
Ref #4419
2022-04-13 08:07:58 +02:00
Martin Stein
046ebc3d34 black_hole: provide ROM service
Ref #4419
2022-04-13 08:07:58 +02:00
Norman Feske
bb26a986e6 sculpt: add trace_logger as optional launcher
This patch adds the trace-logger utility to the default set of packages
along with an optional launcher. With this change, only two steps are
needed to use Genode's tracing mechanism with Sculpt:

- Add 'trace_logger' to the 'launcher:' list of the .sculpt file

- Either manually select the 'trace_logger' from the '+' menu,
  or add the following entry to the deploy configuration:

    <start name="trace_logger"/>

By default, the trace logger is configured to trace all threads
executed in the runtime subsystem and to print a report every 10
seconds. This default policy can be refined in the launcher's <config>
node. Note that the trace logger does not respond to configuration
changes during runtime. Changes come into effect not before restarting
the component.

Issue #4448
2022-04-13 08:07:58 +02:00
Norman Feske
3394f97f86 trace_logger: make output format more concise
This patch changes the output format of the trace logger to become
better suitable for human consumption. For example, when instrumenting
the VFS server in Sculpt using the GENODE_TRACE_TSC utility, the
trace logger now generates tabular output as follows.

  Report 4

  PD "init -> runtime -> arch_vbox6 -> vbox -> " ----------------
   Thread "vCPU"           at (0,0)  total:12909024 recent:989229
   Thread "vCPU"           at (1,0)  total:5643234  recent:786437

  PD "init -> runtime -> ahci-0.fs" -----------------------------
   Thread "ahci-0.fs"      at (0,0)  total:910497   recent:6335
   Thread "ep"             at (0,0)  total:0        recent:0
    71919692932: TSC process_packets: 8005M (4998 calls, last 4932K)
    71921558516: TSC process_packets: 8006M (4999 calls, last 1596K)
    71922760220: TSC process_packets: 8007M (5000 calls, last 1006K)
    71929853586: TSC process_packets: 8009M (5001 calls, last 1840K)
    71931315246: TSC process_packets: 8011M (5002 calls, last 1253K)
    72127999920: TSC process_packets: 8016M (5003 calls, last 5606K)
    72129568198: TSC process_packets: 8018M (5004 calls, last 1345K)
    77161908178: TSC process_packets: 8029M (5005 calls, last 11349K)
    77643225736: TSC process_packets: 8029M (5006 calls, last 217K)
    89422100594: TSC process_packets: 8035M (5007 calls, last 5656K)
    89422123632: TSC process_packets: 8035M (5008 calls, last 1342)
   Thread "signal handler" at (0,0)  total:36329    recent:3001
   Thread "signal_proxy"   at (0,0)  total:51838    recent:13099
   Thread "pdaemon"        at (0,0)  total:97184    recent:332
   Thread "vdrain"         at (0,0)  total:1266     recent:286
   Thread "vrele"          at (0,0)  total:1904     recent:516

  PD "init -> runtime -> nic_drv" -------------------------------
   Thread "nic_drv"        at (0,0)  total:34044    recent:897
   Thread "signal handler" at (0,0)  total:369      recent:142

  ...

Subjects that belong to the same PD are grouped together. The formerly
optional affinity and activity options have been removed. Those
information are now unconditionally displayed. The trace entries
belonging to a thread appear as slightly indented.

The patch also updates the coding style, avoiding excessively long
lines.

Issue #4448
2022-04-13 08:07:58 +02:00
Norman Feske
f7270c44cb trace_logger: omit inactive subjects by default
This patch reduces repetitive log output by omitting inactive trace
subjects from the log output. The information about all subjects can
still be dumped by setting 'verbose="yes"'.

Issue #4448
2022-04-13 08:07:58 +02:00
Norman Feske
ceb91732bf trace_logger: update state after adding subjects
This patch splits the creation and updating of monitor objects into two
stages. The creation of a monitor object changes the state of the
associated trace subject. The patch ensures that the new state is
captured by the update of the monitor object.

Issue #4448
2022-04-13 08:07:58 +02:00
Norman Feske
be0a1742ac base: distinct TRACED from ATTACHED trace subjects
This patch makes the trace-subject state as reflected to the trace
monitor more accurate.

Until now, a subject could be in UNTRACED or TRACED state. In reality,
however, there exists an intermediate state after the trace monitor
called 'trace' for the subject but before the subject locally activated
the tracing (done when passing a trace point). This intermediate state
was reflected as UNTRACED. Consequently, threads that never pass a trace
point (e.g., just waiting for I/O) would remain to appear as UNTRACED
even after enabling its tracing by the trace monitor. This is confusing.

This patch replaces the former UNTRACED and TRACED states by three
distinct states:

  UNATTACHED  prior any call of 'trace'
  ATTACHED    after a trace monitor called 'trace'
              but before the tracing is active
  TRACE       tracing is active

Fixes #4447
2022-04-13 08:07:58 +02:00
Norman Feske
f3984ba5a9 base: declare build artifact for core
This is a generalization of the recent commit "base-hw: declare build
artifact for core".
2022-04-13 08:07:58 +02:00
Norman Feske
34a3209e9b base/log.h: add GENODE_TRACE_TSC
The new macros GENODE_TRACE_TSC and GENODE_TRACE_TSC_NAMED complement
the existing GENODE_LOG_TSC and GENODE_LOG_TSC_NAMED macros to simplify
TSC measurements at a low overhead of the trace mechanism.
2022-04-13 08:07:57 +02:00
Norman Feske
232a45bc14 os: add util/formatted_output.h utilities
The utilities of the new util/formatted_output.h header complement the
existing base/output.h with the text-formatting support needed to
produce tabular output.

Fixes #4449
2022-04-13 08:07:57 +02:00
Norman Feske
a5c9830706 Minor doc fixes in the release notes 2022-04-13 08:07:57 +02:00
Christian Helmuth
bde3be787e qemu-usb: fix device endpoint update
First, the endpoint update has to comply with the current alternate
settings of all interface, which are stored in USBDevice::altsetting[]
(one value per interface). Second, a SET_INTERFACE control request via
Packet_type::ALT_SETTING must update USBDevice::altsetting for the
interface.

Now, USB devices with multi-setting interface like the Joulescope JS110
with mixed bulk/isochronous endpoints are supported.
2022-04-13 08:07:57 +02:00
Christian Helmuth
49efff1fef Remove tool/create_sdk
Fixes #4446
2022-04-13 08:07:57 +02:00
Christian Helmuth
c5f9e61d3a driver_manager: adapt config attributes for usb_host 2022-04-13 08:07:57 +02:00
Norman Feske
26acd6c65a sculpt: suppress non-critical warning 2022-04-13 08:07:57 +02:00
Norman Feske
33c71d1d2c usb_host: change error to warning message
An insufficient session quota as offered by a USB client is not an
erroneous situation of the USB driver.
2022-04-13 08:07:57 +02:00
Norman Feske
b4aa0a20dd os: refine default USB session quota
This commit adjusts the value such that USB sessions requested by
VirtualBox6 on Sculpt OS can get established on the first try without
invoking the session-retry mechanism. This reduces the number of
diagnostic log messages like:

 Error: Insufficient 'ram_quota',got 6296372 need 6297928
2022-04-13 08:07:57 +02:00
Norman Feske
fa5f8dbd55 sculpt: reduce NIC driver CPU quota
The value of 50% as assigned by commit "sculpt: add basic support for
i.MX8 Quad EVK" leaves too little room for other components of the
runtime subsystem. With the adjustements of commit "sculpt: assign CPU
quotas" the sum exeedcs 100%. Hence this commit tunes down the value to
sensible 10%.
2022-04-13 08:07:57 +02:00
Norman Feske
a9022d8451 sandbox: improve CPU-quota accounting
The existing assignment of CPU quotas did not anticipate the dynamic
reconfiguration of init. It merely tracked the available CPU quota by
deducing the consumed amount from a global variable but never
replenished the value. This worked for static scenarios but failed in
situations where components are dynamically re-started.

So far this deficiency remained detected because CPU quotas were not
used in highly dynamic systems like Sculpt OS. However, this has
recently changed by commit "sculpt: assign CPU quotas".

The patch improves the accounting by mirroring the existing handling of
RAM and cap quotas. Note that the CPU-quota accounting is still rather
limited. In particular the dynamic rebalancing is not yet supported.

Issue #4445
2022-04-13 08:07:57 +02:00
Christian Helmuth
d182b20705 build: ensure rules with pipes might fail
.SHELLFLAGS is extended by option pipefail to make pipes fail if any pipe
element fails. As .SHELLFLAGS is exported into sub-make instances it
must be unexported before calling third-party build systems recursively.
2022-03-21 13:43:13 +01:00
Christian Helmuth
7da691b52a pc/usb: defer startup until config is available
The commit also adds lx_kit/initial_config.h as utility.
2022-03-21 13:42:17 +01:00
Norman Feske
e3706837b9 VFS server: foster batching of acknowledgements
With the consolidation of the file-system session's signal handlers
implemented by commit "file_system_session: merge ack and submit sigh",
we can now change the VFS server to produce batches of acknowledgements
before explicitly waking up the client. (in contrast to the traditional
'acknowledge_packet', the new 'try_ack_packet' triggers no signal)

Issue #4388
2022-03-21 13:42:17 +01:00
Johannes Schlatow
f4d0f1624a test/trace: use for_each_new_entry
genodelabs/genode#4434
2022-03-21 13:42:17 +01:00
Johannes Schlatow
c763890f04 trace_buffer: partition trace buffer
Split the trace buffer into two partitions in order to prevent overwriting
of entries when the consumer is too slow. See file comment in buffer.h.

genodelabs/genode#4434
2022-03-21 13:42:16 +01:00
Johannes Schlatow
edc46d15f8 trace_buffer: revise trace buffer implementation
This commit simplifies the current implementation by overloading the
length field with a padding indicator in addition to the zero-length
head entry. This simplifies the iteration semantics as it eliminates
the need for determining whether a zero-length entries is the actual
head of the buffer or a padding at the buffer end.

genodelabs/genode#4434
2022-03-09 12:08:02 +01:00
Johannes Schlatow
d24552f5e2 trace/policy: fix event size in log_output
Returning 0 for max_event_size() can lead to writing out of buffer bounds.

Fixes genodelabs/genode#4435
2022-03-09 12:04:44 +01:00
Stefan Kalkowski
e95f0a409d lx_emul: add implementation for Genode's USB C-API
Fix #4444
2022-03-09 10:55:16 +01:00
Stefan Kalkowski
9713014130 dde_linux: add virt_linux lx_emul flavor
To support device-less protocol-stacks only ports, we can use a
Virt I/O Linux kernel flavor, and export the lx_kit/lx_emul parts
not depending on platform API and devices.

Ref #4397
2022-03-09 10:55:16 +01:00
Stefan Kalkowski
35cf8aada4 lx_emul(x86): fill zero page with zeroes
Ref #4397
2022-03-09 10:55:16 +01:00
Stefan Kalkowski
13c4abf4ad lx_emul: add static_cpu_has macro to shadow header
Ref #4397
2022-03-09 10:55:16 +01:00
Stefan Kalkowski
0fa695dbd7 lx_kit/lx_emul: make memory backend configureable
* Drivers have to use lx_kit/memory_dma.cc
* Protocol-stacks use lx_kit/memory_non_dma.cc
* Moreover the device-dependent lx_emul parts get removed
  from the common lx_emul import rules

Fix #4443
2022-03-09 10:55:16 +01:00
Stefan Kalkowski
d473bed4b7 platform api: export dma buffer capability
Ref #4443
2022-03-09 10:55:16 +01:00
Stefan Kalkowski
5c71a8d74d lx_emul: extract common lx_emul import makefile
Fix #4442
2022-03-09 10:55:16 +01:00
Stefan Kalkowski
b80146a6f7 genode_c_api: unify shared dataspace callbacks
* Unifies the declaration of callbacks which manage driver/client
  shared dataspaces
* Move the Linux driver-specific callback implementation to the
  lx_emul library from the PC's USB host driver

Fix genodelabs/genode#4439
2022-03-09 10:55:16 +01:00
Norman Feske
b1e2e654a9 sculpt: support uplink and event service providers
This patch enhances Sculpt with the ability to route uplink and event
sessions to the optional black-hole component.

Issue #4419
2022-03-08 15:48:53 +01:00
Christian Helmuth
a941dfe7b2 gpt_write: adapt to changed packet stream blocking semantics
Issue #4390
2022-03-08 15:37:04 +01:00
Robin Eklind
1142ef91df base-linux: fix build (BOARD=pc)
Fix a few build errors related to required type conversions
and handling of references.

Fixes #4440
Fixes #4441
2022-03-08 14:23:28 +01:00
Norman Feske
4056fb9127 pc/usb: fix ret value of handle_altsetting_request
The logic got accidentally reversed during the transition from the
legacy USB driver.

Since the function drops error details, this patch adds a diagnostic
message with the error code as returned by the Linux driver.
2022-03-08 12:46:11 +01:00
Norman Feske
0325be0827 virtualbox6: service lib target has no artifacts
This patch declares that the pseudo target virtualbox6/services/ does
not produce any build artifact. This allows the adding of virtualbox6
to Sculpt's 'build:' list.
2022-03-08 10:51:19 +01:00
Christian Helmuth
29e6537939 pc: fix dependency to generated crc32table.h 2022-03-07 16:43:12 +01:00
Stefan Kalkowski
600997d8d6 usb_hid_raw: don't use deprecated qemu option
* Use -device instead of deprecated -usbdevice
* Use the same xhci model as in usb_hid_reconnect
2022-03-07 16:43:12 +01:00
Josef Söntgen
67f797abf2 pc: enable UHCI driver in usb_host
Fix genodelabs/genode#4438
2022-03-07 16:43:12 +01:00
Stefan Kalkowski
2a35c8f9e7 lx_emul: add page macros to x86 shadow headers
* Add page_to_phys and dummy macro for pgprot_device

Original commit provided by Josef Soentgen

Ref genodelabs/genode#4438
2022-03-07 16:43:12 +01:00
Josef Söntgen
2760b67902 lx_kit/lx_emul: add I/O port support
Ref genodelabs/genode#4438
2022-03-07 16:43:12 +01:00
Stefan Kalkowski
57aab46fc3 platform: introduce I/O ports in API
* Introduces Platform::Device::Io_port client utility
* Implements I/O ports as common device resources in platform driver

Fix genodelabs/genode#4436
2022-03-07 16:42:56 +01:00
Stefan Kalkowski
8a4cbe3cc9 io_port_session: make default ram quota explicit
Ref genodelabs/genode#4436
2022-03-02 15:04:18 +01:00
Roland Bär
d45b60ceeb sntp_client.run: redundant aritfacts in image build
The run script uses core, ld.lib.so, and init from depot packages, thus
these cannot be integrated in the image explicitly from the build
directory.

Also, removed special build of report_rom, which is not subject of the
test.

Fixes #4437
2022-03-02 07:56:20 +01:00
Christian Helmuth
4591d501b4 version: 22.02 2022-02-28 15:47:43 +01:00
Norman Feske
36957cb4d3 News item for version 22.02 2022-02-28 15:43:17 +01:00
Norman Feske
8b2247e21b Release notes for version 22.02 2022-02-28 15:43:17 +01:00
Norman Feske
cdb2f624de Update doc/components.txt 2022-02-28 15:43:17 +01:00
Christian Helmuth
2b3370c8d8 depot: update recipe hashes 2022-02-28 11:46:35 +01:00
Christian Prochaska
88dec4cc94 dde_rump: support blocking I/O operations from non-ep threads
Issue #4433
2022-02-28 11:45:19 +01:00
Martin Stein
87c5f91a74 test/black_hole: test link-state change at uplink
Ref #4419
2022-02-28 11:45:19 +01:00
Martin Stein
fa3a195077 test/black_hole: split-up test classes
Ref #4419
2022-02-28 11:45:18 +01:00
Martin Stein
4f640dacab test/black_hole: fix failing packet allocation
* The problem occured only on OKL4, seL4, and L4/Fiasco
* The test used to continue submitting packets regardless of how many were in
  flight
* This commit limits the in-flight packets at the Uplink/Nic connections to 40
  each

Ref #4419
2022-02-28 11:45:18 +01:00
Christian Prochaska
351439b4ab Add vfs_gpu.lib.so to Qt5 run scripts and recipes
Issue #4380
2022-02-28 11:45:18 +01:00
Norman Feske
44282da30d Add vfs_gpu.lib.so to Mesa run scripts
This follow-up commit to "vfs_gpu: VFS plugin that handles GPU
completions" is needed to excute the mesa-gears.run script.

Issue #4380
2022-02-28 11:45:18 +01:00
Norman Feske
668258746b Update expat to version 2.4.6
The tar.gz archive of version 2.4.1 vanished from sourceforge.
2022-02-28 11:45:18 +01:00
Norman Feske
ca9460aead event_filter: touch/press untouch/release sequence
This commit changes the touch-click filter to adhere the following
sequence:

  touch         (physical)
  press         (artifically generated)
  release       (artificially generated)
  release_touch (physical)

This order is important because nitpicker's focus handling takes
press/release events into account. If the release-touch event appears
before the release event, nitpicker subsumes the release-touch event
to the sequence that started with the press event, instead of handling
it as a free-standing event.

Issue #4332
2022-02-28 11:45:18 +01:00
Norman Feske
55492fbe5b sculpt: assign CPU quotas
By assigning CPU budgets, base-hw's priorities come into effect.
Even though the chosen values are rather guessed than informed, they
yield a visibly improved responsiveness on the Pinephone.
2022-02-28 11:45:18 +01:00
Norman Feske
a084f6c835 sculpt: suppress log_kernel on Pinephone
The log_kernel component exists only for NOVA.
2022-02-28 11:45:18 +01:00
Norman Feske
e162317afa sculpt: add nitpicker domain for touch keyboard
Issue #4432
2022-02-28 11:45:18 +01:00
Norman Feske
ac3069ebfa sculpt: launcher for touch_keyboard
Issue #4432
2022-02-28 11:45:18 +01:00
Norman Feske
620a274c82 Touch-screen keyboard
Fixes #4432
2022-02-28 11:45:18 +01:00
Johannes Schlatow
e35837e14b trace_buffer: fix wrap condition
When committing a new entry, the buffer wrapped if the last entry fit
perfectly into the buffer. Otherwise, the length field of the next entry
was set to 0 to mark the new head. Yet, if there was still some padding but not
enough to hold the length field of another entry, we ended up with a
headless buffer.

genodelabs/genode#4430
2022-02-28 11:45:18 +01:00
Johannes Schlatow
91b6032a71 trace_buffer: eliminate race
Since the head of the buffer is marked by a zero-length entry, we must
only write the length field if a new head was set. Otherwise, the
consumer might already read the new entry and not find the new head as a stop
condition.

genodelabs/genode#4430
2022-02-28 11:45:18 +01:00
Johannes Schlatow
b57ccf3517 trace_buffer: fix wrap corner case
If the functor reading the first entry after wrap-around returned false,
the wrapping was not applied successfully.

genodelabs/genode#4430
2022-02-28 11:45:18 +01:00
Johannes Schlatow
44aefc8777 trace_buffer: fix out-of-bounds read
The calculation in next() actually checked whether the current entry
fitted into the buffer, not if another one fitted.

genodelabs/genode#4430
2022-02-28 11:45:18 +01:00
Johannes Schlatow
d7c4265089 trace_buffer: add test pkg for depot_autopilot
genodelabs/genode#4430
2022-02-28 11:45:18 +01:00
Norman Feske
b39c124628 base-okl4: remove non-critical error message 2022-02-28 11:45:18 +01:00
Stefan Kalkowski
b5b958c276 hw: unify architectural kernel interface header
Fix genodelabs/genode#4345
2022-02-28 11:45:18 +01:00
Stefan Kalkowski
b5e327e3e9 platform_drv: do not return cap of device twice
When a device got already acquired by a platform session client, do not
return the same capability again, even if the same platform session
client requested it. Therefore, make doubtful behaviour of client components
visible, and do not have to struggle with Platform::Device instances
instantiated multiple times, which care of the lifetime of the device
capability internally.

Fix genodelabs/genode#4379
2022-02-21 15:47:51 +01:00
Piotr Tworek
e595b0b782 base-hw: Make sure MMU is initially disabled on ARMv8.
Genode code already expects MMU to be disabled when starting the
kernel. It is enabled eventually in Bootstrap::Platform::enable_mmu,
after setting up translation tables. Unfortunately nothing ensures
this is actually the case. If MMU happens to be enabled when entering
the kernel things go downhill pretty fast after we start messing with
TTBR.

This patch ensures MMU is disabled for EL1, EL2, EL3 dependent on the
exception level of the CPU core, which is entering the kernel.

This should allow base-hw to start correctly on Quartz64 A board.
2022-02-21 15:47:51 +01:00
Stefan Kalkowski
0c67d0838a hw: restrict page-table lookup to rw-pages
The `lookup_translation` function got introduced and is used only in the
context to proof whether a cache maintainance function can be executed
safely by the kernel. Unfortunately, it did not checked write permissions,
which can lead to permission faults. This commit restricts the lookup
function to only succeed when the target page is writeable. Consequently,
the lookup function gets renamed to `lookup_rw_translation`.

Fix genodelabs/genode#4348
2022-02-21 15:47:51 +01:00
Stefan Kalkowski
e1a2b5c8d4 pc: build lx_emul and linux driver code with -O2
Ref genodelabs/genode#4416
2022-02-21 15:47:51 +01:00
Stefan Kalkowski
14d1ca17a9 Use new pc_usb_host_drv in all recipes and tests
* Switch from the legacy usb_host driver to the new PC version
  in recipes and automated tests
* Update documentation snippets
* Remove outdated, unused usb_rndis run-script

Fix genodelabs/genode#4416
2022-02-21 15:47:50 +01:00
Stefan Kalkowski
a30c4281d2 genode_c_api: report usb config on demand
Do not only report devices, but the current configuration of the driver too,
as long as the `report` node in the configuration states it.

Ref genodelabs/genode#4416
2022-02-21 15:47:50 +01:00
Stefan Kalkowski
938ac716a8 genode_c_api: make usb devices report configurable
To stay consistent with the configuration of the legacy usb_host_drv
and other components as well, do not report USB devices by default,
but when the following XML node is set within the component's
configuration:

  <report devices="yes"/>

Ref genodelabs/genode#4416
2022-02-21 15:44:23 +01:00
Stefan Kalkowski
a04d0b9a0f usb_session: increase default ram quota
The new usb_host driver for PC by default needs more RAM quota in contrast
to the old one. To minor warnings and repeated attempts to open a USB
session from a client, this commit increases the default RAM quota by one
page.

Ref genodelabs/genode#4416
2022-02-21 15:44:22 +01:00
Stefan Kalkowski
3c07bf4e86 genode_c_api: support to handle empty usb session
Adds a function to the USB part of the Genode's C API, to enable
usb_host drivers to acknowledge USB request in client's packet buffer
although they are not assigned to an USB device. The requests are
marked with a "no device" error.

This commit fixes a regression originally solved in genodelabs/genode#4149

Ref genodelabs/genode#4416
2022-02-21 15:44:22 +01:00
Norman Feske
c2efa5406e xml_node: support backslash as attribute value
XML allows attribute values like <node attr="\"/>. The XML parser
wrongly reflects this case as 'Invalid_syntax'. This behavior stems from
the implicit use of the 'end_of_quote' function, which considers the
sequence of '\"' as a quoted '"' rather than the end of a quoted string.

The patch solves this problem by making the 'end_of_quote' part of
the tokenizer's scanner policy.

The patch removes the 'end_of_quote' function from 'util/string.h'
because it is not universal, and to avoid the ambiguity with
'SCANNER_POLICY::end_of_quote'.

Fixes #4431
2022-02-21 15:44:22 +01:00
Stefan Kalkowski
494f881f27 core: don't use frame 0 for managing_system pd
When a PD owns the right to ask for a RAM dataspace's `dma_addr` it is
concurrently constrained to use allocations of a specific physical RAM area.
This commit further limits this area by removing RAM page frame zero.
Otherwise the return value of `dma_addr` for such a dataspace would be
erroneously interpreted as a fault, because zero is currently the error
return value of `dma_addr`.

Fix genodelabs/genode#4428
2022-02-21 15:44:22 +01:00
Norman Feske
429d078de7 log_core.run: RAM-quota adjustment for sel4
Issue #4400
2022-02-21 15:44:22 +01:00
Norman Feske
ef732f480f mk: pass KERNEL as environment variable
This is a follow-up fix for "mk/ld.mk: trigger kernel-dependent
ld.lib.so build", which alleviates the need to specify the KERNEL at the
build-system command line. Thanks to Piotr Tworek for reporting.

Issue #4320
2022-02-21 15:44:22 +01:00
Norman Feske
4769e05626 mk: abi does not depend shared-lib dependencies
This patch cuts the superfluous dependency of abi.so files from the
library dependencies of the corresponding lib.so file. ABIs depend
only on symbol files.

Prior this patch, the second step of the following sequence would
wrongly re-build the abi.so file.

  arm_v6$ make init
  arm_v6$ make init KERNEL=hw

As the KERNEL argument does not affect the ABI, the abi.so should
better not be created twice.

Issue #4408
2022-02-21 15:44:22 +01:00
Johannes Schlatow
019cacf07e vfs_tap: VFS plugin for Uplink/Nic session access
This plugin emulates a `/dev/tapX` device as found on FreeBSD. See
README for more information.

genodelabs/genode#4394
2022-02-21 15:44:22 +01:00
Johannes Schlatow
19958eafcf vfs: add notify_read_ready() to Single_vfs_handle
The Single_file_system now forwards the
`File_io_service::notify_read_ready` method to the
handle as it already did for most of the other methods.

genodelabs/genode#4394
2022-02-15 17:14:34 +01:00
Johannes Schlatow
f33916e2dc vfs: remove check_unblock from File_io_service
genodelabs/genode#4394
2022-02-15 17:14:34 +01:00
Christian Helmuth
1d5af600cc test-init: increase LOG server cap quota for sel4 2022-02-15 17:14:34 +01:00
Sebastian Sumpf
8edb7b28a0 sculpt_manager: initial mode for 'Managed_config'
Do not set '_mode' per default to MANANGED. Check if a manual config ROM
is present during construction and set '_mode' to MANUAL in case it is.

issue #4369
2022-02-15 16:33:38 +01:00
Norman Feske
14b93c5ff3 run: handle empty create_tar_from_depot_binaries
This patch works around 'tar' erroring out when faced with an empty list
of files:

  tar: Cowardly refusing to create an empty archive

This can happen when using sculpt.run for a scenario with only a runtime
but no deploy or launcher configuration.

Issue #4369
2022-02-15 16:13:54 +01:00
Sebastian Sumpf
300cdc435d expanding_report: make expandable for XML node generation
'generate(Xml_node node)', as used by the Sculpt manager, calls this
function instead of the lambda version. The 'report' function of the
'Genode::Reporter' does not throw an exception in case there is not
enough backing storage for the 'generate' request. Therefore, we have to
check this condition in a loop and call '_increase_report_buffer' in
case size limits are reached.

Patch by Norman Feske.

issue #4369
2022-02-15 16:13:53 +01:00
Piotr Tworek
dd1596aa53 base: Don't produce .gnu.hash tables for Genode.
Genode linker does not support .gnu.hash tables so they will never be
used. Tell the linker not to bother producing them. This should reduce
the size of Genode ELF files a tiny bit without loosing anything
important in the process.

Fixes #4423
2022-02-15 15:32:20 +01:00
Martin Stein
3e460211c8 black_hole: provide Uplink service
Ref #4419
2022-02-15 15:28:58 +01:00
Piotr Tworek
bade0a85e7 base-hw: Implement CPU core identification for Cortex-A55.
According to ARM Cortex-A55 Core Technical Reference Manual r1p0 the
lowest 8 bits (Aff0) of MPIDR register represent thread IDs within a
multi-threaded core. The actual core identification bits are in Aff1.
This layout can be identified by checking the MT bit of MPIDR register.
Basically, if MT=1 core id is in Aff1, if MT=0 core id is in Aff0.

Without this change Genode will identify all CPU cores on A55 as primary
(0) core.

Its worth to mention that Cortex-A55 by itself is not a multi-threaded
CPU. Aff0 values are always expected to be 0 for pure A55 cores. A55
cores can however be paired with cores that are multi-threaded. To
support such big.LITTLE CPUs in Genode we'd probably need to add a
different mechanism for mapping MPIDR values to logical, contignous
core IDs which Genode expects.

Ref:
https://developer.arm.com/documentation/100442/0100/register-descriptions/aarch64-system-registers/mpidr-el1--multiprocessor-affinity-register--el1?lang=en
2022-02-15 15:27:29 +01:00
Johannes Schlatow
c265218ba8 netperf: output more metrics
* use netperf omnitest output selectors to acquire more metrics
* remove packet_size argument that was not interpreted by netperf

genodelabs/genode#4427
2022-02-15 15:25:56 +01:00
Norman Feske
8b7067d289 sd_card_bench.run: assign 'managing_system' role
Issue #2243
2022-02-15 15:18:04 +01:00
Norman Feske
649647538b depot: update recipe hashes 2022-02-15 10:23:59 +01:00
Johannes Schlatow
70bf0cbe84 vfs/lwip: add missing signal handlers
Note, without batching from the Nic server this may slow down the
throughput a bit.

genodelabs/genode#4427
2022-02-15 10:23:59 +01:00
Piotr Tworek
58e0b24006 base: Ignore empty constructors array.
This does not affect default Genode builds as far as I can tell. There
is always at least one global static CTOR which seems to be coming from
one of the GCC runtime libs bundled in the toolchain. The problem became
visible for me only after I've replated GCC runtime with LLVM based
one. In such setup I often see binaries that do not have any static ctors.
Such binaries end up crashing Genode ld.lib.so.

Make sure the code does handle empty constructors array.

Fixes #4422
2022-02-15 10:23:58 +01:00
Piotr Tworek
05e4993d2e gems: Avoid flexible array member in Cached_font.
Switch the code to 0 lengh array instead. The code in
Lru_cache::element_size calls sizeof on this structure. This works in
gcc, but fails when using clang. Even for GCC however the documentation
states:

  "Flexible array members have incomplete type, and so the sizeof operator
   may not be applied. As a quirk of the original implementation of
   zero-length arrays, sizeof evaluates to zero."

Basically its an implementation quirk that clang does not support. Both
GCC and clang do support zero sized arrays however so using them here
allows both compilers to process this code.

Ref: https://gcc.gnu.org/onlinedocs/gcc/Zero-Length.html

Issue #4421
2022-02-15 10:23:58 +01:00
Piotr Tworek
c1a566ce63 gems: Remove unused lambda capture in vfs/ttf.
Clang complains "this" captured by the lambda is not used. Remove the
capture to make it happy.

Issue #4421
2022-02-15 10:23:58 +01:00
Piotr Tworek
ec7d0efddf os: Drop unused Net::Dhcp_client::_alloc member.
This reference member is not used anywhere in the code. This prompts
clang to complain about it. Eliminate the member and all the plumbing
associated with it to silence the warning.

Issue #4421
2022-02-15 10:23:58 +01:00
Piotr Tworek
15c8cac78b os: Don't use char as array subscript.
Clang really doesn't like char subscripts. I can't say I blame it. Fix
the warning by an explicit cast to unsigned.

include/nitpicker_gfx/tff_font.h:230:53: error:
    array subscript is of type 'char' [-Werror,-Wchar-subscripts]
Tff::Vertical_metrics const m = _vertical_metrics['m'];
                                                 ^~~~
Issue #4421
2022-02-15 10:23:58 +01:00
Piotr Tworek
9dd04ad268 os: Drop unused lambda captures in VFS code.
Clang likes to complain when lambdas capture parameters without
actually using them. This patch fixes a couple of such problems in VFS
related os module code.

Issue #4421
2022-02-15 10:23:58 +01:00
Piotr Tworek
14c36efbab os: Disambiguate Genode::destroy in route_model.h
Clang can't figure it out on its own. I can't blame it for this to be
honest. Lets be clear which destroy method we're talking about here.

Issue #4421
2022-02-15 10:23:58 +01:00
Piotr Tworek
f1f3b423ec os: Disambiguate friend Avl_node.
It seems clang does not take "using namespace Genode" statement in
Driver namespace into account when parsing those friend Avl_node
lines.

Issue #4421
2022-02-15 10:23:58 +01:00
Piotr Tworek
5e93a5806b base-hw: Use softfp ABI on virt_qemu ARMv7.
The soft ABI implies purely software floating point implementation.
This is not the case for Genode however. For example core's
exception_vector.S uses vmsr instruction. This builds fine with with
GCC based toolchain, but clang with integrated-as complains:

src/core/spec/arm/exception_vector.S:122:2: error: instruction requires: VFP2
 vmsr fpexc, r1
 ^

Fix this by passing softfp to mfloat-abi command on ARMv7. This allows
usage of FP HW, but implies soft-floating point ABI.

Issue #4421
2022-02-15 10:23:58 +01:00
Piotr Tworek
4ae78639f5 base-hw: Fix invalid structure alignments.
According to C++11 reference:

  "If the strictest (largest) alignas on a declaration is weaker than
   the alignment it would have without any alignas specifiers (that is,
   weaker than its natural alignment or weaker than alignas on another
   declaration of the same object or type), the program is ill-formed:"

https://en.cppreference.com/w/cpp/language/alignas

The code requests 4 byte alignment for Genode::Arm_cpu::Context.
The Context structure inherits Genode::Arm_cpu::Fpu_context which
has minimum alignment requirement of 8 bytes, due to uint64_t d0_d31
member. This makes the 4 byte value in Context's alignas specifier
invalid (smaller than allowed minimum).

Similar situation takes place in Arm_64 case. The claimed minimum
alignment of Context is 8 bytes, but the fpu_state member imposes 16
bytes alignment (explicitly specified in Fpu_state declaration).

In both cases the code builds fine with GCC 8.3.0, but fails with
clang which claims that "requested alignment is less than minimum
alignment of X for type", where X is 8 on ARM and 16 on AArch64.

Ref: https://eel.is/c++draft/dcl.align#5

Issue #4421
2022-02-15 10:23:58 +01:00
Martin Stein
468057638b black_hole: provide Nic service
Ref #4419
2022-02-15 10:23:58 +01:00
Stefan Kalkowski
3edec0c6ca pc: new usb host driver based on Linux 5.14.21
Original commit by Josef Soentgen.

Ref genodelabs/genode#4416
2022-02-15 10:23:58 +01:00
Stefan Kalkowski
e72f39b484 Provide pc specific lx_emul API
This commit contains:

* Minimal Linux kernel target: pc_linux
* Library to generate a Linux build directory, config, generated headers
* API depot package

The actual work was provided by Josef Soentgen.

Ref genodelabs/genode#4416
2022-02-15 10:23:58 +01:00
Norman Feske
33b038e8a7 Consistent spelling of "writeable"
Fixes #4425
2022-02-15 10:23:58 +01:00
Norman Feske
0d48b74bec Remove Dataspace::phys_addr RPC function
The official way to obtain DMA addresses for RAM dataspaces is
the RPC function 'Pd_session::dma_addr' now. User-level device drivers
should not call this function directly but use the 'Platform_session'
interface of the platform driver instead.

Fixes #2243
2022-02-15 10:23:58 +01:00
Norman Feske
84435662aa os/block: Remove use of Dataspace::phys_addr
Issue #2243
2022-02-15 10:23:58 +01:00
Norman Feske
de6c65c453 sd_card/pl180: remove unused code 2022-02-15 10:23:16 +01:00
Martin Stein
7945bcb353 black_hole: add config.xsd
Ref #4419
2022-02-15 10:23:16 +01:00
Martin Stein
ca49e94a87 black_hole: test recipe for the depot_autopilot
* Creates sessions to all supported services of the black hole component
* Test-drives the Event and Capture session with dummy input
* Adds the test to the default list of depot_autopilot.run
* Test-driving the Audio_in and Audio_out sessions is still missing and should
  be added via a dedicated commit

Ref #4419
2022-02-15 10:23:16 +01:00
Stefan Kalkowski
3966d6f16f usb_host_drv: move it to legacy_usb_host_drv
To make room for the re-newed usb_host_drv basing on Linux 5.14 and
the re-newed lx_kit/lx_emul we have to move the depot recipe and
consistently name the old drivers with a legacy_ prefix.

Ref genodelabs/genode#4416
2022-02-15 10:23:16 +01:00
Stefan Kalkowski
17f3e7a38f Introduce pc repository for PC board support
Fix genodelabs/genode#4415
2022-02-15 10:23:16 +01:00
Stefan Kalkowski
da55425114 lx_emul: finalize support for x86_32 and x86_64
Original commit by Josef Soentgen.

Fix genodelabs/genode#4411
2022-02-15 10:23:16 +01:00
Josef Söntgen
5a48f8ab0f lx_kit/lx_emul: support for executing PCI fixups
Ref genodelabs/genode#4411
2022-02-15 10:23:16 +01:00
Josef Söntgen
2515196b82 lx_kit: add Platform session wrapper for x86
The x86 platform driver uses a different API than the one for ARM for
which the lx_kit glue code was designed. Since the x86 platform driver
will eventually adopt a similar interface we implement a wrapper that
encapsulates the old interface.

Ref genodelabs/genode#4411
2022-02-15 10:23:16 +01:00
Josef Söntgen
77ab7bf68b lx_emul: add PCI config space handling
Ref genodelabs/genode#4411
2022-02-15 10:23:16 +01:00
Josef Söntgen
c851b189c5 lx_emul: add wake_q_add/wake_up_q in shadow impl.
The function within this commit were taken verbatim from the
original Linux implementation.

Ref genodelabs/genode#4411
2022-02-15 10:23:16 +01:00
Josef Söntgen
0f70212139 lx_emul: import shadow sched.c from allwinner repo
Ref genodelabs/genode#4411
2022-02-15 10:23:16 +01:00
Josef Söntgen
96ca806e0d lx_emul: fix conversion warnings on 32bit
This change is necessary for also supporting 32bit platforms.

Ref genodelabs/genode#4411
2022-02-15 10:23:16 +01:00
Stefan Kalkowski
7809b9e8ad lx_emul: move arm_64 specifics, add x86 specifics
Split in between x86 and arm code. Move arm-specifics away from
generic include pathes.

Ref genodelabs/genode#4411
2022-02-15 10:23:16 +01:00
Stefan Kalkowski
d7963be212 lx_emul: update to linux kernel 5.14 as default
Until now, the lx_emul layer addressed a 5.11 Linux Kernel port,
now that we add new architectures it is better to update the default version
first. There are especially changes in the task_struct code,
and the signature of some functions in the paging subsystem changed.

Ref genodelabs/genode#4411
2022-02-15 10:23:16 +01:00
Stefan Kalkowski
742c40a60a dde_linux: add linux kernel 5.14.21 port
Ref genodelabs/genode#4411
2022-02-15 10:23:15 +01:00
Stefan Kalkowski
1e41c6daa4 lx_kit: move setjmp/longjmp away from legacy
We use the architecture-specific setjmp/longjmp implementation without
modification in the newer lx_kit implementation as well. There is no
need for a duplication.

Ref genodelabs/genode#4411
2022-02-15 10:23:15 +01:00
Stefan Kalkowski
ed1b8fb3f9 sculpt_manager: increase ram quota of nic driver
When running Sculpt OS on i.MX8 MW EVK or MNT Reform 2 the NIC driver
is far more hangry with respect to memory usage.

Fix genodelabs/genode#4407
2022-02-15 10:23:15 +01:00
Martin Stein
fcb3e32fee black_hole: provide Event service
Fixes #4419
2022-02-15 10:23:15 +01:00
Norman Feske
53dea7e623 Move exec_terminal to genode-world
This is a leftover of issue #4258.
2022-02-15 10:23:15 +01:00
Norman Feske
f9f79af5bd tool/tool_chain: fix condition of ali2dep build
Thanks to Tomasz Gajewski for reporting this issue and suggesting the
fix.

Fixes #4365
2022-02-15 10:23:15 +01:00
Martin Stein
6f571a1e80 port/cbe: update to newest version
The new version fixes a bug that led to the regular attempt of encrypting
invalid block encryption keys at the crypto back-end.

Ref #4355
2022-02-15 10:23:15 +01:00
Norman Feske
4f40a607ea Remove ROM prefetcher
Fixes #4418
2022-02-15 10:23:15 +01:00
Johannes Schlatow
392a2cba66 libc: fix page fault in socket_fs_plugin
In the error case of socket_fs_accept() the Unconfirmed utility was
incompletely applied with the result of executing the cleanup routines
in the wrong order.

Fixes #4417
2022-02-15 10:23:15 +01:00
Stefan Kalkowski
50c7104e22 nic_router tests: remove unused platform driver 2022-02-15 10:23:15 +01:00
Christian Helmuth
a9b8b6e6c2 Move lua/moon to genode-world
Issue genodelabs/genode-world#282
Fixes #4414
2022-02-15 10:23:15 +01:00
Christian Helmuth
76dde9d0ec libports: remove ancient unused readline library 2022-02-15 10:23:15 +01:00
Alexander Boettcher
888b89c1c0 nova: avoid pagefault on invalid SVM exit
Fixes #4391
2022-02-15 10:23:15 +01:00
Alexander Boettcher
35489aa708 seoul: move to genode-world
Fixes #4412
2022-02-15 10:23:15 +01:00
Alexander Boettcher
baea48fbec iso9660: move to genode-world
Fixes #4413
2022-02-15 10:23:15 +01:00
Norman Feske
ec559b85e2 Add missing shared-object link dependencies
Issue #4408
2022-02-15 10:23:14 +01:00
Stefan Kalkowski
144cc8ac54 create_dummies: fix detection of out-of-tree build
Fix genodelabs/genode#4410
2022-02-15 10:21:00 +01:00
Norman Feske
59936c22c0 depot: cut kernel dependency from api/base
This patch removes the implicit build of ld-$(KERNEL) by the generic
ld.mk file because the kernel-specific dynamic linker is unreachable
when building a regular binary archive.

Issue #4320
2022-02-15 10:20:59 +01:00
Norman Feske
368730ce0b run: don't build ld at boot-dir stage
With the kernel-specific build of the dynamic linker triggered
automatically at the build stage, the artificial build step at the
boot-dir stage can be skipped.

Issue #4320
2022-02-15 10:20:59 +01:00
Norman Feske
23f92da02f mk/ld.mk: trigger kernel-dependent ld.lib.so build
When 'KERNEL' is specified, let the generic (pseudo) target of
lib/mk/ld.mk trigger the build of the actual dynamic linker named after
the used kernel. This way, we become able to remove the magic
linker-build step from the boot-image stage of the run tool.

Issue #4320
2022-02-15 10:20:59 +01:00
Norman Feske
f2f0711bf4 mk: don't link transitive shared-lib dependencies
This patch applies the existing "privatization" of transitive
shared-library dependencies from static lib dependencies to shared lib
dependencies. It thereby improves the consistency of binaries created in
a regular build directory with binaries created in depot archives.

Issue #4408
2022-02-15 10:20:59 +01:00
Norman Feske
bdc766980e tool/run/boot_dir/linux: improve error message
Also fix white space
2022-02-15 10:20:59 +01:00
Norman Feske
3b8fe1b410 nitpicker: reflect seq number in clicked report
This patch makes nitpicker's "clicked" report useful for the detection
of clicks outside of any client. This is needed in situations where the
dialog should close when clicking outside its screen area. In the new
version, a click outside any client results in a report without a
'label' attribute. Furthermore, the report is augmented by the sequence
number of the click, which allows for freshness checks by the consumer of
the report (i.e., sculpt_manager).

Issue #4398
2022-02-15 10:20:59 +01:00
Norman Feske
616a92a193 test-vfs_stress_fs: adjust cap quota for seL4 2022-02-15 10:20:59 +01:00
Johannes Schlatow
47cb44c6eb os/trace_buffer.h: fix wraparound
If the buffer contains padding at the end, the iteration must continue
in order to restart iteration from the start of the buffer.

genodelabs/genode#4244
2022-02-15 10:20:59 +01:00
Martin Stein
b31bbfe14c jpeg: update hash of downloaded archive
The archive contents are equivalent except the creation date of the
top-level directory.

  -drwxr-xr-x guivol/users      0 2021-01-07 12:54 jpeg-9d/
  +drwxr-xr-x guivol/users      0 2022-01-04 12:02 jpeg-9d/

Fixes #4406
2022-02-15 10:20:59 +01:00
Norman Feske
36162f5ccf Remove fs_log component
Fixes #4400
2022-02-15 10:20:59 +01:00
Stefan Kalkowski
cd0cfc34a3 create_builddir: add imx repository for arm_v7 2022-02-15 10:20:59 +01:00
Norman Feske
d93d3fbfca log_core.run: use terminal_log instead of fs_log
Issue #4400
2022-02-15 10:20:59 +01:00
Norman Feske
51134a6897 cpu_burner: coding style 2022-02-15 10:17:28 +01:00
Norman Feske
26d9bac78f os: remove outdated test/block components
The functionality of the test-block-client, test-block-server, and
test-block-bench components is now covered by the block_tester
application and the vfs_block server.

Issue #4405
2022-02-15 10:17:28 +01:00
Norman Feske
378e2d9e74 Use block_tester instead of test/block/client
Issue #4405
2022-02-15 10:17:28 +01:00
Norman Feske
76c090b694 Remove block_cache server
Issue #4405
2022-02-15 10:17:28 +01:00
Norman Feske
9478c3cc7c Remove http_block server
Issue #4405
2022-02-15 10:17:28 +01:00
Norman Feske
479f2e0d1f trace_logger: remove false warnings from the log
This patch eliminates warnings that occurred as side effect of using the
'Session_policy' utility ("Warning: no policy defined for label...").
The new version uses the 'with_matching_policy' function instead, which
has the nice side effect of simplifying the error handling.
2022-02-15 10:17:28 +01:00
Norman Feske
6eaeb61d58 os/session_policy.h: add 'with_matching_policy'
This patch makes the server-side policy-matching logic available outside
the 'Session_policy' class. Given that the new 'with_matching_policy'
function does not throw any exception, it gives server implementations
the freedom to avoid the C++ exception mechanism for the policy handling.
2022-02-15 10:17:28 +01:00
Stefan Kalkowski
bb285bf758 Convert virtio to use Platform::Session::dma_addr
Issue #2243
2022-02-15 10:17:28 +01:00
Norman Feske
7e26d3ef3f Give diagnostic aid to callers of 'dma_addr'
If the platform driver lacks the 'managing_system="yes"' attribute,
requests for DMA addresses return 0. This patch is meant to help
diagnosing such configuration issues.

Issue #2243
2022-02-15 10:17:28 +01:00
Norman Feske
cbe3e49c7f os: Input::Event:Axis event type
This event type can be used to propagate analog values such as joypads.

Issue #3669
2022-02-15 10:17:28 +01:00
Norman Feske
50c2b0066f Remove 'Env::reinit' and 'Env::reinit_main_thread'
Fixes #4404
2022-02-15 10:17:28 +01:00
Norman Feske
62b4871c5c Remove gems/magic_ring_buffer.h
Since its introduction four years ago, the utility remained
largely unused.

Fixes #4403
2022-02-15 10:17:28 +01:00
Christian Prochaska
d4d875f2e6 libusb: handle 'ack_avail' signals in a VFS plugin
Issue #4392
2022-02-15 10:17:28 +01:00
Stefan Kalkowski
cf0d007fd4 os: remove imx53 specific platform api and fb_drv
Fix #4402
2022-02-15 10:17:28 +01:00
Stefan Kalkowski
fe009fd66d usb_hid_raw: add configuration for rpi_platform_drv
Ref #4396
2022-02-15 10:16:52 +01:00
Norman Feske
51479e6be0 Convert drivers to use Platform::Session::dma_addr
This patch eliminates several calls of 'Dataspace::phys_addr'.

Issue #2243
2022-02-15 10:16:52 +01:00
Norman Feske
90a6f55f88 os: add platform_session/dma_buffer.h
The new 'Dma_buffer' utility simplifies the allocation of DMA-capable
RAM by device drivers.

Issue #4401
2022-02-15 10:16:52 +01:00
Norman Feske
997a24e91a dde_rump: remove use of Dataspace::phys_addr
This patch removes dead code. The Rump kernel does not need to know any
physical addresses of allocated memory.

Issue #2243
2022-02-15 10:16:52 +01:00
Norman Feske
e4f62380d7 base: Pd_session::dma_addr, Pd_session::attach_dma
This patch enhances the PD-session interface with the support needed for
user-level device drivers performing DMA. Both RPC functions are
intended for the direct use by the platform driver only. If invoked for
PDs that lack the managing-system role, the operations have no effect.

The 'dma_addr()' RPC function allows the platform driver to request the
DMA address of a given RAM dataspace. It is meant to replace the
'Dataspace::phys_addr' RPC function.

The 'attach_dma' RPC function adds the given dataspace to the device
PD's I/O page table. It replaces the former heuristics of marking DMA
buffers as uncached RAM on x86.

With this patch, the UNCACHED attribute of RAM dataspaces is no longer
used to distinguish DMA buffers from regular RAM dataspaces.

Issue #2243
2022-02-15 10:16:52 +01:00
Johannes Schlatow
db3a647c6d allocator_avl: use Attempt for size_at
Fixes ambiguous interpretation of returned 0.

genodelabs/genode#4393
2022-02-15 10:16:51 +01:00
Johannes Schlatow
5aa0fea29b base: pass lambdas by reference in util/attempt.h
genodelabs/genode#4393
2022-02-15 10:16:51 +01:00
Johannes Schlatow
b821776b0d base: add == operator to util/attempt.h
This simplifies testing for early return conditions for which the use of
lambdas would be quite noisy.

genodelabs/genode#4393
2022-02-15 10:16:51 +01:00
Norman Feske
024b987e4c os: change Input::Touch_id from int to unsigned
There no sensible meaning for negative touch IDs.

Issue #3669
2022-02-15 10:16:51 +01:00
Norman Feske
8e9cabf819 sculpt_manager: touch-screen compatibility
This patch makes Sculpt's leitzentrale GUI able to respond to touch events. It
formerly assumed that click/clack events are always preceded by hover reports
that identify the clicked-on widgets. For touch events, however, the most
up-to-date hover information referred to the previous click because there is no
motion without touching. So the GUI tended to identify the wrong widgets as
click targets.

The patch solved this problem by testing the freshness of the hover information
at the time of the click. If the hover information is older than the click, the
action is deferred until up-to-date hover information becomes available.

Fixes #4398
2022-02-15 10:16:51 +01:00
Norman Feske
cdbb929125 nitpicker: forward Input::Seq_number events
Issue #4398
2022-02-15 10:16:51 +01:00
Norman Feske
a824632d95 menu_view: report input seq number in hover info
Issue #4398
2022-02-15 10:16:51 +01:00
Norman Feske
4dfa7902db os: Input::Event:Seq_number event type
The new event type allows for the propagation of sequence numbers as a means to
validate the freshness of input handling. E.g., an menu-view-based application
can augment artificial sequence numbers to the stream of motion events supplied
to 'menu_view'. Menu view, in turn, can now report the latest received sequence
number in its hover reports, thereby enabling the application to robustly
correlate hover results with click positions.

Issue #4398
2022-02-15 10:16:51 +01:00
Stefan Kalkowski
c99ca21649 rpi: remove drivers for platform, fb and sd_card
Fix #4396
2022-02-15 10:16:51 +01:00
Stefan Kalkowski
00f7819623 rpi_gpio_drv: remove dep from rpi board header
Ref #4396
2022-02-15 10:11:11 +01:00
Stefan Kalkowski
10d7741a26 Add board-specific rpi repo to .gitignore
Ref #4396
2022-02-15 10:11:11 +01:00
Christian Prochaska
f773c46b5d libusb: adapt to changed packet stream blocking semantics
Issue #4390
2022-02-15 10:11:11 +01:00
Norman Feske
ad2c5fe4b4 sculpt: check XML syntax of ingredients
Issue #4369
2022-02-15 10:11:11 +01:00
Norman Feske
a8667a55bd test/framebuffer/intel: use VFS, not of fs session
This patch updates the intel_fb_controller test component to use the VFS
API instead of interacting with an file-system session directly.

Issue #4390
2022-02-15 10:11:11 +01:00
Norman Feske
22cce07ec8 fs_log: remove blocking call of get_acked_packet
This patch replaces formerly blocking packet-stream operations by
the explicit use of 'wait_and_dispatch_io_signal' for blocking.
It also removes a misleading comment that promised a fire-and-forget
behavior whereas the implementation relied on blocking I/O anyway.

Issue #4390
2022-02-15 10:11:11 +01:00
Norman Feske
480c0a7dee base-fiasco: silence recv_and_wait error messages
Errors during IPC receive-and-wait can occur at the server side when
a client is killed. This condition is not an error from the server's
perspective. We used to print a message nevertheless, since the
condition is rather exceptional. However, when printed during the
test-sequence test, the messages interfere with the pattern matching of
the depot_autopilot, flagging the successful test as an error.
2022-02-15 10:11:11 +01:00
Norman Feske
df2e7fa842 vfs_block_file_system: remove Signal_receiver
The VFS block plugin used to depend on the blocking semantics of the
packet stream's 'get_acked_packet'. This patch replaces this dependency
by the use of 'wait_and_dispatch_one_io_signal'. However, in order to
implement this change, the custom instance of a 'Signal_receiver' had to
be removed as well.

To keep this patch as little invasive as possible, it does not touch the
direct use of the block session's packet stream, which should better be
replaced by the 'Block::Connection::Job' API.

Issue #4390
2022-02-15 10:11:11 +01:00
Johannes Schlatow
7aa9cf9b37 uplink_client_base: add handlers for zynq_nic_drv
The zynq_nic_drv follows a zero-copy approach and thus uses the packet
buffers as DMA memory. In order to know when the RX DMA memory can be used
for another packet, a custom ack_avail_handler is needed.
Similarly, packets received from the Uplink session are not copied to a
DMA buffer but to directly passed on as DMA memory. For this purpose,
a a custom packet_avail handler is needed.

genodelabs/genode#4384
2022-02-15 10:11:11 +01:00
Norman Feske
ac691eb229 file_system/util.h: remove packet-stream helpers
The 'read' and 'write' utilities are from a time before the VFS API
as os/vfs.h was available. They rely on the (now removed) blocking
semantics of the packet-stream interface.

The only remaining legitimate use case of the direct interaction with
the file-system session without VFS is the back end of gcov, which needs
a way to exfiltrate the statistical data using a channel that is
independent from the libc or the VFS.

Issue #4390
2022-02-15 10:11:10 +01:00
Norman Feske
0f56e76e7a rom_to_file: use VFS instead of fs session
This patch replaces the former direct use of a file-system session by
the use of the VFS API.

Issue #4390
2022-02-15 10:11:10 +01:00
Norman Feske
84f8305cdf usb_report_filter: use VFS instead of fs session
This patch replaces the direct use of a file-system session via the
'file_system/util.h' helpers by the VFS using the os/vfs.h API. This
makes the component more flexible while removing the dependence from
read and write utilities of file_system/util.h, which happen to rely on
the (now removed) blocking packet-stream semantics.

Issue #4390
2022-02-15 10:10:03 +01:00
Norman Feske
911ff31709 dde_rump: use Block::Connection::Job API
This patch replaces the direct interaction with the packet stream of
the block session by the use of the 'Block::Connection::Job' API,
removing the reliance on blocking packet-stream semantics.

Since I/O signals can now occur during 'Backend::submit', the patch
conditions the periodic calls of 'rump_sys_sync' by taking the backend
state into account.

Issue #4390
2022-02-15 10:10:03 +01:00
Norman Feske
7605101665 fatfs: use Block::Connection::Job API
This patch removes the use of blocking packet-stream calls from the
backend of the fatfs library.

Issue #4390
2022-02-15 10:10:03 +01:00
Norman Feske
2b0e64e061 os: remove blocking semantics from packet stream
Fixes #4390
2022-02-15 10:10:03 +01:00
Norman Feske
59ca8f2489 block_request_stream.run: use valid length value
Since the change "block_tester: limit batching in sequential test", the
sequence test blocks infinitely when encountering a length value smaller
than the block size.
2022-02-15 10:10:02 +01:00
Norman Feske
f7ee1f64a9 block_tester: warn on wrong length argument
When specifying a low value, the tester won't spawn any job but stay
silent. The message helps diagnosing such configuration problems.
2022-02-15 10:10:02 +01:00
Norman Feske
64af1d2d84 test/fs_packet: don't block
This patch takes precautions against the use of blocking packet-stream
operations like 'submit_packet'.

With the change of issue #4388, the ready-to-submit signals are no
longer implicitly handled. Hence, a call of submit_packet to a
saturated submit queue blocks infinitely.

Issue #4390
2022-02-15 10:10:02 +01:00
Norman Feske
7e3828b726 test/fs_packet: coding style 2022-02-15 10:10:02 +01:00
Norman Feske
11622fa038 file_system_session: merge ack and submit sigh
Fixes #4388
2022-02-15 10:10:02 +01:00
Christian Prochaska
2591c61e7d libusb: guard USB session packet allocator
Fixes #4389
2022-02-15 10:10:02 +01:00
Norman Feske
e98760a3d5 cpu_sampler.run: increase timeout
The previous timeout sometimes triggered with nova and foc on x86_32.
2022-02-15 10:10:02 +01:00
Norman Feske
ab0cba8ead base-hw: improve comments in kernel/interface.h 2022-02-15 10:10:02 +01:00
Norman Feske
90c446e565 base-hw: remove throw from ipc_reply_wait
Even though the use of the C++ exception mechanism (and the implicit use
of the cxx heap) is not a problem at the server side, this patch
nevertheless replaces the exception-based return-value handling to make
the code consistent with the ipc_call path.

Issue #3612
2022-02-15 10:10:02 +01:00
Norman Feske
3e4af3a567 base-hw: remove throw from ipc_call code path
This eliminates the dependency of the IPC-call operation from the cxx
heap.

Fixes #3612
2022-02-15 10:10:02 +01:00
Johannes Schlatow
0bb2e61e9e Allow derived classes of Genode::Array
genodelabs/genode#4382
2022-02-15 10:10:01 +01:00
Christian Helmuth
41a579e978 vbox6: fix warnings on disabled assertions 2022-02-15 10:10:01 +01:00
Sebastian Sumpf
299a35d943 libdrm/iris: check if VFS '<gpu/>' is present
On startup check if '/dev/gpu' is present and issue an error in case it
is not.

issue #4380
2022-02-15 10:10:01 +01:00
Sebastian Sumpf
cd4d00f31a gpu/intel: remove deadlock during session destruction
* use 'Id_space::apply_any' instead of 'for_each' to destroy session local
  buffer objects
* save session capability in session because 'cap()' is not valid in
  'Session_component' destructor because it was dissolved before calling
  'Root::_destruct_session', the cap is necessary to remove owned
  buffers from the EP

issue #4380
2022-02-15 10:10:01 +01:00
Stefan Kalkowski
7248957553 rpi_fb_drv: avoid alignment fault by own blit func
Fix #4331
2022-02-15 10:10:01 +01:00
Sebastian Sumpf
4cb8c91b08 libdrm/iris: import GPU buffers lazy optimization
Do not import a freshly allocated buffer to all contexts eagerly.
Instead check buffer list in context's 'exec_buffer' call and import
only buffers needed and not present before GPU execution. This leads to
improved performance for applications that use many OpenGL contexts
(e.g., VirtualBox 6).

issue #4380
2022-02-15 10:10:01 +01:00
Sebastian Sumpf
3c97fdbc0e libdrm/mesa/iris: Don't use Genode::Env any more
'vfs_gpu_env' handles this now for all applications.

issue #4380
2022-02-15 10:10:01 +01:00
Sebastian Sumpf
a3976f0468 vfs_gpu: offer 'vfs_gpu_env' call
* retrieve Genode::Env from plugin, this way no mesa applications need to
  be changed.
* add 'vfs_gpu' api
* remove when all required functionality is implemented within the plugin.

issue #4380
2022-02-15 10:10:01 +01:00
Sebastian Sumpf
b98e07ed34 vbox6: basic 3D support
Implement GLX and X functionality through Mesa's EGL interface. This
requires multiple OpenGL contexts and in turn GEM context support in
libdrm/iris, as implemented in libdrm and intel_gpu_drv.

Update recipes and machine.vbox6 files accordingly,

issue #4380
2022-02-15 10:10:01 +01:00
Christian Helmuth
27883c976c vbox6: 3D support skeleton
files required for VBox6's VMSVGA/VBoxSVGA with 3D accelaration
(accelerate3D="true").

issue #4380
2022-02-15 10:10:01 +01:00
Sebastian Sumpf
c35d2aff45 libdrm/iris: add gem context support
Retrieve multiple GPU sessions from VFS plugin, take advantage of buffer
import/export functionallity in order to implement gem context support.
Multiple contexts share all GPU buffers, but use different GPU sessions
and thus, differnt page tables and hardware contexts.

issue #4380
2022-02-15 10:10:01 +01:00
Sebastian Sumpf
7cc1741611 gpu/intel: buffer import/export support
Implement the import/export functionality of GPU buffers.

issue #4380
2022-02-15 10:10:01 +01:00
Sebastian Sumpf
a900594978 gpu_session: add import/export of buffers
Add 'export_buffer'/'import_buffer' calls in order to support buffer
sharing between GPU sessions.

Reduce CAP costs for Gpu::Connection from 256 to 32.

issue #4380
2022-02-15 10:10:01 +01:00
Sebastian Sumpf
567b9dfa39 libdrm/iris: use VFS/GPU plugin
Synchronize GPU completion by calling 'read' of the vfs_gpu plugin. This
enables pthreads to wait for GPU completions instead of the main EP.

issue #4380
2022-02-15 10:10:01 +01:00
Sebastian Sumpf
b3e12dcece vfs_gpu: VFS plugin that handles GPU completions
When a <gpu> node is present in the VFS, the plugin opens a
Gpu::Connection for each open call to the 'gpu' node and installs a
completion signal handler. A read only to the fd returned only comes
back if a completion signal has been received between two read
transctions to the fd.

For now the Gpu::Connections can be retrieved by calling the
'vfs_gpu_connection(unsigned long id)' function. The id can be obtained
using 'stat' on the 'gpu' device and is located in the inode (st_ino)
field of the stat buffer.

issue #4380
2022-01-19 15:01:26 +01:00
Sebastian Sumpf
b7d25636e5 mesa_gpu-iris: iris is linked into mesa already
* remove from library dependency

issue #4380
2022-01-19 15:01:24 +01:00
Sebastian Sumpf
ce409a2438 libdrm/iris: map PPGTT buffers lazy + lseek
* let iris handle buffer management, this implies that BOs are mapped to
  the PPGTT during buffer execution and unmapped by iris later, for this
  to work buffers need to be unmapped when allocating cached BOs
  (vma_free) which requires a patch

* support lseek (drm_lseek for now) for determining object size

issue #4380
2022-01-19 15:01:22 +01:00
Sebastian Sumpf
96ab58691a gpu/intel: PPGTT allocation optimization
Use range allocator as cache for page mappings instead of allocating
from platform driver for each page table.

issue #4380
2022-01-19 15:01:19 +01:00
Josef Söntgen
94405e9280 libdrm/iris: remove tiling short-cut
Instead of ignoring the request, we store the tiling information and
apply them when the buffer is mapped via 'MMAP_GTT'.

issue #4380
2022-01-19 15:01:11 +01:00
Josef Söntgen
e77a54614d libdrm/iris: introduce session resource accounting
Track RAM and CAP resource usage locally and upgrade the session quota
on demand.

issue #4380
2022-01-19 15:01:05 +01:00
Josef Söntgen
83cc36ef0b gpu/intel: account session resources
Account RAM and CAP resources for GPU sessions and trigger client
upgrades before allocating resources at the multiplexer. This prevents
the multiplexer from running out of resources.

issue #4380
2022-01-19 15:00:47 +01:00
Alexander Boettcher
3a39cb86e9 nova: read out more accurate tsc frequency
on newer CPUs.

Fixes #4336
2022-01-19 14:16:53 +01:00
Martin Stein
94121e7cd7 uplink_client_base: no deref of invalid connection
Imagine receiving the signal for an available TX ack or an available RX packet
at the Uplink connection but a later received signal for a link-state change
(to link state "down") at the same connection is handled first and destructs
the Uplink connection before the handling of the former signals. In this case,
the methods 'Uplink_client_base::_conn_tx_handle_ack_avail' and
'Uplink_client_base::_conn_rx_handle_packet_avail' must be guarded against an
unconstructed '_conn' member, but they weren't so far.

Fixes #4384
2022-01-19 14:13:48 +01:00
Martin Stein
83626b18f0 uplink_client_base: remove unused code
So far, the generic Uplink connection code considered NIC drivers to transmit
connection RX packets in three different manners. Most of the drivers follow
the "normal" way of transmission with only one driver callback from generic
code. The monolithic USB NIC-driver, however, used to send in a "burst" mode
that required a dedicated path with multiple driver callbacks in the generic
code. And then there were drivers that had a fully custom function for doing
transmissions.

Also for handling connection TX acks, there was a "normal" and a
"custom handler" way.

Today, all NIC drivers in the Genode repos and the Genode-World repo follow the
"normal" way. Therefor, the unused code can be removed.

Ref #4384
2022-01-19 14:13:38 +01:00
Christian Helmuth
65284b29f8 depot: update recipe hashes 2022-01-19 12:38:13 +01:00
Christian Helmuth
36b46f30f5 Add board-specific allwinner repo to .gitignore 2022-01-19 12:38:13 +01:00
Norman Feske
388a29b299 Road map for 2022 2022-01-19 12:38:13 +01:00
Sebastian Sumpf
f16c1b5ea8 usb_host: handle full packet stream correctly
Thanks to Peter for the fix!

Fixes #4383
2022-01-19 12:38:13 +01:00
Christian Helmuth
a80b2ee6e2 Increase cap quota of drivers_nic-imx6/7 for sel4 2022-01-19 12:38:13 +01:00
Christian Helmuth
02eea3ecf0 More robust output parsing in ieee754 test
Only parse output of the test programs one-by-one and ignore log
messages from other components not starting with '[init -> test$number]'.

Fixes sporadic failures on KERNEL=sel4 due to the following warning from
core.

  Warning: flush page table entries - mapping cache full - PD: init -> test1
2022-01-19 12:38:13 +01:00
Christian Prochaska
d3adadf4cf virtualbox6: adapt watchdog timer interval dynamically
Issue #4381
2022-01-19 12:38:13 +01:00
Christian Prochaska
95d9c15607 libc vfs: open OSS 'info' file only once
Issue #4372
2022-01-19 12:38:13 +01:00
Christian Prochaska
8ced0f184e vfs: add 'with_xml_file_content()' and 'with_raw_file_content()'
Fixes #4372
2022-01-19 12:38:13 +01:00
Christian Prochaska
8fd2847a48 Audio_out::Stream: initialize members
Issue #4373
2022-01-19 12:38:12 +01:00
Christian Helmuth
b7cf316f24 mesa: exclude .git directory from src archive 2022-01-19 12:38:12 +01:00
Christian Prochaska
2143bea176 virtualbox6: add 'Audio_in' session requirement to pkg
To actually receive audio input in a particular VM, it also
needs to be enabled in the vbox file:

<AudioAdapter controller="HDA" driver="OSS" enabled="true"
              enabledOut="true" enabledIn="true"/>

Fixes #4377
2022-01-19 12:38:12 +01:00
Christian Prochaska
3f656bcf84 black_hole: provide 'Audio_in' and 'Capture' sessions
Fixes #4376
2022-01-19 12:38:12 +01:00
Christian Prochaska
33402e407f vfs_oss improvements
Fixes #4375
2022-01-19 12:38:12 +01:00
Christian Helmuth
a1cac9b837 Fix warnings in test/audio_in 2022-01-19 12:38:12 +01:00
Christian Prochaska
7f8a94bb70 Audio_in::Stream: add 'queued()' function
Fixes #4374
2022-01-19 12:38:12 +01:00
Christian Prochaska
7b40ccea85 audio_in: fix compile errors with strict warnings enabled
Fixes #4373
2022-01-19 12:38:12 +01:00
Norman Feske
3ba316b015 base-hw: declare build artifact for core 2022-01-19 12:38:12 +01:00
Stefan Kalkowski
bed7f13008 create_builddir: add rpi and allwinner repos 2022-01-19 12:38:12 +01:00
Josef Söntgen
713c841965 vfs/rump: enable update mtime
Although support was added some time ago (#1784) the commit missed
executing the code from the 'Vfs::File_system' interface.

Fixes #4371.
2022-01-19 12:38:12 +01:00
Stefan Kalkowski
426f52068b hw: avoid 'cps' instruction in ARM hyp mode
On some boards or emulators a CPU might be executing in hyp mode
when entering Genode's bootstrap code. In that mode the 'cps' instruction
is not defined. Therefore, we change the way the boot cpu is identified.

Ref #3415
2022-01-19 12:38:12 +01:00
Stefan Kalkowski
6bd7f167a4 hw: remove rpi1/3 board support
The code moved to https://github.com/skalk/genode-rpi

Ref #4363
2022-01-19 12:38:12 +01:00
Tomasz Gajewski
f79d5d640f hw: irq controller and timer improvements for Rpi
* renamed rpi pic to Bcm2835_pic
* renamed rpi3 pic to Bcm2837_pic
* added bcm2837 control for setting prescaler value (to fix timer_accuracy)
* changed handling of all interrupts for rpi3 by cascading to bcm2835 pic
* rpi3 irq controller base address made consistent with rpi
* added usb controller memory region for pic on rpi3 (for SOF interrupts)

Ref #3415
2022-01-19 12:38:12 +01:00
Stefan Kalkowski
7db602faec os: deprecate platform API for x86, rpi, imx53
* Move platform APIs to "legacy/" subdirectory
* Rename old pc, imx53, and rpi platform_drv
  to "legacy_*_platform_drv"

Fix #4359
2022-01-19 12:38:12 +01:00
Norman Feske
622ddb5b49 base-linux: declare build artifact for lib/ld
This enables the run tool's new [build_artifacts] function to return the
correct binary name for 'build lib/ld'.
2022-01-19 12:38:11 +01:00
Norman Feske
813731a1e0 base-linux: permit rt_sigreturn on 64-bit ARM 2022-01-19 12:38:11 +01:00
Norman Feske
ab9b75236d base-linux: remove residual use of 'which' command
This is a follow-up commit for "Remove dependency from 'which' utility".

Issue #4319
2022-01-19 12:38:11 +01:00
Sergey Platonov
ef130a027b libc: fix type handling on socket creation
The socket type (in the lower bits) maybe ORed with SOCK_CLOEXEC and
SOCK_NONBLOCK options (in the higher bits). Currently, supported values
are SOCK_STREAM (1) and SOCK_DGRAM (2), so just take the lower 2 bits.

This fixes treating `SOCK_STREAM` sockets as UDP if additional flags
were set.

Fixes #4370
2022-01-19 12:38:11 +01:00
Norman Feske
b723b11b30 Modularize Sculpt OS image creation
This patch equips Sculpt with the ability to customize the system image
in very flexible ways.

All customizable aspects of the image have been relocated from the
former sculpt.run script and the accompanied gems/run/sculpt/ directory
to a new location - the sculpt/ directory - which can exist in any
repository. The directory at repos/gems/sculpt/ serves as reference.

The sculpt directory can host any number of <name>-<board>.sculpt files,
each containing a list of ingredients to be incorporated into the
Sculpt system image. The <name> can be specified to the sculpt.run
script. E.g., the following command refers to the 'default-pc.sculpt'
file:

  make run/sculpt KERNEL=nova BOARD=pc SCULPT=default

If no 'SCULPT' argument is supplied, the value 'default' is used.

A .sculpt file refers to a selection of files found at various
subdirectries named after their respective purpose. In particular, There
exists a subdirectory for each file in Sculpt's config fs, like
nitpicker, drivers... The .sculpt file selects the alternative to use
by a simple tag-value notation.

  drivers: pc

The supported tags are as follows.

*Optional* selection of /config files. If not specified, those files are
omitted, which prompts Sculpt to manage those configurations
automatically or via the Leitzentrale GUI:

  fonts
  nic_router
  event_filter
  wifi
  runtime
  gpu_drv

Selection of mandatory /config files. If not specified, the respective
'default' alternative will be used.

  nitpicker
  deploy
  fb_drv
  clipboard
  drivers
  numlock_remap
  leitzentrale
  usb
  system
  ram_fs

Furthermore, the .sculpt file supports the optional selection of
supplemental content such as a set of launchers.

  launches: nano3d system_shell

Another type of content are the set of blessed pubkey/download files
used for installing and verifying software on target.

With the new version, it has become possible to supply a depot with the
the system image. The depot content is assembled according to the 'pkg'
attributes found in launcher files and the selected deploy config.
The resulting depot is incorporated into the system image as 'depot.tar'
archive. It can be supplied to the Sculpt system by mounting it into the
ram fs as done by the 'ram_fs/depot' configuration for the ram fs.

It is possible to add additional boot modules to the system image. There
are two options.

  build: <list of targets>

This tag prompts the sculpt.run script to build the specified targets
directly using the Genode build system and add the created artifacts
into the system image as boot modules.

  import: <list of depot src or pkg archives>

This tag instructs Sculpt to supply the specifid depot-archive content
as boot modules to the system image. This change eliminates the need for
board-specific pkg/sculpt-<board> archives. The board-specific
specializations can now be placed directly into the respective .sculpt
files by using 'import:'.

To make the use of Sculpt as testbed during development more convenient,
the log output of the drivers, leitzentrale, and runtime subsystems
can be redirected to core using the optional 'LOG=core' argument, e.g.,

  make run/sculpt KERNEL=linux BOARD=linux LOG=core

The former pkg/sculpt-installation and pkg/sculpt-installation-pc
archives have been replaced by pkg/sculpt_distribution-pc, which
references the generic pkg/sculpt_distribution archive. Those pkgs are
solely used for publishing / distribution purposes.

Fixes #4369
2022-01-19 12:38:11 +01:00
Norman Feske
fcc96a2c46 tool/run: way to obtain list of build artifacts
The new function 'build_artifacts' returns a list of artifacts created
by the Genode build system. The list can be supplied as argument to
the 'build_boot_image' function.

Note that the list covers only program targets and shared libraries.
Other artifacts created as side effects of custom rules are not covered.

Fixes #4368
2022-01-19 12:38:11 +01:00
Norman Feske
0eee5d5fc1 mk: record build artifacts in progress.log
Issue #4368
2022-01-19 12:38:11 +01:00
Norman Feske
93d431a831 tool/run: skip build if build-target list is empty
This patch prevents the run tool from issuing 'make' in the build
directory if no build targets are specified, which prompts the build
system to build everything.
2022-01-19 12:35:49 +01:00
Norman Feske
410cd9cfc4 run: avoid superfluous call of depot auto update
If only versioned archives are supplied to a depot function like
'create_tar_from_depot_binaries', the depot/create tool is called
with zero arguments, resulting in a help message. The patch detects
this case and skips the call.
2022-01-19 12:35:49 +01:00
Norman Feske
48f0307234 create_builddir: remove 'linux' option
Since unifying the build directories accross architectures, the special
case of the 'linux' platform is no longer needed. Linux can be targeted
from regular CPU-architecture-specific build directories via:

  KERNEL=linux BOARD=linux

Fixes #4366
2022-01-19 12:35:49 +01:00
Norman Feske
88ca8d1a72 base: fix potential memory leak in allocator_avl
When used by the 'Allocator_avl' the slab allocator's backing store is
dynamically disabled and re-enabled while adding/freeing ranges.
However, during those operations, slab entries can be freed. This,
in turn, can result in the release of a slab block (when the freed slab
entry happens to be the last entry of the block). In this corner case,
'Slab::_release_backing_store' operation has no effect because no
backing-store allocator is set. As a result, the block is no longer
referenced but not physically freed.

The patch fixes the problem by skipping '_free_curr_sb' whenever
no backing store is defined. So the completely empty block remains
in the working set.

Thanks to Peter for reporting and fixing this issue!

Fixes #4367
2022-01-19 12:35:49 +01:00
Tomasz Gajewski
3bbe7d9d07 tool/depot/create: typo fix 2022-01-19 12:35:49 +01:00
Christian Prochaska
8e252f79f8 Remove mutex from 'Genode::Trace_output'
Fixes #4356
2022-01-19 12:35:49 +01:00
Christian Helmuth
e6c5e5e8b9 dde_bsd: update mirror URL
OpenBSD 6.6 disappeared from fau.de, so we switch to ftp.openbsd.org.
2022-01-19 12:35:49 +01:00
Norman Feske
ce53d88235 sculpt: support base-linux
- Consider 'sdl' as source of input events in the event-filter
  configuration as generated by the sculpt manager

- Supply an artificial 'platform_info' ROM as requested by the
  sculpt manager to obtain the affinity-space information

- Substitute 'fs_rom' for 'cached_fs_rom' as a workaround for the
  lack of support for managed dataspaces on Linux

Fixes #4362
2022-01-19 12:35:49 +01:00
Norman Feske
fd105e16aa tool/run: add install_boot_module function
This function largely alleviates the need to manually open/close files
in run scripts such as sculpt.run.
2022-01-19 12:35:49 +01:00
Alexander Boettcher
46c9927294 foc: disable thread execution time readout
Issue #4357
2022-01-19 12:35:49 +01:00
Alexander Boettcher
4ac553e5ff cpu_balancer.run: disable testing on foc
Due to some kernel issue the test will not finish, see #4357

Fixes #4357
2022-01-19 12:35:49 +01:00
Norman Feske
f1b46c3205 Move depot keys to repos/gems/sculpt/depot
This change keeps the version-controlled 'pubkey' and 'download' files
separate from files generated via depot/create or downloaded via
depot/download. So one can remove the entire depot/ directory without
interfering with git.

Furthermore, depot keys can now be hosted in supplemental repositories
independent from Genode's main repository.

Fixes #4364
2022-01-19 12:35:49 +01:00
Norman Feske
03cbf435e5 base-linux: increase global cap limit to 20000
This is a prerequisite for executing sculpt.run on Linux.

Issue #4362
2022-01-19 12:35:49 +01:00
Norman Feske
2134792e4c tool: remove obsolete download_sigver/hashver
Those scripts are a left-over from the time before the introduction of
the tool/ports mechanism.
2022-01-19 12:35:49 +01:00
Christian Prochaska
5fed1641a4 virtualbox6: reduce 'Vm_connection' priority
Fixes #4361
2022-01-19 12:35:49 +01:00
Piotr Tworek
d610f9f4f1 Fix some signed/unsigned implicit conversions.
Fix some trivial cases where the signedness of the constant value does
not match the signedness of type the code expects to see. GCC can be
asked to warn about those by passing Wsign-covnersion flag.

Issue #4354
2022-01-19 12:35:48 +01:00
Piotr Tworek
f2dab083f6 os: Properly initialize File_system::Watch_handle.
This comes up when building the code with clang 13. It happens due to
recently enabled Wconversion warning, which in case of clang also
enables implicit-int-conversion warning. The warning reads:

  fs_file_system.h:937:44: error: higher order bits are zeroes after
  implicit conversion [-Werror,-Wimplicit-int-conversion]
                        ::File_system::Watch_handle fs_handle { -1U };
                                                    ~~~~~~~~~   ^~~

This can be fixed by properly specifying fs_handle value to be of
unsigned long type.

Issue #4354
2022-01-19 12:35:48 +01:00
Piotr Tworek
27b798fa4f base: Make int to access_t conversion explicit.
As far as I can tell this is not raised by any released GCC versions.
Clang 13 on the other hand warns about it due to implicit-int-conversion
warning which is automatically enabled together with Wconversion. The
problem is relatively simple, shifting access_t value does not always
produce result which is also of access_t type. For example, if access_t
is uint16_t, shifting it will produce integer result. This can be
observed even with GCC. Building the following C++ example will fail:

  #include <type_traits>
  #include <stdint.h>

  int test() {
      uint16_t a = 0xabcd;
      static_assert(std::is_same_v<decltype(a<<1), uint16_t>);
      return 0;
  }

Changing uint16_t in the static_assert to int, will allow the code to
build.

Make such int to access_t implicit conversion explicit to allow the code
to be compiled with both GCC and clang.

Issue #4354
2022-01-19 12:35:48 +01:00
Alexander Tormasov
b3f8b49873 mk: add golang as target for compilation
Fixes #4358
2022-01-19 12:35:48 +01:00
Alexander Boettcher
507e5ac776 vmm_x86: fix sporadic test failures on x86_32 nova
Explicitly configure wanted exits instead of using the "random" primary
ctrl value.
2022-01-19 12:35:48 +01:00
Sergey Platonov
81acd46518 libc: nameserver file in configured socket directory
The path for the `nameserver` file was fixed to `/socket/nameserver`.
So, if the socket directory was configured differing from `/socket`, DNS
did not work. Now the default path for the `nameserver` takes into
account the path configured in the `socket` libc config attribute.

Fixes #4318
Fixes #4343
2022-01-19 12:35:48 +01:00
Johannes Schlatow
2e1a1c199e lwip plugin: support large backlog values
iperf, e.g., uses INT_MAX as backlog argument to the listen() call

Fixes genodelabs/genode#4341
2022-01-19 12:35:48 +01:00
Sebastian Sumpf
79e69a5549 nic_loopback: Adjust to packet allocator changes
Remove '_expected_offset' check on round trip test from RX packet,
because allocators between RX/TX can have different allocation
strategies. Rely on 'pattern' check for RX packets only.

In loopback server alloc size must match actual packet size.

issue #4312
2022-01-19 12:35:48 +01:00
Josef Söntgen
94a7c32fb4 libports: remove FUSE fs run script snippet
This file is only needed by the FUSE-based file system servers in
the world repository.

Fixes #4353.
2022-01-19 12:35:48 +01:00
Christian Helmuth
18e00c7772 depot_autopilot: enable riscv 2022-01-19 12:35:48 +01:00
Sebastian Sumpf
08c1e69d71 nic/packet_allocator: align allocations to 2 bytes
Override 'try_alloc/free' because ethernet frame headers are 14 bytes
(src/dst mac (12) + ethertype (2)) causing the IP header to be 2 byte
aligned, leading to problems on platforms that require load/store
operations to be naturally aligned when reading, for example, 4 byte IP
addresses. Therefore, we align the allocation to 2 bytes, so the IP
header is aligned to 4.

issue #4312
2022-01-19 12:35:48 +01:00
Norman Feske
5611fd2355 depot: update recipe hashes 2021-12-17 15:06:38 +01:00
Norman Feske
d658648a09 test/block_cache: tweak RAM quota for base-nova 2021-12-17 15:06:38 +01:00
Norman Feske
3cc6df3116 base: tighten affinity handling
This patch improves the robustness of the CPU-affinity handling.

- The types in base/affinity.h received the accessors
  'Location::within(space)' and 'Affinity::valid', which alleviates
  the fiddling with coordinates when sanity checking the values,
  in init or core.

- The 'Affinity::Location::valid' method got removed because its
  meaning was too vague. For sanity checks of affinity configurations,
  the new 'within' method is approriate. In cases where only the x,y
  values are used for selecting a physical CPU (during thread creation),
  the validity check (width*height > 0) was not meaningful anyway.

- The 'Affinity::Location::from_xml' requires a 'Affinity::Space'
  as argument because a location always relates to the bounds of
  a specific space. This function now implements the selection of
  whole rows or columns, which has previously a feature of the
  sandbox library only.

- Whenever the sandbox library (init) encounters an invalid affinity
  configuration, it prints a warning message as a diagnostic aid.

- A new 'Affinity::unrestricted' function constructs an affinity that
  covers the whole affinity space. The named functions clarifies
  the meaning over the previous use of the default constructor.

- Core's CPU service denies session requests with an invalid
  affinity parameter. Previously, it would fall back to an
  unrestricted affinity.

Issue #4300
2021-12-17 15:06:38 +01:00
Christian Helmuth
e21ca736b8 fetchurl: remove duplicate from used_apis in recipe 2021-12-17 15:06:38 +01:00
Christian Helmuth
a80a22c819 recipes: don't declare implemented API in used_apis
Prevents "*** detected duplicates in REPOSITORIES" on recipe build.
2021-12-17 15:06:38 +01:00
Norman Feske
4f820cf1e5 prepare_ports: prevent execution of automake
This patch discharges the dependency of Makefile.in from Makefile.am
files whenever both files are present in a downloaded archive.

Being based on make, the trigger of running automake is based on the
timestamps for the extracted archive content. However, since we reset
the timestamps (via 'tar -m') at extraction time, no assumptions about
the timestamp relations between the extracted files can be made. In the
event automake is triggered, we are faced with the tool dependency from
a specific automake version on the host.

The patch enforces the unconditional use the 'Makefile.in' version
supplied by the archive.

Fixes #4350
2021-12-17 15:04:49 +01:00
Christian Helmuth
c8a3497662 build: detect duplicates in REPOSITORIES 2021-12-17 15:04:49 +01:00
Sebastian Sumpf
7dcd9a9f8d vfs_trace: remove Trace::Session::subject_info
issue #4349
2021-12-17 15:04:49 +01:00
Norman Feske
d370f56a77 Remove obsolete Trace::Session::subject_info RPC
Issue #3610
Fixes #4349
2021-12-17 15:04:49 +01:00
Sebastian Sumpf
43da93bb6f noux: add RISC-V gnu build support
issue #4312
2021-12-17 15:04:49 +01:00
Stefan Kalkowski
6dbdb966fc virtio: remove bitfield in Index template
Eliminates note of GCC about bitfield as parameter semantic change.

Ref #4344
2021-12-17 15:04:48 +01:00
Stefan Kalkowski
609af0037f liblzma: silent some warnings
Ref #4344
2021-12-17 15:04:48 +01:00
Stefan Kalkowski
f6dd1c96f6 libdrm: silent warnings
Ref #4344
2021-12-17 15:04:48 +01:00
Stefan Kalkowski
793a667872 gmp: silent warnings
Ref #4344
2021-12-17 15:04:48 +01:00
Stefan Kalkowski
1779cc7a2f freetype: silent some warnings
Ref #4344
2021-12-17 15:04:48 +01:00
Stefan Kalkowski
86df5b1285 jitterentropy: fix if condition, fix warning
Ref #4344
2021-12-17 15:04:48 +01:00
Stefan Kalkowski
f5193874c8 e2fsprogs: eliminate warnings, fix strncat bug
Ref #4344
2021-12-17 15:04:48 +01:00
Stefan Kalkowski
2c569953d0 base: replace ELF flags bitfield with booleans
Instead of using a bitfield for storing rwx and skip boolean value,
take a boolean instead. This fixes a note giv]en by GCC 9.1 about
changes semantics of bitfields given as parameter by value on ARM.

Ref #4344
2021-12-17 15:04:48 +01:00
Stefan Kalkowski
b11731d6b2 dde_linux: silent warning in fork
When initializing a task_struct within the lx_emul library
we have to temporarily use a big object on the stack.

Ref #4344
2021-12-17 15:04:48 +01:00
Josef Söntgen
f9e0548d0c sculpt_manager: integrate GPU device access
Similar to other devices allow for selecting a graphics device as
well. This is currently only useful on iMX8-based systems like
iMX8Q-EVK and MNT Reform2 where the driver is explicitly started
from a pkg.

Fixes #4342.
2021-12-17 15:04:48 +01:00
Piotr Tworek
1a9fad4022 virtio_nic: Tweak default buffer sizes.
After VirtIO::Queue refactoring buffers no longer share the same
dataspace as VirtIO rings. This makes optimal buffer calculations a lot
easier. In this case 64 buffers 2kB each will need precisely 128kB of
RAM. Previous value of 2016 will just waste 768b.

Fixed #4347
2021-12-17 15:04:48 +01:00
Piotr Tworek
643747b912 os: Refactor VirtIO::Queue implementation.
The key changes in this patch are:
* Buffer allocation is moved into a separate Buffer_pool helper. The
  implementation of the buffer allocation strategy does not change.
  The helper allocates a single RAM dataspace and splits it in multiple,
  equally sized chunks.
* Management of main descriptor ring is enacapsulated in Descriptor_ring
  helper class.
* Use separate RAM dataspaces for descriptor rings and buffers.
  Previously both of them were packed into a single dataspace. This
  might have been more RAM efficient, but IMO it made the code uglier and
  harder to understand.
* All of the VirtIO::Queue members are now initialized on the class member
  initializer list. This is possible due to previously listed changes.
* Since all VirtIO::Queue members are initalized on member initalizer
  list, some additional ones can be marked as const, ex _avail, _used ring
  pointers.
* Move descriptor writing code into a common method used by both
  write_data and write_data_read_reply members. This avoids some code
  duplication between those methods.
* Get rid of request_irq argument that most public VirtIO::Queue methods
  accept. None of the existing drivers use it and I doubt this will
  change any time soon.
* Use Genode namespace by default in Virtio.

This patch also fixes at least one bug that I discovered while working
on VirtIO block device driver. Namely, when chaining descriptors only the
first descriptor in the chain should be exposed in the available ring.

Issue #4347
2021-12-17 15:04:48 +01:00
Norman Feske
aaf9e992da run: remove residual use of 'which' command
This is a follow-up commit for "Remove dependency from 'which' utility".

Thanks to John Karcher for reporting.

Fixes #4319
2021-12-17 15:04:48 +01:00
Christian Helmuth
e4ee30abf1 Add board-specific repos to .gitignore 2021-12-17 15:04:48 +01:00
Sebastian Sumpf
75509d77b5 base-hw: Remove 'riscv_qemu' and move to 'genode-riscv'
issue #4312
2021-12-17 15:04:48 +01:00
Sebastian Sumpf
0fc2db50f0 ieee754: add test for riscv
issue #4312
2021-12-17 15:04:47 +01:00
Sebastian Sumpf
ee5d300f72 stdcxx: riscv support
issue #4312
2021-12-17 15:04:47 +01:00
Sebastian Sumpf
a4d67c3262 libm: riscv support
issue #4312
2021-12-17 15:04:47 +01:00
Sebastian Sumpf
7c976a83e0 libc: riscv support
libc-gen, libc-setjmp, task startup

issue #4312
2021-12-17 15:04:47 +01:00
Norman Feske
890842dce2 base-hw/lib/mk/spec/cortex_a8/core-hw.inc (usb_armory) 2021-12-17 15:04:47 +01:00
Norman Feske
63f78b6255 ports: avoid implicit conversions
Issue #23
2021-12-17 15:04:47 +01:00
Norman Feske
dea467f692 libports: avoid implicit conversions
Issue #23
2021-12-17 15:04:47 +01:00
Norman Feske
8a1675e12e gems: avoid implicit conversions
Issue #23
2021-12-17 15:04:46 +01:00
Norman Feske
5bd8fa9678 dde_linux: avoid implicit conversions
Issue #23
2021-12-17 15:04:45 +01:00
Norman Feske
1aa4f29300 demo: avoid implicit conversions
Issue #23
2021-12-17 15:04:45 +01:00
Norman Feske
04cf6ea3ab os: avoid implicit conversions
Issue #23
2021-12-17 15:04:45 +01:00
Norman Feske
03047009b1 base: avoid implicit conversions
This patch is a prerequisite for compiling the code with
the warnings -Wconversion enabled.

Issue #23
2021-12-17 15:04:44 +01:00
Norman Feske
c79a59655d Add -Wconversion to strict build mode 2021-12-17 15:04:43 +01:00
Johannes Schlatow
b1bbd72e84 net: fix tail size calculation in Ethernet_frame
The const-variant of the data() method contained an erroneous
calculation of the tail size. This led to the size guard throwing
exceptions when trying to parse TCP packets that only contained the
TCP header.

Fixes genodelabs/genode#4340
2021-12-17 15:04:43 +01:00
Norman Feske
162ddb1fdb virtio: fix len calculation
Thanks to Piotr Tworek for the fix and his explanation as follows:

The basic idea is to try to fit payload data into the descriptor used to
send the header. If there is no payload, or the payload fits exactly
into the remaining space in the header decriptor, len should be 0 and
only one descriptor should be used. In such case the "next" and "flags"
members of the descriptor structure should be set to 0.

In case there is some extra payload data to send, but its size is
bigger than the remaining free space in the descriptor used to send the
header, len should contain the remaining size of the payload that
can't be sent via the header descriptor. The code will then chain
additional descriptors to handle this remainder.

With the len variable shadowing, the code will never queue the remaining
data.

Issue #4327
2021-12-17 15:04:43 +01:00
Stefan Kalkowski
6cc6047962 platform_drv: introduce clocks, power, reset
Share datastructures for clock, power and reset related configurations
per device. In the generic platform driver component these structures
are kept empty. Driver derivates can fill the clocks settings, power and
reset switches with life. The former Driver::Env gets removed.

Fix #4338
2021-12-17 15:04:39 +01:00
Stefan Kalkowski
f11d2b5b54 autopilot: automated stress test for platform_drv
Fix #4330
2021-12-17 14:56:53 +01:00
Stefan Kalkowski
132e4fe815 platform_drv(arm): robust re-configuration support
This change of the inner working of the platform driver for ARM allows
clients to have permanent open sessions, as long as a policy node matches
the client. If devices disappear from the policy resp. from the set of
available devices (hotplug), the devices ROM of the session gets updated,
and a corresponding device session gets closed. If the device remains
untouched in the configuration but other devices appeared/disappeared, the
device session is not affected.

Ref #4330
2021-12-17 14:56:46 +01:00
Norman Feske
6d231597b4 allocator_avl.h: remove debug feature 2021-12-02 10:03:26 +01:00
Norman Feske
a0a1f6455a base/string.h: avoid fallthrough cases 2021-12-02 10:02:48 +01:00
Christian Helmuth
4188427596 version: 21.11 2021-11-30 14:34:09 +01:00
Norman Feske
ea6f90ec17 News item for version 21.11 2021-11-30 14:32:17 +01:00
Norman Feske
c528cd7819 Release notes for version 21.11 2021-11-30 14:32:17 +01:00
Christian Helmuth
92b7be4d11 depot: update recipe hashes 2021-11-30 12:08:54 +01:00
Christian Helmuth
13dab699b1 base: invalidate entire range on VM-session detach
The requested guest-physical memory range may comprise multiple attached
dataspace regions, which must all be detached. This is not required for
the current vbox5 implementation, but for vbox6 as the current API
suggests these semantics.

This commit can be seen as intermediate fix as a real fix should change
the API to prevent long-running detach loops in core that may lock out
requests by other components.
2021-11-29 15:11:53 +01:00
Stefan Kalkowski
7eb3da71b5 base-hw: check managing_system property for SMC
* When issuing a secure-monitor-call on behalf of a PD session client
  first check the permission via the 'managing_system' property.

Fix #4321
2021-11-29 15:11:53 +01:00
Stefan Kalkowski
14de84fae6 base: be more restrictive with 'managing_system'
* Only give managing_system permission when all parent nodes of the
  corresponding component agree in doing so.
* Move the physical memory constrains heuristic from sandbox library to core

Fix #4335
2021-11-29 15:11:53 +01:00
Johannes Schlatow
916683b6d6 platform_drv(arm): fix cap and memory leaks
* Track all caps and ram quotas of the sub-sessions properly
* Release DMA buffers, it is not done implicitely when destroying
  the Constrained_ram_allocator
* Do not replenish quota before really releasing memory from
  the allocator

Issue #4330
2021-11-29 15:11:53 +01:00
Johannes Schlatow
e256969489 platform_drv(arm): fix destruction order
The Session_component must be destroyed before updating the device
model because the Session_component must also release all previously
acquired devices. If the device model is updated before, the devices
might have been removed.

Issue #4330
2021-11-29 15:11:53 +01:00
Johannes Schlatow
7a2826a2fe base: fix use after free in Genode::Heap
Fixes genodelabs/genode#4334
2021-11-29 15:11:53 +01:00
Alexander Boettcher
45cebd774d cpu_balancer: avoid dynamic policy allocation
Pre-allocate all possible type of policy objects as part of the thread meta
state to avoid increased memory consumption due to different policy object
sizes. The cpu_balancer accounts the memory per client and can't forward
potentially occurring out-of-ram exceptions during config-ROM update phases.

Fixes #4333
2021-11-29 15:11:53 +01:00
Alexander Boettcher
1f58b05255 cpu_balancer: limit mem increase on config update
The commits avoids reading in and allocating memory for all potentially
threads, which are potentially currently not existent (but configured in the
policy beforehand). Instead the policy is read in and evaluated when a thread
is created and policy changes are solely applied to existing/running threads.
By this the commit avoids the increase of memory consumption during the
evaluation of policies during config ROM updates.

Issue #4333
2021-11-29 15:11:53 +01:00
Piotr Tworek
30b3ad218f virt_qemu: Use VirtIO fb driver instead of ramfb.
This driver should be better suited for VirtIO based board like
qemu_virt.
2021-11-29 15:11:53 +01:00
Piotr Tworek
7c1888644a os: Add VirtIO framebuffer driver.
This implements the necessary bits to provide 2D framebuffer support on
top of VirtIO GPU device as implemented in Qemu. I don't know if any
other implementation of this specific device exists.

Compared to the ramfb driver which already exists in Genode Virtio FB driver
has one major benefit. It allows Qemu window to be dynamically resized at
runtime. The driver will treat this as resolution change and act accordingly.
Ramfb driver can currently only use the hardcoded 1024x768 screen size. Changing
screen resolution might not sound like a big deal, but it is rather useful to
run Genode on Qemu in full screen mode.
2021-11-29 15:11:53 +01:00
Piotr Tworek
2ec9e69fd4 os: Add support for reading VirtIO responses.
Some more advanced devices like VirtIO GPU do expect they can receive
responses to VirtIO commands they issue via VirtIO queue. Such responses
are not sent via a separate device writeable queue. Instead the driver
is expected to queue some additional descriptors and buffers which the
device can then use to provide the reply.

This patch adds support for such write-data-read-response opeartion to
Genode VirtIO::Queue implementation. The implementation is pretty simple
and does not support any fancy features like receiving the response
asynchronously. Instead the operation will use caller provided callback
to wait for the device to process the command. Once this callback
returns the write-data-read-response VirtIO::Queue function will invoke
another callback passing received response as argument.
2021-11-29 15:11:53 +01:00
Christian Helmuth
0bb0ac079a sculpt: version 21.11 2021-11-29 15:11:53 +01:00
Josef Söntgen
fcc236d906 libports: add mesa_gpu-etnaviv recipe
Similar to the existing 'mesa_gpu' pkgs add one for 'etnaviv'
as well.

Issue #4329.
2021-11-29 15:11:53 +01:00
Josef Söntgen
17da7c88d0 import-libdrm: fix building etnaviv as recipe
Make sure all needed headers are found when building via depot.

Issue #4329.
2021-11-29 15:11:53 +01:00
Josef Söntgen
4d93187d31 libdrm: introduce Gpu session for etnaviv
* The Gpu session back end translates all DRM API requests of the
  client into matching Gpu session operations.

* Enable ioctl for etnaviv

Fixes #4329.
2021-11-29 15:11:53 +01:00
Josef Söntgen
645e51dc1d gpu: add information for etnaviv driver
Mesa queries information about the underlying device and this header
denotes the layout of the information. It is also used by the driver
itself to populate the 'info_dataspace'.

Issue #4329.
2021-11-29 15:11:52 +01:00
Josef Söntgen
8155505b41 mesa/etnaviv: guard unmapImage call
We may call this function only in case mapImage was successful.

Issue #4329.
2021-11-29 15:11:52 +01:00
Josef Söntgen
d39af2206c mesa_gpu-etnaviv: etnaviv already part of mesa
Since the parts of the 'etnaviv' library are already part of the
'mesa.lib.so' that is normally loaded along-side remove the
duplication here.

Issue #4329.
2021-11-29 15:11:52 +01:00
Norman Feske
133d21ad38 event_filter: add touch-click filter
This filter bridges the gap between a touchscreen driver, which
generates raw touch events and traditional GUI applications that expect
a pointer (absolute motion, press/release of the left mouse button).

Fixes #4332
2021-11-29 15:11:52 +01:00
Norman Feske
09d020508c depot: recipes for pin-control/state session APIs
Issue #4315
2021-11-29 15:11:52 +01:00
Norman Feske
dc39a8db62 base: introduce Allocator::try_alloc
This patch changes the 'Allocator' interface to the use of 'Attempt'
return values instead of using exceptions for propagating errors.

To largely uphold compatibility with components using the original
exception-based interface - in particluar use cases where an 'Allocator'
is passed to the 'new' operator - the traditional 'alloc' is still
supported. But it existes merely as a wrapper around the new
'try_alloc'.

Issue #4324
2021-11-29 15:11:52 +01:00
Christian Helmuth
9591e6caee vbox6: CPU halt/wakeup via RTSEMEVENTMULTI
The former use of Pthread conditionals did not cover the corner case of
early wakeups just before halting the CPU. These wakeups were simply
lost which resulted in sporadic halts of about 500 ms (the maximum timeout
of all halts in VirtualBox). RTSEMEVENTMULTI preserves early wakeups
and effectively prevents the CPU from halting.

Additionally, we now wakeup the target CPU on VMMR0_DO_GVMM_SCHED_POLL
and, thus, mimic the behavior of the original implementation slightly
better,

Slightly related to #4313
2021-11-29 15:10:53 +01:00
Johannes Schlatow
a65807ff08 rom_filter: optionally skip top-level node
Since the top-level node of the output ROM is always generated by the
rom_filter, there is no way to pass-through the content of an input ROM
without wrapping in an addition XML node.

genodelabs/genode#4326
2021-11-29 15:10:53 +01:00
Josef Söntgen
059c7ed74a dde_linux: prevent debug message in memory backend
The Allocator_avl back end will display diagnostic messages if the
address to be freed is not at the beginning of a block. This happens
regulary when 'struct page' objects are not freed in allocation order.

Issue #4325.
2021-11-29 15:10:53 +01:00
Josef Söntgen
98385a7658 allocator_avl: return 0 for improper size_at call
In case the given address is not the start of a block bail instead of
making improper size assumptions.

Issue #4325.
2021-11-29 15:10:53 +01:00
Josef Söntgen
49bf58a2ae lx_kit: free dataspace interface
Allow for freeing of manually managed dataspaces.

Fixes #4325.
2021-11-29 15:10:53 +01:00
Josef Söntgen
327ec61ee3 lx_kit: get buffer dataspace from virt addr
Introduce a method to access the dataspace capability of the underlying
backing store for a memory allocation. This is necessary for drivers
where the memory is managed manually and the capability needs to be
given to a client.

Issue #4325.
2021-11-29 15:10:53 +01:00
Josef Söntgen
cd7a65a313 dde_linux: extended pgtable header for etnaviv
The 'pgprot_noncached' function is referenced by the driver code.

Issue #4325.
2021-11-29 15:10:53 +01:00
Stefan Kalkowski
23514bf5c2 dde_linux: add runqueues symbol for -O0 build 2021-11-29 15:10:53 +01:00
Christian Helmuth
974627f700 vbox6: adapt to GUI framebuffer size on startup
Explicitly, adapt to current framebuffer/window size after
initialization finished. This ensures the use of the correct framebuffer
dimensions in scenarios without a window manager.

Thanks to Raphael for the patch.
2021-11-29 15:10:53 +01:00
Norman Feske
3b456e0037 test/resource_request: ignore spurious requests
This patch makes the test less dependent on the rate of state updates by
calculating the upgraded quota from the values found in the state report
instead of simply increasing the '_ram_quota' for each incoming report.
2021-11-29 15:10:53 +01:00
Norman Feske
231ac187fe base: introduce Ram_allocator::try_alloc
This patch replaces the 'Ram_allocator::alloc' RPC function by a
'try_alloc' function, which reflects errors as 'Attempt' return value
instead of an exception.

Issue #4322
Issue #3612
2021-11-29 15:10:53 +01:00
Norman Feske
959bcae557 base: add util/attempt.h utility
Fixes #4322
2021-11-29 15:10:52 +01:00
Norman Feske
694dff8a5c base: sort symbols/ld with LC_COLLATE=C 2021-11-29 15:10:52 +01:00
Christian Helmuth
68caa26407 virt_qemu: use "-device ramfb"
Issue #4282
2021-11-29 15:10:52 +01:00
Norman Feske
4cfd954e1e Remove dependency from 'which' utility
Debian declared the 'which' utility as deprecated.

Fixes #4319
2021-11-29 15:10:52 +01:00
Norman Feske
293d545b97 sandbox: use Genode::update_list_model_from_xml
This patch replaces the former local implementation by the function
provided in 'util/list_model.h'.

Issue #4317
2021-11-29 15:10:52 +01:00
Norman Feske
4df7e6adde util/list_model.h: Add update_list_model_from_xml
The new 'update_list_model_from_xml' function template simplifies the
use of the list model utility by alleviating the need for implementing a
custom policy class for each model. Instead, the transformation is done
using a few lambda functions given directly as arguments.

Issue #4317
2021-11-29 15:10:52 +01:00
Norman Feske
449f647e58 dde_linux: lx_emul interface for GPIO pin access
This patch introduces the lx_emul/pin.h interface that enables GPIO stub
drivers to interact with Genode's Pin_control and IRQ sessions via a
simple C API.

Fixes #4316
2021-11-29 15:10:52 +01:00
Norman Feske
f2a627c107 os: Pin_control and Pin_state session interfaces
The new interfaces are meant to gradually replace the existing
Gpio_session interface.

- Each session refers to a single pin.
- The session types distiguish the direction of the signal as input or
  output.
- Pin coordinates can be selected via session labels.
- GPIO interrupts are covered by the regular IRQ session interface.

The interfaces are accompanied by framework utilities and interfaces:

- os/pin_driver.h
- pin_control_session/component.h
- pin_state_session/component.h

These headers relieve GPIO drivers from implementing boilerplate code by
providing device-agnostic portions. The A64 pio driver serves as
reference for using those utilities.

  https://github.com/nfeske/genode-allwinner/tree/master/src/drivers/pin/a64

Fixes #4315
2021-11-29 15:10:52 +01:00
Johannes Schlatow
2ecb09ba7e tool/run: move nic model to qemu_args file
Always instantiating a network device with id `net0`, removes the need to call
append_qemu_nic_args in run scripts unless we want to add forwarding
rules.

genodelabs/genode#4311
2021-11-29 15:10:52 +01:00
Johannes Schlatow
522a1cdc5b tool/run: read board-specific qemu args from file
Allow specifying additional qemu arguments for externally supported boards
(e.g. zynq_qemu) by adding a `qemu_args` file in the board-property directory.

The syntax of the qemu_args file is as follows:
- Arguments can appear in a single line or in multiple lines as the
  lines will be appended (separated by a whitespace) to the global
  qemu_args variable.
- If the line is prepended with a `foobar:` expression. The arguments
  are only added if the foobar spec is present.

Note, that a `-m` argument specified in the qemu_args file will
override the arguments provided by the run scripts.

genodelabs/genode#4311
2021-11-29 15:10:52 +01:00
Johannes Schlatow
c0c2ed2bf5 tool/run: make qemu RAM sanity check more robust
First, the former implementation has only considered the pure numerical
variant of the -m argument. Yet, qemu also allows specifying the amount
of memory by `-m 1G`, `-m size=1G` and more.

Second, the default amount of memory for BOARD=pc was 512M (800M in case of okl4).
Since the depot_autopilot.run also required at least 768M on all
platforms it seems reasonable to take 800M as a default value for BOARD=pc and
thereby remove the special treatment of okl4.

genodelabs/genode#4311
2021-11-29 15:10:52 +01:00
Alexander Boettcher
c774272366 vbox5/6: set ia32_tsc_aux for rdtscp usage
Fixes #4314
2021-11-29 15:10:52 +01:00
Alexander Boettcher
533015b93e nova: support transfer of IA32_TSC_AUX MSR for vCPUs
The 32-bit MSR is returned by rdtscp in ecx register and used to detect
the CPU ID the timestamp was taken on.

Issue #4314
2021-11-29 15:10:52 +01:00
Alexander Boettcher
f4e52863c0 vbox6: exit on rdtsc and rdtscp (intel)
Otherwise Windows 10 shows 50 Ghz frequency in task manager and other
strange things may happen.

Issue #1769
Issue #4314
Fixes #4313
2021-11-29 15:10:52 +01:00
Alexander Boettcher
7a06633173 nova: FPU handling for vCPUs in VM session
- request FPU state on VM exit in portal config

- transfer FPU state on VM entry

- save fpu state early

  Avoid any FPU instructions (for example during base API calls), which
  use the FPU and overwrite FPU registers holding the guest vCPU FPU
  state.

- don't save fpu state of EP

Issue #4313
2021-11-29 15:10:52 +01:00
Alexander Boettcher
1a79bf2be2 vbox6: avoid race for NEM state checking
The commit avoids the race between checking for the NEM state and the decision
to notify (poke) the NEM backend (nem.cc).

- ever notify about POKE flag for remote vCPU
- check synchronized for NEM state
- store recheck flag and apply on next switch_to_hw

Issue #4313
2021-11-29 15:10:52 +01:00
Alexander Boettcher
3701733c8f vbox6: add POKE calls in TM for remote vCPUs
and return to VMM if TM_TIMER flag is set

Issue #4313
2021-11-29 15:10:52 +01:00
Christian Helmuth
5a21431c31 vbox6: check for pending IRQs in sup_vcpu
Issue #4313
2021-11-29 15:10:52 +01:00
Alexander Boettcher
00eadf9791 vbox6: adjust TPR handling according to HMVMXR0
Issue #4313
2021-11-29 15:10:52 +01:00
Alexander Boettcher
33bf926b50 vbox6: add SIPI patch improving vCPU startup
Issue #4313
2021-11-29 15:10:52 +01:00
Alexander Boettcher
4798ffd055 vbox6: initialize more vcpu state in sup_vm.cc
Issue #4313
2021-11-29 15:10:51 +01:00
Christian Helmuth
228d1c27b7 vbox6: fix npt_ept fault calculation
Issue #4313
2021-11-29 15:10:51 +01:00
Alexander Boettcher
68878ca98a vbox6: implement SUPSemEventMulti*() functions
Issue #4313
2021-11-29 15:10:51 +01:00
Alexander Boettcher
28db5cadee vbox5: generic - discharge by default
intr_state and actv_state are now charged only if required and with
valid values.

Issue #4313
2021-11-29 15:10:51 +01:00
Alexander Boettcher
8d5903cba9 vbox6: avoid unintended state transfer on hw enter
intr_state and actv_state are now charged only if required and with
valid values.

Issue #4313
2021-11-29 15:10:51 +01:00
Alexander Boettcher
74a8a801e4 nova: report vCPU prio & quantum in trace conn
Issue #4313
2021-11-29 15:10:51 +01:00
Stefan Kalkowski
b12b0ed93d imx8q_evk: remove board support from repository
Moved to separate repo at https://github.com/skalk/genode-imx/

Fix #4301
2021-11-29 15:10:51 +01:00
Johannes Schlatow
7917c5d9ec Remove zynq_qemu platform and zynq nic driver
Moved to separate repo at https://github.com/jschlatow/genode-zynq

Fixes genodelabs/genode#4280
2021-11-29 15:10:51 +01:00
Josef Söntgen
6ecae6adb3 qemu-usb: increase USB2/3 root ports to 8 each
In the default setting the number of root ports is set to 4. This
also limits the number of USB host devices that may be attached to
the VM. Since the USB webcam shares the slots, that leaves us with
only 3 available USB2 slots to attach USB host devices. Depending on
the use-case that might not be enough.

This commit statically increases the number of ports to 8 each and
adapts the qemu-usb glue-code accordingly.

Many thanks to Raphael for initial investigation and workaround.

Fixes #4310.
2021-11-29 15:10:51 +01:00
Stefan Kalkowski
6d991313b1 nvme_drv: get I/O resources from platform API only
Do not use the I/O memory service from core directly,
but instead use the I/O resources the platform session
provides to the driver anyway.

Fix #4309
2021-11-29 15:10:51 +01:00
Stefan Kalkowski
43ef9b5a3a platform_drv: do not account IOMEM as ram quota
Accidentally, the size of IOMEM dataspace got accounted within the
implementation of the platform driver for ARM. Instead we should
only account a bit for the metadata and paging of the I/O memory.

Fix #4307
2021-11-29 15:10:51 +01:00
Johannes Schlatow
87bb81cd66 nic: add _custom_conn_tx_ack_avail_handler()
The custom ack avail handler is required for zero-copy nic drivers (e.g.
the zynq nic driver), which must release the corresponding DMA buffers.

Fixes genodelabs/genode#4277
2021-11-29 15:10:51 +01:00
Tomasz Gajewski
332cfb38c1 usb_host: fix MMU fault on rpi2 and rpi3 2021-11-29 15:10:51 +01:00
Norman Feske
275479867d window_layouter: handle decorator margins at start
This patch adds a missing call of '_handle_decorator_margins' at
construction time. Up to commit "report_rom: versioning and explicit
notification" this problem was masked by an unconditional signal, which
implicitely triggered the call.

Issue #4274
Fixes #4306
2021-11-29 15:10:51 +01:00
Piotr Tworek
4f1e9fd256 os: Use VirtIO input drivers for virt_qemu.
This makes Genode's interactive test scenarios run on virt_qemu board
actually interactive.

Issue #4282
2021-11-29 15:10:51 +01:00
Piotr Tworek
80d11ca751 tool: Add keyboard and mouse devices to virt_qemu.
Now that we have appropriate native driver for them add keyboard and
mouse devices to virt_qemu machine. Make sure qemu exposes those new
devices in modern, VirtIO 1.0 mode. At leasts qemu 5.1.0 still uses
pre 1.0 mode in default setup.

Issue #4282
2021-11-29 15:10:51 +01:00
Piotr Tworek
60f1a1a554 os: Add VirtIO input driver.
This component can service Qemu VirtIO mouse, keyboard and tablet
devices. The implementation is based on VirtIO 1.1 device spec. Its
described in section 5.8 "Input Device".

Issue #4282
2021-11-29 15:10:51 +01:00
Josef Söntgen
851d96de8a Fix misleading DosBox snippet in porting-guide
The included 'target.mk' snippet of DosBox suggests to use the contrib
source directory directly to reference source files.

Fixes #4305.
2021-11-29 15:10:50 +01:00
Tomasz Gajewski
ecb1a6187c ssh_terminal: moved to genode world
Fixes #4258
2021-11-29 15:10:50 +01:00
Sebastian Sumpf
d4a6342295 tool_chain: remove Go support from bootstrap compiler
Fixes #4292
2021-11-29 15:10:50 +01:00
Piotr Tworek
a10903a197 libm: fix undefined __isinff / __isinfl symbol references
Those symbols are not satisfied by any code or dependency of libm. As
result calling cprojf function will always crash on Genode. This crash
can be turned into link time error by adding --no-undefined to LD_OPT.

This patch provides the missing symbols by including isninf.c in libm
build.

Fixes #4299
2021-11-29 15:10:50 +01:00
Piotr Tworek
c38c2a6455 cxx: missing operator delete with align_val_t arg
When rebasing my local branch on top of sculpt-21.10 tag I've noticed
two problems.

The code in new_delete.cc does not include new header file. This works
fine with GCC, but fails with clang because std::align_val_t type is
not defined anywhere according to clang. It looks like GCC pulls this
header indirectly somehow.

The second problem can be seen if one disallows undefined symbols in
executables and shared_libraries. This can be seen with both GCC and
clang by adding --no-undefined to LD_OPT. With such change in place core
fails to link due to:

ld.lld: error: undefined symbol: operator delete(void*, std::align_val_t)
>>> referenced by thread.h:448 (/home/tworaz/devel/genode/repos/base-hw/src/core/kernel/thread.h:448)
>>>               thread.o:(Kernel::Core_main_thread::~Core_main_thread()) in archive debug/core-hw-virt_qemu.a
>>> referenced by thread.h:448 (/home/tworaz/devel/genode/repos/base-hw/src/core/kernel/thread.h:448)
>>>               thread.o:(non-virtual thunk to Kernel::Core_main_thread::~Core_main_thread()) in archive debug/core-hw-virt_qemu.a
>>> did you mean: operator delete(void*, unsigned long, std::align_val_t)
>>> defined in: debug/core-hw-virt_qemu.a(supc++.o)

If the code would somehow manage call such undefined symbol it'd crash.
Since I generally prefer link time failures to runtime crashes I link
all genode binaries with --no-undefined.

To fix this problem just add a dummy implementation of missing delete
operator.

Fixes #4298
2021-11-29 15:10:50 +01:00
Piotr Tworek
e748efacd8 reconstructible: Fix alignas specifier placement.
Alignas should be placed before the type. Placing it after it works for
GCC, but fails when building the same codee with clang. The error
message is:

reconstructible.h:48:27: error: 'alignas' attribute cannot be applied to types
    char _space[sizeof(MT)] alignas(sizeof(addr_t));
                            ^
Issue #4298
2021-10-15 15:45:52 +02:00
Christian Helmuth
42ff902576 vbox6: settings version 1.18-genode in machine.vbox6
At least the audio backend depends on the correct .vbox settings version
for VirtualBox 6.1 which is 1.18 as of VirtualBox.xidl.
2021-10-15 12:17:05 +02:00
Norman Feske
7e2716800b News item for Sculpt 21.10 2021-10-14 14:40:08 +02:00
2518 changed files with 57141 additions and 45766 deletions

5
.gitignore vendored
View File

@@ -7,5 +7,10 @@
/contrib
/depot
/public
/repos/allwinner
/repos/imx
/repos/riscv
/repos/rpi
/repos/world
/repos/zynq

View File

@@ -1 +1 @@
21.08
22.02

View File

@@ -343,10 +343,6 @@ Separate components
Provides each file contained in a tar file obtained via Genode's ROM session
as separate ROM session.
:_os/src/server/iso9660/_:
Provides each file of an ISO9660 file system accessed via a block session as
separate ROM session.
:_os/src/server/lx_fs/_:
A file system server that makes the file system of a Linux base platform
available to Genode.
@@ -361,9 +357,6 @@ Separate components
:_os/src/server/log_terminal/_:
Adapter for forwarding terminal output to a LOG session.
:_os/src/server/fs_log/_:
Adapter that writes LOG messages to files on a file system.
:_demo/src/server/nitlog/_:
Provides a LOG session, printing log output on screen via a GUI session.
@@ -377,9 +370,6 @@ Separate components
switching between configuration variants dependent on the state of
the system.
:_os/src/server/log_terminal/_:
Forwards terminal output to a LOG session.
:_gems/src/server/file_terminal/_:
Provides terminal sessions that target files on a file system.
@@ -395,10 +385,6 @@ Separate components
The terminal crosslink service allows to terminal clients to talk to each
other.
:_gems/src/server/http_block/_:
A block service that fetches a virtual block device over the network from
a HTTP server.
:_os/src/server/fs_rom/_:
A ROM service that translates the 'File_system' session interface to the
'ROM' session' interface. Each request for a ROM file is handled by looking
@@ -454,6 +440,9 @@ implement the VFS-plugin interface. They can be combined with any application
based on Genode's C runtime, with the VFS server, and with non-POSIX
components that use the Genode's VFS library directly.
:_os/src/lib/vfs/tap/_:
A VFS plugin that allows for packet-level access of a NIC or uplink session.
:_gems/src/lib/vfs/trace/_:
A VFS plugin that makes core's TRACE service accessible as a pseudo
file system.
@@ -609,15 +598,11 @@ Package-management components
Runtime environments
####################
:_ports/src/app/seoul/_: Seoul is a virtual-machine monitor developed for
the use with the NOVA platform. It virtualizes 32bit x86 PC hardware
including various peripherals.
:_os/src/server/loader/_: A service that allows the creation and destruction
of Genode subsystems via a session interface. For further information,
refer to _os/src/server/loader/README_.
:_ports/src/virtualbox5/_: VirtualBox running on top of the NOVA hypervisor.
:_ports/src/virtualbox6/_: VirtualBox running on top of the NOVA hypervisor.
:_os/src/server/vmm/_: A virtual machine monitor that is based on
hardware-assisted virtualization of ARM platforms. It is supported on

View File

@@ -4,6 +4,163 @@
===========
Genode OS Framework release 22.02 | 2022-02-28
##############################################
| With Genode 22.02, 3D acceleration becomes available to guest operating
| systems running in VirtualBox 6, Sculpt OS evolves into a versatile framework
| for building special-purpose operating systems, and Genode starts to interact
| with the modem of the Pinephone.
The features mentioned above are merely the tip of the iceberg of version
22.02. In fact, the majority of the development work during the release cycle
was focused on topics beyond the visible surface, ranging from the
reorganization of the code base for streamlining the targeting of new hardware,
over the tightening of foundational framework APIs, to the raising of the
default warning level used when building genuine Genode components. Over the
course of this infrastructural work, almost no component was left unturned.
Functionality-wise, improvements of the Genode-based Sculpt OS are at the
center stage of the release. Originally pursued with the vision of a
Genode-based general-purpose OS that is fit for day-to-day use on commodity PC
hardware, the current release lifts the potential of Sculpt's architecture for
the creation of special-purpose operating-system appliances. The gained
flexibility took even us developers by surprise! Thanks to the new modular
approach, we were able to demonstrate a bare-bones version of Sculpt OS on
the Pinephone at FOSDEM, or accelerate our development workflow by routinely
running Sculpt OS directly on the Linux kernel.
The intensive device-driver-related developments of the previous releases
continued as well. This time, we took our new approach for running Linux
drivers in Genode to PC hardware, starting with a fresh port of the USB host
controller driver. The Intel GPU driver received numerous performance
improvements and can now even be combined with guest operating systems running
in VirtualBox 6. Further notable driver-related improvements are the new
ability to interact with the modem on the Pinephone and largely streamlined
driver infrastructure for the Raspberry Pi.
All the details of the new version can be found in the
[https:/documentation/release-notes/22.02 - release documentation of version 22.02...]
Road Map for 2022 | 2022-01-18
##############################
| Our plans for 2022 envision the use of Genode for advanced mobile
| use cases such as video chat.
Following Genode's major technical breakthroughs in the areas of reusing Linux
drivers, hardware-accelerated graphics, and the native execution of Chromium
during 2021, we will pursue _mobile usability_ as overarching theme in 2022.
Specifically, we aspire the routine use of Genode on the Pinephone as a
platform for video chat, using WireGuard to protect the communications.
This vision motivates a large variety of challenging technical topics.
To name a few, we have to squeeze good performance out of the
resource-constrained Pinephone hardware, focus on UI latency and the quality
of service of audio streaming, come up with a somewhat usable touch-based
user interface, and get to the guts of power management.
Aside this guiding theme, we put a broad update of our PC drivers on our
agenda so that Sculpt OS remains a suitable basis for our day-to-day
computing needs on recent generations of Intel hardware.
As an additional line of development, we are excited to intensify the
combination of Genode with reconfigurable hardware.
More information about our review of the past year, this year's focus, and a
rough schedule are presented at our official
[https:/about/road-map - road-map page].
Genode OS Framework release 21.11 | 2021-11-30
##############################################
| Genode 21.11 puts the spotlight on device drivers. Interactive Genode
| scenarios come to the Pinephone, hardware-accelerated graphics becomes
| available on Intel Gen9+ and Vivante GPUs, and Xilnx Zynq receives
| new love.
The previous release presented our new take on porting drivers from Linux, and
the architectural integration of hardware-accelerated graphics in Genode-based
systems. The just released version 21.11 is the continuation of both topics.
Thanks to our streamlined approach for transplanting Linux drivers to Genode, we
were able to reuse the Pinephone's Linux drivers for the display and
touchscreen without modification. But, in contrast to running those drivers in
the Linux kernel, we are walking on new ground by confining each driver in a
separate sandbox.
With our GPU line of work, we followed two major directions during the release
cycle. For one, we applied our architectural approach to a second GPU vendor
besides Intel, namely the Vivante GPU as used by the i.MX SoC family.
Combined with the etnaviv Gallium driver of the Mesa library, Genode thereby
becomes able to render graphics with hardware acceleration on the MNT Reform
open-hardware laptop. The second branch is the promised extension of our
custom Intel GPU multiplexer to GPUs of generation 9 or newer. Thereby, GPU
support has now become a regular feature of the Genode-based Sculpt OS that
can be taken for a spin on commodity PC hardware.
Regarding 32-bit ARM platforms, the current release revives our engagement
with Xilinx Zynq devices, which combine FPGA fabric with a 32-bit ARM CPU.
In particular, the release brings the framework to the USRP E310 board,
opening new hardware-software co-design opportunities.
Besides the many hardware-related topics outlined above, two functional
improvements stand out. First, the Genode version of VirtualBox 6 has reached
feature parity with version 5. Both versions can now be used interchangeably
on Sculpt OS. Finally, libSDL2 got upgraded with support for audio and OpenGL,
which is a nice pathway for hosting games on Genode.
The new version is described in full detail by the
[https:/documentation/release-notes/21.11 - release documentation of version 21.11...]
Sculpt OS release 21.10 | 2021-10-14
####################################
| Sculpt OS version 21.10 introduces GPU-accelerated graphics on Intel,
| media playback in the web browser, VirtualBox 6, and USB webcam support.
At the first glance, the just released Sculpt 21.10 looks and feels nearly
identical to the time-tested previous version 21.03. However, a look at the
installable packages reveals a firework of exciting new features.
First and technically most exciting, the new version enables the use of
hardware-accelerated graphics on Intel GPUs, paving the ground for
graphics-intensive applications and games. The GPU support is based on the
combination of the Mesa library stack with our custom GPU multiplexer
as featured in
[https://genode.org/documentation/release-notes/21.08#Advancing_GPU_driver_stack - Genode 21.08].
_Note that this fresh new feature should best be regarded as experimental_
_and be used with caution._
Second, our port of the Chromium-based Falkon web browser has become able to
present media content like videos and sound. Look out for the browser in the
tools menu of cproc's depot. It is accompanied with a ready-to-use audio
driver and a mixer component. In cases where audio output is not desired, the
browser - or any other component that requests audio output - can be connected
to a new component called black hole, which merely mimics an audio driver
without any audible effect.
Third, with the addition of the new file-vault component, Sculpt now provides
an easy way to setup and use an encrypted file store using our custom CBE
block encrypter as underlying crypto container. The file vault is especially
useful in combination with the recall-fs component that provides each client
with a distinct storage compartment.
Finally, the support for USB webcams as introduced with
[https://genode.org/documentation/release-notes/21.05#Webcam_support - Genode 21.05]
has entered Sculpt OS in the form of a new webcam package. The webcam support
can best be combined with our new port of VirtualBox 6 that is available in
addition to VirtualBox version 5. With Sculpt 21.10, both VirtualBox versions
can be used in parallel.
Sculpt OS 21.10 is available as ready-to-use system image at the
[https://genode.org/download/sculpt - Sculpt download page] and is accompanied
with updated [https://genode.org/documentation/articles/sculpt-21-10 - documentation].
More details about individual new features of Sculpt 21.10 will be covered
soon by dedicated articles at [https://genodians.org].
Genode OS Framework release 21.08 | 2021-08-31
##############################################

View File

@@ -289,9 +289,9 @@ Examining the log file leaves us with the following list of source files:
! FILTER_OUT_dos = cdrom_aspi_win32.cpp cdrom_ioctl_linux.cpp cdrom_ioctl_os2.cpp \
! cdrom_ioctl_win32.cpp
! SRC_CC_dos = $(filter-out $(FILTER_OUT_dos), \
! $(notdir $(wildcard $(DOSBOX_DIR)/src/*.cpp)))
! $(notdir $(wildcard $(DOSBOX_DIR)/src/dos/*.cpp)))
! […]
! SRC_CC = $(DOSBOX_DIR)/src/dosbox.cpp
! SRC_CC = $(notdir $(DOSBOX_DIR)/src/dosbox.cpp)
! SRC_CC += $(SRC_CC_cpu) $(SRC_CC_debug) $(SRC_CC_dos) $(SRC_CC_fpu) \
! $(SRC_CC_gui) $(SRC_CC_hw) $(SRC_CC_hw_ser) $(SRC_CC_ints) \
! $(SRC_CC_ints) $(SRC_CC_misc) $(SRC_CC_shell)

View File

@@ -219,8 +219,9 @@ Base framework and OS-level infrastructure
Increased default warning level
===============================
For building Genode components written in C++, the compiler flags -Wextra,
-Weffc++, and -Werror are now enabled in addition to -Wall by default.
For building Genode components written in C++, the compiler
flags -Wextra, -Weffc++, and -Werror are now enabled in addition
to -Wall by default.
If this strict warning level is inapplicable for a given component or
library, it is possible to explicitly disable the strictness in the

835
doc/release_notes/21-11.txt Normal file
View File

@@ -0,0 +1,835 @@
===============================================
Release notes for the Genode OS Framework 21.11
===============================================
Genode Labs
Version 21.11 of the Genode OS Framework puts device drivers into the
spotlight. Where to begin? Back in
[https://genode.org/news/road-map-for-2021 - January], we envisioned Genode
running on the Pinephone. With the current release, the first interactive
Genode scenarios become alive on this platform. Unlike the regular Linux-based
systems used on the Pinephone, we are walking on new ground by running each
individual driver in a dedicated sandbox.
Speaking of 64-bit ARM platforms, Genode's support for the i.MX8 SoC family
received a new USB host driver as well as the first version of the Vivante GPU
driver. The latter is a continuation of our GPU-related work presented in the
[https://genode.org/documentation/release-notes/21.08#Advancing_GPU_driver_stack - previous release],
which proves that our approach of integrating hardware-accelerated graphics
into the framework's architecture is applicable across different GPU vendors.
As promised three months ago, we have also taken our custom Intel GPU
multiplexer to Gen9 or newer devices. In fact, GPU support has now become a
regular feature of the Genode-based Sculpt OS that can be taken for a spin on
commodity PC hardware.
Even though most efforts are nowadays spent on 64-bit platforms, we have
revived Genode's support for Xilinx Zynq devices in aspiration of future
hardware-software co-design work. Those chips combine FPGA fabric with 32-bit
ARM cores and thereby allow us to explore the combination of reconfigurable
hardware with Genode's component architecture.
For users who prefer the comforts of virtual hardware over the tinkering with
physical devices, new drivers for VirtIO input and graphics open up the use of
interactive Genode systems on Qemu's "virt" platform.
Besides the predominant device-driver topics of the release, one other
highlight is the feature completion of Genode's version of VirtualBox 6 on PC
platforms, which has now reached parity with the time-tested version 5. Now,
features like shared folders, shared clipboard, sound, or USB pass-through
have become readily available.
A little kingdom for each SoC family
####################################
With the number of supported boards and CPU architectures growing, our
existing maintenance structure of the central Genode code repository becomes
increasingly nonviable. We made the following observations.
First, with respect to drivers ported from Linux, each SoC tends to refer
to a different _flavour_ of the Linux kernel. This so-called vendor kernel
may be a specific version with a blessed kernel configuration, or even a
hard fork. In the past, we tried harmonizing drivers across SoCs by using
the vanilla Linux kernel as common ground. But in practice, this common
ground seems to be walked-on by only a few. Devices are shipped with vendor
kernels after all. To get the best supported drivers for a given hardware,
we have to port the drivers from the respective vendor kernel.
This realization, in turn, faces us with the problem of a growing number
of vendor kernels we have to work with whenever extending Genode's hardware
support to a new SoC. But there are only so many Linux kernels one can juggle
with.
Second, when using one monolithic code base for all SoCs, the coordination of
the code repository becomes a bottleneck when it comes to reviewing and
merging contributions, and the nurturing of a consistent level of quality
assurance. In the case of Genode, this responsibility is shared by two head
maintainers. However, their expertise lies in the Genode framework, not in the
peculiarities of specific SoC hardware. Hence, the review of such SoC-related
contributions must remain at surface level. But the burden of responsibility
still rests on the two.
Third, we ultimately want to encourage 3rd parties - like hardware vendors -
to supplement SoC support for Genode independently from us. Forcing such
independent developers to funnel their results into our code base is not
always natural and may even be legally impeded by Genode's need for a
[https://genode.org/community/contributions#Genode_Contributors_Agreement - contributor's agreement].
We want to avoid such artificial friction.
The consequence of these observations is the need to modularize our code base
around the idea of giving each SoC family a little kingdom of their own. We
envision a code repository with a different maintainer for each SoC family. As
a prerequisite, we had to cleanly separate SoC-specific code from the generic
code that will remain in the main Genode repository. To stress this approach,
each of four developers picked a dedicated SoC family and went with it. Stefan
Kalkowski took the i.MX-related code to his
[https://github.com/skalk/genode-imx - genode-imx] repository,
Johannes Schlatow took the Xilinx Zynq code to his
[https://github.com/jschlatow/genode-zynq - genode-zynq] repository,
Norman Feske
maintains the Allwinner code for the Pinephone in
his [https://github.com/nfeske/genode-allwinner - genode-allwinner]
repository, and Sebastian Sumpf gave the RISC-V support a new home
at his [https://github.com/ssumpf/genode-riscv - genode-riscv] repository.
By looking at this modularization from four different perspectives at the same
time, we reached satisfying interfaces between the generic and SoC-specific
code. We found that this maintenance model works as anticipated. In
particular, we hoped that each SoC can be shepherded by a single person
without stress. This turned out to be true.
We also found that the taken approach gives each maintainer a sense of
autonomy that was not possible with one monolithic code base. This is
particularly fruitful when drafting generic utilities for the eventual
inclusion into Genode's main repository. The drafts can first receive a test
of time at individual SoC repositories before integrating them into the common
code base, the pin I/O interfaces described in
Section [Pin I/O session interfaces] being a good example.
The supportive tooling for each SoC tends to differ between vendors, speaking
of custom system-image formats, boot loaders, or firmware. The SoC-specific
repositories provide a natural home for hosting such tools, custom work-flow
scripts, and configurations.
With this exploratory phase completed, we plan to move the SoC-specific
repositories - that currently reside at each maintainer's GitHub account -
under the banner of [https://github.com/genodelabs - genodelabs] during the
next release cycle.
NXP i.MX family
===============
Support for the family of i.MX SoC related boards is located in the
[https://github.com/skalk/genode-imx - genode-imx] repository.
By now, it contains far-reaching support for the i.MX 8M Quad evaluation kit,
and the MNT Reform2.
Besides the basic kernel support for Genode's custom base-hw microkernel,
it contains drivers for using SD and eMMC cards, HDMI, and MIPI-DSI connected
displays, Ethernet, and USB connected devices. Moreover, we are proud to
introduce support for the Vivante GPU used by the i.MX 8M SoC. All mentioned
device drivers were ported using the
[https://genode.org/documentation/release-notes/21.08#Linux-device-driver_environment_re-imagined - re-imagined approach to port Linux drivers]
that was introduced in the previous release.
To obtain a ready-to-use SD-card when testing an arbitrary run-script
scenario, it is sufficient to add the following value to the 'RUN_OPT'
variable:
! RUN_OPT += --include image/imx8mq_mmc
Depending on which board you've chosen, it will build the corresponding u-boot
bootloader, file system, Genode system image, and integrate those parts into
one SD-card image.
Xilinx Zynq
===========
Basic platform support for the Zynq-7000 SoC has already been added to Genode
with
[https://genode.org/documentation/release-notes/15.11#Xilinx_Zynq-7000 - release 15.11].
While the virtualized zynq_qemu board support resided in the main Genode
repository and was regularly tested, support files for real Zynq-hardware were
living in segregation within the Genode-world repository.
By creating a new realm in form of a
[https://github.com/jschlatow/genode-zynq - genode-zynq repository], we were
able to consolidate the Zynq-specific board support and drivers in one place.
Furthermore, we are currently intensifying our work on this platform and
documenting the journey on
[https://genodians.org/jschlatow/2021-11-29-zynq-guide-1 - genodians.org].
This particularly includes building ready-to-use SD card images with u-boot
and supporting run-time re-configuration of the FPGA.
In order to use the zynq repository, you only need to create a clone at
_repos/zynq_, create a new build directory for arm_v7a and uncomment the
corresponding line in your etc/build.conf. Step-by-step instructions for
individual boards can be found at _repos/zynq/doc/_.
Allwinner A64 (Pinephone)
=========================
During the release cycle, Genode's support for the Allwinner A64 SoC, and
the Pinephone in particular, made big leaps forward. The corresponding code
is hosted in the dedicated
[https://github.com/nfeske/genode-allwinner - genode-allwinner] repository.
First, the Linux version taken as the basis for ported device drivers has been
updated to 5.14.1 in order to support the revision v2 of the Pine-A64-LTS
board, which features a different Ethernet PHY, namely the Motorcomm YT8511
PHY. Genode's 'pine_a64lts' board supports both board revisions now.
To enable touchscreen input on the Pinephone, the corresponding driver for the
Goodix touchscreen controller has been ported from the Linux kernel. It
complements the framebuffer driver that we introduced with the previous
release. Combined, both drivers enable the use of Genode's regular interactive
scenarios based on the 'drivers_interactive' package. The biggest technical
challenge was the untangling of both drivers from the clock, reset, and power
control units (CCU, RSB, PMIC). Those low-level platform configurations are
now handled by a new A64-specific version of the platform driver.
[image pinephone_touch]
Genode's nano-3D example responding to touch input
The improved driver support is accompanied with new tooling for booting Genode
on the Pinephone, either via USB fastboot, or via SD-card. Both options are
described in the following Genodians article.
:Booting Genode on the Pinephone:
[https://genodians.org/nfeske/2021-09-20-pine-fun-pinephone-boot]
RISC-V
======
RISC-V board support for the base-hw kernel is now located at the
[https://github.com/ssumpf/genode-riscv - genode-riscv] repository. Currently,
the repository contains support for the
[https://hensoldt-cyber.com/mig-v - MiG-V] SoC including kernel specific parts
as well as a driver for MiG-V's network-interface controller.
Base framework and OS-level infrastructure
##########################################
New pattern for C++ error handling
==================================
Genode employs C++ exceptions for propagating errors, which is true to the
language. However, the use and the mechanics of C++ exceptions comes with its
own bag of problems. The current release introduces a new error-handling
pattern in the form of the so-called 'Attempt' utility. Its name reflects its
designated use as a carrier for return values. This new utility is described
by a dedicated article at Genodians.org:
:An 'Attempt' to avoid C++ exceptions:
[https://genodians.org/nfeske/2021-11-26-attempt-no-exceptions]
During the release cycle, we applied the 'Attempt' pattern to Genode's
low-level memory-allocation code, namely core's PD session interface (for the
allocation of RAM dataspaces), and the code related to the generic 'Allocator'
interface (for the allocation of bytes). The latter is an extensive change,
touching all implementations of this interface.
To largely uphold compatibility with components using the original
exception-based interface as a mere client - in particular use cases where an
'Allocator' is passed to the 'new' operator - the traditional 'alloc' is still
supported. But it exists merely as a wrapper around the new 'try_alloc'.
However, the change does not preserve compatibility with the original
'Range_allocator' interface. So uses of this interface must be adapted.
Pin I/O session interfaces
==========================
On ARM-based SoCs, the use of general-purpose I/O (GPIO) pins is omnipresent.
Traditionally, Genode features the "Gpio" session interface for this purpose.
This interface allows a client to access an individual pin. Once assigned to a
pin, the session grants the client the full responsibility for the pin. In
particular the direction of the I/O pin is laid into the hands of the client.
We later realized that the wiring and thereby the direction of a pin is
ultimately a board-level decision. Wrongly operating an input pin in output
mode can easily result in a short-circuit. Therefore, the client of an
individual pin should better not be burdened with the responsibility to
control the pin direction or pull resistors. To address this concern, it is
best to split the roles of GPIO pins into clear-cut session interfaces.
Those roles are:
* The sensing of the state of a GPIO pin, e.g., detecting whether a button is
pressed or not: operating a pin as an input signal. This role is now covered
by the "Pin_state" session interface with the single RPC function
! bool state() const;
By calling this function, the client can request the state of the pin.
That's it.
* Controlling the signal level of a pin: operating a pin as an output signal.
This role is now addressed by the "Pin_control" session interface that
provides an interface of only one rather unsurprising RPC function
! void state(bool);
* Receiving a notification of a change of the signal level of a GPIO pin:
operating a pin as an interrupt source. This role can be represented by
Genode's existing IRQ session interface - the same interface as provided by
Genode's core for GIC interrupts.
Since each pin corresponds to a separate session, per-pin access control
becomes possible by Genode's regular session-routing mechanisms.
In contrast to the original GPIO session, the role of each pin as output and
input becomes explicit. A client can no longer drive a pin that is an input
signal unless explicitly permitted.
The interfaces were created and time-tested in the context of our
Pinephone-related development, in particular during the work described in the
following two articles.
:Device access from the user level:
[https://genodians.org/nfeske/2021-03-17-pine-fun-device-access]
:One Platform driver to rule them all:
[https://genodians.org/nfeske/2021-04-29-platform-driver]
Pin-driver framework
--------------------
In real-world system scenarios, a variety of different components must
decidedly interact with individual GPIO pins. This is where a so-called pin
driver enters the picture. This component provides the pin-state, pin-control,
and IRQ services. Analogously to how the platform driver safeguards the access
to device resources by different - mutually distrusting - device drivers, the
pin driver's job is the safeguarding of GPIO pins.
To ease the implementation of such pin drivers, the new session interfaces are
accompanied by a set of new utilities in
[https://github.com/genodelabs/genode/blob/staging/repos/os/include/os/pin_driver.h - os/pin_driver.h].
The use of these utilities is best illustrated by the
[https://github.com/nfeske/genode-allwinner/tree/master/src/drivers/pin/a64 - pin driver for the A64 SoC].
Time-multiplexed pin direction
------------------------------
There exist rare use cases for changing the direction of an I/O pin during
runtime. For example, the Goodix touchscreen controller as found in the
Pinephone monitors the state of its interrupt signal during reset. During its
normal operation, this signal is driven by the touchscreen controller but
during reset, it is driven by the host to send one bit of information (I2C
address selection). We support this time-multiplexed use of one pin as both
input and output by the means of session lifetimes. The pin driver switches
the pin into output mode not before a client establishes a pin-control session
referring to this pin. The client can thereby control the direction by
creating or closing its pin-control session.
Genode C APIs
=============
USB host-controller service API
-------------------------------
While porting the Linux driver for the Designware USB host-controller used
within the i.MX 8M SoC, we introduced a new C API to serve Genode USB clients
from C driver ports. It enables drivers to:
* Announce and release USB devices,
* Ask for a session handle of an open session via the bus/device ID pair,
* Ask for a single USB request via a session handle,
* Acknowledge a USB request via a session and request handle, and
* Notify potential USB clients that I/O progress has been made.
You can find the new C API under _repos/os/include/genode_c_api/usb.h_. A
working example driver can be found within the 'genode-imx' repository under
_src/drivers/usb_host/imx8mq_.
Touchscreen driver API
----------------------
To accommodate input drivers written in C, like the ones ported from the Linux
kernel, we need a clean way to connect C code with Genode's event session
interface.
The current release introduces a C API to be used by input drivers to generate
Genode events. The interface is located at
_repos/os/include/genode_c_api/event.h_ whereas the implementation resides at
_repos/os/src/lib/genode_c_api/event.cc_.
The initial version is limited to multitouch events only.
As of now, it is used by the Goodix touchscreen driver for the Pinephone.
Event filter for converting touch to pointer input
==================================================
Unlike traditional pointer devices, touchscreens have no notion of a pointer
position, hovering, or mouse buttons. E.g., without touching, there is no
position. There exists a gap between those devices and regular GUI
applications, which respond to pointer events in terms of hovering motion (in
screen coordinates) and mouse clicks. Genode's existing touchscreen drivers
try to bridge this gap by translating touch input to pointer events in rather
pragmatic ways. This is not optimal for two reasons.
First, putting the burden of emulating traditional pointer devices on the
touchscreen drivers not only inflates their complexity but is also unnatural
when the calibration of touch coordinates to screen coordinates comes into
play. In this case, the touchscreen driver must be made aware of the display
resolution. Second, the heuristics of how touch events are best translated
into pointer events tend to differ from driver to driver, or between Genode
use cases. Any intelligence that is builtin in the drivers stands in the way
of interchanging the drivers or enhancing the translation across all drivers
(e.g., adding two-finger-scroll).
To solve this problem in a clean way, we added a new optional filter for
translating touch events to pointer events to Genode's event-filter component
(first introduced in
[https://genode.org/documentation/release-notes/17.02#Input-event_filter - 17.02]
as input filter, reworked in
[https://genode.org/documentation/release-notes/20.08#Replacing_the_input_filter_with_an_event_filter - 20.08]).
The new filter comes in the form of a new '<touch-click>' node in the filter's
'<output>' definition. For example, the configuration of the event filter that
sits in-between the Goodix touchscreen driver for the Pinephone and the
nitpicker GUI server looks as follows.
! <config>
! <output>
! <touch-click>
! <input name="touch"/>
! </touch-click>
! </output>
! <policy label="touch" input="touch"/>
! </config>
The filter augments touch events with artificial absolute motion and mouse
click/clack events as understood by regular GUI applications. The original
touch events are preserved, enabling touch-aware applications to interpret
touch gestures.
Device drivers
##############
Hardware-accelerated graphics
=============================
Generic GPU-session interface
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
When we introduced the GPU session initially, it was modeled after the
perceived requirements of the Linux i915 DRM back end. In the meantime, with
the enablement of a more recent Mesa version and the addition of Vivante as
another GPU family, we learned that some of those requirements are obsolete.
First, we replaced the 'info' RPC by an information ROM dataspace to overcome
the following limitations.
* The amount of data that can be transferred in an RPC is constrained by the
underlying base platform,
* Most information never changes during run time but must be copied
nonetheless when using an RPC interface,
* The information presented differs depending on the used GPU device.
With the introduction of Vivante, the original Intel-centric implementation no
longer suffices.
* Sequence numbers of GPU execution buffers are not GPU-specific and, thus,
should be part of the generic GPU session interface.
Currently, the GPU-specific information is presented in binary format, which
is specified in _gpu/info_intel.h_ resp. _gpu/info_etnaviv.h_ for the Vivante
GPU. We entertain the idea to replace the current representation by an
XML-based ROM in the future to render the interface binary agnostic and also
backwards-compatible. The information ROM can be accessed via the
'attached_info' client API function.
Furthermore, we replaced the usage of heavy-weight dataspace capabilities with
light-weight client-local identifiers called 'Buffer_id' within the API. In
case the client requires a capability (e.g., for mapping the buffer in its
address space) it uses the corresponding ID to request it from the server.
With upcoming support for other driver back ends, we need to take their
requirements into account as well. We introduced abstractions that further
encapsulate the device-specific state and operations. The changes in this
release represent only the first consolidation steps of Genode's GPU support
and we will continue this work during the next months.
Intel GPU support for Gen9 and newer
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
As mentioned in the
[https://genode.org/documentation/release-notes/21.08#Advancing_GPU_driver_stack - 21.08]
release notes, we were fiercely working on Intel GPU Gen9+ support because
Gen8 (Broadwell) was the only stable running GPU on Genode at the time. For
Gen9+, we experienced severe GPU hangs after an undefined amount of rendering
passes. As promised in the previous release, we dove right in and were able to
identify the main causes of this behavior. This led to working Gen9+ support in
[https://genode.org/documentation/articles/sculpt-21-10#GPU - Sculpt OS release 21.10].
To go into a little more detail, we had to look into workarounds as described by the
[https://01.org/sites/default/files/documentation/intel-gfx-prm-osrc-skl-vol16-workarounds_0.pdf - Intel documentation]
and the Linux kernel driver, and determine known workarounds that only apply
to Gen9 and above. After many iterations, we found one workaround that fixed
our GPU hang issue and now apply it during GPU initialization. Additionally,
we found the hardware context sizes (a memory region where the GPU stores its
state) vary between GPU generations, where Gen9 requires more space than Gen8.
Additionally, we found that some features like tiling or client mappings
through the global-graphics translation table are not required by our updated
Mesa 21.0.0 Iris Gallium driver. Since these resources are global and were
split between multiple GPU client applications, not using them lifts the
limits formerly imposed by the partitioning.
For the Sculpt integration, we added GPU-service support and are providing
various packages. A summary on how to test GPU acceleration on Sculpt can be
found at the following Genodians article.
:Test driving Sculpt's 3D support:
[https://genodians.org/ssumpf/2021-10-25-glmark2]
Vivante GPUs (i.MX8)
~~~~~~~~~~~~~~~~~~~~
With the previous release, we already foresaw adding support for Vivante
GPUs as found in i.MX8 SoCs by show-casing a work-in-progress driver
component based on the Linux 'etnaviv' DRM driver and using the also ported
'etnaviv' Gallium driver.
This driver component is now available in an updated fashion in the
[https://github.com/skalk/genode-imx - genode-imx] repository that
encapsulates support for the family of i.MX8 SoCs for Genode. In contrast to
our first prototype, the driver now relies completely on the new DDE Linux
approach and re-uses the existing 'lx_emul' and 'lx_kit' libraries. At the
moment, the driver does not make use of a C-API to Genode services for
accessing the GPU service like the other new DDE Linux drivers do but
implements the session directly. We decided against prematurely introducing
such an C-API while the GPU session itself is still in flux.
[image glmark_mnt_reform]
Glmark running via the ported Vivante GPU driver on the MNT Reform laptop
Briefly touching on the current implementation of the driver, we had to extend
the 'lx_kit' API slightly to implement the buffer-object allocation. Also, we
added a special-purpose interface called 'lx_drm' that comprises all Linux DRM
I/O controls that need to be performed for implementing the GPU session and
itself is a simple layer on top of 'drm_ioctl'.
The 'lx_drm' functions are executed within the context of an emulated Linux
kernel thread executed under a cooperative user-level scheduling scheme.
However, since the GPU session is based on synchronous RPCs and we do not know
in advance if a call into the ported driver code blocks at some point, we had
to ensure the RPC returns not before the operation completed. The completion
of operations may include several blocking states and concurrent event
handling (e.g., hardware interrupts).
For the time being, the driver component is still being worked on. We are, for
example, investigating overall performance regressions. Nevertheless, the
driver is functionally complete and currently supports one client at a time.
In addition to the driver component, we cleaned up the existing 'etnaviv'
libdrm back end and created a Sculpt pkg called *mesa_gpu-etnaviv* analogous
to the pkgs for 'iris' and 'softpipe' back ends. The most visible change is
the switch from the ad-hoc DRM session to the GPU session.
All in all, we are now at a stage were we can work on optimizing the graphics
stack on the Vivante GPU and are in particular looking forward to porting the
next Linux driver. After all, by doing so, we can flesh out and maybe
generalize the 'lx_drm' API so that for other drivers the porting effort gets
reduced even further.
VirtIO input and framebuffer drivers
====================================
_This section was co-authored by Piotr Tworek who created the_
_VirtIO driver support. Thanks Piotr for the welcome contribution!_
Over the
[https://genode.org/documentation/release-notes/21.02#VirtIO_block_devices_for_virtual_machines_on_ARM - previous]
[https://genode.org/documentation/release-notes/21.08#RAM_framebuffer_driver_for_Qemu - releases]
of Genode this year, the framework received steadily improved driver support
for virtual devices as supported by Qemu. The primary motivation behind this
line of work is the use of virtual hardware as an experimentation ground for
Genode on the AARCH64 and RISC-V architectures. The use of virtual hardware
nicely side-steps the costs and (un-)availability of suitable devices, and
avoids the extra effort that is usually involved when working with real
hardware. The current release further advances the virtual-device support by
the introduction of VirtIO input and graphics drivers.
VirtIO input
------------
The new input driver can service Qemu VirtIO mouse, keyboard, and tablet
devices. The implementation is based on the VirtIO 1.1 device specification,
Section 5.8 "Input Device". The driver can service three separate device
types, namely mouse, keyboard, and tablet. The main difference between mouse
and tablet devices is that the former produces relative events whereas the
latter produces absolute motion events.
By default, the driver tries to attach to the first VirtIO input device of any
of the listed types. Such behavior would pose a bit of a problem since in
Genode, we'd like to know that a specific instance of the driver will attach
only to a mouse for example. This way, we can define proper policies for it.
To allow such behavior, the VirtIO input driver has one configuration key
called 'match_product', which accepts the values of "mouse", "keyboard",
"tablet", and "any" (default). Using this config key, one can accomplish
exactly what is needed to tell the driver to only attach to a VirtIO input
device if it's of "match_product" type.
VirtIO framebuffer
------------------
The new VirtIO framebuffer driver implements the necessary bits to provide 2D
framebuffer support on top of a VirtIO GPU device as provided by Qemu. Compared
to the ramfb driver, which was introduced in Genode
[https://genode.org/documentation/release-notes/21.08#RAM_framebuffer_driver_for_Qemu - 21.08],
the VirtIO framebuffer driver has one major benefit: It allows the Qemu window
to be dynamically resized at runtime. The driver will treat this as resolution
change and act accordingly. In contrast to the VirtIO input driver, the
framebuffer driver does not support any extra config options.
Practical use
-------------
Thanks to the new drivers, the drivers_interactive package for the 'virt_qemu'
board has become fully interactively usable. The drivers subsystem spawns two
instances of virtio_input. One attaches to a keyboard device and the second to
a mouse. This is what the default virt_qemu board exposes. At this time, the
tablet device is not instantiated by default but it might become useful in the
future for testing Genode's touch support.
Make sure that Qemu exposes those new devices in the modern VirtIO 1.0 mode.
Versions up to Qemu 5.1.0 still use pre-1.0 mode in the default setup.
One thing to keep in mind is that the VirtIO framebuffer driver will change
the resolution of the virtual display whenever the Qemu window is resized.
This means that for high resolution screens, one might have to tweak the
default RAM quota for the driver. The default should be enough for 1080p
screens, but not much more than that.
Linux device-driver environment
===============================
While working on Linux device-driver ports that use the new DDE Linux
environment introduced in
[https://genode.org/documentation/release-notes/21.08#Linux-device-driver_environment_re-imagined - release 21.08],
we stumbled across some inaccuracies and missing pieces of the former
implementation.
For instance, kworker threads were blocked unconditionally before. But the
original Linux kernel semantics includes corner-cases that delay kworker
suspension. By adding them, we circumvent potential deadlocks. The cache
maintenance operations got optimized by checking the read/write direction of
the device with regard to DMA memory more accurately. Moreover, we had to
learn that on ARM the minimal alignment for all allocations within Linux have
to be of cache-line granularity.
Feature-wise, a new API got introduced to access the pin-control service and
IRQ sessions offered by it. This is useful when a Linux driver directly
depends on GPIO settings respectively uses GPIO pins as interrupt source.
Libraries and Applications
##########################
Feature completion of VirtualBox 6
==================================
With [https://genode.org/documentation/articles/sculpt-21-10 - Sculpt OS 21.10],
we released VirtualBox version 6 as experimental alternative to the existing
port of version 5. We also switched to version 6 as daily driver on our
development machines at Genode Labs. These steps yielded the following
improvements during the past Genode release cycle.
The integration features shared folders, shared clipboard, and guest
mouse-pointer shape were fully enabled. Most guest-integration modules in
VirtualBox are implemented as shared libraries/objects, which are loaded at
runtime on demand. Following our goal to keep changes to the upstream code
minimal, our version of VirtualBox 6 now provides VBoxSharedClipboard and
VBoxSharedFolders as dedicated libraries that must be integrated into the
system as follows. Note, the libraries are accessed by the VirtualBox code as
files before loading but must also be available as ROMs to our runtime dynamic
linker.
! <start name="virtualbox6">
! <config vbox_file="machine.vbox6">
! <vfs>
! <!-- original file names of shared objects -->
! <rom name="VBoxSharedClipboard.so"/>
! <rom name="VBoxSharedFolders.so"/>
! </vfs>
! </config>
! <route>
! <!-- map file names to Genode shared-object naming scheme -->
! <service name="ROM" label="VBoxSharedClipboard.so">
! <parent label="virtualbox6-sharedclipboard.lib.so"/> </service>
! <service name="ROM" label="VBoxSharedFolders.so">
! <parent label="virtualbox6-sharedfolders.lib.so"/> </service>
! </route>
! </start>
As depicted in the configuration snippet above, we use the file extension
_.vbox6_ for VirtualBox 6 configuration files. The background is that there
are some subtle incompatibilities in VirtualBox 6 with settings we used in
version 5. For example, the version of the configuration file must be set to
1.18+ for maximum compatibility of virtual-device configuration and guest
operating systems. An example configuration is provided by the pkg/vbox6 depot
archive and specifies the version like follows.
! <VirtualBox xmlns="http://www.virtualbox.org/" version="1.18-genode">
Unlike VirtualBox 5, the current version does not implement a custom Audio
back end for Genode but uses the existing OSS back end of the original
implementation. The feature can be enabled in .vbox and runtime configuration.
We recommend using the HDA controller.
! <AudioAdapter controller="HDA" driver="OSS" enabled="true" enabledOut="true" enabledIn="false"/>
! <start name="virtualbox6">
! <config>
! <vfs>
! <dir name="dev"> <oss name="dsp"/> </dir>
! <vfs>
! </config>
! </start>
More device-related improvements are the reporting of mouse-wheel events, the
support of up to 8 pass-through USB devices via the virtual XHCI USB3
controller, and a ready-to-use Sculpt package to capture webcam streams in the
VM (genodelabs/pkg/vbox6-capture).
Finally, this release includes a whole lot of stability improvements to bring
VirtualBox 6 on par with version 5 in daily use like robust machine state
handling including the FPU, fixed corner cases in the AHCI model and
Startup-IPI implementation as well as enhanced timeout and CPU wakeup
handling.
Sculpt OS for 64-bit ARM in addition to x86
===========================================
Up until now, the Genode-based [https://genode.org/download/sculpt - Sculpt OS]
was primarily targeted at the 64-bit x86 architecture. However, since the
hardware support of 64-bit ARM platforms like i.MX8 has reached almost feature
parity with the PC platform, it was time to introduce the notion of CPU
architectures to package index files.
In Sculpt OS, software packages are provided in a federated way from any
number of package providers. Each provider offers a so-called _index_ that
enlists the available package versions blessed for a specific Sculpt OS
release. See the release notes for Genode
[https://genode.org/documentation/release-notes/19.02#Announcing_software_packages - 19.02]
for more details.
Starting with [https://genode.org/news/sculpt-os-release-21.10 - Sculpt OS 21.10]
released in October, each index file features a declaration of the CPU
architectures supported by the package provider.
! <index>
! <supports arch="x86_64"/>
! <supports arch="arm_v8a"/>
! ...
Sculpt uses this information to decide whether to display the index or not by
comparing the architecture of the running machine with these declarations.
Individual entries of an index file can be tagged as being specific for one
architecture.
! <pkg path="mesa_gpu-intel" info="Intel GPU driver (IRIS)" arch="x86_64"/>
This annotation can also be specified for a sub index.
! <index name="Virtual machines" arch="x86_64">
! ...
! </index>
Thanks to this approach, most packages - which are architecture-agnostic - can
be offered for both x64_64 and arm_v8a with almost no manual work. In fact,
starting with Sculpt 21.10, all default packages offered by Genode Labs are
available for both architectures.
Audio and OpenGL support for libSDL2
====================================
With this release, we extend the features of our SDL2 port by enabling audio
support via the OSS back end and added basic support for using OpenGL.
Re-using the existing OSS back end via our VFS OSS plugin is in contrast to
how we enabled audio in our SDL1 port where we use Genode's audio-out
session directly. Instead of having to add a Genode specific back end to each
ported software, it is more reasonable to have just one implementation of a
somewhat common interface for which the back end already exists.
The OpenGL support, on the other hand, has not been thoroughly tested yet
but works well enough for one or the other game. It still suffers from the
same limitation as the normal video back end where resizing the window during
runtime is not supported. This feature is yet to be implemented.
Additionally, we made SDL2 now to use its existing pthread back ends,
rather than using the generic fallback ones, as we deem the current pthread
support in Genode sufficient.
SSH terminal moved to Genode world repository
=============================================
The SSH terminal component now resides in the world repository. When we
initially introduced this component, it complemented the existing TCP
terminal. Rather than using plain TCP to access a terminal server the
connection is secured by the SSH protocol.
In the meantime the component itself incorporated more and more features
that were not anticipated in the initial design. Since we have not used
the component much ourselves lately, albeit some features are tested in our
nightly CI, we decided to move it to the world repository.
On a different note, the component now features new support for SFTP that
enables one to access a Genode file system via SSH. Thanks to Tomasz Gajewski
for this welcome contribution.
Build system and tools
######################
Moving the platform-specific board support into extra repositories made it
necessary to review the run tool with respect to virtualized platforms. For
running Genode within Qemu, the run tool used to assemble the Qemu command
line depending on the target board. In order to achieve a clean cut between
the main repository hosting this part of the run tool and the
platform-specific repositories, we came up with a way to specify the Qemu
arguments outside the main repository.
The solution follows along our approach of how we already specify the
architecture and link address of a target board in distinct files within a
board-property directory _board/<board_name>/_. Similarly, the board-specific
Qemu arguments are now provided in a _board/<board_name>/qemu_args_ file. This
file may contain one or multiple lines that will be appended to the command
line generated by the run tool. Because it is required by virt_qemu, it is
possible to restrict particular arguments to a certain spec, e.g. arm_v8a, by
prefixing the line with 'arm_v8a:'. Note, that any '-m *' argument, which
specifies the amount of RAM, provided within a _qemu_args_ file will override
any memory setting provided in the run scripts.
Moreover, the _qemu_args_ file is obliged with instantiating a network
controller since this is also specific to the platform. For the zynq_qemu
board, e.g., this is achieved by the following arguments:
! -net nic,model=cadence_gem,netdev=net0 -netdev user,id=net0
Always instantiating a network device removes the need to call
'append_qemu_nic_args' in the run scripts. However, you can still use this
function to add forwarding rules to the netdev with id _net0_.

1070
doc/release_notes/22-02.txt Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -7,99 +7,89 @@
Herein, we lay out our plans for evolving Genode. Progress in addition to this
planning will very much depend on the degree of community support the project
will receive. The
[https://genode.org/about/challenges - Challenges] page collects some of our ideas to
advance Genode in various further directions.
[https://genode.org/about/challenges - Challenges] page collects some of our
ideas to advance Genode in various further directions.
The road map is not fixed. If there is commercial interest of pushing the
Genode technology to a certain direction, we are willing to revisit our plans.
Review of 2020
Review of 2021
##############
The overarching theme of our road map for 2020 was "Dwarfing the barrier of
entry", which expressed the ambition to reach a wider audience. On that
account, we identified four promising directions: First, making Sculpt OS
palatable for a wider circle. Second, fostering the public perception of the
high quality of Genode to reinforce the confidence of people who are sceptical
towards novel operating-system technology. Third, lowering the barrier of
entry by providing frictionless tooling. And fourth, publicly presenting use
cases that prove the fitness and flexibility of Genode. These directions
certainly did a good job of motivating the working topics of last year's four
releases
[https://genode.org/documentation/release-notes/20.02 - 20.02],
[https://genode.org/documentation/release-notes/20.05 - 20.05],
[https://genode.org/documentation/release-notes/20.08 - 20.08], and
[https://genode.org/documentation/release-notes/20.11 - 20.11].
Genode's year 2021 was defined by three extremely challenging lines of work.
The UI improvements of Sculpt OS in version 20.02 largely eliminated the need
to use the command line as presented
[https://www.youtube.com/watch?v=vmgWgzeKAjU - here].
The second direction - software quality - motivated the steady improvements of
our POSIX runtime, ultimately enabling highly sophisticated workloads like the
Chromium web engine on Genode. Regarding our stated commitment to 64-bit ARM
hardware, in particular supporting the NXP i.MX8 SoC, we covered 64-bit
multi-core virtualization, HDMI, touch input, OLED, networking, LTE, USB,
clock and power management, VirtIO, up to running Sculpt OS on this platform.
First, we conquered the territory of GPU support that was ridden with
uncertainties and seemed almost impenetrable when we started. But at the end
of the year, our custom Intel-GPU multiplexer has landed in Sculpt OS like it
always belonged there. In tandem with the Intel-GPU work, we explored the
Vivante GPU as a representative of an ARM platform. The work required a deep
dive into the respective GPU architectures and the Mesa software stack. It
eventually led us to the design of Genode's device-agnostic GPU interfaces.
Granted, Genode's audience hasn't increased by a large margin as a direct
result of these efforts. But as illustrated by the fruitful road-map
discussion for 2021 on the
[https://genode.org/community/mailing-lists - mailing list],
our community is more engaged and enthusiastic than ever before.
The second line of work was concerned with the reuse of Linux drivers as
Genode components. Over the year, the puzzle pieces of our new Linux
device-driver environment come together, replacing former confusion and chaos
with knowledge and order, ultimately uncovering the treasure of Linux drivers
for Genode with very little friction. On the way, we created new methodology
and tooling, as well as extensive documentation in the form of the "Genode
Platforms" document. Thanks to the new drivers ported from the Linux kernel,
we were able to witness interactive Genode scenarios becoming alive on the
Pinephone by the end of the year.
The third major topic was the growing sophistication of Genode-native
workloads, with the media features of the Chromium-based browser on 64-bit ARM
being the most impressive example. Apart from the apparent functional benefits
for Genode and Sculpt OS, this is the long outstanding validation of some bold
design decisions we took years ago, in particular the role and architecture of
the VFS and its interplay with the libc.
When reviewing the road map for 2021, some items remained uncovered. In
particular the seL4-related topics became stale. At the end of 2020 - when we
assembled the road map for the past year - there was a tangible prospect of
pursuing this topic as funded work. However, those plans were repeatedly
deferred and remained uncertain. Also, there are some items that have seen
healthy doses of progress - like the topics related to Ada/SPARK or Goa - but
received less attention than anticipated. On the other hand, the four releases
([https://genode.org/documentation/release-notes/21.02 - 21.02],
[https://genode.org/documentation/release-notes/21.05 - 21.05],
[https://genode.org/documentation/release-notes/21.08 - 21.08],
[https://genode.org/documentation/release-notes/21.11 - 21.11])
of 2021 covered quite a few topics not advertised at the road
map, e.g., webcam support, Xilinx Zynq, or RISC-V.
It is fair to say that the level of technical risks we took in 2021 had been
unprecedented in Genode's development history. We are more than proud of the
outcome, which will hopefully propel Genode to new heights in 2022.
2021 - Optimization and Platform diversity
##########################################
2022 - Mobile Usability
#######################
For the initial conquering of 64-bit ARM territory, restraining our focus to
one particular SoC - namely NXP i.MX8 - was a healthy approach. Now it is the
right time to optimize and to branch out the development to further
platforms. The following key aspects of our road map for 2021 reflect that.
After having enabled the first interactive Genode scenarios on the Pinephone
last year, we plan to take Genode on the Pinephone to a level where we can
routinely use it for advanced applications, in particular video chat. This
vision confronts us with a multitude of hard technical nuts to crack such as
power efficiency, UI latency, quality-of-service of audio processing, drivers
for multi-media devices, WebRTC performance, and usability. This grand theme
will not only address the Pinephone specifically. The efficiency gains will
benefit all Genode use cases large and small.
:Pinephone:
By the end of the year, we want be able to use Genode on the
[https://pine64.com/product-category/pinephone/ - Pinephone]
as a feature phone, covering basic web-browsing needs, placing calls, and
SMS.
Our theme of the Genode-based video chat on the Pinephone fuels several
ambitions in closely related areas. In particular, we aspire using WireGuard
to secure private communication, and experiment with the operation of
hardware-based trust anchors as the basis for encrypted storage and
communication.
:Linux-device-driver environment re-imagined:
We are convinced that we have to dramatically reduce the engineering
effort needed to port device drivers from the Linux kernel to Genode. With
many years of driver-porting experience under our belts, we plan to condense
the lessons learned in the form of new tooling and documentation. This, in
turn, will hopefully pave the ground for more and more developers
contributing to Genode's device-driver coverage in the future.
:Developer experience:
Speaking of new developers, we see Genode's existing tool set as a barrier
because it requires a rather steep learning curve. Hence, this year, we will
have a fresh take on tooling and workflows. The starting point will be the
experimental [https://github.com/nfeske/goa - Goa] tool, which in principle
allows developers to use familiar build systems for Genode development. We
plan to extend Goa to cover more build systems, and shape the tool towards
system-integration tasks and quick compile-test cycles targeting embedded
devices.
:Optimization:
Motivated by usage scenarios like the Pinephone, we are eager to tap into
plenty of opportunities for optimization. Based on data gathered by improved
system tracing, we consider interface refinements to improve the batching of
I/O (file-system access, networking), micro-optimizations of hot code paths
(like TLS lookup, parsers, and allocators), as well as structural changes
(like the consolidation of low-level services).
:GPU support:
Distantly related to optimization, GPU support is an increasingly requested
feature. We already
[https://genode.org/documentation/release-notes/17.08#Hardware-accelerated_graphics_for_Intel_Gen-8_GPUs - wetted our toes]
in the past. But GPU support has not yet become routinely supported in
system scenarios like Sculpt OS. In 2021, we want to change that, making GPU
support a feature that can be relied on. We will primarily address Intel
graphics first but also explore GPUs on ARM-based devices.
Besides the Pinephone, we will steadily nurture the quality and scope of
driver support on PC hardware, which remains the primary platform for the
day-to-day use of Sculpt OS. So you can expect us to keep up with recent
generations of Intel-based hardware. In this area, we plan to make IOMMU
support available with kernels beyond NOVA, and explore the use of
power-management features like suspend-resume with Sculpt OS.
Milestones for 2021
Milestones for 2022
###################
In the following, we present a rough schedule of the planned work. As usual,
@@ -107,65 +97,45 @@ it is not set in stone. If you are interested in a particular line of work,
please get in touch.
February - Release 21.02
February - Release 22.02
========================
* Pluggable device drivers (NIC, WLAN, framebuffer, input)
* VirtualBox 6
* Sculpt: basic UI for the consistent block encrypter (CBE)
* 64-bit ARM
* VirtIO block-device support for virtual machines
* Base platform support for the Pine A64 board (kernel base framework)
* OpenGL in VirtualBox 6
* Sculpt OS as tool kit for special-purpose OS images
* Pinephone
* Modem access
* Touch-screen compatibility of Sculpt OS
May - Release 21.05
May - Release 22.05
===================
* Annual documentation update, including the "Genode Foundations" book
* GPU support
* MESA update
* Experiments on ARM (e.g., Vivante on i.MX8, or Mali-400 on A64)
* Sculpt OS on Pine A64 (USB, input, framebuffer, SD-card, networking)
* 64-bit ARM
* Platform-driver consolidation between ARM and x86
* PCI-express support for MNT Reform (i.MX8)
* Tool-chain update (e.g., switching to hard-float on ARM)
* Modernized client-side NIC and uplink APIs
* Goa
* Broadened architecture support and testing workflow
* API projects
* Inter-project dependencies
* Annual update of the "Genode Foundations" book
* Second edition of the "Genode Platforms" documentation
* WireGuard VPN
* Updated drivers for PC hardware (Wifi, Intel framebuffer, USB)
* New tracing tool with support for CTF and PCAP
* Pinephone telephony
August - Release 21.08
August - Release 22.08
======================
* Linux DDE re-imagined
* Improved tooling
* Exploring Goa-based development workflow
* GPU support
* GPU multiplexer for Intel Gen9 graphics
* Harmonization of GPU driver with Intel framebuffer driver
* Initial version of a custom kernel (Spunky) implemented in Ada/SPARK
* System-level tracing infrastructure for guiding and validating optimizations
* Pinephone
* Touchscreen and display
* Mobile web browser
* Goa
* CMake-based Qt5 applications
* QML-based applications
* Morph browser
* Media record and playback capabilities
* FPGA-powered DMA protection for the Zynq-7000 SoC
* Kernel-agnostic IOMMU support for PC hardware
* Optimized GUI latency and synchronization
November - Release 21.11
November - Release 22.11
========================
* Pinephone
* Mobile data connectivity (LTE)
* Phone calls (audio)
* SMS
* seL4
* Update to current kernel version, MCS scheduling
* Combining CAmkES with Genode
* SMMU (I/O-MMU for ARM) support for our custom (base-hw) kernel
* Multi-monitor support
* WebRTC-based video chat
* Power management
* Base mechanism for suspend-resume on PC hardware
* Support for hardware-based trust anchor for CBE and WireGuard
* Software-hardware co-design example for the Zynq-7000 SoC

View File

@@ -103,6 +103,10 @@ but build upon of each other:
The repository contains a server that uses a rump kernel to provide
various NetBSD file systems to Genode.
:'pc':
This source-code repository hosts device drivers that are specific for PC
platforms. It depends on the 'dde_linux' repository.
:'ports':
This source-code repository hosts ports of 3rd-party applications to

View File

@@ -6,22 +6,22 @@ FIASCO_SRC = $(L4_SRC_DIR)/kernel/fiasco
KERNEL_BUILD_OUTPUT_FILTER = 2>&1 | sed "s/^/ [fiasco] /"
KERNEL_CXXFLAGS = -std=gnu++98 -fno-delete-null-pointer-checks $(CXXWARN) \
-Wno-address-of-packed-member
$(FIASCO_BUILD_DIR):
$(VERBOSE_MK) set -o pipefail; \
MAKEFLAGS= $(MAKE) SYSTEM_TARGET="$(CROSS_DEV_PREFIX)" \
$(VERBOSE_MK) MAKEFLAGS= $(MAKE) SYSTEM_TARGET="$(CROSS_DEV_PREFIX)" \
$(VERBOSE_DIR) -C $(FIASCO_SRC) BUILDDIR=$@ \
$(KERNEL_BUILD_OUTPUT_FILTER)
$(VERBOSE)cp $(KERNEL_CONFIG) $@/globalconfig.out
$(VERBOSE_MK) set -o pipefail; \
MAKEFLAGS= $(MAKE) SYSTEM_TARGET="$(CROSS_DEV_PREFIX)" \
$(VERBOSE_MK) MAKEFLAGS= $(MAKE) SYSTEM_TARGET="$(CROSS_DEV_PREFIX)" \
$(VERBOSE_DIR) -C $@ oldconfig \
$(KERNEL_BUILD_OUTPUT_FILTER)
$(VERBOSE)cp $(KERNEL_CONFIG) $@/globalconfig.out
$(FIASCO): $(FIASCO_BUILD_DIR)
$(VERBOSE_MK) set -o pipefail; \
MAKEFLAGS= CFLAGS="-std=gnu89 $(CWARN)" \
CXXFLAGS="-std=gnu++98 -fno-delete-null-pointer-checks $(CXXWARN)" \
$(VERBOSE_MK) MAKEFLAGS= CFLAGS="-std=gnu89 $(CWARN)" \
CXXFLAGS="$(KERNEL_CXXFLAGS)" \
$(MAKE) SYSTEM_TARGET="$(CROSS_DEV_PREFIX)" \
$(VERBOSE_DIR) -C $(FIASCO_BUILD_DIR) \
$(KERNEL_BUILD_OUTPUT_FILTER)

View File

@@ -33,6 +33,9 @@ ifeq ($(VERBOSE),)
L4_VERBOSE = V=1
endif
# do not confuse third-party sub-makes
unexport .SHELLFLAGS
#
# Execute the rules in this file only at the second build stage when we know
# about the complete build settings, e.g., 'CROSS_DEV_PREFIX'.
@@ -61,8 +64,7 @@ CXXWARN = $(WARN) -Wno-bool-compare -Wno-c++11-compat -Wno-class-memaccess
# 'off64_t' type, which is used by bootstrap.
#
%.tag:
$(VERBOSE_MK) set -o pipefail; \
MAKEFLAGS= CPPFLAGS="$(CC_MARCH)" \
$(VERBOSE_MK) MAKEFLAGS= CPPFLAGS="$(CC_MARCH)" \
CFLAGS="$(CC_MARCH) -std=gnu89 $(CWARN)" \
CXXFLAGS="$(CC_MARCH) -D_GNU_SOURCE -std=gnu++98 $(CXXWARN)" \
ASFLAGS="$(CC_MARCH)" LDFLAGS="$(LD_MARCH)" \

View File

@@ -15,7 +15,7 @@ L4_BUILD_DIR := $(shell pwd)
.Makeconf.bid.old:
$(VERBOSE)mkdir -p $(dir $@)
$(VERBOSE)cp $(L4_CONFIG) $(@:.old=)
$(VERBOSE_MK) set -o pipefail; \
$(VERBOSE_MK) \
MAKEFLAGS= make $(VERBOSE_DIR) -C $(L4_SRC_DIR)/l4 \
O=$(L4_BUILD_DIR) SYSTEM_TARGET="$(CROSS_DEV_PREFIX)" oldconfig \
2>&1 | sed "s/^/ [l4build] /"

View File

@@ -1 +1 @@
2021-10-13 05c76f8a5e76e0cc76fd7336c7cf63836ecec35d
2022-04-12 515112b4fff8f569ab6194cabbde0dc8e8446c82

View File

@@ -46,6 +46,7 @@ class Genode::Platform_pd : public Address_space
enum {
VERSION_BITS = 10,
VERSION_MASK = (1 << VERSION_BITS) - 1,
PD_FIRST = 0x10,
PD_MAX = (1 << 11) - 1, /* leave 0x7ff free for L4_INVALID_ID */
PD_VERSION_MAX = (1 << 10) - 1,
@@ -101,7 +102,7 @@ class Genode::Platform_pd : public Address_space
unsigned version : VERSION_BITS;
Pd_alloc(bool r, bool f, unsigned v)
: reserved(r), free(f), version(v) { }
: reserved(r), free(f), version(v & VERSION_MASK) { }
Pd_alloc() : reserved(0), free(0), version(0) { }
};

View File

@@ -38,61 +38,67 @@ static inline bool can_use_super_page(addr_t, size_t)
}
addr_t Io_mem_session_component::_map_local(addr_t base, size_t size)
addr_t Io_mem_session_component::_map_local(addr_t phys_base, size_t size)
{
using namespace Fiasco;
auto map_io_region = [] (addr_t phys_base, addr_t local_base, size_t size)
{
using namespace Fiasco;
l4_threadid_t const sigma0 = sigma0_threadid;
unsigned offset = 0;
while (size) {
/*
* Call sigma0 for I/O region
*/
/* special case for page0, which is RAM in sigma0/x86 */
l4_umword_t const request = (phys_base + offset == 0)
? SIGMA0_REQ_FPAGE_RAM
: SIGMA0_REQ_FPAGE_IOMEM;
size_t const size_log2 = can_use_super_page(phys_base + offset, size)
? get_super_page_size_log2()
: get_page_size_log2();
l4_umword_t dw0 = 0, dw1 = 0;
l4_msgdope_t result { };
l4_msgtag_t tag { };
int const err =
l4_ipc_call_tag(sigma0,
L4_IPC_SHORT_MSG,
request,
l4_fpage(phys_base + offset, size_log2, 0, 0).fpage,
l4_msgtag(L4_MSGTAG_SIGMA0, 0, 0, 0),
L4_IPC_MAPMSG(local_base + offset, size_log2),
&dw0, &dw1,
L4_IPC_NEVER, &result, &tag);
if (err || !l4_ipc_fpage_received(result)) {
error("map_local failed err=", err, " "
"(", l4_ipc_fpage_received(result), ")");
return;
}
offset += 1 << size_log2;
size -= 1 << size_log2;
}
};
/* align large I/O dataspaces on a super-page boundary within core */
size_t alignment = (size >= get_super_page_size()) ? get_super_page_size_log2()
: get_page_size_log2();
size_t align = (size >= get_super_page_size()) ? get_super_page_size_log2()
: get_page_size_log2();
/* find appropriate region for mapping */
void *local_base = 0;
if (platform().region_alloc().alloc_aligned(size, &local_base, alignment).error())
return 0;
return platform().region_alloc().alloc_aligned(size, align).convert<addr_t>(
/* call sigma0 for I/O region */
int err;
l4_umword_t request;
l4_umword_t dw0, dw1;
l4_msgdope_t result;
l4_msgtag_t tag;
[&] (void *ptr) {
addr_t const core_local_base = (addr_t)ptr;
map_io_region(phys_base, core_local_base, size);
return core_local_base; },
l4_threadid_t sigma0 = sigma0_threadid;
unsigned offset = 0;
while (size) {
/* FIXME what about caching demands? */
/* FIXME what about read / write? */
/* special case for page0, which is RAM in sigma0/x86 */
if (base + offset == 0)
request = SIGMA0_REQ_FPAGE_RAM;
else
request = SIGMA0_REQ_FPAGE_IOMEM;
size_t page_size_log2 = get_page_size_log2();
if (can_use_super_page(base + offset, size))
page_size_log2 = get_super_page_size_log2();
err = l4_ipc_call_tag(sigma0,
L4_IPC_SHORT_MSG,
request,
l4_fpage(base + offset, page_size_log2, 0, 0).fpage,
l4_msgtag(L4_MSGTAG_SIGMA0, 0, 0, 0),
L4_IPC_MAPMSG((addr_t)local_base + offset, page_size_log2),
&dw0, &dw1,
L4_IPC_NEVER, &result, &tag);
if (err || !l4_ipc_fpage_received(result)) {
error("map_local failed err=", err, " "
"(", l4_ipc_fpage_received(result), ")");
return 0;
}
offset += 1 << page_size_log2;
size -= 1 << page_size_log2;
}
return (addr_t)local_base;
[&] (Range_allocator::Alloc_error) -> addr_t {
error("core-local mapping of memory-mapped I/O range failed");
return 0; });
}

View File

@@ -130,7 +130,7 @@ Irq_session_component::Irq_session_component(Range_allocator &irq_alloc,
if (msi)
throw Service_denied();
if (irq_alloc.alloc_addr(1, _irq_number).error()) {
if (irq_alloc.alloc_addr(1, _irq_number).failed()) {
error("unavailable IRQ ", _irq_number, " requested");
throw Service_denied();
}

View File

@@ -445,51 +445,42 @@ Platform::Platform()
fiasco_register_thread_name(core_thread.native_thread_id(),
core_thread.name().string());
/* core log as ROM module */
auto export_page_as_rom_module = [&] (auto rom_name, auto content_fn)
{
void * phys_ptr = nullptr;
unsigned const pages = 1;
size_t const log_size = pages << get_page_size_log2();
size_t const size = 1 << get_page_size_log2();
ram_alloc().alloc_aligned(size, get_page_size_log2()).with_result(
ram_alloc().alloc_aligned(log_size, &phys_ptr, get_page_size_log2());
addr_t const phys_addr = reinterpret_cast<addr_t>(phys_ptr);
[&] (void *phys_ptr) {
void * const core_local_ptr = phys_ptr;
addr_t const core_local_addr = phys_addr;
/* core-local memory is one-to-one mapped physical RAM */
addr_t const phys_addr = reinterpret_cast<addr_t>(phys_ptr);
void * const core_local_ptr = phys_ptr;
/* let one page free after the log buffer */
region_alloc().remove_range(core_local_addr, log_size + get_page_size());
region_alloc().remove_range((addr_t)core_local_ptr, size);
memset(core_local_ptr, 0, size);
content_fn(core_local_ptr, size);
memset(core_local_ptr, 0, log_size);
_rom_fs.insert(new (core_mem_alloc())
Rom_module(phys_addr, size, rom_name));
},
[&] (Range_allocator::Alloc_error) {
warning("failed to export ", rom_name, " as ROM module"); }
);
};
_rom_fs.insert(new (core_mem_alloc()) Rom_module(phys_addr, log_size,
"core_log"));
init_core_log(Core_log_range { core_local_addr, log_size } );
}
/* core log as ROM module */
export_page_as_rom_module("core_log",
[&] (void *core_local_ptr, size_t size) {
init_core_log(Core_log_range { (addr_t)core_local_ptr, size } ); });
/* export platform specific infos */
{
void * phys_ptr = nullptr;
size_t const size = 1 << get_page_size_log2();
if (ram_alloc().alloc_aligned(size, &phys_ptr,
get_page_size_log2()).ok()) {
addr_t const phys_addr = reinterpret_cast<addr_t>(phys_ptr);
addr_t const core_local_addr = phys_addr;
region_alloc().remove_range(core_local_addr, size);
Genode::Xml_generator xml(reinterpret_cast<char *>(core_local_addr),
size, "platform_info", [&] ()
{
xml.node("kernel", [&] () { xml.attribute("name", "fiasco"); });
});
_rom_fs.insert(new (core_mem_alloc()) Rom_module(phys_addr, size,
"platform_info"));
}
}
export_page_as_rom_module("platform_info",
[&] (void *core_local_ptr, size_t size) {
Xml_generator xml(reinterpret_cast<char *>(core_local_ptr),
size, "platform_info",
[&] () {
xml.node("kernel", [&] () {
xml.attribute("name", "fiasco"); }); }); });
}

View File

@@ -58,10 +58,13 @@ void Platform_pd::init()
void Platform_pd::_create_pd(bool syscall)
{
enum { TASK_ID_MASK = (1 << 11) - 1,
VERSION_LOW_MASK = (1 << 10) - 1 };
l4_threadid_t l4t = l4_myself();
l4t.id.task = _pd_id;
l4t.id.task = _pd_id & TASK_ID_MASK;
l4t.id.lthread = 0;
l4t.id.version_low = _version;
l4t.id.version_low = _version & VERSION_LOW_MASK;
l4_taskid_t nt;
if (syscall)
@@ -203,8 +206,10 @@ bool Platform_pd::bind_thread(Platform_thread &thread)
}
thread_id = t;
enum { LTHREAD_MASK = (1 << 7) - 1 };
l4_thread_id = _l4_task_id;
l4_thread_id.id.lthread = thread_id;
l4_thread_id.id.lthread = thread_id & LTHREAD_MASK;
/* finally inform thread about binding */
thread.bind(thread_id, l4_thread_id, *this);

View File

@@ -15,6 +15,10 @@
#define _INCLUDE__FIASCO__SYSCALL_H_
namespace Fiasco {
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wconversion"
#include <l4/sys/types.h>
#include <l4/sys/kdebug.h>
#include <l4/sys/ipc.h>
@@ -24,6 +28,8 @@ namespace Fiasco {
#include <l4/sys/ktrace.h>
#include <l4/sys/syscalls.h>
#include <l4/sigma0/sigma0.h>
#pragma GCC diagnostic pop /* restore -Wconversion warnings */
}
#endif /* _INCLUDE__FIASCO__SYSCALL_H_ */

View File

@@ -32,9 +32,9 @@ class Msg_header
private:
/* kernel-defined message header */
l4_fpage_t rcv_fpage; /* unused */
l4_msgdope_t size_dope;
l4_msgdope_t send_dope;
l4_fpage_t _rcv_fpage; /* unused */
l4_msgdope_t _size_dope;
l4_msgdope_t _send_dope;
public:
@@ -52,6 +52,8 @@ class Msg_header
enum { MAX_CAPS_PER_MSG = Msgbuf_base::MAX_CAPS_PER_MSG };
enum { SIZE_DOPE_MASK = 0x3ffff };
l4_threadid_t _cap_tid [MAX_CAPS_PER_MSG];
unsigned long _cap_local_name [MAX_CAPS_PER_MSG];
@@ -68,7 +70,7 @@ class Msg_header
public:
void *msg_start() { return &rcv_fpage; }
void *msg_start() { return &_rcv_fpage; }
/**
* Load header fields according to send-message buffer
@@ -79,7 +81,8 @@ class Msg_header
num_caps = min((unsigned)MAX_CAPS_PER_MSG, snd_msg.used_caps());
size_t const snd_words = snd_msg.data_size()/sizeof(l4_umword_t);
send_dope = L4_IPC_DOPE(_num_msg_words(snd_words), 0);
_send_dope = L4_IPC_DOPE(_num_msg_words(snd_words) & SIZE_DOPE_MASK, 0);
/* reset _cap_tid and _cap_local_name */
for (unsigned i = 0; i < MAX_CAPS_PER_MSG; i++) {
@@ -107,7 +110,7 @@ class Msg_header
{
size_t const rcv_max_words = rcv_msg.capacity()/sizeof(l4_umword_t);
size_dope = L4_IPC_DOPE(_num_msg_words(rcv_max_words), 0);
_size_dope = L4_IPC_DOPE(_num_msg_words(rcv_max_words) & SIZE_DOPE_MASK, 0);
}
/**
@@ -234,11 +237,8 @@ Genode::Rpc_request Genode::ipc_reply_wait(Reply_capability const &last_caller,
* error condition to the user but want to wait for the next proper
* incoming message.
*/
if (L4_IPC_IS_ERROR(ipc_result)) {
error("ipc_reply_and_wait error ", Hex(L4_IPC_ERROR(ipc_result)));
} else {
if (!L4_IPC_IS_ERROR(ipc_result))
need_to_wait = false;
}
}
while (need_to_wait) {

View File

@@ -25,8 +25,7 @@ using namespace Genode;
** Startup library support **
*****************************/
void prepare_init_main_thread() { }
void prepare_reinit_main_thread() { }
void prepare_init_main_thread() { }
/************

View File

@@ -14,6 +14,9 @@
#ifndef _INCLUDE__FOC__SYSCALL_H_
#define _INCLUDE__FOC__SYSCALL_H_
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wconversion"
namespace Foc {
#include <l4/sys/types.h>
#include <l4/sys/kip>
@@ -33,4 +36,6 @@ namespace Foc {
#include <l4/sigma0/sigma0.h>
}
#pragma GCC diagnostic pop /* restore -Wconversion warnings */
#endif /* _INCLUDE__FOC__SYSCALL_H_ */

View File

@@ -26,7 +26,7 @@ namespace Genode { struct Foc_thread_state; }
struct Genode::Foc_thread_state : Thread_state
{
Foc::l4_cap_idx_t kcap; /* thread's gate cap in its PD */
int id; /* ID of gate capability */
uint16_t id; /* ID of gate capability */
addr_t utcb; /* thread's UTCB in its PD */
/**

View File

@@ -8,15 +8,13 @@ MAKEOVERRIDES := $(filter-out KERNEL=%,$(MAKEOVERRIDES))
unexport KERNEL
$(FOC_BUILD_DIR):
$(VERBOSE_MK) set -o pipefail; \
$(MAKE) CROSS_COMPILE="$(CROSS_DEV_PREFIX)" \
$(VERBOSE_MK) $(MAKE) CROSS_COMPILE="$(CROSS_DEV_PREFIX)" \
$(VERBOSE_DIR) -C $(FOC_SRC) BUILDDIR=$@ \
$(KERNEL_BUILD_OUTPUT_FILTER)
$(VERBOSE)cp $(KERNEL_CONFIG) $@/globalconfig.out
$(FOC): $(FOC_BUILD_DIR)
$(VERBOSE_MK) set -o pipefail; \
$(MAKE) CROSS_COMPILE="$(CROSS_DEV_PREFIX)" \
$(VERBOSE_MK) $(MAKE) CROSS_COMPILE="$(CROSS_DEV_PREFIX)" \
CC="$(CC)" CXX="$(CXX)" \
$(VERBOSE_DIR) -C $(FOC_BUILD_DIR) \
$(KERNEL_BUILD_OUTPUT_FILTER)

View File

@@ -39,6 +39,9 @@ PKG_TAGS = $(addsuffix .tag,$(addsuffix .$(BOARD),$(PKGS)))
BUILD_OUTPUT_FILTER = 2>&1 | sed "s~^~ [$*] ~"
# do not confuse third-party sub-makes
unexport .SHELLFLAGS
#
# Execute the rules in this file only at the second build stage when we know
# about the complete build settings, e.g., 'CROSS_DEV_PREFIX'.
@@ -55,8 +58,7 @@ endif
.NOTPARALLEL: $(PKG_TAGS)
%.$(BOARD).tag:
$(VERBOSE_MK) set -o pipefail; \
$(MAKE) $(VERBOSE_DIR) O=$(L4_BUILD_DIR) -C $(L4_PKG_DIR)/$* \
$(VERBOSE_MK) $(MAKE) $(VERBOSE_DIR) O=$(L4_BUILD_DIR) -C $(L4_PKG_DIR)/$* \
"$(L4_BUILD_OPT)" WARNINGS=$(WARNINGS) $(BUILD_OUTPUT_FILTER)
$(VERBOSE)mkdir -p $(dir $@) && touch $@

View File

@@ -37,7 +37,7 @@ CC_OPT += -DL4SYS_USE_UTCB_WRAP=1 -Wno-unused-function
# build system will stuble over predefined variables, i.e., 'LIB'
#
$(L4_BUILD_DIR)/.kconfig:
$(VERBOSE_MK) set -o pipefail; \
$(VERBOSE_MK) \
MAKEFLAGS= $(MAKE) $(VERBOSE_DIR) -C $(L4_SRC_DIR)/l4 \
B=$(L4_BUILD_DIR) DROPSCONF_DEFCONFIG="$(L4_CONFIG)" \
VERBOSE="$(VERBOSE)" CROSS_COMPILE="$(CROSS_DEV_PREFIX)" \

View File

@@ -1 +1 @@
2021-10-13 0e3f2b9302333cb9bcabfb933a0ab142f41d070c
2022-04-12 b1e43bda46dcc2e180649bed9990230bbc6f5eb3

View File

@@ -1 +1 @@
2021-10-13 af7ceb5c77e20a66ed9f394526766b31a205d89d
2022-04-12 587953d4a135f958b156bf9ec31adfbc2c84881a

View File

@@ -1 +1 @@
2021-10-13 62af5bc4ad5747f1552f1c03882f756ec7f1d63c
2022-04-12 99c54bf391d7e438022b70b39ba175ee13a831f8

View File

@@ -1 +1 @@
2021-10-13 6bd8c055af6f1031539124d93164d0ae24f956c8
2022-04-12 4fe361144ecfe216246e5ba199f578c69ebbec57

View File

@@ -1 +1 @@
2021-10-13 dabb150f6be49ee72d2d5db160e8885ac7faddd0
2022-04-12 b920fe281256f366f1565444ba07bc136897ba06

View File

@@ -25,6 +25,12 @@ namespace Genode { class Cap_id_allocator; }
class Genode::Cap_id_allocator
{
public:
using id_t = uint16_t;
enum { ID_MASK = 0xffff };
private:
enum {
@@ -44,8 +50,8 @@ class Genode::Cap_id_allocator
Cap_id_allocator(Allocator &);
unsigned long alloc();
void free(unsigned long id);
id_t alloc();
void free(id_t id);
};
#endif /* _CORE__INCLUDE__CAP_ID_ALLOC_H_ */

View File

@@ -38,7 +38,7 @@ class Genode::Irq_object
Irq_session::Polarity _polarity; /* interrupt polarity */
unsigned _irq;
addr_t _msi_addr;
uint64_t _msi_addr;
addr_t _msi_data;
Signal_context_capability _sig_cap { };
@@ -53,8 +53,8 @@ class Genode::Irq_object
Irq_session::Trigger trigger() const { return _trigger; }
Irq_session::Polarity polarity() const { return _polarity; }
Genode::addr_t msi_address() const { return _msi_addr; }
Genode::addr_t msi_value() const { return _msi_data; }
uint64_t msi_address() const { return _msi_addr; }
addr_t msi_value() const { return _msi_data; }
void sigh(Genode::Signal_context_capability cap) { _sig_cap = cap; }
void notify() { Genode::Signal_transmitter(_sig_cap).submit(1); }

View File

@@ -45,7 +45,7 @@ namespace Genode {
using namespace Foc;
l4_fpage_t snd_fpage = l4_fpage(from_addr + offset,
page_size_log2, L4_FPAGE_RW);
(unsigned)page_size_log2, L4_FPAGE_RW);
if (l4_msgtag_has_error(l4_task_map(L4_BASE_TASK_CAP,
L4_BASE_TASK_CAP,
@@ -95,13 +95,13 @@ namespace Genode {
if (can_use_super_page(from_addr + offset, size))
page_size_log2 = get_super_page_size_log2();
l4_utcb_mr()->mr[1] = l4_fpage(from_addr + offset,
page_size_log2, L4_FPAGE_RWX).raw;
(unsigned)page_size_log2, L4_FPAGE_RWX).raw;
/* open receive window for mapping */
l4_utcb_br()->bdr = 0;
l4_utcb_br()->br[0] = L4_ITEM_MAP;
l4_utcb_br()->br[1] = l4_fpage((addr_t)to_addr + offset,
page_size_log2, L4_FPAGE_RWX).raw;
(unsigned)page_size_log2, L4_FPAGE_RWX).raw;
l4_msgtag_t tag = l4_msgtag(L4_PROTO_SIGMA0, 2, 0, 0);
tag = l4_ipc_call(L4_BASE_PAGER_CAP, l4_utcb(), tag, L4_IPC_NEVER);

View File

@@ -34,14 +34,18 @@ addr_t Io_mem_session_component::_map_local(addr_t base, size_t size)
: get_page_size_log2();
/* find appropriate region for mapping */
void *local_base = 0;
if (platform().region_alloc().alloc_aligned(size, &local_base, alignment).error())
return 0;
return platform().region_alloc().alloc_aligned(size, (unsigned)alignment).convert<addr_t>(
if (!map_local_io(base, (addr_t)local_base, size >> get_page_size_log2())) {
error("map_local_io failed");
return 0;
}
[&] (void *local_base) {
if (!map_local_io(base, (addr_t)local_base, size >> get_page_size_log2())) {
error("map_local_io failed");
platform().region_alloc().free(local_base, base);
return 0UL;
}
return (addr_t)local_base;
},
return (addr_t)local_base;
[&] (Range_allocator::Alloc_error) {
error("allocation of virtual memory for local I/O mapping failed");
return 0UL; });
}

View File

@@ -86,7 +86,7 @@ void Ipc_pager::wait_for_fault()
do {
_tag = l4_ipc_wait(l4_utcb(), &label, L4_IPC_NEVER);
int err = l4_ipc_error(_tag, l4_utcb());
l4_umword_t err = l4_ipc_error(_tag, l4_utcb());
if (!err) {
_parse(label);
return;
@@ -121,7 +121,7 @@ void Ipc_pager::reply_and_wait_for_fault()
};
l4_fpage_t const fpage = l4_fpage(_reply_mapping.src_addr,
_reply_mapping.size_log2,
(unsigned)_reply_mapping.size_log2,
rights(_reply_mapping.writeable,
_reply_mapping.executable));
@@ -129,7 +129,7 @@ void Ipc_pager::reply_and_wait_for_fault()
_tag = l4_ipc_send_and_wait(_last.kcap, l4_utcb(), snd_tag,
&label, L4_IPC_SEND_TIMEOUT_0);
int const err = l4_ipc_error(_tag, l4_utcb());
l4_umword_t const err = l4_ipc_error(_tag, l4_utcb());
if (err) {
error("Ipc error ", err, " in pagefault from ", Hex(label & ~0x3));
wait_for_fault();

View File

@@ -139,7 +139,7 @@ void Irq_object::ack_irq()
{
using namespace Foc;
int err;
l4_umword_t err;
l4_msgtag_t tag = l4_irq_unmask(_capability());
if ((err = l4_ipc_error(tag, l4_utcb())))
error("IRQ unmask: ", err);
@@ -148,7 +148,7 @@ void Irq_object::ack_irq()
Irq_object::Irq_object()
:
_cap(cap_map().insert(platform_specific().cap_id_alloc().alloc())),
_cap(cap_map().insert((Cap_index::id_t)platform_specific().cap_id_alloc().alloc())),
_trigger(Irq_session::TRIGGER_UNCHANGED),
_polarity(Irq_session::POLARITY_UNCHANGED),
_irq(~0U), _msi_addr(0), _msi_data(0)
@@ -170,7 +170,7 @@ Irq_object::~Irq_object()
if (l4_error(l4_irq_detach(_capability())))
error("cannot detach IRQ");
if (l4_error(l4_icu_unbind(L4_BASE_ICU_CAP, irq, _capability())))
if (l4_error(l4_icu_unbind(L4_BASE_ICU_CAP, (unsigned)irq, _capability())))
error("cannot unbind IRQ");
cap_map().remove(_cap);
@@ -184,7 +184,7 @@ Irq_object::~Irq_object()
Irq_session_component::Irq_session_component(Range_allocator &irq_alloc,
const char *args)
:
_irq_number(Arg_string::find_arg(args, "irq_number").long_value(-1)),
_irq_number((unsigned)Arg_string::find_arg(args, "irq_number").long_value(-1)),
_irq_alloc(irq_alloc), _irq_object()
{
long const msi = Arg_string::find_arg(args, "device_config_phys").long_value(0);
@@ -196,7 +196,7 @@ Irq_session_component::Irq_session_component(Range_allocator &irq_alloc,
}
msi_alloc.set(_irq_number, 1);
} else {
if (irq_alloc.alloc_addr(1, _irq_number).error()) {
if (irq_alloc.alloc_addr(1, _irq_number).failed()) {
error("unavailable IRQ ", _irq_number, " requested");
throw Service_denied();
}
@@ -252,7 +252,7 @@ Irq_session::Info Irq_session_component::info()
return {
.type = Genode::Irq_session::Info::Type::MSI,
.address = _irq_object.msi_address(),
.address = (addr_t)_irq_object.msi_address(),
.value = _irq_object.msi_value()
};
}
@@ -269,7 +269,7 @@ void Interrupt_handler::entry()
{
using namespace Foc;
int err;
l4_umword_t err;
l4_msgtag_t tag;
l4_umword_t label;

View File

@@ -293,14 +293,14 @@ void Platform::_setup_mem_alloc()
for ( ; beg < end; beg += L4_PAGESIZE) (void)(*beg);
/* request pages of known page size starting with largest */
size_t const log2_sizes[] = { L4_LOG2_SUPERPAGESIZE, L4_LOG2_PAGESIZE };
unsigned const log2_sizes[] = { L4_LOG2_SUPERPAGESIZE, L4_LOG2_PAGESIZE };
for (unsigned i = 0; i < sizeof(log2_sizes)/sizeof(*log2_sizes); ++i) {
size_t const log2_size = log2_sizes[i];
size_t const size = 1UL << log2_size;
unsigned const log2_size = log2_sizes[i];
size_t const size = 1UL << log2_size;
int err = 0;
addr_t addr = 0;
Foc::l4_umword_t err = 0;
addr_t addr = 0;
Region region;
/* request any page of current size from sigma0 */
@@ -467,75 +467,68 @@ Platform::Platform()
core_thread.pager(_sigma0);
_core_pd->bind_thread(core_thread);
/* export x86 platform specific infos */
auto export_page_as_rom_module = [&] (auto rom_name, auto content_fn)
{
void * core_local_ptr = nullptr;
void * phys_ptr = nullptr;
unsigned const pages = 1;
size_t const align = get_page_size_log2();
size_t const size = pages << get_page_size_log2();
size_t const pages = 1;
size_t const align = get_page_size_log2();
size_t const bytes = pages << get_page_size_log2();
ram_alloc().alloc_aligned(bytes, align).with_result(
if (ram_alloc().alloc_aligned(size, &phys_ptr, align).error())
return;
[&] (void *phys_ptr) {
if (region_alloc().alloc_aligned(size, &core_local_ptr, align).error())
return;
addr_t const phys_addr = reinterpret_cast<addr_t>(phys_ptr);
addr_t const phys_addr = reinterpret_cast<addr_t>(phys_ptr);
addr_t const core_local_addr = reinterpret_cast<addr_t>(core_local_ptr);
region_alloc().alloc_aligned(bytes, align).with_result(
[&] (void *core_local_ptr) {
if (!map_local(phys_addr, core_local_addr, pages))
return;
if (!map_local(phys_addr, (addr_t)core_local_ptr, pages)) {
warning("map_local failed while exporting ",
rom_name, " as ROM module");
ram_alloc().free(phys_ptr, bytes);
region_alloc().free(core_local_ptr, bytes);
return;
}
memset(core_local_ptr, 0, size);
memset(core_local_ptr, 0, bytes);
content_fn((char *)core_local_ptr, bytes);
Xml_generator xml(reinterpret_cast<char *>(core_local_addr),
pages << get_page_size_log2(),
"platform_info", [&] ()
{
xml.node("kernel", [&] () {
xml.attribute("name", "foc");
xml.attribute("acpi", true);
xml.attribute("msi" , true);
_rom_fs.insert(new (core_mem_alloc())
Rom_module(phys_addr, bytes, rom_name));
},
[&] (Range_allocator::Alloc_error) {
warning("failed allocate virtual memory to export ",
rom_name, " as ROM module");
ram_alloc().free(phys_ptr, bytes);
}
);
},
[&] (Range_allocator::Alloc_error) {
warning("failed to export ", rom_name, " as ROM module"); }
);
};
export_page_as_rom_module("platform_info",
[&] (char *core_local_ptr, size_t size) {
Xml_generator xml(core_local_ptr, size, "platform_info", [&] ()
{
xml.node("kernel", [&] () {
xml.attribute("name", "foc");
xml.attribute("acpi", true);
xml.attribute("msi" , true);
});
xml.node("hardware", [&] () {
_setup_platform_info(xml, sigma0_map_kip()); });
xml.node("affinity-space", [&] () {
xml.attribute("width", affinity_space().width());
xml.attribute("height", affinity_space().height()); });
});
xml.node("hardware", [&] () {
_setup_platform_info(xml, sigma0_map_kip()); });
}
);
xml.node("affinity-space", [&] () {
xml.attribute("width", affinity_space().width());
xml.attribute("height", affinity_space().height()); });
});
_rom_fs.insert(new (core_mem_alloc()) Rom_module(phys_addr, size,
"platform_info"));
}
/* core log as ROM module */
{
void * core_local_ptr = nullptr;
void * phys_ptr = nullptr;
unsigned const pages = 1;
size_t const align = get_page_size_log2();
size_t const size = pages << get_page_size_log2();
if (ram_alloc().alloc_aligned(size, &phys_ptr, align).error())
return;
if (region_alloc().alloc_aligned(size, &core_local_ptr, align).error())
return;
addr_t const phys_addr = reinterpret_cast<addr_t>(phys_ptr);
addr_t const core_local_addr = reinterpret_cast<addr_t>(core_local_ptr);
if (!map_local(phys_addr, core_local_addr, pages))
return;
memset(core_local_ptr, 0, size);
_rom_fs.insert(new (core_mem_alloc()) Rom_module(phys_addr, size,
"core_log"));
init_core_log(Core_log_range { core_local_addr, size } );
}
export_page_as_rom_module("core_log",
[&] (char *core_local_ptr, size_t size) {
init_core_log(Core_log_range { (addr_t)core_local_ptr, size } ); });
Affinity::Space const cpus = affinity_space();

View File

@@ -122,12 +122,13 @@ void Platform_pd::flush(addr_t, size_t size, Core_local_addr core_local)
static Native_capability debug_cap()
{
unsigned long const id = platform_specific().cap_id_alloc().alloc();
Cap_index::id_t const id = platform_specific().cap_id_alloc().alloc();
static Cap_index * idx = cap_map().insert(id, DEBUG_CAP);
static Native_capability debug_cap(reinterpret_cast<Core_cap_index*>(idx));
return debug_cap;
}
Platform_pd::Platform_pd(Core_cap_index &ci)
:
_task(Native_capability(&ci), TASK_CAP)

View File

@@ -32,7 +32,10 @@ using namespace Foc;
Trace::Execution_time Platform_thread::execution_time() const
{
Foc::l4_kernel_clock_t us = 0;
/* syscall does not return ever, if thread is on remote cpu,
see issue #4357
l4_thread_stats_time(_thread.local.data()->kcap(), &us);
*/
return { us, 0, 10000 /* quantum readable ?*/, _prio };
}
@@ -211,7 +214,7 @@ Foc_thread_state Platform_thread::state()
s = _pager_obj->state.state;
s.kcap = _gate.remote;
s.id = _gate.local.local_name();
s.id = (uint16_t)_gate.local.local_name();
s.utcb = _utcb;
return s;

View File

@@ -49,7 +49,7 @@ Cap_index_allocator &Genode::cap_idx_alloc()
Core_cap_index *Cap_mapping::_get_cap()
{
int const id = platform_specific().cap_id_alloc().alloc();
Cap_index::id_t const id = platform_specific().cap_id_alloc().alloc();
return static_cast<Core_cap_index*>(cap_map().insert(id));
}
@@ -104,7 +104,7 @@ Native_capability Rpc_cap_factory::alloc(Native_capability ep)
/*
* Allocate new id, and ipc-gate and set id as gate-label
*/
unsigned long const id = platform_specific().cap_id_alloc().alloc();
Cap_index::id_t const id = platform_specific().cap_id_alloc().alloc();
Core_cap_index *idx = static_cast<Core_cap_index*>(cap_map().insert(id));
if (!idx) {
@@ -194,19 +194,21 @@ Cap_id_allocator::Cap_id_allocator(Allocator &alloc)
}
unsigned long Cap_id_allocator::alloc()
Cap_id_allocator::id_t Cap_id_allocator::alloc()
{
Mutex::Guard lock_guard(_mutex);
void *id = nullptr;
if (_id_alloc.alloc(CAP_ID_OFFSET, &id))
return (unsigned long) id;
return _id_alloc.try_alloc(CAP_ID_OFFSET).convert<id_t>(
throw Out_of_ids();
[&] (void *id) -> id_t {
return (addr_t)id & ID_MASK; },
[&] (Range_allocator::Alloc_error) -> id_t {
throw Out_of_ids(); });
}
void Cap_id_allocator::free(unsigned long id)
void Cap_id_allocator::free(id_t id)
{
Mutex::Guard lock_guard(_mutex);

View File

@@ -41,7 +41,7 @@ void Signal_source_component::submit(Signal_context_component &context,
unsigned long cnt)
{
/* enqueue signal to context */
context.increment_signal_cnt(cnt);
context.increment_signal_cnt((int)cnt);
if (!context.enqueued()) {
_signal_queue.enqueue(context);

View File

@@ -78,14 +78,22 @@ void Thread::start()
Info trace_source_info() const override
{
uint64_t const sc_time = 0;
addr_t const kcap = (addr_t) platform_thread.pager_object_badge();
using namespace Foc;
l4_kernel_clock_t ec_time = 0;
l4_msgtag_t res = l4_thread_stats_time(kcap, &ec_time);
if (l4_error(res))
Genode::error("cpu time for ", thread.name(),
" is not available ", l4_error(res));
/*
* The 'l4_thread_stats_time' syscall does not always return if
* the thread is on remote CPU. Disable the feature to keep core
* safe (see issue #4357).
*/
if (0) {
addr_t const kcap = (addr_t) platform_thread.pager_object_badge();
l4_msgtag_t res = l4_thread_stats_time(kcap, &ec_time);
if (l4_error(res))
Genode::error("cpu time for ", thread.name(),
" is not available ", l4_error(res));
}
return { Session_label("core"), thread.name(),
Trace::Execution_time(ec_time, sc_time, 10000,

View File

@@ -49,7 +49,7 @@ Vcpu::Vcpu(Rpc_entrypoint &ep,
}
try {
unsigned const vcpu_id = _vcpu_ids.alloc();
unsigned const vcpu_id = (unsigned)_vcpu_ids.alloc();
_task_index_client = thread.setup_vcpu(vcpu_id, task_cap, recall_cap(),
_foc_vcpu_state);
if (_task_index_client == Foc::L4_INVALID_CAP) {
@@ -76,7 +76,7 @@ Vcpu::~Vcpu()
}
if (_foc_vcpu_state) {
unsigned const vcpu_id = ((addr_t)_foc_vcpu_state -
addr_t const vcpu_id = ((addr_t)_foc_vcpu_state -
Platform::VCPU_VIRT_EXT_START) / L4_PAGESIZE;
_vcpu_ids.free(vcpu_id);
}
@@ -176,7 +176,7 @@ void Vm_session_component::_attach_vm_memory(Dataspace_component &dsc,
using namespace Foc;
uint8_t flags = L4_FPAGE_RO;
if (dsc.writable() && attribute.writeable)
if (dsc.writeable() && attribute.writeable)
if (attribute.executable)
flags = L4_FPAGE_RWX;
else
@@ -187,7 +187,7 @@ void Vm_session_component::_attach_vm_memory(Dataspace_component &dsc,
Flexpage page = flex.page();
while (page.valid()) {
l4_fpage_t fp = l4_fpage(page.addr, page.log2_order, flags);
l4_fpage_t fp = l4_fpage(page.addr, (unsigned)page.log2_order, flags);
l4_msgtag_t msg = l4_task_map(_task_vcpu.local.data()->kcap(),
L4_BASE_TASK_CAP, fp,
l4_map_obj_control(page.hotspot,
@@ -210,7 +210,7 @@ void Vm_session_component::_detach_vm_memory(addr_t guest_phys, size_t size)
using namespace Foc;
l4_task_unmap(_task_vcpu.local.data()->kcap(),
l4_fpage(page.addr, page.log2_order, L4_FPAGE_RWX),
l4_fpage(page.addr, (unsigned)page.log2_order, L4_FPAGE_RWX),
L4_FP_ALL_SPACES);
page = flex.page();

View File

@@ -190,7 +190,7 @@ class Genode::Capability_map : private Noncopyable
* \param id the global capability id
* \return pointer of Cap_index when found, otherwise zero
*/
Cap_index* find(int id);
Cap_index* find(Cap_index::id_t id);
/**
* Create and insert a new Cap_index with a specific capability id
@@ -203,7 +203,7 @@ class Genode::Capability_map : private Noncopyable
* \return pointer to the new Cap_index object, or zero
* when allocation failed
*/
Cap_index* insert(int id);
Cap_index* insert(Cap_index::id_t id);
/**
@@ -217,7 +217,7 @@ class Genode::Capability_map : private Noncopyable
* \return pointer to the new Cap_index object, or zero
* when allocation failed
*/
Cap_index* insert(int id, addr_t kcap);
Cap_index* insert(Cap_index::id_t id, addr_t kcap);
/**
* Create and insert a new Cap_index with a specific capability id
@@ -236,7 +236,7 @@ class Genode::Capability_map : private Noncopyable
* with the same id exists and it's kernel-object
* differs to the one given by kcap
*/
Cap_index *insert_map(int id, addr_t kcap);
Cap_index *insert_map(Cap_index::id_t id, addr_t kcap);
/**
* Remove (resp. invalidate) a Cap_index object

View File

@@ -28,13 +28,17 @@
*/
class Genode::Native_capability::Data : public Avl_node<Data>
{
public:
using id_t = uint16_t;
private:
constexpr static uint16_t INVALID_ID = ~0;
constexpr static uint16_t UNUSED = 0;
uint8_t _ref_cnt; /* reference counter */
uint16_t _id; /* global capability id */
uint8_t _ref_cnt; /* reference counter */
id_t _id; /* global capability id */
public:
@@ -56,7 +60,7 @@ class Genode::Native_capability::Data : public Avl_node<Data>
************************/
bool higher(Data *n);
Data *find_by_id(uint16_t id);
Data *find_by_id(id_t id);
};
#endif /* _INCLUDE__BASE__INTERNAL__CAPABILITY_DATA_H_ */

View File

@@ -30,7 +30,7 @@ namespace Genode {
static inline Parent_capability parent_cap()
{
unsigned long const local_name = _parent_cap;
Cap_index::id_t const local_name = (Cap_index::id_t)_parent_cap;
static Cap_index *i = cap_map().insert(local_name, Foc::PARENT_CAP);
/*

View File

@@ -104,7 +104,7 @@ uint8_t Cap_index::dec()
** Capability_map class **
****************************/
Cap_index* Capability_map::find(int id)
Cap_index* Capability_map::find(Cap_index::id_t id)
{
Lock_guard<Spin_lock> guard(_lock);
@@ -112,7 +112,7 @@ Cap_index* Capability_map::find(int id)
}
Cap_index* Capability_map::insert(int id)
Cap_index* Capability_map::insert(Cap_index::id_t id)
{
Lock_guard<Spin_lock> guard(_lock);
@@ -128,7 +128,7 @@ Cap_index* Capability_map::insert(int id)
}
Cap_index* Capability_map::insert(int id, addr_t kcap)
Cap_index* Capability_map::insert(Cap_index::id_t id, addr_t kcap)
{
Lock_guard<Spin_lock> guard(_lock);
@@ -146,7 +146,7 @@ Cap_index* Capability_map::insert(int id, addr_t kcap)
}
Cap_index* Capability_map::insert_map(int id, addr_t kcap)
Cap_index* Capability_map::insert_map(Cap_index::id_t id, addr_t kcap)
{
using namespace Foc;

View File

@@ -49,13 +49,13 @@ enum Debug { DEBUG_MSG = 1 };
static inline bool ipc_error(l4_msgtag_t tag, bool print)
{
int const ipc_error = l4_ipc_error(tag, l4_utcb());
Foc::l4_umword_t const ipc_error = l4_ipc_error(tag, l4_utcb());
if (ipc_error && print) raw("Ipc error: ", ipc_error, " occurred!");
return ipc_error;
}
static constexpr unsigned long INVALID_BADGE = ~0UL;
static constexpr Cap_index::id_t INVALID_BADGE = 0xffff;
/**
@@ -63,9 +63,9 @@ static constexpr unsigned long INVALID_BADGE = ~0UL;
*/
struct Cap_info
{
bool valid = false;
unsigned long sel = 0;
unsigned long badge = 0;
bool valid = false;
unsigned long sel = 0;
Cap_index::id_t badge = 0;
};
@@ -74,9 +74,9 @@ struct Cap_info
*
* \return protocol word (local name or exception code)
*/
static unsigned long extract_msg_from_utcb(l4_msgtag_t tag,
Receive_window &rcv_window,
Msgbuf_base &rcv_msg)
static int extract_msg_from_utcb(l4_msgtag_t tag,
Receive_window &rcv_window,
Msgbuf_base &rcv_msg)
{
unsigned num_msg_words = l4_msgtag_words(tag);
@@ -90,7 +90,7 @@ static unsigned long extract_msg_from_utcb(l4_msgtag_t tag,
unsigned long const protocol_word = *msg_words++;
/* read number of capability arguments from second message word */
size_t const num_caps = min(*msg_words, Msgbuf_base::MAX_CAPS_PER_MSG);
unsigned const num_caps = (unsigned)min(*msg_words, Msgbuf_base::MAX_CAPS_PER_MSG);
msg_words++;
num_msg_words -= 2;
@@ -114,7 +114,7 @@ static unsigned long extract_msg_from_utcb(l4_msgtag_t tag,
for (unsigned i = 0, sel_idx = 0; i < num_caps; i++) {
unsigned long const badge = *msg_words++;
Cap_index::id_t const badge = (Cap_index::id_t)(*msg_words++);
if (badge == INVALID_BADGE)
continue;
@@ -135,7 +135,7 @@ static unsigned long extract_msg_from_utcb(l4_msgtag_t tag,
if ((num_msg_words)*sizeof(l4_mword_t) > rcv_msg.capacity()) {
if (DEBUG_MSG)
raw("receive message buffer too small");
num_msg_words = rcv_msg.capacity()/sizeof(l4_mword_t);
num_msg_words = (unsigned)(rcv_msg.capacity()/sizeof(l4_mword_t));
}
/* read message payload beginning from the second UTCB message register */
@@ -160,7 +160,7 @@ static unsigned long extract_msg_from_utcb(l4_msgtag_t tag,
}
}
return protocol_word;
return (int)protocol_word;
}
@@ -175,8 +175,8 @@ static l4_msgtag_t copy_msgbuf_to_utcb(Msgbuf_base &snd_msg,
unsigned long protocol_word)
{
unsigned const num_data_words = snd_msg.data_size() / sizeof(l4_mword_t);
unsigned const num_caps = snd_msg.used_caps();
unsigned const num_data_words = (unsigned)(snd_msg.data_size() / sizeof(l4_mword_t));
unsigned const num_caps = (unsigned)snd_msg.used_caps();
/* validate capabilities present in the message buffer */
for (unsigned i = 0; i < num_caps; i++) {
@@ -201,7 +201,7 @@ static l4_msgtag_t copy_msgbuf_to_utcb(Msgbuf_base &snd_msg,
Native_capability const &cap = snd_msg.cap(i);
if (cap.valid()) {
caps[i].valid = true;
caps[i].badge = cap.local_name();
caps[i].badge = (Cap_index::id_t)cap.local_name();
caps[i].sel = cap.data()->kcap();
}
}

View File

@@ -38,14 +38,6 @@ void prepare_init_main_thread()
}
void prepare_reinit_main_thread()
{
construct_at<Capability_map>(&cap_map());
cap_idx_alloc().reinit();
prepare_init_main_thread();
}
/************
** Thread **
************/

View File

@@ -29,9 +29,12 @@
#include <foc/native_capability.h>
namespace Foc {
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wconversion"
#include <l4/sys/vcpu.h>
#include <l4/sys/__vm-svm.h>
#include <l4/sys/__vm-vmx.h>
#pragma GCC diagnostic pop /* restore -Wconversion warnings */
}
using namespace Genode;
@@ -218,9 +221,9 @@ struct Foc_vcpu : Thread, Noncopyable
CR0_PG = 0 /* 1U << 31 - not needed in case of UG */
};
addr_t const _cr0_mask { CR0_NM | CR0_CD };
addr_t const vmcb_ctrl0 { CTRL0_IO | CTRL0_MSR };
addr_t const vmcb_ctrl1 { 0 };
addr_t const _cr0_mask { CR0_NM | CR0_CD };
uint32_t const vmcb_ctrl0 { CTRL0_IO | CTRL0_MSR };
uint32_t const vmcb_ctrl1 { 0 };
addr_t vmcb_cr0_shadow { 0 };
addr_t vmcb_cr4_shadow { 0 };
@@ -481,7 +484,7 @@ struct Foc_vcpu : Thread, Noncopyable
* Convert to AMD (and Genode) format comprising 16 bits.
*/
uint16_t _convert_ar_16(addr_t value) {
return ((value & 0x1f000) >> 4) | (value & 0xff); }
return (uint16_t)(((value & 0x1f000) >> 4) | (value & 0xff)); }
void _read_intel_state(Vcpu_state &state, void *vmcs,
Foc::l4_vcpu_state_t *vcpu)
@@ -495,18 +498,15 @@ struct Foc_vcpu : Thread, Noncopyable
state.di.charge(vcpu->r.di);
state.si.charge(vcpu->r.si);
state.flags.charge(Foc::l4_vm_vmx_read(vmcs, Vmcs::FLAGS));
state.sp.charge(Foc::l4_vm_vmx_read(vmcs, Vmcs::SP));
state.ip.charge(Foc::l4_vm_vmx_read(vmcs, Vmcs::IP));
state.ip_len.charge(Foc::l4_vm_vmx_read(vmcs, Vmcs::INST_LEN));
state.dr7.charge(Foc::l4_vm_vmx_read(vmcs, Vmcs::DR7));
state.flags .charge((addr_t)Foc::l4_vm_vmx_read(vmcs, Vmcs::FLAGS));
state.sp .charge((addr_t)Foc::l4_vm_vmx_read(vmcs, Vmcs::SP));
state.ip .charge((addr_t)Foc::l4_vm_vmx_read(vmcs, Vmcs::IP));
state.ip_len.charge((addr_t)Foc::l4_vm_vmx_read(vmcs, Vmcs::INST_LEN));
state.dr7 .charge((addr_t)Foc::l4_vm_vmx_read(vmcs, Vmcs::DR7));
#ifdef __x86_64__
state.r8.charge(vcpu->r.r8);
state.r9.charge(vcpu->r.r9);
state.r8 .charge(vcpu->r.r8);
state.r9 .charge(vcpu->r.r9);
state.r10.charge(vcpu->r.r10);
state.r11.charge(vcpu->r.r11);
state.r12.charge(vcpu->r.r12);
@@ -516,21 +516,25 @@ struct Foc_vcpu : Thread, Noncopyable
#endif
{
addr_t const cr0 = Foc::l4_vm_vmx_read(vmcs, Vmcs::CR0);
addr_t const cr0_shadow = Foc::l4_vm_vmx_read(vmcs, Vmcs::CR0_SHADOW);
addr_t const cr0 = (addr_t)Foc::l4_vm_vmx_read(vmcs, Vmcs::CR0);
addr_t const cr0_shadow = (addr_t)Foc::l4_vm_vmx_read(vmcs, Vmcs::CR0_SHADOW);
state.cr0.charge((cr0 & ~vmcs_cr0_mask) | (cr0_shadow & vmcs_cr0_mask));
if (state.cr0.value() != cr0_shadow)
Foc::l4_vm_vmx_write(vmcs, Vmcs::CR0_SHADOW, state.cr0.value());
}
unsigned const cr2 = Foc::l4_vm_vmx_get_cr2_index(vmcs);
state.cr2.charge(Foc::l4_vm_vmx_read(vmcs, cr2));
state.cr3.charge(Foc::l4_vm_vmx_read(vmcs, Vmcs::CR3));
state.cr2.charge((addr_t)Foc::l4_vm_vmx_read(vmcs, cr2));
state.cr3.charge((addr_t)Foc::l4_vm_vmx_read(vmcs, Vmcs::CR3));
{
addr_t const cr4 = Foc::l4_vm_vmx_read(vmcs, Vmcs::CR4);
addr_t const cr4_shadow = Foc::l4_vm_vmx_read(vmcs, Vmcs::CR4_SHADOW);
addr_t const cr4 = (addr_t)Foc::l4_vm_vmx_read(vmcs, Vmcs::CR4);
addr_t const cr4_shadow = (addr_t)Foc::l4_vm_vmx_read(vmcs, Vmcs::CR4_SHADOW);
state.cr4.charge((cr4 & ~vmcs_cr4_mask) | (cr4_shadow & vmcs_cr4_mask));
if (state.cr4.value() != cr4_shadow)
Foc::l4_vm_vmx_write(vmcs, Vmcs::CR4_SHADOW,
state.cr4.value());
@@ -545,7 +549,7 @@ struct Foc_vcpu : Thread, Noncopyable
{
Segment cs { l4_vm_vmx_read_16(vmcs, Vmcs::CS_SEL),
_convert_ar_16(l4_vm_vmx_read(vmcs, Vmcs::CS_AR)),
_convert_ar_16((addr_t)l4_vm_vmx_read(vmcs, Vmcs::CS_AR)),
l4_vm_vmx_read_32(vmcs, Vmcs::CS_LIMIT),
l4_vm_vmx_read_nat(vmcs, Vmcs::CS_BASE) };
@@ -554,7 +558,7 @@ struct Foc_vcpu : Thread, Noncopyable
{
Segment ss { l4_vm_vmx_read_16(vmcs, Vmcs::SS_SEL),
_convert_ar_16(l4_vm_vmx_read(vmcs, Vmcs::SS_AR)),
_convert_ar_16((addr_t)l4_vm_vmx_read(vmcs, Vmcs::SS_AR)),
l4_vm_vmx_read_32(vmcs, Vmcs::SS_LIMIT),
l4_vm_vmx_read_nat(vmcs, Vmcs::SS_BASE) };
@@ -563,7 +567,7 @@ struct Foc_vcpu : Thread, Noncopyable
{
Segment es { l4_vm_vmx_read_16(vmcs, Vmcs::ES_SEL),
_convert_ar_16(l4_vm_vmx_read(vmcs, Vmcs::ES_AR)),
_convert_ar_16((addr_t)l4_vm_vmx_read(vmcs, Vmcs::ES_AR)),
l4_vm_vmx_read_32(vmcs, Vmcs::ES_LIMIT),
l4_vm_vmx_read_nat(vmcs, Vmcs::ES_BASE) };
@@ -572,7 +576,7 @@ struct Foc_vcpu : Thread, Noncopyable
{
Segment ds { l4_vm_vmx_read_16(vmcs, Vmcs::DS_SEL),
_convert_ar_16(l4_vm_vmx_read(vmcs, Vmcs::DS_AR)),
_convert_ar_16((addr_t)l4_vm_vmx_read(vmcs, Vmcs::DS_AR)),
l4_vm_vmx_read_32(vmcs, Vmcs::DS_LIMIT),
l4_vm_vmx_read_nat(vmcs, Vmcs::DS_BASE) };
@@ -581,7 +585,7 @@ struct Foc_vcpu : Thread, Noncopyable
{
Segment fs { l4_vm_vmx_read_16(vmcs, Vmcs::FS_SEL),
_convert_ar_16(l4_vm_vmx_read(vmcs, Vmcs::FS_AR)),
_convert_ar_16((addr_t)l4_vm_vmx_read(vmcs, Vmcs::FS_AR)),
l4_vm_vmx_read_32(vmcs, Vmcs::FS_LIMIT),
l4_vm_vmx_read_nat(vmcs, Vmcs::FS_BASE) };
@@ -590,7 +594,7 @@ struct Foc_vcpu : Thread, Noncopyable
{
Segment gs { l4_vm_vmx_read_16(vmcs, Vmcs::GS_SEL),
_convert_ar_16(l4_vm_vmx_read(vmcs, Vmcs::GS_AR)),
_convert_ar_16((addr_t)l4_vm_vmx_read(vmcs, Vmcs::GS_AR)),
l4_vm_vmx_read_32(vmcs, Vmcs::GS_LIMIT),
l4_vm_vmx_read_nat(vmcs, Vmcs::GS_BASE) };
@@ -599,7 +603,7 @@ struct Foc_vcpu : Thread, Noncopyable
{
Segment tr { l4_vm_vmx_read_16(vmcs, Vmcs::TR_SEL),
_convert_ar_16(l4_vm_vmx_read(vmcs, Vmcs::TR_AR)),
_convert_ar_16((addr_t)l4_vm_vmx_read(vmcs, Vmcs::TR_AR)),
l4_vm_vmx_read_32(vmcs, Vmcs::TR_LIMIT),
l4_vm_vmx_read_nat(vmcs, Vmcs::TR_BASE) };
@@ -608,7 +612,7 @@ struct Foc_vcpu : Thread, Noncopyable
{
Segment ldtr { l4_vm_vmx_read_16(vmcs, Vmcs::LDTR_SEL),
_convert_ar_16(l4_vm_vmx_read(vmcs, Vmcs::LDTR_AR)),
_convert_ar_16((addr_t)l4_vm_vmx_read(vmcs, Vmcs::LDTR_AR)),
l4_vm_vmx_read_32(vmcs, Vmcs::LDTR_LIMIT),
l4_vm_vmx_read_nat(vmcs, Vmcs::LDTR_BASE) };
@@ -621,35 +625,35 @@ struct Foc_vcpu : Thread, Noncopyable
state.idtr.charge(Range{.limit = l4_vm_vmx_read_32(vmcs, Vmcs::IDTR_LIMIT),
.base = l4_vm_vmx_read_nat(vmcs, Vmcs::IDTR_BASE)});
state.sysenter_cs.charge(l4_vm_vmx_read(vmcs, Vmcs::SYSENTER_CS));
state.sysenter_sp.charge(l4_vm_vmx_read(vmcs, Vmcs::SYSENTER_SP));
state.sysenter_ip.charge(l4_vm_vmx_read(vmcs, Vmcs::SYSENTER_IP));
state.sysenter_cs.charge((addr_t)l4_vm_vmx_read(vmcs, Vmcs::SYSENTER_CS));
state.sysenter_sp.charge((addr_t)l4_vm_vmx_read(vmcs, Vmcs::SYSENTER_SP));
state.sysenter_ip.charge((addr_t)l4_vm_vmx_read(vmcs, Vmcs::SYSENTER_IP));
state.qual_primary.charge(l4_vm_vmx_read(vmcs, Vmcs::EXIT_QUAL));
state.qual_primary .charge(l4_vm_vmx_read(vmcs, Vmcs::EXIT_QUAL));
state.qual_secondary.charge(l4_vm_vmx_read(vmcs, Vmcs::GUEST_PHYS));
state.ctrl_primary.charge(l4_vm_vmx_read(vmcs, Vmcs::CTRL_0));
state.ctrl_secondary.charge(l4_vm_vmx_read(vmcs, Vmcs::CTRL_1));
state.ctrl_primary .charge((uint32_t)l4_vm_vmx_read(vmcs, Vmcs::CTRL_0));
state.ctrl_secondary.charge((uint32_t)l4_vm_vmx_read(vmcs, Vmcs::CTRL_1));
if (state.exit_reason == INTEL_EXIT_INVALID ||
state.exit_reason == VMEXIT_PAUSED)
{
state.inj_info.charge(l4_vm_vmx_read(vmcs, Vmcs::INTR_INFO));
state.inj_error.charge(l4_vm_vmx_read(vmcs, Vmcs::INTR_ERROR));
state.inj_info .charge((uint32_t)l4_vm_vmx_read(vmcs, Vmcs::INTR_INFO));
state.inj_error.charge((uint32_t)l4_vm_vmx_read(vmcs, Vmcs::INTR_ERROR));
} else {
state.inj_info.charge(l4_vm_vmx_read(vmcs, Vmcs::IDT_INFO));
state.inj_error.charge(l4_vm_vmx_read(vmcs, Vmcs::IDT_ERROR));
state.inj_info .charge((uint32_t)l4_vm_vmx_read(vmcs, Vmcs::IDT_INFO));
state.inj_error.charge((uint32_t)l4_vm_vmx_read(vmcs, Vmcs::IDT_ERROR));
}
state.intr_state.charge(l4_vm_vmx_read(vmcs, Vmcs::STATE_INTR));
state.actv_state.charge(l4_vm_vmx_read(vmcs, Vmcs::STATE_ACTV));
state.intr_state.charge((uint32_t)l4_vm_vmx_read(vmcs, Vmcs::STATE_INTR));
state.actv_state.charge((uint32_t)l4_vm_vmx_read(vmcs, Vmcs::STATE_ACTV));
state.tsc.charge(Trace::timestamp());
state.tsc_offset.charge(_tsc_offset);
state.efer.charge(l4_vm_vmx_read(vmcs, Vmcs::EFER));
state.efer.charge((addr_t)l4_vm_vmx_read(vmcs, Vmcs::EFER));
state.star.charge(l4_vm_vmx_read(vmcs, Vmcs::MSR_STAR));
state.star .charge(l4_vm_vmx_read(vmcs, Vmcs::MSR_STAR));
state.lstar.charge(l4_vm_vmx_read(vmcs, Vmcs::MSR_LSTAR));
state.cstar.charge(l4_vm_vmx_read(vmcs, Vmcs::MSR_CSTAR));
state.fmask.charge(l4_vm_vmx_read(vmcs, Vmcs::MSR_FMASK));
@@ -665,7 +669,7 @@ struct Foc_vcpu : Thread, Noncopyable
void _read_amd_state(Vcpu_state &state, Foc::l4_vm_svm_vmcb_t *vmcb,
Foc::l4_vcpu_state_t * const vcpu)
{
state.ax.charge(vmcb->state_save_area.rax);
state.ax.charge((addr_t)vmcb->state_save_area.rax);
state.cx.charge(vcpu->r.cx);
state.dx.charge(vcpu->r.dx);
state.bx.charge(vcpu->r.bx);
@@ -674,18 +678,18 @@ struct Foc_vcpu : Thread, Noncopyable
state.si.charge(vcpu->r.si);
state.bp.charge(vcpu->r.bp);
state.flags.charge(vmcb->state_save_area.rflags);
state.flags.charge((addr_t)vmcb->state_save_area.rflags);
state.sp.charge(vmcb->state_save_area.rsp);
state.sp.charge((addr_t)vmcb->state_save_area.rsp);
state.ip.charge(vmcb->state_save_area.rip);
state.ip.charge((addr_t)vmcb->state_save_area.rip);
state.ip_len.charge(0); /* unsupported on AMD */
state.dr7.charge(vmcb->state_save_area.dr7);
state.dr7.charge((addr_t)vmcb->state_save_area.dr7);
#ifdef __x86_64__
state.r8.charge(vcpu->r.r8);
state.r9.charge(vcpu->r.r9);
state.r8 .charge(vcpu->r.r8);
state.r9 .charge(vcpu->r.r9);
state.r10.charge(vcpu->r.r10);
state.r11.charge(vcpu->r.r11);
state.r12.charge(vcpu->r.r12);
@@ -695,15 +699,15 @@ struct Foc_vcpu : Thread, Noncopyable
#endif
{
addr_t const cr0 = vmcb->state_save_area.cr0;
addr_t const cr0 = (addr_t)vmcb->state_save_area.cr0;
state.cr0.charge((cr0 & ~vmcb_cr0_mask) | (vmcb_cr0_shadow & vmcb_cr0_mask));
if (state.cr0.value() != vmcb_cr0_shadow)
vmcb_cr0_shadow = state.cr0.value();
}
state.cr2.charge(vmcb->state_save_area.cr2);
state.cr3.charge(vmcb->state_save_area.cr3);
state.cr2.charge((addr_t)vmcb->state_save_area.cr2);
state.cr3.charge((addr_t)vmcb->state_save_area.cr3);
{
addr_t const cr4 = vmcb->state_save_area.cr4;
addr_t const cr4 = (addr_t)vmcb->state_save_area.cr4;
state.cr4.charge((cr4 & ~vmcb_cr4_mask) | (vmcb_cr4_shadow & vmcb_cr4_mask));
if (state.cr4.value() != vmcb_cr4_shadow)
vmcb_cr4_shadow = state.cr4.value();
@@ -712,44 +716,44 @@ struct Foc_vcpu : Thread, Noncopyable
typedef Vcpu_state::Segment Segment;
state.cs.charge(Segment{vmcb->state_save_area.cs.selector,
vmcb->state_save_area.cs.attrib,
vmcb->state_save_area.cs.limit,
(addr_t)vmcb->state_save_area.cs.base});
vmcb->state_save_area.cs.attrib,
vmcb->state_save_area.cs.limit,
(addr_t)vmcb->state_save_area.cs.base});
state.ss.charge(Segment{vmcb->state_save_area.ss.selector,
vmcb->state_save_area.ss.attrib,
vmcb->state_save_area.ss.limit,
(addr_t)vmcb->state_save_area.ss.base});
vmcb->state_save_area.ss.attrib,
vmcb->state_save_area.ss.limit,
(addr_t)vmcb->state_save_area.ss.base});
state.es.charge(Segment{vmcb->state_save_area.es.selector,
vmcb->state_save_area.es.attrib,
vmcb->state_save_area.es.limit,
(addr_t)vmcb->state_save_area.es.base});
vmcb->state_save_area.es.attrib,
vmcb->state_save_area.es.limit,
(addr_t)vmcb->state_save_area.es.base});
state.ds.charge(Segment{vmcb->state_save_area.ds.selector,
vmcb->state_save_area.ds.attrib,
vmcb->state_save_area.ds.limit,
(addr_t)vmcb->state_save_area.ds.base});
vmcb->state_save_area.ds.attrib,
vmcb->state_save_area.ds.limit,
(addr_t)vmcb->state_save_area.ds.base});
state.fs.charge(Segment{vmcb->state_save_area.fs.selector,
vmcb->state_save_area.fs.attrib,
vmcb->state_save_area.fs.limit,
(addr_t)vmcb->state_save_area.fs.base});
vmcb->state_save_area.fs.attrib,
vmcb->state_save_area.fs.limit,
(addr_t)vmcb->state_save_area.fs.base});
state.gs.charge(Segment{vmcb->state_save_area.gs.selector,
vmcb->state_save_area.gs.attrib,
vmcb->state_save_area.gs.limit,
(addr_t)vmcb->state_save_area.gs.base});
vmcb->state_save_area.gs.attrib,
vmcb->state_save_area.gs.limit,
(addr_t)vmcb->state_save_area.gs.base});
state.tr.charge(Segment{vmcb->state_save_area.tr.selector,
vmcb->state_save_area.tr.attrib,
vmcb->state_save_area.tr.limit,
(addr_t)vmcb->state_save_area.tr.base});
vmcb->state_save_area.tr.attrib,
vmcb->state_save_area.tr.limit,
(addr_t)vmcb->state_save_area.tr.base});
state.ldtr.charge(Segment{vmcb->state_save_area.ldtr.selector,
vmcb->state_save_area.ldtr.attrib,
vmcb->state_save_area.ldtr.limit,
(addr_t)vmcb->state_save_area.ldtr.base});
vmcb->state_save_area.ldtr.attrib,
vmcb->state_save_area.ldtr.limit,
(addr_t)vmcb->state_save_area.ldtr.base});
typedef Vcpu_state::Range Range;
@@ -759,11 +763,11 @@ struct Foc_vcpu : Thread, Noncopyable
state.idtr.charge(Range{.limit = vmcb->state_save_area.idtr.limit,
.base = (addr_t)vmcb->state_save_area.idtr.base });
state.sysenter_cs.charge(vmcb->state_save_area.sysenter_cs);
state.sysenter_sp.charge(vmcb->state_save_area.sysenter_esp);
state.sysenter_ip.charge(vmcb->state_save_area.sysenter_eip);
state.sysenter_cs.charge((addr_t)vmcb->state_save_area.sysenter_cs);
state.sysenter_sp.charge((addr_t)vmcb->state_save_area.sysenter_esp);
state.sysenter_ip.charge((addr_t)vmcb->state_save_area.sysenter_eip);
state.qual_primary.charge(vmcb->control_area.exitinfo1);
state.qual_primary .charge(vmcb->control_area.exitinfo1);
state.qual_secondary.charge(vmcb->control_area.exitinfo2);
uint32_t inj_info = 0;
@@ -771,22 +775,22 @@ struct Foc_vcpu : Thread, Noncopyable
if (state.exit_reason == AMD_EXIT_INVALID ||
state.exit_reason == VMEXIT_PAUSED)
{
inj_info = vmcb->control_area.eventinj;
inj_error = vmcb->control_area.eventinj >> 32;
inj_info = (uint32_t)vmcb->control_area.eventinj;
inj_error = (uint32_t)(vmcb->control_area.eventinj >> 32);
} else {
inj_info = vmcb->control_area.exitintinfo;
inj_error = vmcb->control_area.exitintinfo >> 32;
inj_info = (uint32_t)vmcb->control_area.exitintinfo;
inj_error = (uint32_t)(vmcb->control_area.exitintinfo >> 32);
}
state.inj_info.charge(inj_info);
state.inj_info .charge(inj_info);
state.inj_error.charge(inj_error);
state.intr_state.charge(vmcb->control_area.interrupt_shadow);
state.intr_state.charge((uint32_t)vmcb->control_area.interrupt_shadow);
state.actv_state.charge(0);
state.tsc.charge(Trace::timestamp());
state.tsc_offset.charge(_tsc_offset);
state.efer.charge(vmcb->state_save_area.efer);
state.efer.charge((addr_t)vmcb->state_save_area.efer);
if (state.pdpte_0.charged() || state.pdpte_1.charged() ||
state.pdpte_2.charged() || state.pdpte_3.charged()) {
@@ -894,9 +898,9 @@ struct Foc_vcpu : Thread, Noncopyable
}
if (state.inj_info.charged() || state.inj_error.charged()) {
addr_t ctrl_0 = state.ctrl_primary.charged() ?
state.ctrl_primary.value() :
Foc::l4_vm_vmx_read(vmcs, Vmcs::CTRL_0);
uint32_t ctrl_0 = state.ctrl_primary.charged()
? (uint32_t)state.ctrl_primary.value()
: (uint32_t)Foc::l4_vm_vmx_read(vmcs, Vmcs::CTRL_0);
if (state.inj_info.value() & 0x2000)
warning("unimplemented ", state.inj_info.value() & 0x1000, " ",

View File

@@ -38,7 +38,8 @@ Main::Main(Env &env)
Foc::l4_cap_idx_t tid = Capability_space::kcap(env.pd_session_cap());
/* try the first 1000 local name IDs */
for (int local_name = 0; local_name < COUNT; local_name++, idx++) {
using id_t = Native_capability::Data::id_t;
for (id_t local_name = 0; local_name < COUNT; local_name++, idx++) {
idx->id(local_name);
l4_task_map(L4_BASE_TASK_CAP, L4_BASE_TASK_CAP,
l4_obj_fpage(tid, 0, L4_FPAGE_RWX),

View File

@@ -1 +0,0 @@
arm_v8a

View File

@@ -1 +0,0 @@
0x40010000

View File

@@ -1 +0,0 @@
riscv

View File

@@ -1 +0,0 @@
0x80200000

View File

@@ -1 +0,0 @@
arm_v6

View File

@@ -1 +0,0 @@
0x00800000

View File

@@ -1 +0,0 @@
arm_v8a

View File

@@ -1 +0,0 @@
0x00800000

View File

@@ -1 +0,0 @@
arm_v7a

View File

@@ -1 +0,0 @@
0x00100000

View File

@@ -16,7 +16,6 @@
/* base-hw includes */
#include <kernel/types.h>
#include <kernel/interface_support.h>
namespace Kernel {
@@ -92,12 +91,11 @@ namespace Kernel {
* \param duration_us timeout duration in microseconds
* \param sigid local name of signal context to trigger
*
* This call always overwrites the last timeout installed by the thread
* if any.
* This call overwrites the last timeout installed by the thread.
*/
inline int timeout(timeout_t const duration_us, capid_t const sigid)
{
return call(call_id_timeout(), duration_us, sigid);
return (int)call(call_id_timeout(), duration_us, sigid);
}
@@ -130,7 +128,7 @@ namespace Kernel {
*
* The stop syscall always targets the calling thread that, therefore must
* be in the 'active' thread state. The thread then switches to the
* 'stopped' thread state in wich it waits for a restart. The restart
* 'stopped' thread state, in which it waits for a restart. The restart
* syscall can only be used on a thread in the 'stopped' or the 'active'
* thread state. The thread then switches back to the 'active' thread
* state and the syscall returns whether the thread was stopped. Both
@@ -151,7 +149,7 @@ namespace Kernel {
/**
* End blocking of a stopped thread
*
* \param thread_id capability id of the targeted thread
* \param thread_id capability ID of the targeted thread
*
* \return wether the thread was stopped beforehand
*
@@ -164,9 +162,9 @@ namespace Kernel {
/**
* Yield the callers remaining CPU time for this super period
* Yield the caller's remaining CPU time for this super period
*
* Does its best that the caller is scheduled as few as possible in the
* Tell the kernel to schedule the caller as little as possible in the
* current scheduling super-period without touching the thread or pause
* state of the thread. In the next superperiod, however, the thread is
* scheduled 'normal' again. The syscall is not core-restricted and always
@@ -217,25 +215,25 @@ namespace Kernel {
/**
* Send request message and await receipt of corresponding reply message
* Send request message and await reception of corresponding reply message
*
* \param thread_id capability id of targeted thread
* \param thread_id capability ID of targeted thread
*
* \retval 0 succeeded
* \retval -1 failed
* \retval -2 failed due to out-of-memory for capability reception
*
* If the call returns successful, the received message is located at the
* base of the callers userland thread-context.
* base of the caller's userland thread-context.
*/
inline int send_request_msg(capid_t const thread_id, unsigned rcv_caps)
{
return call(call_id_send_request_msg(), thread_id, rcv_caps);
return (int)call(call_id_send_request_msg(), thread_id, rcv_caps);
}
/**
* Await receipt of request message
* Await reception of request message
*
* \param rcv_caps number of capabilities willing to accept
*
@@ -243,37 +241,37 @@ namespace Kernel {
* \retval -1 canceled
* \retval -2 failed due to out-of-memory for capability reception
*
* If the call returns successful, the received message is located at the
* base of the callers userland thread-context.
* If the call returns successfully, the received message is located at the
* base of the caller's userland thread-context.
*/
inline int await_request_msg(unsigned rcv_caps)
{
return call(call_id_await_request_msg(), rcv_caps);
return (int)call(call_id_await_request_msg(), rcv_caps);
}
/**
* Reply to lastly received request message
* Reply to previously received request message
*
* \param rcv_caps number of capabilities to accept when awaiting again
* \param await_request_msg wether the call shall await a request message
* \param await_request_msg whether the call shall await a request message
*
* \retval 0 await_request_msg == 0 or request-message receipt succeeded
* \retval -1 await_request_msg == 1 and request-message receipt failed
* \retval 0 await_request_msg == 0 or request-message received
* \retval -1 await_request_msg == 1 and request-message failed
*
* If the call returns successful and await_request_msg == 1, the received
* message is located at the base of the callers userland thread-context.
* message is located at the base of the caller's userland thread context.
*/
inline int send_reply_msg(unsigned rcv_caps, bool const await_request_msg)
{
return call(call_id_send_reply_msg(), rcv_caps, await_request_msg);
return (int)call(call_id_send_reply_msg(), rcv_caps, await_request_msg);
}
/**
* Print a char c to the kernels serial ouput
* Print a char c to the kernel's serial ouput
*
* If c is set to 0 the kernel prints a table of all threads and their
* If 'c' is set to 0 the kernel prints a table of all threads and their
* current activities to the serial output.
*/
inline void print_char(char const c)
@@ -285,13 +283,13 @@ namespace Kernel {
/**
* Await any context of a receiver and optionally ack a context before
*
* \param receiver_id capability id of the targeted signal receiver
* \param receiver_id capability ID of the targeted signal receiver
*
* \retval 0 suceeded
* \retval -1 failed
*
* If this call returns 0, an instance of 'Signal::Data' is located at the
* base of the callers UTCB. Every occurence of a signal is provided
* base of the caller's UTCB. Every occurence of a signal is provided
* through this function until it gets delivered through this function or
* context respectively receiver get destructed. If multiple threads
* listen at the same receiver, and/or multiple contexts of the receiver
@@ -302,7 +300,7 @@ namespace Kernel {
*/
inline int await_signal(capid_t const receiver_id)
{
return call(call_id_await_signal(), receiver_id);
return (int)call(call_id_await_signal(), receiver_id);
}
@@ -310,7 +308,7 @@ namespace Kernel {
* Check for any pending signal of a context of a receiver the calling
* thread relates to
*
* \param receiver_id capability id of the targeted signal receiver
* \param receiver_id capability ID of the targeted signal receiver
*
* \retval 0 suceeded
* \retval -1 failed
@@ -320,14 +318,14 @@ namespace Kernel {
*/
inline int pending_signal(capid_t const receiver_id)
{
return call(call_id_pending_signal(), receiver_id);
return (int)call(call_id_pending_signal(), receiver_id);
}
/**
* Request to cancel the next signal blocking of a local thread
*
* \param thread_id capability id of the targeted thread
* \param thread_id capability ID of the targeted thread
*
* Does not block. Targeted thread must be in the same PD as the caller.
* If the targeted thread is in a signal blocking, cancels the blocking
@@ -344,7 +342,7 @@ namespace Kernel {
/**
* Trigger a specific signal context
*
* \param context capability id of the targeted signal context
* \param context capability ID of the targeted signal context
* \param num how often the context shall be triggered by this call
*
* \retval 0 suceeded
@@ -352,14 +350,14 @@ namespace Kernel {
*/
inline int submit_signal(capid_t const context, unsigned const num)
{
return call(call_id_submit_signal(), context, num);
return (int)call(call_id_submit_signal(), context, num);
}
/**
* Acknowledge the processing of the last delivery of a signal context
*
* \param context capability id of the targeted signal context
* \param context capability ID of the targeted signal context
*/
inline void ack_signal(capid_t const context)
{
@@ -370,20 +368,20 @@ namespace Kernel {
/**
* Halt processing of a signal context synchronously
*
* \param context capability id of the targeted signal context
* \param context capability ID of the targeted signal context
*
* \retval 0 suceeded
* \retval -1 failed
*/
inline int kill_signal_context(capid_t const context)
{
return call(call_id_kill_signal_context(), context);
return (int)call(call_id_kill_signal_context(), context);
}
/**
* Acknowledge reception of a capability
*
* \param cap capability id to acknowledge
* \param cap capability ID to acknowledge
*/
inline void ack_cap(capid_t const cap)
{
@@ -391,9 +389,9 @@ namespace Kernel {
}
/**
* Delete a capability id
* Delete a capability ID
*
* \param cap capability id to delete
* \param cap capability ID to delete
*/
inline void delete_cap(capid_t const cap)
{
@@ -404,7 +402,7 @@ namespace Kernel {
/**
* Execute a virtual-machine (again)
*
* \param vm pointer to vm kernel object
* \param vm pointer to VM kernel object
*/
inline void run_vm(capid_t const cap)
{
@@ -415,7 +413,7 @@ namespace Kernel {
/**
* Stop execution of a virtual-machine
*
* \param vm pointer to vm kernel object
* \param vm pointer to VM kernel object
*/
inline void pause_vm(capid_t const cap)
{

View File

@@ -14,8 +14,8 @@
#ifndef _KERNEL__TYPES_H_
#define _KERNEL__TYPES_H_
/* base-hw includes */
#include <kernel/interface_support.h>
/* Genode includes */
#include <base/stdint.h>
namespace Kernel {
@@ -25,6 +25,11 @@ namespace Kernel {
using time_t = Genode::uint64_t;
using timeout_t = Genode::uint32_t;
using Call_arg = Genode::umword_t;
using Call_ret = Genode::umword_t;
using Call_ret_64 = Genode::uint64_t;
constexpr capid_t cap_id_invalid() { return 0; }
}

View File

@@ -1,26 +0,0 @@
/*
* \brief Interface between kernel and userland
* \author Martin Stein
* \date 2011-11-30
*/
/*
* Copyright (C) 2011-2017 Genode Labs GmbH
*
* This file is part of the Genode OS framework, which is distributed
* under the terms of the GNU Affero General Public License version 3.
*/
#ifndef _INCLUDE__SPEC__ARM__KERNEL__INTERFACE_SUPPORT_H_
#define _INCLUDE__SPEC__ARM__KERNEL__INTERFACE_SUPPORT_H_
/* Genode includes */
#include <base/stdint.h>
namespace Kernel {
typedef Genode::uint32_t Call_arg;
typedef Genode::uint32_t Call_ret;
typedef Genode::uint64_t Call_ret_64;
}
#endif /* _INCLUDE__SPEC__ARM__KERNEL__INTERFACE_SUPPORT_H_ */

View File

@@ -1,26 +0,0 @@
/*
* \brief Interface between kernel and userland
* \author Stefan Kalkowski
* \date 2019-05-09
*/
/*
* Copyright (C) 2019 Genode Labs GmbH
*
* This file is part of the Genode OS framework, which is distributed
* under the terms of the GNU Affero General Public License version 3.
*/
#ifndef _INCLUDE__SPEC__ARM_64__KERNEL__INTERFACE_SUPPORT_H_
#define _INCLUDE__SPEC__ARM_64__KERNEL__INTERFACE_SUPPORT_H_
/* Genode includes */
#include <base/stdint.h>
namespace Kernel {
typedef Genode::uint64_t Call_arg;
typedef Genode::uint64_t Call_ret;
typedef Genode::uint64_t Call_ret_64;
}
#endif /* _INCLUDE__SPEC__ARM_64__KERNEL__INTERFACE_SUPPORT_H_ */

View File

@@ -1,26 +0,0 @@
/*
* \brief Interface between kernel and userland
* \author Sebastian Sumpf
* \date 2015-06-02
*/
/*
* Copyright (C) 2015-2017 Genode Labs GmbH
*
* This file is part of the Genode OS framework, which is distributed
* under the terms of the GNU Affero General Public License version 3.
*/
#ifndef _KERNEL__INTERFACE_SUPPORT_H_
#define _KERNEL__INTERFACE_SUPPORT_H_
/* Genode includes */
#include <base/stdint.h>
namespace Kernel {
typedef Genode::uint64_t Call_arg;
typedef Genode::uint64_t Call_ret;
typedef Genode::uint64_t Call_ret_64;
}
#endif /* _KERNEL__INTERFACE_SUPPORT_H_ */

View File

@@ -1,26 +0,0 @@
/*
* \brief Interface between kernel and userland
* \author Reto Buerki
* \date 2015-02-06
*/
/*
* Copyright (C) 2015-2017 Genode Labs GmbH
*
* This file is part of the Genode OS framework, which is distributed
* under the terms of the GNU Affero General Public License version 3.
*/
#ifndef _INCLUDE__SPEC__X86_64__KERNEL__INTERFACE_SUPPORT_H_
#define _INCLUDE__SPEC__X86_64__KERNEL__INTERFACE_SUPPORT_H_
/* Genode includes */
#include <base/stdint.h>
namespace Kernel {
typedef Genode::uint64_t Call_arg;
typedef Genode::uint64_t Call_ret;
typedef Genode::uint64_t Call_ret_64;
}
#endif /* _INCLUDE__SPEC__X86_64__KERNEL__INTERFACE_SUPPORT_H_ */

View File

@@ -38,3 +38,5 @@ vpath hw/% $(BASE_HW_DIR)/src/lib
vpath lib/base/% $(BASE_HW_DIR)/src
vpath lib/base/% $(BASE_DIR)/src
vpath lib/startup/% $(BASE_DIR)/src
CC_CXX_WARN_STRICT_CONVERSION =

View File

@@ -1,8 +0,0 @@
REP_INC_DIR += src/bootstrap/board/rpi
SRC_CC += bootstrap/board/rpi/platform.cc
SRC_CC += bootstrap/spec/arm/arm_v6_cpu.cc
SRC_CC += hw/spec/32bit/memory_map.cc
SRC_S += bootstrap/spec/arm/crt0.s
include $(call select_from_repositories,lib/mk/bootstrap-hw.inc)

View File

@@ -1,16 +0,0 @@
#
# \brief Build config for Genodes core process
# \author Norman Feske
# \date 2013-04-05
#
# add include paths
REP_INC_DIR += src/core/board/rpi
# add C++ sources
SRC_CC += platform_services.cc
SRC_CC += spec/arm/bcm2835_pic.cc
SRC_CC += spec/arm/bcm2835_system_timer.cc
# include less specific configuration
include $(call select_from_repositories,lib/mk/spec/arm_v6/core-hw.inc)

View File

@@ -1,20 +0,0 @@
#
# \brief Build config for Genodes core process
# \author Martin Stein
# \author Stefan Kalkowski
# \date 2012-10-04
#
# add include paths
REP_INC_DIR += src/core/spec/arm_v6
# add C++ sources
SRC_CC += spec/arm_v6/perf_counter.cc
SRC_CC += kernel/vm_thread_off.cc
SRC_CC += kernel/cpu_up.cc
SRC_CC += kernel/lock.cc
SRC_S += spec/arm/vfpv2.s
# include less specific configuration
include $(call select_from_repositories,lib/mk/spec/arm/core-hw.inc)

View File

@@ -1,14 +0,0 @@
REP_INC_DIR += src/bootstrap/board/zynq_qemu
SRC_S += bootstrap/spec/arm/crt0.s
SRC_CC += bootstrap/board/zynq_qemu/platform.cc
SRC_CC += bootstrap/spec/arm/cpu.cc
SRC_CC += bootstrap/spec/arm/cortex_a9_mmu.cc
SRC_CC += bootstrap/spec/arm/gicv2.cc
SRC_CC += bootstrap/spec/arm/arm_v7_cpu.cc
SRC_CC += hw/spec/32bit/memory_map.cc
NR_OF_CPUS = 1
include $(call select_from_repositories,lib/mk/bootstrap-hw.inc)

View File

@@ -1,16 +1,8 @@
#
# \brief Build config for Genodes core process
# \author Stefan Kalkowski
# \author Martin Stein
# \date 2012-10-24
#
# add include paths
REP_INC_DIR += src/core/board/imx53_qsb
SRC_CC += spec/arm/imx_epit.cc
SRC_CC += spec/arm/imx_tzic.cc
# include less specific configuration
include $(call select_from_repositories,lib/mk/spec/cortex_a8/core-hw.inc)
CC_CXX_WARN_STRICT_CONVERSION =

View File

@@ -11,4 +11,3 @@ SRC_S += spec/arm_v7/trustzone/exception_vector.s
# include less specific configuration
include $(call select_from_repositories,lib/mk/spec/arm_v7/core-hw-imx53_qsb.inc)

View File

@@ -16,6 +16,6 @@ SRC_S += spec/arm_v7/virtualization/exception_vector.s
NR_OF_CPUS = 2
CC_MARCH = -march=armv7ve -mtune=cortex-a15 -mfpu=vfpv3 -mfloat-abi=soft
CC_MARCH = -march=armv7ve -mtune=cortex-a15 -mfpu=vfpv3 -mfloat-abi=softfp
include $(call select_from_repositories,lib/mk/spec/cortex_a15/core-hw.inc)

View File

@@ -1,11 +0,0 @@
#
# \brief Build config for Genodes core process
# \author Johannes Schlatow
# \date 2014-12-15
#
# add C++ sources
SRC_CC += platform_services.cc
# include less specific configuration
include $(call select_from_repositories,lib/mk/spec/cortex_a9/core-hw.inc)

View File

@@ -1,13 +0,0 @@
#
# \brief Build config for Genodes core process
# \author Johannes Schlatow
# \date 2014-12-15
#
# add include paths
REP_INC_DIR += src/core/board/zynq_qemu
NR_OF_CPUS = 1
# include less specific configuration
include $(call select_from_repositories,lib/mk/spec/arm_v7/core-hw-zynq.inc)

View File

@@ -1,14 +0,0 @@
REP_INC_DIR += src/bootstrap/board/imx8q_evk
SRC_CC += bootstrap/board/imx8q_evk/platform.cc
SRC_CC += bootstrap/spec/arm/gicv3.cc
SRC_CC += bootstrap/spec/arm_64/cortex_a53_mmu.cc
SRC_CC += lib/base/arm_64/kernel/interface.cc
SRC_CC += spec/64bit/memory_map.cc
SRC_S += bootstrap/spec/arm_64/crt0.s
NR_OF_CPUS = 4
vpath spec/64bit/memory_map.cc $(call select_from_repositories,src/lib/hw)
include $(call select_from_repositories,lib/mk/bootstrap-hw.inc)

View File

@@ -1,13 +0,0 @@
REP_INC_DIR += src/bootstrap/board/rpi3
SRC_CC += bootstrap/spec/arm_64/cortex_a53_mmu.cc
SRC_CC += bootstrap/board/rpi3/platform.cc
SRC_CC += lib/base/arm_64/kernel/interface.cc
SRC_CC += spec/64bit/memory_map.cc
SRC_S += bootstrap/spec/arm_64/crt0.s
NR_OF_CPUS = 4
vpath spec/64bit/memory_map.cc $(call select_from_repositories,src/lib/hw)
include $(call select_from_repositories,lib/mk/bootstrap-hw.inc)

View File

@@ -1,19 +0,0 @@
REP_INC_DIR += src/core/board/imx8q_evk
REP_INC_DIR += src/core/spec/arm/virtualization
# add C++ sources
SRC_CC += kernel/vm_thread_on.cc
SRC_CC += spec/arm/gicv3.cc
SRC_CC += spec/arm_v8/virtualization/kernel/vm.cc
SRC_CC += spec/arm/virtualization/platform_services.cc
SRC_CC += spec/arm/virtualization/vm_session_component.cc
SRC_CC += vm_session_common.cc
SRC_CC += vm_session_component.cc
#add assembly sources
SRC_S += spec/arm_v8/virtualization/exception_vector.s
NR_OF_CPUS = 4
# include less specific configuration
include $(call select_from_repositories,lib/mk/spec/arm_v8/core-hw.inc)

View File

@@ -1,11 +0,0 @@
REP_INC_DIR += src/core/board/rpi3
# add C++ sources
SRC_CC += kernel/vm_thread_off.cc
SRC_CC += platform_services.cc
SRC_CC += spec/arm/bcm2837_pic.cc
NR_OF_CPUS = 4
# include less specific configuration
include $(call select_from_repositories,lib/mk/spec/arm_v8/core-hw.inc)

View File

@@ -11,3 +11,5 @@ SRC_CC += spec/arm/kernel/lock.cc
# include less specific configuration
include $(call select_from_repositories,lib/mk/spec/arm_v7/core-hw.inc)
CC_CXX_WARN_STRICT_CONVERSION =

View File

@@ -12,3 +12,5 @@ NR_OF_CPUS = 1
# include less specific configuration
include $(call select_from_repositories,lib/mk/spec/arm_v7/core-hw.inc)
CC_CXX_WARN_STRICT_CONVERSION =

View File

@@ -15,3 +15,5 @@ SRC_CC += kernel/cpu_mp.cc
# include less specific configuration
include $(call select_from_repositories,lib/mk/spec/arm_v7/core-hw.inc)
CC_CXX_WARN_STRICT_CONVERSION =

View File

@@ -1,10 +0,0 @@
INC_DIR += $(REP_DIR)/src/bootstrap/board/riscv_qemu
SRC_CC += bootstrap/spec/riscv/platform.cc
SRC_S += bootstrap/spec/riscv/crt0.s
SRC_CC += lib/base/riscv/kernel/interface.cc
SRC_CC += spec/64bit/memory_map.cc
vpath spec/64bit/memory_map.cc $(REP_DIR)/src/lib/hw
include $(REP_DIR)/lib/mk/bootstrap-hw.inc

View File

@@ -1,27 +0,0 @@
REP_INC_DIR += src/core/spec/riscv src/core/board/riscv_qemu
CC_OPT += -fno-delete-null-pointer-checks
# add C++ sources
SRC_CC += platform_services.cc
SRC_CC += kernel/vm_thread_off.cc
SRC_CC += kernel/cpu_up.cc
SRC_CC += kernel/lock.cc
SRC_CC += spec/riscv/kernel/thread.cc
SRC_CC += spec/riscv/kernel/cpu.cc
SRC_CC += spec/riscv/kernel/interface.cc
SRC_CC += spec/riscv/kernel/pd.cc
SRC_CC += spec/riscv/cpu.cc
SRC_CC += spec/riscv/pic.cc
SRC_CC += spec/riscv/platform_support.cc
SRC_CC += spec/riscv/timer.cc
SRC_CC += spec/64bit/memory_map.cc
#add assembly sources
SRC_S += spec/riscv/exception_vector.s
SRC_S += spec/riscv/crt0.s
vpath spec/64bit/memory_map.cc $(call select_from_repositories,src/lib/hw)
# include less specific configuration
include $(call select_from_repositories,lib/mk/core-hw.inc)

View File

@@ -1 +1 @@
2021-10-13 e4a9e369a9c321759fdc73d5e2b2b9ac1e2d7795
2022-02-27 86bd429179fd08dcb42e5fe852040d7e2785f4fb

View File

@@ -1 +1 @@
2021-10-13 11943f5bc31d6ebd43c67e008cf12cc7e2ca2934
2022-04-12 97ecc02ab7544f8b8bad04a2d23178ce0f14f566

View File

@@ -1 +1 @@
2021-10-13 69215f704c6797b15bcacfc11a2709d5b65019e9
2022-04-12 46afb000e6e14e6580e66f489891b14ea7765ddc

View File

@@ -1 +1 @@
2021-10-13 78f942508805ec6afc8d75550d5b67f38664b5f6
2022-04-12 2dcfe4b1dc0cf006c4c2acbcfb6b72fcf8e50890

View File

@@ -1 +1 @@
2021-10-13 85df38295bad953fc194078cc22d31f1acfa4c08
2022-04-12 90a97e63f9870468b957b2493a6c433dd5b0a64c

View File

@@ -1 +0,0 @@
include $(GENODE_DIR)/repos/base-hw/recipes/src/base-hw_content.inc

View File

@@ -1 +0,0 @@
2021-10-13 e23737af156d1967b1d59c690b62f5538856a85c

View File

@@ -1,2 +0,0 @@
base-hw
base

View File

@@ -1 +1 @@
2021-10-13 cf4e82d22cc8f343aa16f5b996e4cf3cc9608d69
2022-04-12 1eb2a74c06a2130d39d57edcb31e19365e1ee2d9

View File

@@ -1 +1 @@
2021-10-13 ec5754c900404b3d4e1594fa5e36630afb58df0e
2022-04-12 d562748afbe8ef29883d33de8c2c63740a3adc30

View File

@@ -1 +1 @@
2021-10-13 910b8cd795a9326fc0b3fcd9afef8d35abd60c8b
2022-04-12 0af1ada2933e4af5b0d07c8586f39f60d31d68f9

View File

@@ -1 +0,0 @@
include $(GENODE_DIR)/repos/base-hw/recipes/src/base-hw_content.inc

Some files were not shown because too many files have changed in this diff Show More