mirror of
https://github.com/mmueller41/genode.git
synced 2026-01-22 04:52:56 +01:00
Compare commits
237 Commits
sculpt-21.
...
21.05
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c0150f97e5 | ||
|
|
5dc7d55cc0 | ||
|
|
fd2f137a9b | ||
|
|
1d52bd017d | ||
|
|
e06f3bba27 | ||
|
|
1d12755401 | ||
|
|
f2ac341003 | ||
|
|
f2ff1a6d52 | ||
|
|
4383579db6 | ||
|
|
f0b9549376 | ||
|
|
aab6f52325 | ||
|
|
6e85a73a28 | ||
|
|
4abc530974 | ||
|
|
583ba0e9db | ||
|
|
62f83b7198 | ||
|
|
464f0eaf8b | ||
|
|
0f72a342f3 | ||
|
|
3dff399fba | ||
|
|
0aa99648d7 | ||
|
|
6b9fcc9449 | ||
|
|
f9c7947c45 | ||
|
|
28189ba77a | ||
|
|
fc5903c917 | ||
|
|
7f6f710bd2 | ||
|
|
ed7d6c74f4 | ||
|
|
9f099bd61c | ||
|
|
6780cf0790 | ||
|
|
7b197d54ed | ||
|
|
933de21339 | ||
|
|
509e5aa776 | ||
|
|
e1abd2db4e | ||
|
|
faf491ce92 | ||
|
|
98f524bb41 | ||
|
|
7fcf9053b9 | ||
|
|
6910b880e7 | ||
|
|
708b7f4619 | ||
|
|
921a99bb9b | ||
|
|
a13dee8d19 | ||
|
|
0069660958 | ||
|
|
7b09675236 | ||
|
|
4bed825956 | ||
|
|
5135ff2dc2 | ||
|
|
4a56171a77 | ||
|
|
ae5b4c9624 | ||
|
|
46c846ef91 | ||
|
|
c8c589d91a | ||
|
|
5254930930 | ||
|
|
70797fe879 | ||
|
|
100583e262 | ||
|
|
57fbd2b658 | ||
|
|
9549eeeca4 | ||
|
|
9166a75f2c | ||
|
|
dd587c6712 | ||
|
|
3ed26e7bb2 | ||
|
|
6e900f147c | ||
|
|
0507d3f44b | ||
|
|
0b641ba581 | ||
|
|
b3a229eebb | ||
|
|
fd0a4e78c8 | ||
|
|
74d826d1ad | ||
|
|
b6b9801c20 | ||
|
|
b22d9385f1 | ||
|
|
516601b7ba | ||
|
|
67a8f29697 | ||
|
|
3e284558a1 | ||
|
|
04d8e03ecb | ||
|
|
cfe29b0e52 | ||
|
|
d4b9be8d44 | ||
|
|
db97af8dec | ||
|
|
4daf19ec7e | ||
|
|
18a43c1afd | ||
|
|
813f4d976b | ||
|
|
a24224ffc3 | ||
|
|
9543161827 | ||
|
|
a0517686ca | ||
|
|
9209dfc9d5 | ||
|
|
f8d0552d52 | ||
|
|
139a2cfae9 | ||
|
|
1c20ed12c1 | ||
|
|
d516544a1f | ||
|
|
f8b2fd522b | ||
|
|
471d34a367 | ||
|
|
d5e4ffd191 | ||
|
|
4a4b754bf2 | ||
|
|
a0f5d34e25 | ||
|
|
9a3d5dcf21 | ||
|
|
9c05cda6e7 | ||
|
|
6639261126 | ||
|
|
fc902d9e66 | ||
|
|
6a11b78cdf | ||
|
|
7fd598f0c1 | ||
|
|
777923f9bd | ||
|
|
d2bf565503 | ||
|
|
384a8da50b | ||
|
|
b6bdd91cfa | ||
|
|
a5385cebf4 | ||
|
|
c5c3d7ca98 | ||
|
|
d19b751632 | ||
|
|
ff160decec | ||
|
|
a4115cfea9 | ||
|
|
2f9d430c00 | ||
|
|
718f44ae5b | ||
|
|
66feb939e6 | ||
|
|
1baf844e20 | ||
|
|
5fa2efa745 | ||
|
|
ad847d0543 | ||
|
|
0b36d81c0c | ||
|
|
a4727c90a8 | ||
|
|
e65b7f3b82 | ||
|
|
0f0edc0134 | ||
|
|
d0f084d449 | ||
|
|
c7b2314d23 | ||
|
|
eb94f03416 | ||
|
|
516a9a6925 | ||
|
|
fdb1a4dd88 | ||
|
|
d477062c56 | ||
|
|
811009d18b | ||
|
|
00d13cf304 | ||
|
|
49184fb938 | ||
|
|
52e8c95321 | ||
|
|
9b854e1496 | ||
|
|
d5e7870532 | ||
|
|
bc8dbc6b1a | ||
|
|
8f23e377d9 | ||
|
|
aebece5110 | ||
|
|
82604f2c2b | ||
|
|
4563baae77 | ||
|
|
c4e3d3dbc4 | ||
|
|
eb53f8c113 | ||
|
|
07649b667b | ||
|
|
0f679bb35e | ||
|
|
d6e9d74038 | ||
|
|
405e6744fb | ||
|
|
fad85c3fd5 | ||
|
|
49392dfa44 | ||
|
|
e627f8320f | ||
|
|
8196e229b0 | ||
|
|
0a8394c891 | ||
|
|
66e8f8d764 | ||
|
|
84e4cbb54c | ||
|
|
23b21812dd | ||
|
|
d66e55ec37 | ||
|
|
5dbc9ef244 | ||
|
|
4e822436fc | ||
|
|
ce75b25fd4 | ||
|
|
118e8ee6e1 | ||
|
|
f236e99b5c | ||
|
|
86e09b60c4 | ||
|
|
373b45a0f0 | ||
|
|
a2491c30b3 | ||
|
|
d80b2a150a | ||
|
|
c802de2cf9 | ||
|
|
e86387d557 | ||
|
|
f6aabfe233 | ||
|
|
8617e5cee0 | ||
|
|
2db94b8438 | ||
|
|
7b9e7361ba | ||
|
|
910ea16405 | ||
|
|
58db8c647a | ||
|
|
4826bd82fe | ||
|
|
7b90f8f857 | ||
|
|
bf3ad3baff | ||
|
|
8a4b52d9e3 | ||
|
|
a47fd36b9f | ||
|
|
a2e62db6ec | ||
|
|
7503472ae6 | ||
|
|
1c49da8ce4 | ||
|
|
9cb8c37e3a | ||
|
|
bb6617ad03 | ||
|
|
f49ec5b171 | ||
|
|
507a7789fb | ||
|
|
421d2bed40 | ||
|
|
6caa74a18e | ||
|
|
5ac3c335dc | ||
|
|
e8b97ad684 | ||
|
|
3f450a77e1 | ||
|
|
462bff5aef | ||
|
|
ace7c9172b | ||
|
|
173264ed1e | ||
|
|
190eafeaa6 | ||
|
|
ddf6a0c276 | ||
|
|
8f30fc993d | ||
|
|
33a64f79dc | ||
|
|
7de62734e5 | ||
|
|
d73eaaa14c | ||
|
|
efbed6f7bf | ||
|
|
5ca024ff8b | ||
|
|
dc8c899c1d | ||
|
|
d1cf9c86b8 | ||
|
|
46ca576eac | ||
|
|
70281715c6 | ||
|
|
4546148ab7 | ||
|
|
80cf47d906 | ||
|
|
7c01053842 | ||
|
|
e28709d54d | ||
|
|
dc89ebf978 | ||
|
|
7ae1210531 | ||
|
|
c9d904df71 | ||
|
|
21e9e1840a | ||
|
|
4e714d3f3a | ||
|
|
2084404aba | ||
|
|
9c9302e51d | ||
|
|
af490bdd5b | ||
|
|
0339318572 | ||
|
|
53e44f8bfd | ||
|
|
a839b4f0bb | ||
|
|
468e7a825c | ||
|
|
3ed8df9089 | ||
|
|
97a9ad114c | ||
|
|
f5f5b8c1f1 | ||
|
|
b661459aca | ||
|
|
f925fef17b | ||
|
|
97d44c5a79 | ||
|
|
1867cf4967 | ||
|
|
f3f8d9a6de | ||
|
|
99f4b3cd07 | ||
|
|
ac07f9d08e | ||
|
|
ed9487b452 | ||
|
|
729b22f04f | ||
|
|
698f6eb86c | ||
|
|
73e8d64c34 | ||
|
|
cb9a26f1ed | ||
|
|
49481dd3fb | ||
|
|
dc8dd3396d | ||
|
|
9ac23a18d4 | ||
|
|
ae8050bb82 | ||
|
|
0a849a1681 | ||
|
|
f89414c637 | ||
|
|
4cdfeb13e2 | ||
|
|
1a57a5a959 | ||
|
|
96cc660f95 | ||
|
|
2c7c7767fc | ||
|
|
9f8c555e7d | ||
|
|
fb9f6812e1 | ||
|
|
839183d2b6 | ||
|
|
c67e78a7f0 | ||
|
|
0ac4d1d411 |
@@ -1 +0,0 @@
|
||||
https://depot.1337.cx
|
||||
@@ -1,37 +0,0 @@
|
||||
-----BEGIN PGP PUBLIC KEY BLOCK-----
|
||||
Version: GnuPG v1
|
||||
|
||||
mQENBFm3BlYBCADR2ZGIWiYurf/urQ+rAZs3HMobXQ/fckc3FOAdY9qiklrvPr9s
|
||||
maZZyMF+Wn4J2AmsGctJbBUt3ujcmk09AgZIzrHpVJRagUSz9q+bK7NvAfenDC2q
|
||||
w4HS5yE9DYxXOjxrcS5a2HhKfE5sZef1zPtFIkEZCJXCvh4IL6maLijOrUZPf9R6
|
||||
VJ+0itNh0hK9KiYsKA7CwrWuFaw7ZenVkEBV1HGXybFh9aInTTSqopyU6qYLDK1X
|
||||
U0NG24cjM8TDbMGTaoScpLchcftBGEhjYg7Y2FCu455MDVdrmoOoxDINYgDU1KN6
|
||||
8GBKKJ+xqG703/o550l+rCMB+TxMN5zKTFhXABEBAAG0IkVtZXJ5IEhlbWluZ3dh
|
||||
eSA8ZWhtcnlAcG9zdGVvLm5ldD6JAVQEEwEIAD4CGwMFCwkIBwIGFQgJCgsCBBYC
|
||||
AwECHgECF4AWIQRuEEFO5xYHgfX+6P+xTQQ6JrPSxwUCWgHubgUJAZm9OgAKCRCx
|
||||
TQQ6JrPSxyJ0B/0eBOIloo3zJwtuQnNXe2ZFAmHFF7MJhrr0IpZ0n5K0OHTFPqXN
|
||||
VJ+vhTGuI/SlF3a9YEHohIT2KKal1aq+/wVkX6Kdi4G4nGTEXdRsTwlzN/GXHBPF
|
||||
IW0iUOInJOliKReaamsR/rgXXH5sstq2IU4x+NpHMT/OrkQPNSqVX0RjS9i76Awo
|
||||
+EqdtW8g3y8qWd8WtTfhbMlQLhuzm99aADbspr4nK9WhZ7UHYLJAz/u7LzZlRiI5
|
||||
hNa85BCPhNuYz5NTHhn4L9r6PdbKPzUV173XrlAtlteYuGIHk4d/zSAwlgDevChL
|
||||
0MDRq1vvgfQ2V0SwIqRqIfnO31Ph8uktJ8WRiQEfBBABCAAJBQJaAReyAgcAAAoJ
|
||||
EIZq4LBroLaERpQH/3Dw0H6N9YF2ATmkse6NNNQjxhKSUoA34UBWj0v4Q1AvXEe6
|
||||
nHRR0mAa9Gije9ixKUg85VbKM3lUhXCFqW5jzyzpF1rzzTpAHaUTYKb8M2D9iRKo
|
||||
9ejTK3KrgpstYJ8jthfosxeC+lK24WUXKKWPjgoIhv7Thd31ea/PZdkFVd1MpSwg
|
||||
5BHRHcogsJI9uou7zWYbap9/k0lxKHJWklLh/oXet+aAoUIL0kTU+nILy3/RZJGW
|
||||
9WlnZR9g3qSQ8YNpgNSrraEtXpcs6MGsWZSzbzJ1U95NL87NbWEOYgHZA++vhEy5
|
||||
EXVrd8SuSHbUbqNF36gz1cxmEuKwxAaWZ1/UbGW5AQ0EWbcGVgEIANC9LozG/TXV
|
||||
4j0TniuLrsq7kkNH+OJQexcD19pBrmEV4eYYD6c8BB9CaBITqvKIqtG0VJrmB5S5
|
||||
D0oW4mQI+TkcX+Q7y3S7dUkc856d03aUX3vVcNhXEbNgM19qxAGieC8WH2kr4XU1
|
||||
psu1WvFCXOktrE5c8H0rPCQ1jseB0S67XCA9BLwAqlqu0OuTpbWddjXuE1ahi0ig
|
||||
Yt5YsHvgCMLup208azQqGCnJ5tFotqzbLg3I6+QzMcLySqsN4BzYmUGbOSSZdUhX
|
||||
DWxwAK1dB8qa27iwsxCMncdGnqOTkq+mXRmu8ztPTUivyC6YHJ+O5lXvMMADZi4j
|
||||
8RpQQlh5gFkAEQEAAYkBNgQYAQgAIBYhBG4QQU7nFgeB9f7o/7FNBDoms9LHBQJZ
|
||||
twZWAhsMAAoJELFNBDoms9LHTmIH/0PuzpA3Ezdrb4xfVwnhUUZGiqfNzULCZipT
|
||||
qtfym6Ove6To4BbXAihWwnCYs4sgipabW1WaXsDDvU+AmOmz4EPyTna23fUzYRSL
|
||||
MT/kk77d+BGRGeA8/Gj/BgjPlHlFa7ukbT1DL1lSV0RMQ32tDGnhJ7wMBx4GoYU+
|
||||
xjlsxrYKKdvZKOQVCCFn4KY/GavqT+8pYYI63stSPGspboQR2iboKqc350MVMvzz
|
||||
IaDt14YiOYlgV6LoNj2VaPJvFqm9ML+plYl4PPQZTV6KAhFWCDJq2DzEQqwG6RU4
|
||||
SsneHAqMlG4A5SSMTLEd9F2gZ2sJicybr1WbNLj1KF74ckUhpM4=
|
||||
=p4q9
|
||||
-----END PGP PUBLIC KEY BLOCK-----
|
||||
@@ -362,6 +362,20 @@ in its 'LIBS' declaration and refers to the tools relative to
|
||||
'$(BUILD_BASE_DIR)'.
|
||||
|
||||
|
||||
Building additional custom targets accompanying library or program
|
||||
==================================================================
|
||||
|
||||
There are cases when it is important to build additional targets
|
||||
besides standard files built for library or program. Of course there
|
||||
is no problem with writing specific make rules for commands that
|
||||
generate those target files but for them to be built a proper
|
||||
dependency must be specified. To achieve it those additional targets
|
||||
should be added to 'CUSTOM_TARGET_DEPS' variable like e.g. in
|
||||
iwl_firmware library from dde_linux repository:
|
||||
|
||||
! CUSTOM_TARGET_DEPS += $(addprefix $(BIN_DIR)/,$(IMAGES))
|
||||
|
||||
|
||||
Automated integration and testing
|
||||
#################################
|
||||
|
||||
|
||||
53
doc/news.txt
53
doc/news.txt
@@ -4,6 +4,59 @@
|
||||
===========
|
||||
|
||||
|
||||
Genode OS Framework release 21.05 | 2021-05-31
|
||||
##############################################
|
||||
|
||||
| Version 21.05 introduces webcam support, features an encrypted file vault
|
||||
| for Sculpt OS, and adds new drivers for the i.MX8 SoC and Pine-A64.
|
||||
| Furthermore, it is accompanied with a new tool chain based on GCC 10
|
||||
| and new guidance documentation for driver development.
|
||||
|
||||
Device-driver support remains a prominent topic for almost every release.
|
||||
The just released version 21.05 is no exception, touching hardware topics
|
||||
ranging from USB, over I2C on i.MX8, over GPIO on Pine-A64, to networking on
|
||||
RISC-V. Until now, such nitty-gritty driver-development work has been pursued
|
||||
almost exclusively by the core team at Genode Labs. To encourage developers
|
||||
outside the inner circle to join the fun, the release is accompanied with the
|
||||
initial version of a comprehensive guidance documentation for
|
||||
hardware-related topics.
|
||||
|
||||
Feature-wise the two highlights of the new version are webcam support and an
|
||||
easy-to-use encrypted file store based on our custom CBE block encrypter.
|
||||
As detailed by the release documentation, both features leverage Genode's
|
||||
architecture in unique ways to attain high flexibility without an inflation of
|
||||
complexity.
|
||||
|
||||
The release is rounded up by a new tool chain based on GCC 10 and Binutils
|
||||
2.36, profound performance optimizations, framework refinements, and new
|
||||
assistive tooling for porting Linux drivers. All the details of the new
|
||||
version are covered by the official
|
||||
[https:/documentation/release-notes/21.05 - release documentation of version 21.05...]
|
||||
|
||||
|
||||
Sculpt OS 21.03 boots now in 2.5 seconds | 2021-05-03
|
||||
#####################################################
|
||||
|
||||
| We have released an updated Sculpt 21.03 image featuring several
|
||||
| hardware-compatibility tweaks and performance improvements.
|
||||
|
||||
Since the official Sculpt OS 21.03 release end of March, we continued our
|
||||
efforts with refining the user experience and broadening hardware
|
||||
compatibility, thanks to the user feedback we received. We have now released
|
||||
an updated system image that includes those refinements as well as several
|
||||
performance optimizations that boost the boot time of Sculpt to less than 2.5
|
||||
seconds from the first life sign of the kernel to the graphical user
|
||||
interface (measured on a 5-years old Lenovo x250 laptop).
|
||||
|
||||
You can get the new version of the system image named sculpt-21-03b at the
|
||||
[https://genode.org/download/sculpt - Sculpt OS download] page.
|
||||
It is binary compatible with the original release version. So you can use it
|
||||
as a drop-in-replacement.
|
||||
|
||||
For manually reproducing the image, please refer to the corresponding
|
||||
[https://github.com/chelmuth/genode/commits/sculpt_21_03b - Git branch].
|
||||
|
||||
|
||||
Sculpt OS release 21.03 | 2021-03-24
|
||||
####################################
|
||||
|
||||
|
||||
817
doc/release_notes/21-05.txt
Normal file
817
doc/release_notes/21-05.txt
Normal file
@@ -0,0 +1,817 @@
|
||||
|
||||
|
||||
===============================================
|
||||
Release notes for the Genode OS Framework 21.05
|
||||
===============================================
|
||||
|
||||
Genode Labs
|
||||
|
||||
|
||||
|
||||
The most prominent user-visible features of Genode 21.05 are the support for
|
||||
webcams and an easy-to-use component for file encryption on
|
||||
[https://genode.org/download/sculpt - Sculpt OS]. Both topics greatly benefit
|
||||
from Genode's component architecture. The video-conferencing scenario
|
||||
described in Section [Webcam support] sandboxes the webcam driver in a
|
||||
disposable Genode component while using a second instance of the nitpicker GUI
|
||||
server as a video bridge. This design strikes a beautiful combination of
|
||||
simplicity, robustness, and flexibility.
|
||||
|
||||
The new file vault described in Section
|
||||
[File vault based on the CBE block encrypter] leverages Genode's dynamic
|
||||
sandboxing capabilities to manage the creation and operation of an encrypted
|
||||
file store. Even though the underpinnings can be described as nothing less
|
||||
than sophisticated machinery, the package presented to the user combines ease
|
||||
of use with a great sense of control.
|
||||
|
||||
The second focus of the current release are the manifold improvements of
|
||||
Genode's driver and platform support as described in Sections [Device drivers]
|
||||
and [Platforms]. Our USB support received the attention needed to accommodate
|
||||
the webcam scenario, the arsenal of i.MX8 drivers got enriched with I2C and
|
||||
power-domain control, the Pine-A64 board support is growing, Genode has become
|
||||
able to run on 64-bit ARM Linux, and we enabled principle networking for
|
||||
RISC-V.
|
||||
|
||||
Speaking of platforms, this release features the first version of a new
|
||||
"Genode Platforms" documentation (Section [Updated and new documentation])
|
||||
that aids the porting of Genode to new ARM SoCs. With this document, we share
|
||||
our former in-house know-how and methodology about the porting and development
|
||||
of drivers with developers outside of Genode Labs.
|
||||
|
||||
The release is rounded up by several performance optimizations
|
||||
(Section [Performance optimizations]) to the benefit of most Genode system
|
||||
scenarios. Furthermore, it is accompanied with an updated tool chain,
|
||||
following our established two-years rhythm
|
||||
(Section [Tool-chain update to GCC 10.3 and binutils 2.36]).
|
||||
|
||||
|
||||
Webcam support
|
||||
##############
|
||||
|
||||
During 2020, the amount of home office and remote work took an unexpected turn.
|
||||
Video conferences and video chats have become the norm, which people and
|
||||
companies rely upon. Even though, not to be found on our
|
||||
[https://genode.org/about/road-map - road map] for 2021, this development
|
||||
prompted the Genode team to explore the field of webcam and video chat support
|
||||
on Genode.
|
||||
|
||||
Webcams are generally connected via USB to a host device and implement the USB
|
||||
video device class
|
||||
([https://www.usb.org/sites/default/files/USB_Video_Class_1_5.zip - UVC spec]).
|
||||
Therefore, it is possible to drive many different webcam devices using the
|
||||
same USB interface. To support this protocol, we enabled
|
||||
[https://ken.tossell.net/libuvc/doc - libuvc], which offers fine-grained control
|
||||
over UVC exporting USB devices. In order to enable _libuvc_ on Genode, we
|
||||
simply integrated the library into Genode's port system with no further
|
||||
changes required. _libuvc_ depends on [https://libusb.info - libusb] as a back
|
||||
end to access the actual webcam device. While there exists a port of _libusb_
|
||||
for Genode - that connects through Genode's USB session interface to the USB
|
||||
host controller - the port still lacked support for isochronous USB transfers
|
||||
as required by UVC devices. Isochronous transfers represent a continuous
|
||||
stream of data (either input or output) with a constant rate without delivery
|
||||
guarantees. We extended _libusb_ to handle isochronous transfers, which were
|
||||
already supported by Genode's USB session. Observing that this kind of
|
||||
transfers can cause high load within the USB host driver, we optimized
|
||||
isochronous transfer support at the host driver level (Section [USB]).
|
||||
|
||||
At the front-end side, we created a small _usb_webcam_ component that uses
|
||||
_libuvc_ in order to enable, disable, and configure the camera. The component
|
||||
connects to a GUI session, and thus, can be interfaced directly, for example,
|
||||
to the Nitpicker component for rendering webcam images natively on screen.
|
||||
Whereas Genode's pixel format is 32 bit RGB, webcams stream data in the YUV2,
|
||||
MJPEG, or H.264 formats. To handle the conversion of these formats to Genode's
|
||||
pixel format, we utilize the
|
||||
[https://chromium.googlesource.com/libyuv/libyuv - libyuv] library and thereby
|
||||
support the YUV2 as well as the MJPEG pixel format for webcams.
|
||||
|
||||
Additionally, we wanted to be able to transfer the webcam data directly into
|
||||
our VirtualBox port, thus enabling, sophisticated video conference systems
|
||||
like Jitsi or Skype.
|
||||
|
||||
[image webcam]
|
||||
|
||||
Our USB host-controller support for VirtualBox is based on the ported Qemu USB
|
||||
3.0 (XHCI) controller model. Since no USB webcam device model is available for
|
||||
Qemu, we were required to develop a one from scratch. The new USB webcam model
|
||||
is attached to the QEMU USB XHCI controller and operates as a bulk endpoint.
|
||||
In contrast to an isochronous endpoint, the model causes less CPU load and
|
||||
fewer virtual interrupts. The supported formats offered to the guest are YUV2
|
||||
and BGR3. By enabling the USB webcam model within the Genode VirtualBox
|
||||
configuration, a _Capture_ session is used to capture pictures at the rate of
|
||||
a configured _fps_ value. The following snippet shows the default values of
|
||||
the supported configuration attributes.
|
||||
|
||||
!<config ...>
|
||||
! ...
|
||||
! <webcam width="640" height="480" fps="15" vertical_flip="false"
|
||||
! screen_size="false" report="false"/>
|
||||
! ...
|
||||
!</config>
|
||||
|
||||
If the _screen_size_ attribute is set to _true_, the device model determines
|
||||
the resolution from the established capture session. Otherwise, the specified
|
||||
_width_ and _height_ values are used. The _vertical_flip_ attribute is useful
|
||||
for the BGR3 format, which is - when interpreted by Linux guests - flipped
|
||||
vertically and can be flipped back by setting the attribute to _true_.
|
||||
|
||||
If the _report_ attribute is set to _true_, a report will be generated
|
||||
whenever the guest changes the state of the webcam model, either by switching
|
||||
capturing on/off or by changing the pixel format.
|
||||
|
||||
! <capture enabled="true/false" format="YUV2/BGR3"/>
|
||||
|
||||
[image webcam_chat]
|
||||
|
||||
Finally, our developers, croc and lion, setup the Webcam scenario in Sculpt
|
||||
and test drive the new feature fascinated. The picture shows a session via
|
||||
Jitsi, on the right side croc participates at the meeting via a Win10 VM on
|
||||
Sculpt and lion sitting left joined via an Android tablet.
|
||||
|
||||
|
||||
Performance optimizations
|
||||
#########################
|
||||
|
||||
One of the overarching topics of this year's
|
||||
[https://genode.org/about/road-map - roadmap] is optimization.
|
||||
As part of working on the Sculpt OS
|
||||
[https://genode.org/news/sculpt-os-21.03-boots-now-in-2.5-seconds - version 21.03],
|
||||
we identified several optimization vectors with the potential for user-visible
|
||||
improvements. In particular, while interacting with the system, a few effects
|
||||
made us curious.
|
||||
|
||||
Operations that involved changes to the runtime subsystem, e.g., adding or
|
||||
reconfiguring a component, seemed to interfere with multi-media workloads.
|
||||
When running a graphical animation, we could see it stutter in such
|
||||
situations. Another direction of our curiosity was the boot time of the
|
||||
system. The boot time of Sculpt OS has always been relatively quick compared
|
||||
to commodity operating systems. E.g., on a 5-years old laptop like a Lenovo
|
||||
x260, the system used to boot in about 5 seconds to the graphical user
|
||||
interface. However, with the anticipation of Sculpt OS on lower-end platforms
|
||||
like the Pinephone and with the vision of instant-on systems, we wondered
|
||||
about the potential for improvement.
|
||||
|
||||
While gathering a CPU-load profile of the boot process using the top tool, we
|
||||
learned that the boot time was bounded not by I/O but by the CPU load (the
|
||||
kernel's idle thread did not appear in the profile). Interestingly, a
|
||||
significant portion of the cycles were consumed by various instances of the
|
||||
init component, which prompted us to turn our attention to the implementation
|
||||
of init.
|
||||
|
||||
|
||||
Clock-cycle measurements
|
||||
------------------------
|
||||
|
||||
The next natural step was the benchmarking of various code paths of init using
|
||||
a cycle-accurate time-stamp counter (TSC). Even though Genode has a
|
||||
'Trace::timestamp' utility readily available, it remains barely used for
|
||||
manual instrumentation because such instrumentations require too much labor:
|
||||
allocation of state variables for gathering the statistics, computing time
|
||||
differences, traffic-shaping of the debug noise (needed whenever investigating
|
||||
highly frequently called code). These tasks should better be covered by a
|
||||
utility so that friction-less performance analysis can become a regular part
|
||||
of our development work. As a side effect of our investigation, we came up
|
||||
with a new utility called GENODE_LOG_TSC. This utility is covered by a
|
||||
dedicated article.
|
||||
|
||||
:Performance analysis made easy:
|
||||
|
||||
[https://genodians.org/nfeske/2021-04-07-performance]
|
||||
|
||||
Thanks to GENODE_LOG_TSC, we were able to identify three concrete
|
||||
opportunities for optimization in a course of one evening. First, the dynamic
|
||||
reconfiguration of init apparently did not scale well with a growing number of
|
||||
components. The code for analysing differences of configuration versions
|
||||
relied on doubly nested loops in order to stay as simple as possible. With the
|
||||
typical number of 30 or more components/subsystems hosted in Sculpt's runtime,
|
||||
we passed a tipping point where quadratic time complexity is justifiable.
|
||||
Second, during a configuration update, the XML data is evaluated in multiple
|
||||
passes, which puts pressure on the efficiency of Genode's XML parser. This
|
||||
pressure could in principle be relieved. Third, the process of taking
|
||||
session-routing decisions involved XML parsing. In scenarios as sophisticated
|
||||
as Sculpt, the routing rules can become quite elaborate. Since the rules are
|
||||
consulted for each session route, the costs for the rule evaluations stack up.
|
||||
|
||||
|
||||
Init optimizations
|
||||
------------------
|
||||
|
||||
These realizations motivated us to replace the hand-crafted configuration
|
||||
processing by the use of Genode's generic 'List_model' utility. This way, the
|
||||
parsing follows a common formalism that makes the code easier to maintain and
|
||||
to understand while reducing the XML parsing to a single pass. The increased
|
||||
formality cleared the way for further optimizations. In particular, init
|
||||
became able to skip the re-evaluation of the session routing whenever no
|
||||
service is affected by the configuration change. This is actually the common
|
||||
case in Sculpt.
|
||||
|
||||
To alleviate the costs for evaluating session routes, we introduced an
|
||||
internal data model for the routing rules that is optimized for the matching
|
||||
of routes. With this model, the detection of a definite mismatch (the common
|
||||
case) comes down to a comparison of a single numeric value.
|
||||
|
||||
Combined, those optimizations yield a great effect. In a typical Sculpt
|
||||
system, the time of a dynamic reconfiguration got reduced by factor 10 to the
|
||||
order of 10 to 20 milliseconds. Hence, the visual stuttering we observed
|
||||
during structural changes of the runtime are completely eliminated.
|
||||
|
||||
Besides the major optimization of init, we were able to shave off a few
|
||||
milliseconds from the boot procedure here and there. For example, by deferring
|
||||
the initialization of the real-time clock driver to its first use, we avoid a
|
||||
potentially expensive active polling loop during the highly contended boot
|
||||
phase. Another obvious heuristic improvement is the skipping of the GUI
|
||||
handling until the framebuffer driver is up because all the nice pixels would
|
||||
not be visible anyway.
|
||||
|
||||
Combined, these optimizations were able to reduce the boot time of Sculpt from
|
||||
the entering of the kernel up to the graphical user interface down to only 2.3
|
||||
seconds. The improved performance of init is impactful beyond Sculpt OS
|
||||
because it is a central component of all Genode systems large and small.
|
||||
|
||||
|
||||
Updated and new documentation
|
||||
#############################
|
||||
|
||||
Genode Platforms
|
||||
----------------
|
||||
|
||||
We are proud to introduce the first version of a new "Genode Platforms"
|
||||
document, which complements the existing Genode Foundations book with
|
||||
low-level hardware-related topics. It is primarily intended for integrators
|
||||
and developers of device drivers.
|
||||
|
||||
: <div class="visualClear"><!-- --></div>
|
||||
: <p>
|
||||
: <div style="clear: both; float: left; margin-right:20px;">
|
||||
: <a class="internal-link" href="https://genode.org">
|
||||
: <img class="image-inline" src="https://genode.org/documentation/genode-platforms-title.png">
|
||||
: </a>
|
||||
: </div>
|
||||
: </p>
|
||||
|
||||
In this first edition, the document features a practical guide for the steps
|
||||
needed to bring Genode to a new ARM SoC. The content is based on the ongoing
|
||||
Pine Fun article series at [https://genodians.org - Genodians.org].
|
||||
We plan to continuously extend it with further practical topics as we go.
|
||||
|
||||
:Initial revision of the Genode Platforms document:
|
||||
|
||||
[https://genode.org/documentation/genode-platforms-21-05.pdf]
|
||||
|
||||
|
||||
Genode Foundations
|
||||
------------------
|
||||
|
||||
The "Genode Foundations" book received its annual update. It is available at
|
||||
the [https://genode.org] website as a PDF document and an online version.
|
||||
The most noteworthy additions and changes are:
|
||||
|
||||
: <div class="visualClear"><!-- --></div>
|
||||
: <p>
|
||||
: <div style="clear: both; float: left; margin-right:20px;">
|
||||
: <a class="internal-link" href="https://genode.org">
|
||||
: <img class="image-inline" src="https://genode.org/documentation/genode-foundations-title.png">
|
||||
: </a>
|
||||
: </div>
|
||||
: </p>
|
||||
|
||||
* Adaptation to the re-stacked GUI stack introduced in
|
||||
[https://genode.org/documentation/release-notes/20.08#The_GUI_stack__restacked - version 20.08]
|
||||
* Coverage of the new uplink, capture, and event session interfaces
|
||||
* Updated API documentation
|
||||
|
||||
: <div class="visualClear"><!-- --></div>
|
||||
|
||||
To examine the changes in detail, please refer to the book's
|
||||
[https://github.com/nfeske/genode-manual/commits/master - revision history].
|
||||
|
||||
|
||||
Base framework and OS-level infrastructure
|
||||
##########################################
|
||||
|
||||
API refinements
|
||||
===============
|
||||
|
||||
VFS-access utilities
|
||||
--------------------
|
||||
|
||||
Low-complexity native Genode components do not depend on a C runtime. To allow
|
||||
such components to still enjoy the power and flexibility of the Genode's VFS
|
||||
infrastructure, we provide an evolving front-end API
|
||||
[https://github.com/genodelabs/genode/blob/master/repos/os/include/os/vfs.h - os/vfs.h]
|
||||
first introduced in version
|
||||
[https://genode.org/documentation/release-notes/19.11#Virtual_file-system_infrastructure - 19.11].
|
||||
|
||||
The API is tailored and refined according to the relatively simple use cases
|
||||
of low-complexity Genode components. The current release introduces a new
|
||||
utility for the creation of new files, appropriately named 'New_file'. The
|
||||
change is accompanied by a new 'Directory::create_sub_directory' method for
|
||||
the easy creation of directory hierarchies.
|
||||
|
||||
|
||||
Safeguarded arrays
|
||||
------------------
|
||||
|
||||
To handle arrays in a safe and C++-like fashion, a new helper class has become
|
||||
available at _base/include/util/array.h_. It accommodates an increasingly used
|
||||
pattern where elements are dynamically added at construction time but stay the
|
||||
same once the array is constructed.
|
||||
|
||||
|
||||
Cosmetic changes
|
||||
----------------
|
||||
|
||||
We refined the 'Range_allocator::alloc_aligned' interface to make it more
|
||||
safe. The former 'from' and 'to' arguments are replaced by a single 'range'
|
||||
argument. The distinction of the use cases of regular allocations vs.
|
||||
address-constrained allocations is now covered by a dedicated overload instead
|
||||
of relying on a default argument. The 'align' argument has been changed from
|
||||
'int' to 'unsigned' to be better compatible with 'addr_t' and 'size_t'.
|
||||
|
||||
The 'Cache_attribute' type has been renamed to 'Cache'.
|
||||
|
||||
|
||||
Input-event handling
|
||||
====================
|
||||
|
||||
A central component for Genode's input-event handling functionality is the
|
||||
event filter. It merges input events from multiple event sources and passes
|
||||
them to the event sink (typically the GUI server). In between, it performs
|
||||
low-level key remapping and applies character mapping rules. Character mapping
|
||||
rules are essential for supporting different keyboard layouts (including
|
||||
dead-key sequences). Low-level key remapping is, for instance, used for
|
||||
changing the emitted key codes of the Num Pad keys according to the Num Lock
|
||||
state. The different filter functionalities can be arbitrarily assembled into
|
||||
a filter chain and provided as a dynamic config ROM to the event filter
|
||||
component. The event sink then receives and processes the filtered events.
|
||||
|
||||
Some input devices emit unusual and/or extra key codes in certain situations,
|
||||
which impedes the event sink's ability to detect key combos correctly. We
|
||||
therefore added the functionality to completely mute certain key codes. In
|
||||
order to ignore all unknown key codes for instance, we can now add an
|
||||
'<ignore-key>' node to the config of the event filter.
|
||||
|
||||
! <remap>
|
||||
! <ignore-key name="KEY_UNKNOWN"/>
|
||||
! ...
|
||||
! </remap>
|
||||
|
||||
Note, that '<ignore-key>' is part of the '<remap>' filter. The name attribute
|
||||
refers to the low-level key name before any remapping rule has been applied.
|
||||
|
||||
As a second addition, we implemented a '<log>' filter that allows low-level
|
||||
debugging of the event-filter component and its configuration. The '<log>'
|
||||
filter can appear at each stage in the filter chain. For instance, we can log
|
||||
the input events before and after the remap filter as follows.
|
||||
|
||||
! <log prefix="REMAPPED ">
|
||||
! <remap>
|
||||
! <log prefix="RAW ">
|
||||
! ...
|
||||
! </log>
|
||||
! </remap>
|
||||
! </log>
|
||||
|
||||
The optional 'prefix' attribute thereby helps to distinguish the log output
|
||||
from different stages.
|
||||
|
||||
|
||||
File-system helpers
|
||||
===================
|
||||
|
||||
The
|
||||
[https://genode.org/documentation/release-notes/18.08#New_component_for_querying_information_from_a_file_system - fs_query]
|
||||
component is a simple helper to query information from a file system. E.g., it
|
||||
is used by the file browser of Sculpt OS to obtain the directory structure.
|
||||
The component received two welcomed improvements. First, directory content is
|
||||
now reported in alphabetic order. Thereby, all consumers of the reports become
|
||||
able to rely on deterministic output. For example, the file browser of Sculpt
|
||||
OS, the launcher menu items, and the depot-selection items will appear in a
|
||||
predictable way. Second, the size of files can be queried now. By adding an
|
||||
attribute 'size="yes"' to a query, fs_query is instructed to report the size
|
||||
of each queried file as attribute 'size' of the corresponding 'file' node.
|
||||
|
||||
Whereas fs_query inspects a file system without changing it, its sister
|
||||
component fs_tool is able to perform file-system modifications. The new
|
||||
version adds a '<new-file path="...">' operation, which writes the content of
|
||||
the XML node into the file specified as 'path' attribute. The directory
|
||||
structure leading to the file is implicitly created if needed. Should a file
|
||||
with the specified name already exist, the original file will be overwritten.
|
||||
|
||||
|
||||
Applications
|
||||
############
|
||||
|
||||
File vault based on the CBE block encrypter
|
||||
===========================================
|
||||
|
||||
Over several releases
|
||||
([https://genode.org/documentation/release-notes/19.11#Preliminary_block-device_encrypter - 19.11],
|
||||
[https://genode.org/documentation/release-notes/20.05#Feature-completeness_of_the_consistent_block_encrypter - 20.05],
|
||||
[https://genode.org/documentation/release-notes/20.08#Consistent_Block_Encrypter - 20.08],
|
||||
[https://genode.org/documentation/release-notes/20.11#Consistent_Block_Encrypter__CBE_ - 20.11]),
|
||||
we persistently worked at a native solution for modern block encryption - the
|
||||
SPARK-based CBE-library - and its integration into Genode's VFS. Even though,
|
||||
this work was already suitable for real-world scenarios like
|
||||
[https://genodians.org/m-stein/2020-06-12-cbe-linux-vm - hosting a Linux VM on top of an encrypted block device],
|
||||
it still lacked stress-testing by a regular user base because its integration
|
||||
into an end-user system - like Sculpt - required tedious low-level wizardry.
|
||||
|
||||
This situation had to change because we want to encourage as many people as
|
||||
possible to expose the codebase around the CBE to their workflows and let it
|
||||
mature. Therefore, we came up with a new package called file vault that can be
|
||||
readily deployed on Sculpt OS. It is a graphical front end that aims at making
|
||||
the creation, use, and maintenance of a CBE-based encrypted file store as
|
||||
intuitive and secure as possible.
|
||||
|
||||
:Introducing the file vault:
|
||||
|
||||
[https://genodians.org/m-stein/2021-05-17-introducing-the-file-vault]
|
||||
|
||||
[image file_vault_setup]
|
||||
|
||||
The file vault only requires two file-system sessions from you (the trust
|
||||
anchor is stored separately from the payload data). With that, it will
|
||||
automatically create and connect a trust anchor, set up a CBE image, prepare
|
||||
an ext2 FS on top of the CBE image and provide it through a file system
|
||||
service - ready to be used like a simple directory. The directory can be
|
||||
locked by closing the file vault and unlocked by starting the file vault on
|
||||
the same trust anchor and entering the correct user passphrase. All controls
|
||||
for the file vault's underlying CBE encrypter - like for its re-sizing and
|
||||
re-keying functionality - are presented through a simple and guiding UI that
|
||||
also provides you with the most relevant status information of your vault.
|
||||
|
||||
The file vault package is accompanied by some notable improvements regarding
|
||||
CBE's key management. Whereas in the previous release, this aspect was still
|
||||
merely a prototype with almost no protective value, the current implementation
|
||||
embraces well-known algorithms to generate and encrypt the keys used within
|
||||
the CBE respectively the file vault. This is explained in detail in the
|
||||
aforementioned article.
|
||||
|
||||
As a note of caution, the primary purpose of the current version of the file
|
||||
vault is to lift native block encryption in Genode from the development stage
|
||||
to product quality. At the current stage, it is neither time-tested nor
|
||||
reviewed by independent cryptography experts. Consequently, you should use it
|
||||
with a healthy dose of suspicion, for non-critical data only! We would be more
|
||||
than happy to receive feedback on your experience with the file vault.
|
||||
|
||||
|
||||
VirtualBox
|
||||
==========
|
||||
|
||||
Since the previous release, we continued the enablement of VirtualBox 6 on
|
||||
Genode and put efforts into stabilizing the port. Therefore, we updated to
|
||||
version 6.1.18 and reorganized the internal structure for a more
|
||||
comprehensible execution model with fewer threads. Further, we improved
|
||||
synchronization in multi-processor use cases and added a Sculpt runtime
|
||||
package for vbox6.
|
||||
|
||||
Finally, as a little treat, our ports of VirtualBox now support to pass extra
|
||||
buttons of five-button mice to the guest.
|
||||
|
||||
|
||||
Device drivers
|
||||
##############
|
||||
|
||||
Platform driver on ARM
|
||||
======================
|
||||
|
||||
The current release streamlines Genode's API for interacting with the platform
|
||||
driver on ARM platforms. It eases the access to memory-mapped I/O registers
|
||||
and interrupts by introducing the notions of
|
||||
|
||||
:'Platform::Device': one device obtained from a platform session
|
||||
|
||||
:'Platform::Device::Mmio': locally-mapped MMIO registers of a device
|
||||
|
||||
:'Platform::Device::Irq': interface for receiving device interrupts
|
||||
|
||||
The API is covered in detail by the following article.
|
||||
|
||||
:One Platform driver to rule them all:
|
||||
|
||||
[https://genodians.org/nfeske/2021-04-29-platform-driver]
|
||||
|
||||
It goes without saying that this change touches most ARM-specific drivers.
|
||||
Closely related, we also revised the concept of the XML based device-info
|
||||
mechanism provided by the platform driver to accommodate both complex drivers
|
||||
operating on multiple devices simultaneously such as driver stacks ported from
|
||||
Linux as well as low-complexity drivers for simple devices. In the new
|
||||
version, the device XML-information dataspace is only provided if the client's
|
||||
session policy states 'info="yes"'. The format of the XML information got
|
||||
refined to include the physical resource names (I/O memory and IRQ addresses)
|
||||
instead of virtual IDs and page offsets and by using a 'type' attribute
|
||||
instead of a '<compatible>' node to uniquely identify devices.
|
||||
|
||||
|
||||
Changes specific to i.MX8
|
||||
-------------------------
|
||||
|
||||
The platform driver incarnation specific to i.MX8 got slightly improved. It
|
||||
can handle the configuration of reset-pins now. Analogously to the already
|
||||
existent power domains, one can assign reset domains per device. Whenever a
|
||||
device with a reset domain gets acquired, its reset-pins are de-asserted. When
|
||||
the device gets released again, its reset-pins are asserted to put it into
|
||||
reset state. A sample configuration looks as follows:
|
||||
|
||||
! <device name="mipi_dsi>
|
||||
! <reset-domain name="mipi_dsi_pclk"/>
|
||||
! ...
|
||||
! </device>
|
||||
|
||||
Technically, those reset domains map to pin settings of the System Reset
|
||||
Controller (SRC) that is part of the i.MX8 SoC. The SRC is under control of
|
||||
the platform driver now. Currently, only the pins for the MIPI DSI Phy get
|
||||
exported. They are used by the graphical subsystem to handle panels connected
|
||||
via MIPI DSI.
|
||||
|
||||
|
||||
I2C driver for i.MX8
|
||||
====================
|
||||
|
||||
Thanks to Jean-Adrien Domage from [https://www.gapfruit.com - gapfruit], an
|
||||
API for I2C bus transactions and a new I2C bus driver for the i.MX8 SoC
|
||||
entered our framework. Coincidentally, the need to use the new I2C API more
|
||||
intensively arose soon after his initial contribution. As a consequence, the
|
||||
API got extended a bit. The result is a nice joint venture, and looks like the
|
||||
following:
|
||||
|
||||
! void transmit(Transaction & t);
|
||||
|
||||
Hereby a 'Transaction' is a simple array of 'Message' objects, and a 'Message'
|
||||
is an array of bytes that are either read or written. For very simple
|
||||
use-cases, e.g., a client that polls single bytes from a temperature sensor,
|
||||
some convenience utilities are incorporated into the 'I2c::Connection'.
|
||||
|
||||
|
||||
USB
|
||||
===
|
||||
|
||||
The USB-driver system has received quite a few refinements, performance
|
||||
improvements, and robustness handling efforts during the current release
|
||||
cycle. The HID subsystem is now capable of handling devices where the HID USB
|
||||
interface is at an arbitrary location within the device descriptors - as
|
||||
opposed to the assumption that the HID interface is always at the first
|
||||
position in the interface list of the device. Also, the HID driver now handles
|
||||
session destruction more gracefully and supports unlimited plug and unplug
|
||||
events of an associated HID device.
|
||||
|
||||
For the USB host driver, various fixes of newer Linux kernel versions have
|
||||
been back ported, which concern the handling of DMA memory. Error code and
|
||||
timeout handling have been improved in order to support more corner cases, and
|
||||
the USB session handles outstanding USB requests (synchronous and
|
||||
asynchronous) on sudden session disconnects gracefully now.
|
||||
|
||||
The CPU usage of the host driver for isochronous transfers has been reduced
|
||||
significantly for Intel XHCI controllers by adding a fix that reduces the
|
||||
triggering of an interrupt for every completed isochronous packet to one
|
||||
interrupt per eight packets, bringing the worst case scenario down to 1000
|
||||
interrupts per second from a possible 8000 IRQs before.
|
||||
|
||||
|
||||
NIC drivers
|
||||
===========
|
||||
|
||||
Drivers for iPXE-supported Ethernet devices, Wifi adapters, and Linux TAP
|
||||
devices now support the reporting of the MAC address of detected adapters.
|
||||
The feature can be enabled by a '<report>' node in the driver configuration as
|
||||
follows, prompting the driver to request a report session with the label
|
||||
_devices_.
|
||||
|
||||
! <config>
|
||||
! <report mac_address="true"/>
|
||||
! </config>
|
||||
|
||||
The resulting report is depicted below.
|
||||
|
||||
! <devices>
|
||||
! <nic mac_address="02:00:00:00:00:01"/>
|
||||
! </devices>
|
||||
|
||||
|
||||
Platforms
|
||||
#########
|
||||
|
||||
Genode/Linux on 64-bit ARM
|
||||
==========================
|
||||
|
||||
The release introduces the support for running the Linux version of Genode on
|
||||
64-bit ARM platforms. As a part of this line of work, Genode's system call
|
||||
bindings for Linux underwent a modernization to harmonize the system calls
|
||||
across the supported CPU architectures. Furthermore, we took the opportunity
|
||||
to simplify the use of the clone system call by eliminating the need for
|
||||
passing a TLS pointer.
|
||||
|
||||
Expecting that the 64-bit Genode/Linux version will remain a niche use case of
|
||||
Genode in the foreseeable future, we do not provide a pre-built tool chain.
|
||||
Hence, as a preparatory step for using this version of Genode, the tool chain
|
||||
must be built manually via Genode's _tool/tool_chain_ script.
|
||||
|
||||
As a known limitation, Genode's 'Trace::timestamp' function is not available
|
||||
on this version of Genode because Linux prevents the user land from accessing
|
||||
the cycle counter (pmccntr_el0). So the accuracy of timing is somewhat impeded
|
||||
to the order of milliseconds. Also, the jitterentropy random-number generator
|
||||
cannot be used.
|
||||
|
||||
Those limitations notwithstanding, one can successfully execute scenarios as
|
||||
complex as _leitzentrale.run_. When using AARCH64 Linux as host, run scripts
|
||||
can be executed with the same convenience as on Linux on a PC.
|
||||
|
||||
! $ make run/<script> KERNEL=linux BOARD=linux
|
||||
|
||||
|
||||
Pine-A64-LTS single board computer
|
||||
==================================
|
||||
|
||||
The current release continues
|
||||
[https://genode.org/documentation/release-notes/21.02#Pine-A64-LTS_single_board_computer - our story]
|
||||
of porting Genode to the
|
||||
[https://pine64.com/product-category/pine-a64-ltslong-term-supply/ - Pine-A64-LTS]
|
||||
board. We document the progress in great detail as we go.
|
||||
|
||||
# [https://genodians.org/nfeske/2021-03-05-pine-fun-testing - Kernel packaging and testing]
|
||||
# [https://genodians.org/nfeske/2021-03-17-pine-fun-device-access - Device access from the user level]
|
||||
# [https://genodians.org/nfeske/2021-04-29-platform-driver - One Platform driver to rule them all]
|
||||
# [https://genodians.org/nfeske/2021-05-12-pine-fun-linux - Taking Linux out for a Walk]
|
||||
# [https://genodians.org/nfeske/2021-05-19-pine-dts-pruning - Pruning device trees]
|
||||
|
||||
The accumulated material forms the basis for the evolving Genode Platforms
|
||||
document introduced in Section [Updated and new documentation].
|
||||
|
||||
The code of this line of work is available at a dedicated repository:
|
||||
|
||||
:Genode board support for Allwinner SoCs:
|
||||
|
||||
[https://github.com/nfeske/genode-allwinner]
|
||||
|
||||
|
||||
RISC-V
|
||||
======
|
||||
|
||||
The support for the RISC-V architecture has further been developed into the
|
||||
direction of a fully supported Genode platform. With this release, we wanted
|
||||
to enable basic device driver support, which requires a working interrupt
|
||||
controller. Since the "platform-level interrupt controller" (PLIC) is now
|
||||
present on most hardware as well as on the Qemu emulator, we have added
|
||||
support for the PLIC within our base-hw kernel.
|
||||
|
||||
With the interrupt controller in place, we implemented a driver for the
|
||||
[https://opencores.org - OpenCores] Ethernet device as present on the
|
||||
[https://hensoldt-cyber.com/mig-v - MiG-V] board. The driver component runs on
|
||||
Qemu (with OpenCores enabled) as well as on the MiG-V board itself. Our RISC-V
|
||||
board specific line of work can now be found within a separate
|
||||
[https://github.com/ssumpf/genode-riscv - repository].
|
||||
|
||||
With driver support in place, the final step for full RISC-V support in Genode
|
||||
is to extend our C library for this architecture.
|
||||
|
||||
|
||||
Build system and tools
|
||||
######################
|
||||
|
||||
Tool-chain update to GCC 10.3 and binutils 2.36
|
||||
===============================================
|
||||
|
||||
About every two years, we update our tailored Genode tool chain to recent
|
||||
versions. This year's update includes GCC 10.3.0, binutils 2.36.1 and GDB 10.2
|
||||
together with their corresponding Genode libraries and tools (stdcxx, ADA
|
||||
runtime, libsparkcrypto, gcov, sanitizer).
|
||||
|
||||
Feature-wise, changes are not as significant this time as with the
|
||||
[https://genode.org/documentation/release-notes/19.05#Tool_chain_based_on_GCC_8.3.0_and_binutils_2.32 - previous update],
|
||||
nevertheless we had to overcome some hurdles worth noting.
|
||||
|
||||
* The _gprbuild_ tool, which is needed to build the _ali2dep_
|
||||
tool had a bug in the version provided by Ubuntu 18.04, which prevented it
|
||||
from building _ali2dep_ with GCC/GNAT 10. To still be able to build the
|
||||
tool chain on Ubuntu 18.04, the _gprbuild_ tool is now built from
|
||||
source (of a newer version) when running the _tool_chain_ script.
|
||||
|
||||
* When building the tool chain on armhf Linux, errors occurred because
|
||||
of mismatching float-abi compiler flags used when building the
|
||||
dependency libraries (_gmp_, _mpc_, _mpfr_) with the host tool chain and
|
||||
when building the Genode tool chain with the intermediate bootstrap
|
||||
tool chain. To solve this problem, the dependency libraries are now
|
||||
downloaded and built using the GCC build system. This also had the
|
||||
effect that the _mpc_ and _mpfr_ Genode ports were not needed anymore
|
||||
and got removed.
|
||||
|
||||
* GCC 10 reports more compile errors, which had to be fixed. The most common
|
||||
errors related to narrowing conversions and potential unaligned pointers
|
||||
from packed members.
|
||||
|
||||
* GCC 10 has the _-fno-common_ option set by default, which caused link
|
||||
errors especially with some 3rd party ports.
|
||||
|
||||
* GCC 10 generated 'memset()' calls in implementations of 'memset()',
|
||||
which caused stack overflows from this recursion.
|
||||
|
||||
* The ARM compiler generates more VFP instructions now, especially when
|
||||
building for armv6, so we had to update the 'setjmp()' and 'longjmp()'
|
||||
functions used by _dde_linux_ drivers to additionally save and restore the
|
||||
FPU registers on ARM.
|
||||
|
||||
* With the new binutils version, linker sections with the same name in
|
||||
multiple linker scripts are not merged anymore. Since we rely on this
|
||||
behavior when building _core_ for NOVA, we reverted the corresponding change
|
||||
with a patch.
|
||||
|
||||
* With the new binutils version, executable files are not allowed as input
|
||||
when linking executable output files anymore. The build process of the
|
||||
Fiasco.OC kernel relied on this behavior and needed to be adapted by the
|
||||
upstream developers.
|
||||
|
||||
The new tool chain has not been enabled for RISC-V yet, because of an unsolved
|
||||
issue on initialization (resp. initial relocation) of our dynamic linker.
|
||||
Until we finalized the RISC-V support, we recommend using the tool chain
|
||||
version 19.05 for this CPU architecture by adding the following two lines to
|
||||
your build directory's _etc/tools.conf_.
|
||||
|
||||
! CROSS_DEV_PREFIX = /usr/local/genode/tool/19.05/bin/genode-riscv-
|
||||
! REQUIRED_GCC_VERSION = 8.3.0
|
||||
|
||||
The updated tool chain can be built from source or downloaded in binary form
|
||||
as described in this [https://genode.org/download/tool-chain - document].
|
||||
|
||||
|
||||
Utilities for porting Linux drivers
|
||||
===================================
|
||||
|
||||
Dummy-function generator
|
||||
------------------------
|
||||
|
||||
While porting device drivers from the Linux kernel to Genode, one has to
|
||||
tailor the environment that replaces the original kernel code. Thereby, tons
|
||||
of missing function and variable implementations have to be written. Most of
|
||||
them won't even be called by the driver under normal circumstances, but
|
||||
nonetheless they are needed to link the executable binary.
|
||||
|
||||
The production of these dummy functions in the first place is a tiresome and
|
||||
somewhat annoying work. To free developers from this burden, a new tool
|
||||
entered the Genode framework under _tool/dde_linux/create_dummies_. Apart from
|
||||
the creation of missing kernel functions and variables, it can also be used to
|
||||
easily summarize all missing symbols during the porting work.
|
||||
|
||||
For a more detailed explanation of the new tool, please have a look at the
|
||||
following article.
|
||||
|
||||
:Linux device driver ports - Breaking new ground:
|
||||
|
||||
[https://genodians.org/skalk/2021-04-08-dde-linux-experiments-1]
|
||||
|
||||
|
||||
Device-tree source processing
|
||||
-----------------------------
|
||||
|
||||
Device-tree source files as featured in the source tree of the Linux kernel
|
||||
contain valuable information about the structure and parameters of SoCs and
|
||||
boards. The porting and implementation of device drivers for Genode calls for
|
||||
tooling that is able to extract and convert this information into digestible
|
||||
forms. The current release introduces the first version of a new tool set at
|
||||
_tools/dts/_ for this purpose.
|
||||
|
||||
[image dts_extract]
|
||||
|
||||
The tool aids the understanding of the hardware and allows for the pruning of
|
||||
device trees down to a manageable complexity. As an illustration, the
|
||||
spiderweb on the left shows the device-interdependencies of the Pine-A64-LTS
|
||||
board. On the right, the device tree is pruned to cover only what's needed to
|
||||
use Ethernet. The tool is covered in more detail by the following dedicated
|
||||
article.
|
||||
|
||||
:Pruning device trees:
|
||||
|
||||
[https://genodians.org/nfeske/2021-05-19-pine-dts-pruning]
|
||||
|
||||
|
||||
Cache for downloaded ports
|
||||
==========================
|
||||
|
||||
When working with ports, it is not uncommon that a port hash is changed due to
|
||||
some minor change like the addition of a patch. A subsequent call of
|
||||
'prepare_port' would download the same files that were already downloaded
|
||||
while preparing a previous version of the port even if the downloaded content
|
||||
remains the same. This wastes internet bandwidth and developer time. The
|
||||
current release introduces a simple cache for downloaded archives, which
|
||||
alleviates these costs.
|
||||
|
||||
_Thanks to Tomasz Gajewski for his continuous contributions to improve our_
|
||||
_development workflows._
|
||||
|
||||
|
||||
Common hook for custom build rules
|
||||
==================================
|
||||
|
||||
There are cases that call for building custom targets in addition to a regular
|
||||
library or program. For example, the executable binary of an application may
|
||||
be accompanied by generated data files. The creation of such build artifacts
|
||||
can be expressed by custom make rules. However, a rule is triggered only if it
|
||||
is a dependency of the build target. This can now be achieved by adding the
|
||||
rule to the 'CUSTOM_TARGET_DEPS' variable. For example,
|
||||
|
||||
! CUSTOM_TARGET_DEPS += menu_view_styles.tar
|
||||
!
|
||||
! menu_view_styles.tar:
|
||||
! $(VERBOSE)cd $(PRG_DIR); tar cf $(PWD)/bin/$@ styles
|
||||
|
||||
_Thanks to Tomasz Gajewski for this welcome contribution._
|
||||
|
||||
@@ -1 +1 @@
|
||||
2021-03-11 d5d038d82badefdb0ec442be4dc7b23064ad2831
|
||||
2021-05-27 d8e59b010b60eba516a0e20b3aab18e05c85a977
|
||||
|
||||
@@ -17,7 +17,6 @@
|
||||
/* Genode includes */
|
||||
#include <base/cache.h>
|
||||
#include <base/ipc.h>
|
||||
#include <base/stdint.h>
|
||||
#include <base/native_capability.h>
|
||||
#include <util/touch.h>
|
||||
|
||||
@@ -26,67 +25,12 @@
|
||||
|
||||
/* core includes */
|
||||
#include <util.h>
|
||||
#include <mapping.h>
|
||||
|
||||
/* L4/Fiasco includes */
|
||||
#include <fiasco/syscall.h>
|
||||
|
||||
namespace Genode {
|
||||
|
||||
class Mapping;
|
||||
class Ipc_pager;
|
||||
}
|
||||
|
||||
|
||||
class Genode::Mapping
|
||||
{
|
||||
private:
|
||||
|
||||
addr_t _dst_addr;
|
||||
Fiasco::l4_fpage_t _fpage;
|
||||
|
||||
public:
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*/
|
||||
Mapping(addr_t dst_addr, addr_t src_addr,
|
||||
Cache_attribute cacheability, bool,
|
||||
unsigned l2size, bool rw, bool)
|
||||
:
|
||||
_dst_addr(dst_addr),
|
||||
_fpage(Fiasco::l4_fpage(src_addr, l2size, rw, false))
|
||||
{
|
||||
if (cacheability == WRITE_COMBINED)
|
||||
_fpage.fp.cache = Fiasco::L4_FPAGE_BUFFERABLE;
|
||||
}
|
||||
|
||||
/**
|
||||
* Construct invalid flexpage
|
||||
*/
|
||||
Mapping() : _dst_addr(0), _fpage(Fiasco::l4_fpage(0, 0, 0, 0)) { }
|
||||
|
||||
Fiasco::l4_umword_t dst_addr() const { return _dst_addr; }
|
||||
Fiasco::l4_fpage_t fpage() const { return _fpage; }
|
||||
|
||||
/**
|
||||
* Prepare map operation
|
||||
*
|
||||
* On Fiasco, we need to map a page locally to be able to map it to
|
||||
* another address space.
|
||||
*/
|
||||
void prepare_map_operation()
|
||||
{
|
||||
addr_t core_local_addr = _fpage.fp.page << 12;
|
||||
size_t mapping_size = 1 << _fpage.fp.size;
|
||||
|
||||
for (addr_t i = 0; i < mapping_size; i += L4_PAGESIZE) {
|
||||
if (_fpage.fp.write)
|
||||
touch_read_write((unsigned char volatile *)(core_local_addr + i));
|
||||
else
|
||||
touch_read((unsigned char const volatile *)(core_local_addr + i));
|
||||
}
|
||||
}
|
||||
};
|
||||
namespace Genode { class Ipc_pager; }
|
||||
|
||||
|
||||
class Genode::Ipc_pager
|
||||
|
||||
@@ -29,6 +29,26 @@ using namespace Genode;
|
||||
using namespace Fiasco;
|
||||
|
||||
|
||||
/**
|
||||
* Prepare map operation
|
||||
*
|
||||
* On Fiasco, we need to map a page locally to be able to map it to another
|
||||
* address space.
|
||||
*/
|
||||
void Mapping::prepare_map_operation() const
|
||||
{
|
||||
addr_t const core_local_addr = src_addr;
|
||||
size_t const mapping_size = 1UL << size_log2;
|
||||
|
||||
for (addr_t i = 0; i < mapping_size; i += L4_PAGESIZE) {
|
||||
if (writeable)
|
||||
touch_read_write((unsigned char volatile *)(core_local_addr + i));
|
||||
else
|
||||
touch_read((unsigned char const volatile *)(core_local_addr + i));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/***************
|
||||
** Ipc_pager **
|
||||
***************/
|
||||
@@ -51,11 +71,13 @@ void Ipc_pager::wait_for_fault()
|
||||
|
||||
void Ipc_pager::reply_and_wait_for_fault()
|
||||
{
|
||||
l4_msgdope_t result;
|
||||
l4_fpage_t const fpage { l4_fpage(_reply_mapping.src_addr,
|
||||
_reply_mapping.size_log2,
|
||||
_reply_mapping.writeable, false) };
|
||||
|
||||
l4_ipc_reply_and_wait(_last,
|
||||
L4_IPC_SHORT_FPAGE, _reply_mapping.dst_addr(),
|
||||
_reply_mapping.fpage().fpage, &_last,
|
||||
l4_msgdope_t result;
|
||||
l4_ipc_reply_and_wait(_last, L4_IPC_SHORT_FPAGE,
|
||||
_reply_mapping.dst_addr, fpage.fpage, &_last,
|
||||
L4_IPC_SHORT_MSG, &_pf_addr, &_pf_ip,
|
||||
L4_IPC_SEND_TIMEOUT_0, &result);
|
||||
|
||||
|
||||
@@ -16,6 +16,7 @@
|
||||
#include <base/allocator_avl.h>
|
||||
#include <base/sleep.h>
|
||||
#include <util/misc_math.h>
|
||||
#include <util/xml_generator.h>
|
||||
|
||||
/* base-internal includes */
|
||||
#include <base/internal/crt0.h>
|
||||
@@ -466,6 +467,29 @@ Platform::Platform()
|
||||
|
||||
init_core_log(Core_log_range { core_local_addr, log_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"));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
15
repos/base-foc/patches/0018-L4-enable-gcc_10.patch
Normal file
15
repos/base-foc/patches/0018-L4-enable-gcc_10.patch
Normal file
@@ -0,0 +1,15 @@
|
||||
L4: enable GCC 10
|
||||
|
||||
diff --git a/l4/mk/Makeconf b/l4/mk/Makeconf
|
||||
index eb59b51..a7b5955 100644
|
||||
--- a/l4/mk/Makeconf
|
||||
+++ b/l4/mk/Makeconf
|
||||
@@ -52,7 +52,7 @@ L4_KIP_OFFS_SYS_DEBUGGER = 0x900
|
||||
L4_STACK_ADDR ?= $(L4_STACK_ADDR_$(ARCH))
|
||||
L4_STACK_SIZE ?= $(if $(L4_STACK_SIZE_MAIN_THREAD),$(L4_STACK_SIZE_MAIN_THREAD),0x8000)
|
||||
|
||||
-CC_WHITELIST-gcc := 4.7 4.8 4.9 5 6 7 8 9
|
||||
+CC_WHITELIST-gcc := 4.7 4.8 4.9 5 6 7 8 9 10
|
||||
CC_WHITELIST-clang := 3.5 3.6 3.7 3.8 3.9
|
||||
|
||||
# This is quite bad: There is no other chance to disable the page-alignedment
|
||||
@@ -0,0 +1,162 @@
|
||||
From dd8842dbdae2bb11d4f726f8a49a6ecb4d5d6870 Mon Sep 17 00:00:00 2001
|
||||
|
||||
From: Frank Mehnert <frank.mehnert@kernkonzept.com>
|
||||
|
||||
Subject: [PATCH] Do not depend on any libstdc++ feature
|
||||
|
||||
The libc_minimal library does not provide support for libstdc++ so use
|
||||
the normal libc headers instead and do not use any 'std' functions.
|
||||
|
||||
Change-Id: I9b4e04ddba0e3f366550265a2c30ef0f37df5534
|
||||
---
|
||||
server/src/boot_modules.cc | 2 +-
|
||||
server/src/multiboot2.cc | 24 ++++++++++++------------
|
||||
server/src/platform/exynos.cc | 2 +-
|
||||
server/src/platform/x86_pc-base.h | 4 ++--
|
||||
server/src/platform_common.cc | 2 +-
|
||||
server/src/support.h | 4 ++--
|
||||
6 files changed, 19 insertions(+), 19 deletions(-)
|
||||
|
||||
diff --git a/server/src/boot_modules.cc b/server/src/boot_modules.cc
|
||||
index 2446967..6100749 100644
|
||||
--- a/server/src/boot_modules.cc
|
||||
+++ b/server/src/boot_modules.cc
|
||||
@@ -1,6 +1,6 @@
|
||||
#include "support.h"
|
||||
#include "panic.h"
|
||||
-#include <cassert>
|
||||
+#include <assert.h>
|
||||
#include "mod_info.h"
|
||||
#ifdef COMPRESS
|
||||
#include "uncompress.h"
|
||||
diff --git a/server/src/multiboot2.cc b/server/src/multiboot2.cc
|
||||
index c7255a3..17a2fdd 100644
|
||||
--- a/server/src/multiboot2.cc
|
||||
+++ b/server/src/multiboot2.cc
|
||||
@@ -18,7 +18,7 @@
|
||||
#include <l4/sys/consts.h>
|
||||
#include <l4/cxx/minmax>
|
||||
|
||||
-#include <cstring>
|
||||
+#include <string.h>
|
||||
|
||||
#include <assert.h>
|
||||
#include <stddef.h>
|
||||
@@ -62,7 +62,7 @@ public:
|
||||
// by some other tag type)
|
||||
void process_modules(l4util_mb2_tag_t *tag)
|
||||
{
|
||||
- std::size_t cnt = 0;
|
||||
+ size_t cnt = 0;
|
||||
|
||||
while (tag->type == L4UTIL_MB2_MODULE_INFO_TAG)
|
||||
{
|
||||
@@ -146,8 +146,8 @@ public:
|
||||
void finalize()
|
||||
{
|
||||
assert(sizeof(_mbi) <= _size);
|
||||
- std::memcpy(_buf, &_mbi, sizeof(_mbi));
|
||||
- std::memset(_buf + sizeof(_mbi), 0, _size - sizeof(_mbi));
|
||||
+ memcpy(_buf, &_mbi, sizeof(_mbi));
|
||||
+ memset(_buf + sizeof(_mbi), 0, _size - sizeof(_mbi));
|
||||
}
|
||||
|
||||
private:
|
||||
@@ -157,25 +157,25 @@ private:
|
||||
{
|
||||
char buf[1024];
|
||||
|
||||
- std::size_t size = l4_round_size(tag->size, L4UTIL_MB2_TAG_ALIGN_SHIFT);
|
||||
+ size_t size = l4_round_size(tag->size, L4UTIL_MB2_TAG_ALIGN_SHIFT);
|
||||
l4util_mb2_tag_t *dst_tag =
|
||||
reinterpret_cast<l4util_mb2_tag_t *>(end() - size);
|
||||
char *_src = reinterpret_cast<char *>(tag);
|
||||
|
||||
while (size)
|
||||
{
|
||||
- std::size_t copied = cxx::min(sizeof(buf), size);
|
||||
+ size_t copied = cxx::min(sizeof(buf), size);
|
||||
char *_dst = end() - copied;
|
||||
- std::memcpy(buf, _src, copied);
|
||||
- std::memmove(_src, _src + copied, (end() - _src) - copied);
|
||||
- std::memcpy(_dst, buf, copied);
|
||||
+ memcpy(buf, _src, copied);
|
||||
+ memmove(_src, _src + copied, (end() - _src) - copied);
|
||||
+ memcpy(_dst, buf, copied);
|
||||
size -= copied;
|
||||
}
|
||||
|
||||
return dst_tag;
|
||||
}
|
||||
|
||||
- void reserve_from_end(std::size_t size)
|
||||
+ void reserve_from_end(size_t size)
|
||||
{
|
||||
size = l4_round_size(size, L4UTIL_MB2_TAG_ALIGN_SHIFT);
|
||||
assert(_size >= size);
|
||||
@@ -183,8 +183,8 @@ private:
|
||||
}
|
||||
|
||||
char *_buf;
|
||||
- std::size_t _size;
|
||||
- const std::size_t _total_size;
|
||||
+ size_t _size;
|
||||
+ const size_t _total_size;
|
||||
|
||||
l4util_mb_info_t _mbi;
|
||||
};
|
||||
diff --git a/server/src/platform/exynos.cc b/server/src/platform/exynos.cc
|
||||
index d10d70d..bcd6d02 100644
|
||||
--- a/server/src/platform/exynos.cc
|
||||
+++ b/server/src/platform/exynos.cc
|
||||
@@ -17,7 +17,7 @@
|
||||
#include "support.h"
|
||||
#include <l4/drivers/uart_s3c2410.h>
|
||||
|
||||
-#include <cstdio>
|
||||
+#include <stdio.h>
|
||||
|
||||
namespace {
|
||||
class Platform_arm_exynos : public Platform_single_region_ram
|
||||
diff --git a/server/src/platform/x86_pc-base.h b/server/src/platform/x86_pc-base.h
|
||||
index d5d53bf..fe0e0dd 100644
|
||||
--- a/server/src/platform/x86_pc-base.h
|
||||
+++ b/server/src/platform/x86_pc-base.h
|
||||
@@ -12,8 +12,8 @@
|
||||
#include <l4/util/port_io.h>
|
||||
#include <l4/cxx/static_container>
|
||||
|
||||
-#include <cassert>
|
||||
-#include <cstdio>
|
||||
+#include <assert.h>
|
||||
+#include <stdio.h>
|
||||
|
||||
/** VGA console output */
|
||||
|
||||
diff --git a/server/src/platform_common.cc b/server/src/platform_common.cc
|
||||
index 0503802..26ae0a9 100644
|
||||
--- a/server/src/platform_common.cc
|
||||
+++ b/server/src/platform_common.cc
|
||||
@@ -1,6 +1,6 @@
|
||||
#include "support.h"
|
||||
#include <l4/cxx/minmax>
|
||||
-#include <cassert>
|
||||
+#include <assert.h>
|
||||
|
||||
#ifdef RAM_SIZE_MB
|
||||
|
||||
diff --git a/server/src/support.h b/server/src/support.h
|
||||
index 472e40e..20d2c04 100644
|
||||
--- a/server/src/support.h
|
||||
+++ b/server/src/support.h
|
||||
@@ -21,8 +21,8 @@
|
||||
#include <l4/util/mb_info.h>
|
||||
#include <stdio.h>
|
||||
#include "region.h"
|
||||
-#include <cstring>
|
||||
-#include <cstdlib>
|
||||
+#include <string.h>
|
||||
+#include <stdlib.h>
|
||||
|
||||
L4::Uart *uart();
|
||||
void set_stdio_uart(L4::Uart *uart);
|
||||
@@ -0,0 +1,25 @@
|
||||
From a4d6d7877c0050308a9c28308fa8a233c86902e1 Mon Sep 17 00:00:00 2001
|
||||
From: Alexander Warg <alexander.warg@kernkonzept.com>
|
||||
Date: Mon, 29 Jul 2019 00:00:00 +0000
|
||||
Subject: [PATCH] Fix amd64 build with binutils 2.32+
|
||||
|
||||
We have to make sure that a linker script is not given twice to ld.
|
||||
|
||||
Change-Id: Ibd0f8972083f665fb7824df2a65b319183d7b1e7
|
||||
---
|
||||
server/src/Make.rules | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/server/src/Make.rules b/server/src/Make.rules
|
||||
index 43e8775..c1bbfec 100644
|
||||
--- a/server/src/Make.rules
|
||||
+++ b/server/src/Make.rules
|
||||
@@ -439,7 +439,7 @@ $(OBJ_DIR)/ARCH-amd64/libc32/OBJ-$(ARCH)_$(CPU)/libc32.a: FORCE
|
||||
bootstrap32.elf: $(OBJ32) bootstrap32.bin $(SRC_DIR)/ARCH-amd64/boot32/bootstrap32.ld $(OBJ_DIR)/ARCH-amd64/libc32/OBJ-$(ARCH)_$(CPU)/libc32.a
|
||||
@$(LINK_MESSAGE)
|
||||
$(VERBOSE)$(CC32) -o $@ -nostdlib -static \
|
||||
- -Wl,-T,$(SRC_DIR)/ARCH-amd64/boot32/bootstrap32.ld,--gc-sections $^ -lgcc
|
||||
+ -Wl,-T,$(SRC_DIR)/ARCH-amd64/boot32/bootstrap32.ld,--gc-sections $(filter-out %/bootstrap32.ld,$^) -lgcc
|
||||
$(VERBOSE)chmod 755 $@
|
||||
|
||||
bootstrap: bootstrap32.elf
|
||||
15
repos/base-foc/patches/0021-FOC-enable-gcc_10.patch
Normal file
15
repos/base-foc/patches/0021-FOC-enable-gcc_10.patch
Normal file
@@ -0,0 +1,15 @@
|
||||
FOC: enable GCC 10
|
||||
|
||||
diff --git a/src/Makeconf b/src/Makeconf
|
||||
index de5b656..7660daa 100644
|
||||
--- a/src/Makeconf
|
||||
+++ b/src/Makeconf
|
||||
@@ -244,7 +244,7 @@ ifeq ($(CC_TYPE),gcc)
|
||||
endif
|
||||
|
||||
|
||||
-CC_WHITELIST-gcc := 4.7 4.8 4.9 5 6 7 8 9
|
||||
+CC_WHITELIST-gcc := 4.7 4.8 4.9 5 6 7 8 9 10
|
||||
CC_WHITELIST-clang := 3.6 3.7 3.8 3.9 4.0 5.0 6.0 7.0 8.0 9.0
|
||||
CC_WHITELIST := $(CC_WHITELIST-$(CC_TYPE))
|
||||
|
||||
@@ -0,0 +1,234 @@
|
||||
From f29031cdbe8cebf6c39d02a72dd50c736cec3a69 Mon Sep 17 00:00:00 2001
|
||||
|
||||
From: =?UTF-8?q?Jakub=20Jerm=C3=A1=C5=99?= <jakub.jermar@kernkonzept.com>
|
||||
|
||||
Subject: [PATCH] amd64: Split _syscall_entry into code and data
|
||||
|
||||
This change makes the entire syscall entry table smaller, sparing 32
|
||||
bytes per a statically configured CPU. Note that some padding is still
|
||||
used to achieve cacheline alignment of the per-CPU entries of the data
|
||||
part of the table.
|
||||
|
||||
Furthemore, by moving the two data members into a data section and
|
||||
allowing to modify the handler offset from JDB only, the amd64 kernel is
|
||||
easier to make completely W^X in the future. The handler entry offset
|
||||
remains a part of the jump instruction opcode (there is no data
|
||||
indirection) and JDB is enhanced to be able to patch it when needed.
|
||||
|
||||
Change-Id: I22b91f9fd2b108d99e3ceea6611a15ab3db26bb6
|
||||
|
||||
Edit for Genode: UX changes not included because of more dependencies
|
||||
---
|
||||
src/jdb/ia32/jdb_trace_set-ia32-ux.cpp | 4 +-
|
||||
src/kern/ia32/64/cpu-64.cpp | 31 +++++-------------
|
||||
src/kern/ia32/64/entry.S | 29 +++++++++++++++++
|
||||
src/kern/ia32/64/syscall_entry.cpp | 54 +++++---------------------------
|
||||
4 files changed, 48 insertions(+), 70 deletions(-)
|
||||
|
||||
diff --git a/src/jdb/ia32/jdb_trace_set-ia32-ux.cpp b/src/jdb/ia32/jdb_trace_set-ia32-ux.cpp
|
||||
index ec23322..0a2f309 100644
|
||||
--- a/src/jdb/ia32/jdb_trace_set-ia32-ux.cpp
|
||||
+++ b/src/jdb/ia32/jdb_trace_set-ia32-ux.cpp
|
||||
@@ -39,7 +39,7 @@ Jdb_set_trace::set_ipc_vector()
|
||||
|
||||
Idt::set_entry(0x30, (Address) int30_entry, true);
|
||||
Jdb::on_each_cpu([fast_entry](Cpu_number cpu){
|
||||
- Cpu::cpus.cpu(cpu).set_fast_entry(fast_entry);
|
||||
+ //Cpu::cpus.cpu(cpu).set_fast_entry(fast_entry);
|
||||
});
|
||||
|
||||
if (Jdb_ipc_trace::_trace)
|
||||
@@ -98,7 +98,7 @@ struct Jdb_ipc_log_pm : Pm_object
|
||||
else
|
||||
fast_entry = entry_sys_fast_ipc_c;
|
||||
|
||||
- Cpu::cpus.cpu(cpu).set_fast_entry(fast_entry);
|
||||
+ //Cpu::cpus.cpu(cpu).set_fast_entry(fast_entry);
|
||||
}
|
||||
|
||||
void pm_on_suspend(Cpu_number) override {}
|
||||
diff --git a/src/kern/ia32/64/cpu-64.cpp b/src/kern/ia32/64/cpu-64.cpp
|
||||
index 974c677..d18ad16 100644
|
||||
--- a/src/kern/ia32/64/cpu-64.cpp
|
||||
+++ b/src/kern/ia32/64/cpu-64.cpp
|
||||
@@ -4,7 +4,8 @@ INTERFACE [amd64 && !kernel_isolation]:
|
||||
|
||||
EXTENSION class Cpu
|
||||
{
|
||||
- static Per_cpu_array<Syscall_entry> _syscall_entry;
|
||||
+ static Per_cpu_array<Syscall_entry_data>
|
||||
+ _syscall_entry_data asm("syscall_entry_data");
|
||||
};
|
||||
|
||||
|
||||
@@ -13,14 +14,7 @@ IMPLEMENTATION[amd64 && !kernel_isolation]:
|
||||
#include "mem_layout.h"
|
||||
#include "tss.h"
|
||||
|
||||
-Per_cpu_array<Syscall_entry> Cpu::_syscall_entry;
|
||||
-
|
||||
-PUBLIC
|
||||
-void
|
||||
-Cpu::set_fast_entry(void (*func)())
|
||||
-{
|
||||
- _syscall_entry[id()].set_entry(func);
|
||||
-}
|
||||
+Per_cpu_array<Syscall_entry_data> Cpu::_syscall_entry_data;
|
||||
|
||||
IMPLEMENT inline NEEDS["tss.h"]
|
||||
Address volatile &
|
||||
@@ -31,11 +25,13 @@ PUBLIC inline
|
||||
void
|
||||
Cpu::setup_sysenter()
|
||||
{
|
||||
+ extern Per_cpu_array<Syscall_entry_text> syscall_entry_text;
|
||||
+
|
||||
wrmsr(0, GDT_CODE_KERNEL | ((GDT_CODE_USER32 | 3) << 16), MSR_STAR);
|
||||
- wrmsr((Unsigned64)&_syscall_entry[id()], MSR_LSTAR);
|
||||
- wrmsr((Unsigned64)&_syscall_entry[id()], MSR_CSTAR);
|
||||
+ wrmsr((Unsigned64)&syscall_entry_text[id()], MSR_LSTAR);
|
||||
+ wrmsr((Unsigned64)&syscall_entry_text[id()], MSR_CSTAR);
|
||||
wrmsr(~0U, MSR_SFMASK);
|
||||
- _syscall_entry[id()].set_rsp((Address)&kernel_sp());
|
||||
+ _syscall_entry_data[id()].set_rsp((Address)&kernel_sp());
|
||||
}
|
||||
|
||||
IMPLEMENTATION[amd64 && kernel_isolation]:
|
||||
@@ -43,16 +39,6 @@ IMPLEMENTATION[amd64 && kernel_isolation]:
|
||||
#include "mem_layout.h"
|
||||
#include "tss.h"
|
||||
|
||||
-PUBLIC
|
||||
-void
|
||||
-Cpu::set_fast_entry(void (*func)())
|
||||
-{
|
||||
- extern char const syscall_entry_code[];
|
||||
- extern char const syscall_entry_reloc[];
|
||||
- auto ofs = syscall_entry_reloc - syscall_entry_code + 3; // 3 byte movebas
|
||||
- *reinterpret_cast<Signed32 *>(Mem_layout::Mem_layout::Kentry_cpu_page + ofs + 0xa0) = (Signed32)(Signed64)func;
|
||||
-}
|
||||
-
|
||||
PUBLIC inline
|
||||
void
|
||||
Cpu::setup_sysenter() const
|
||||
@@ -78,7 +64,6 @@ Cpu::init_sysenter()
|
||||
{
|
||||
setup_sysenter();
|
||||
wrmsr(rdmsr(MSR_EFER) | 1, MSR_EFER);
|
||||
- set_fast_entry(entry_sys_fast_ipc_c);
|
||||
}
|
||||
|
||||
|
||||
diff --git a/src/kern/ia32/64/entry.S b/src/kern/ia32/64/entry.S
|
||||
index 1cb8137..ed5a04c 100644
|
||||
--- a/src/kern/ia32/64/entry.S
|
||||
+++ b/src/kern/ia32/64/entry.S
|
||||
@@ -372,7 +372,36 @@ entry_\name:
|
||||
jmp all_syscalls
|
||||
.endm
|
||||
|
||||
+#ifndef CONFIG_KERNEL_ISOLATION
|
||||
+#ifdef CONFIG_MP
|
||||
+MAX_NUM_CPUS = CONFIG_MP_MAX_CPUS
|
||||
+#else
|
||||
+MAX_NUM_CPUS = 1
|
||||
+#endif
|
||||
+
|
||||
+#define SYSCALL_ENTRY_DATA_SIZE 64
|
||||
+#define SYSCALL_ENTRY_TEXT_SIZE (0f - 0b)
|
||||
+#define SYSCALL_ENTRY_OFFSET ((0b - syscall_entry_text) / SYSCALL_ENTRY_TEXT_SIZE)
|
||||
+#define SYSCALL_ENTRY_DATA (syscall_entry_data + SYSCALL_ENTRY_OFFSET * SYSCALL_ENTRY_DATA_SIZE)
|
||||
+#define KERN_SP (SYSCALL_ENTRY_DATA + 0)
|
||||
+#define USER_SP (SYSCALL_ENTRY_DATA + 8)
|
||||
.section ".entry.text.syscalls", "ax", @progbits
|
||||
+ .global syscall_entry_text
|
||||
+ .align 64
|
||||
+syscall_entry_text:
|
||||
+.rept MAX_NUM_CPUS
|
||||
+0:
|
||||
+ mov %rsp, USER_SP(%rip)
|
||||
+ mov KERN_SP(%rip), %rsp
|
||||
+ mov (%rsp), %rsp
|
||||
+ pushq $GDT_DATA_USER | 3
|
||||
+ pushq USER_SP(%rip)
|
||||
+ jmp entry_sys_fast_ipc_c
|
||||
+ .align 32
|
||||
+0:
|
||||
+.endr
|
||||
+#endif /* !CONFIG_KERNEL_ISOLATION */
|
||||
+
|
||||
.p2align 4
|
||||
.type all_syscalls,@function
|
||||
all_syscalls:
|
||||
diff --git a/src/kern/ia32/64/syscall_entry.cpp b/src/kern/ia32/64/syscall_entry.cpp
|
||||
index b03d1ad..3dd7db3 100644
|
||||
--- a/src/kern/ia32/64/syscall_entry.cpp
|
||||
+++ b/src/kern/ia32/64/syscall_entry.cpp
|
||||
@@ -2,58 +2,22 @@ INTERFACE [amd64]:
|
||||
|
||||
#include "types.h"
|
||||
|
||||
-class Syscall_entry
|
||||
+class Syscall_entry_data
|
||||
{
|
||||
-private:
|
||||
- template<int INSN_LEN>
|
||||
- struct Mem_insn
|
||||
- {
|
||||
- Unsigned32 _insn:INSN_LEN * 8;
|
||||
- Unsigned32 _offset;
|
||||
- Mem_insn(Unsigned32 insn, void *mem)
|
||||
- : _insn(insn),
|
||||
- _offset((Address)mem - (Address)(&_offset + 1))
|
||||
- {}
|
||||
- } __attribute__((packed));
|
||||
-
|
||||
- Mem_insn<3> _mov_rsp_user_sp;
|
||||
- Mem_insn<3> _mov_kern_sp_rsp;
|
||||
- Unsigned32 _mov_rsp_rsp;
|
||||
- Unsigned8 _push_ss, _ss_value;
|
||||
- Mem_insn<2> _push_user_rsp;
|
||||
- Unsigned8 _jmp;
|
||||
- Signed32 _entry_offset;
|
||||
- Unsigned8 _pading[33]; // pad to the next 64 byte boundary
|
||||
- Unsigned64 _kern_sp;
|
||||
- Unsigned64 _user_sp;
|
||||
-} __attribute__((packed, aligned(64)));
|
||||
+ Unsigned64 _kern_sp = 0;
|
||||
+ Unsigned64 _user_sp = 0;
|
||||
+} __attribute__((packed, aligned(64))); // Enforce cacheline alignment
|
||||
|
||||
+struct Syscall_entry_text
|
||||
+{
|
||||
+ char _res[32]; // Keep this in sync with code in syscall_entry_text!
|
||||
+} __attribute__((packed, aligned(32)));
|
||||
|
||||
IMPLEMENTATION [amd64]:
|
||||
|
||||
-#include "config_gdt.h"
|
||||
-
|
||||
-PUBLIC inline NEEDS["config_gdt.h"]
|
||||
-Syscall_entry::Syscall_entry()
|
||||
-: /* mov %rsp, _user_sp(%rip) */ _mov_rsp_user_sp(0x258948, &_user_sp),
|
||||
- /* mov _kern_sp(%rip), %rsp */ _mov_kern_sp_rsp(0x258b48, &_kern_sp),
|
||||
- /* mov (%rsp), %rsp */ _mov_rsp_rsp(0x24248b48),
|
||||
- /* pushq GDT_DATA_USER | 3 */ _push_ss(0x6a), _ss_value(GDT_DATA_USER | 3),
|
||||
- /* pushq _user_sp(%rip) */ _push_user_rsp(0x35ff, &_user_sp),
|
||||
- /* jmp *_entry_offset */ _jmp(0xe9)
|
||||
-{}
|
||||
-
|
||||
-PUBLIC inline
|
||||
-void
|
||||
-Syscall_entry::set_entry(void (*func)(void))
|
||||
-{
|
||||
- _entry_offset = (Address)func
|
||||
- - ((Address)&_entry_offset + sizeof(_entry_offset));
|
||||
-}
|
||||
-
|
||||
PUBLIC inline
|
||||
void
|
||||
-Syscall_entry::set_rsp(Address rsp)
|
||||
+Syscall_entry_data::set_rsp(Address rsp)
|
||||
{
|
||||
_kern_sp = rsp;
|
||||
}
|
||||
@@ -0,0 +1,94 @@
|
||||
ARM: link bootstrap as ET_REL not ET_EXEC
|
||||
|
||||
From: Frank Mehnert <frank.mehnert@kernkonzept.com>
|
||||
|
||||
Support for linking of ET_EXEC section was deprecated in binutils 2.35
|
||||
and dropped in binutils 2.36.
|
||||
|
||||
Instead, extract the raw section of the fully linked bootstrap object
|
||||
and create a relocatable object which can be linked to the kernel. The
|
||||
required symbols for the linker are extracted separately.
|
||||
|
||||
Fixes ticket #CD-301.
|
||||
|
||||
Change-Id: I0cdc2aacb5dbd01677d93e2bb1103940ac60e848
|
||||
|
||||
Edit: fixed merge error for Genode
|
||||
---
|
||||
src/Makeconf.arm | 6 ++++++
|
||||
src/kern/arm/Makerules.KERNEL | 20 ++++++++++++++++----
|
||||
src/kernel.arm.ld | 4 ++--
|
||||
3 files changed, 24 insertions(+), 6 deletions(-)
|
||||
|
||||
diff --git a/src/Makeconf.arm b/src/Makeconf.arm
|
||||
index 7c66a8d..89b9e7d 100644
|
||||
--- a/src/Makeconf.arm
|
||||
+++ b/src/Makeconf.arm
|
||||
@@ -31,3 +31,9 @@ LDFLAGS += $(LDFLAGS-y)
|
||||
LD_EMULATION_CHOICE-$(CONFIG_BIT32) := armelf armelf_linux_eabi armelf_fbsd
|
||||
LD_EMULATION_CHOICE-$(CONFIG_BIT64) := aarch64linux aarch64elf
|
||||
LD_EMULATION_CHOICE := $(LD_EMULATION_CHOICE-y)
|
||||
+OBJCOPY_BFDNAME-$(CONFIG_BIT32) := elf32-littlearm
|
||||
+OBJCOPY_BFDNAME-$(CONFIG_BIT64) := elf64-littleaarch64
|
||||
+OBJCOPY_BFDNAME := $(OBJCOPY_BFDNAME-y)
|
||||
+OBJCOPY_BFDARCH-$(CONFIG_BIT32) := arm
|
||||
+OBJCOPY_BFDARCH-$(CONFIG_BIT64) := aarch64
|
||||
+OBJCOPY_BFDARCH := $(OBJCOPY_BFDARCH-y)
|
||||
diff --git a/src/kern/arm/Makerules.KERNEL b/src/kern/arm/Makerules.KERNEL
|
||||
index d706444..fae3013 100644
|
||||
--- a/src/kern/arm/Makerules.KERNEL
|
||||
+++ b/src/kern/arm/Makerules.KERNEL
|
||||
@@ -21,16 +21,28 @@ bootstrap_ldflags += -T$(bootstrap_lds)
|
||||
|
||||
bootstrap_export = _start start_of_loader end_of_bootstrap_info
|
||||
bootstrap_strip = --strip-all $(addprefix --keep-symbol=,$(bootstrap_export))
|
||||
+bootstrap_syms = end_of_bootstrap_info|_start|start_of_loader
|
||||
+bootstrap_sed = 's/^0*([0-9a-f]*) [a-zA-Z] ($(bootstrap_syms))/\2 = 0x\1;/p'
|
||||
|
||||
bootstrap.$(KERNEL).pre.o: $(OBJ_BOOTSTRAP) $(LIBGCC) $(bootstrap_lds)
|
||||
$(LINK_MESSAGE)
|
||||
$(VERBOSE)$(LD) $(bootstrap_ldflags) $(OBJ_BOOTSTRAP) $(LIBGCC) -o $@
|
||||
|
||||
-bootstrap.$(KERNEL).o: bootstrap.$(KERNEL).pre.o
|
||||
- $(LINK_MESSAGE)
|
||||
- $(VERBOSE)$(OBJCOPY) $(bootstrap_strip) $< $@
|
||||
+bootstrap.$(KERNEL).bin: bootstrap.$(KERNEL).pre.o
|
||||
+ $(COMP_MESSAGE)
|
||||
+ $(VERBOSE)$(OBJCOPY) -O binary --only-section=.bootstrap.text $< $@
|
||||
+
|
||||
+bootstrap.$(KERNEL).rel: bootstrap.$(KERNEL).bin
|
||||
+ $(COMP_MESSAGE)
|
||||
+ $(VERBOSE)$(OBJCOPY) -I binary -O $(OBJCOPY_BFDNAME) -B $(OBJCOPY_BFDARCH) \
|
||||
+ --rename-section .data=.bootstrap.text $< $@
|
||||
+
|
||||
+# The linker will treat this file as linker script.
|
||||
+bootstrap.$(KERNEL).sym: bootstrap.$(KERNEL).pre.o
|
||||
+ $(COMP_MESSAGE)
|
||||
+ $(VERBOSE)$(NM) $< | sed -n -E $(bootstrap_sed) > $@
|
||||
|
||||
-$(KERNEL).image: kernel.arm.lds $(CRT0) bootstrap.$(KERNEL).o $(OBJ_KERNEL_noboot) $(JDB) $(LIBK) $(KERNEL_EXTRA_LIBS) $(LIBDISASM) $(ABI) libdrivers.a $(LIBUART) $(CXXLIB) $(MINILIBC) $(LIBGCC) $(MINILIBC) libgluedriverslibc.a
|
||||
+$(KERNEL).image: kernel.arm.lds $(CRT0) bootstrap.$(KERNEL).rel bootstrap.$(KERNEL).sym $(OBJ_KERNEL_noboot) $(JDB) $(LIBK) $(KERNEL_EXTRA_LIBS) $(LIBDISASM) $(ABI) libdrivers.a $(LIBUART) $(CXXLIB) $(MINILIBC) $(LIBGCC) $(MINILIBC) libgluedriverslibc.a
|
||||
$(LINK_MESSAGE)
|
||||
$(VERBOSE)$(LD) $(LDFLAGS) -m $(LD_EMULATION) $(KERNEL_LDFLAGS) -N -defsym kernel_load_addr=$(CONFIG_KERNEL_LOAD_ADDR) \
|
||||
-T $< -o $@ $(filter-out $<,$+)
|
||||
diff --git a/src/kernel.arm.ld b/src/kernel.arm.ld
|
||||
index 1e3ec75..86c16b3 100644
|
||||
--- a/src/kernel.arm.ld
|
||||
+++ b/src/kernel.arm.ld
|
||||
@@ -61,14 +61,14 @@ SECTIONS {
|
||||
|
||||
. = kernel_load_addr + 0x1000;
|
||||
|
||||
- .text : {
|
||||
+ .text kernel_load_addr + 0x1000 : {
|
||||
MWORD(_start_kernel)
|
||||
MWORD(my_kernel_info_page)
|
||||
KEEP(*(.bootstrap.info))
|
||||
ASSERT (ABSOLUTE(.) == end_of_bootstrap_info, "invalid size of bootstrap.info");
|
||||
|
||||
. = ABSOLUTE(start_of_loader);
|
||||
- *(.bootstrap.text)
|
||||
+ KEEP(*(.bootstrap.text))
|
||||
} :bstrap
|
||||
|
||||
. = ALIGN(4K);
|
||||
@@ -1 +1 @@
|
||||
2e8cbb44d4c009238d96b66a9fc085e038f22e61
|
||||
abe2de76835f33297ca4e4ac687e69bc04f83dc5
|
||||
|
||||
@@ -37,5 +37,11 @@ PATCH_OPT(patches/0014-Always-enable-user-mode-access-for-performance-monit.patc
|
||||
PATCH_OPT(patches/0015-VMX-disable-event-injection-if-requested-by-VMM.patch) := -p3 -d${DIR(foc)}
|
||||
PATCH_OPT(patches/0016-svm-provide-cr0-to-guest-if-np-enabled.patch) := -p3 -d${DIR(foc)}
|
||||
PATCH_OPT(patches/0017-svm-avoid-forceful-exit-on-task-switch.patch) := -p3 -d${DIR(foc)}
|
||||
PATCH_OPT(patches/0018-L4-enable-gcc_10.patch) := -p2 -d${DIR(mk)}
|
||||
PATCH_OPT(patches/0019-Bootstrap-do-not-depend-on-any-libstdcxx-feature.patch) := -p1 -d${DIR(bootstrap)}
|
||||
PATCH_OPT(patches/0020-Bootstrap-fix-amd64-build-with-binutils-2_32.patch) := -p1 -d${DIR(bootstrap)}
|
||||
PATCH_OPT(patches/0021-FOC-enable-gcc_10.patch) := -p1 -d${DIR(foc)}
|
||||
PATCH_OPT(patches/0022-FOC-amd64-split-_syscall_entry-into-code-and-data.patch) := -p1 -d${DIR(foc)}
|
||||
PATCH_OPT(patches/0023-FOC-arm-link-bootstrap-as-et_rel.patch) := -p1 -d${DIR(foc)}
|
||||
|
||||
$(call check_tool,gawk)
|
||||
|
||||
@@ -1 +1 @@
|
||||
2021-03-11 c1f7d1de07d3a55d5e43f6ab5fb67b502ab1d0bb
|
||||
2021-05-27 8cfe2fe4913b79b6b58ae5dc1e47e4c96881b9fb
|
||||
|
||||
@@ -1 +1 @@
|
||||
2021-03-11 9383498670ce6668c8b99da3e62008b21a5932aa
|
||||
2021-05-27 af377c6c3dcc0adcd59cd2e8668f47bdcc12d4c1
|
||||
|
||||
@@ -1 +1 @@
|
||||
2021-03-11 50104241d20d23e928d3b27d0931d14112c68e82
|
||||
2021-05-27 475462d2565c1eb0cb0df6c3ba4f58007f73ac04
|
||||
|
||||
@@ -1 +1 @@
|
||||
2021-03-11 43cc39f70c8bfe4df3427c94d096d7e218b7b24c
|
||||
2021-05-27 778e2a540f54b8164db8f459931211964cafeb58
|
||||
|
||||
@@ -1 +1 @@
|
||||
2021-03-11 742459157b61720e96c17bb6cfbf7ac085a4df2f
|
||||
2021-05-27 d977d90dd21a266a9325b355da80def7bf26cd0f
|
||||
|
||||
@@ -16,7 +16,6 @@
|
||||
#define _CORE__INCLUDE__IPC_PAGER_H_
|
||||
|
||||
/* Genode includes */
|
||||
#include <base/cache.h>
|
||||
#include <base/ipc.h>
|
||||
#include <base/stdint.h>
|
||||
#include <base/native_capability.h>
|
||||
@@ -28,67 +27,15 @@
|
||||
/* base-internal includes */
|
||||
#include <base/internal/native_thread.h>
|
||||
|
||||
/* core-local includes */
|
||||
#include <mapping.h>
|
||||
|
||||
/* Fiasco.OC includes */
|
||||
#include <foc/syscall.h>
|
||||
|
||||
namespace Genode {
|
||||
|
||||
class Mapping;
|
||||
class Ipc_pager;
|
||||
}
|
||||
namespace Genode { class Ipc_pager; }
|
||||
|
||||
|
||||
class Genode::Mapping
|
||||
{
|
||||
private:
|
||||
|
||||
addr_t _dst_addr;
|
||||
Foc::l4_fpage_t _fpage { };
|
||||
Cache_attribute _cacheability;
|
||||
bool _iomem;
|
||||
|
||||
public:
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*/
|
||||
Mapping(addr_t dst_addr, addr_t src_addr,
|
||||
Cache_attribute c, bool io_mem,
|
||||
unsigned log2size, bool write, bool executable)
|
||||
:
|
||||
_dst_addr(dst_addr), _cacheability(c), _iomem(io_mem)
|
||||
{
|
||||
typedef Foc::L4_fpage_rights Rights;
|
||||
Rights rights = ( write && executable) ? Foc::L4_FPAGE_RWX :
|
||||
( write && !executable) ? Foc::L4_FPAGE_RW :
|
||||
(!write && !executable) ? Foc::L4_FPAGE_RO :
|
||||
Foc::L4_FPAGE_RX;
|
||||
|
||||
_fpage = Foc::l4_fpage(src_addr, log2size, rights);
|
||||
}
|
||||
|
||||
/**
|
||||
* Construct invalid flexpage
|
||||
*/
|
||||
Mapping() : _dst_addr(0), _fpage(Foc::l4_fpage_invalid()),
|
||||
_cacheability(UNCACHED), _iomem(false) { }
|
||||
|
||||
Foc::l4_umword_t dst_addr() const { return _dst_addr; }
|
||||
bool grant() const { return false; }
|
||||
Foc::l4_fpage_t fpage() const { return _fpage; }
|
||||
Cache_attribute cacheability() const { return _cacheability; }
|
||||
bool iomem() const { return _iomem; }
|
||||
/**
|
||||
* Prepare map operation is not needed on Fiasco.OC, since we clear the
|
||||
* dataspace before this function is called.
|
||||
*/
|
||||
void prepare_map_operation() { }
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* Special paging server class
|
||||
*/
|
||||
class Genode::Ipc_pager : public Native_capability
|
||||
{
|
||||
public:
|
||||
@@ -97,14 +44,14 @@ class Genode::Ipc_pager : public Native_capability
|
||||
|
||||
private:
|
||||
|
||||
Native_thread _last { }; /* origin of last fault */
|
||||
addr_t _pf_addr { 0 }; /* page-fault address */
|
||||
addr_t _pf_ip { 0 }; /* ip of faulter */
|
||||
Mapping _reply_mapping { }; /* page-fault answer */
|
||||
unsigned long _badge; /* badge of faulting thread */
|
||||
Native_thread _last { }; /* origin of last fault */
|
||||
addr_t _pf_addr { 0 }; /* page-fault address */
|
||||
addr_t _pf_ip { 0 }; /* ip of faulter */
|
||||
Mapping _reply_mapping { }; /* page-fault answer */
|
||||
unsigned long _badge; /* badge of faulting thread */
|
||||
Foc::l4_msgtag_t _tag { }; /* receive message tag */
|
||||
Foc::l4_exc_regs_t _regs { }; /* exception registers */
|
||||
Msg_type _type { PAGEFAULT };
|
||||
Msg_type _type { PAGEFAULT };
|
||||
|
||||
void _parse_msg_type(void);
|
||||
void _parse_exception(void);
|
||||
|
||||
@@ -29,6 +29,13 @@ using namespace Genode;
|
||||
using namespace Foc;
|
||||
|
||||
|
||||
/*
|
||||
* There is no preparation needed because the entire physical memory is known
|
||||
* to be mapped within core.
|
||||
*/
|
||||
void Mapping::prepare_map_operation() const { }
|
||||
|
||||
|
||||
void Ipc_pager::_parse(unsigned long label)
|
||||
{
|
||||
_badge = label & ~0x3;
|
||||
@@ -94,31 +101,35 @@ void Ipc_pager::reply_and_wait_for_fault()
|
||||
l4_umword_t label;
|
||||
l4_msgtag_t snd_tag = l4_msgtag(0, 0, 1, 0);
|
||||
|
||||
l4_umword_t grant = _reply_mapping.grant() ? L4_MAP_ITEM_GRANT : 0;
|
||||
l4_utcb_mr()->mr[0] = _reply_mapping.dst_addr() | L4_ITEM_MAP | grant;
|
||||
l4_utcb_mr()->mr[0] = _reply_mapping.dst_addr | L4_ITEM_MAP;
|
||||
|
||||
switch (_reply_mapping.cacheability()) {
|
||||
bool const bufferable = !_reply_mapping.io_mem || _reply_mapping.write_combined;
|
||||
|
||||
case WRITE_COMBINED:
|
||||
l4_utcb_mr()->mr[0] |= L4_FPAGE_BUFFERABLE << 4;
|
||||
break;
|
||||
l4_fpage_cacheability_opt_t const
|
||||
cacheability = _reply_mapping.cached ? L4_FPAGE_CACHEABLE
|
||||
: bufferable ? L4_FPAGE_BUFFERABLE
|
||||
: L4_FPAGE_UNCACHEABLE;
|
||||
|
||||
case CACHED:
|
||||
l4_utcb_mr()->mr[0] |= L4_FPAGE_CACHEABLE << 4;
|
||||
break;
|
||||
l4_utcb_mr()->mr[0] |= cacheability << 4;
|
||||
|
||||
case UNCACHED:
|
||||
if (!_reply_mapping.iomem())
|
||||
l4_utcb_mr()->mr[0] |= L4_FPAGE_BUFFERABLE << 4;
|
||||
else
|
||||
l4_utcb_mr()->mr[0] |= L4_FPAGE_UNCACHEABLE << 4;
|
||||
break;
|
||||
}
|
||||
l4_utcb_mr()->mr[1] = _reply_mapping.fpage().raw;
|
||||
auto rights = [] (bool writeable, bool executable)
|
||||
{
|
||||
if ( writeable && executable) return L4_FPAGE_RWX;
|
||||
if ( writeable && !executable) return L4_FPAGE_RW;
|
||||
if (!writeable && !executable) return L4_FPAGE_RO;
|
||||
return L4_FPAGE_RX;
|
||||
};
|
||||
|
||||
l4_fpage_t const fpage = l4_fpage(_reply_mapping.src_addr,
|
||||
_reply_mapping.size_log2,
|
||||
rights(_reply_mapping.writeable,
|
||||
_reply_mapping.executable));
|
||||
|
||||
l4_utcb_mr()->mr[1] = fpage.raw;
|
||||
|
||||
_tag = l4_ipc_send_and_wait(_last.kcap, l4_utcb(), snd_tag,
|
||||
&label, L4_IPC_SEND_TIMEOUT_0);
|
||||
int err = l4_ipc_error(_tag, l4_utcb());
|
||||
int const err = l4_ipc_error(_tag, l4_utcb());
|
||||
if (err) {
|
||||
error("Ipc error ", err, " in pagefault from ", Hex(label & ~0x3));
|
||||
wait_for_fault();
|
||||
@@ -139,7 +150,7 @@ void Ipc_pager::acknowledge_wakeup()
|
||||
|
||||
void Ipc_pager::acknowledge_exception()
|
||||
{
|
||||
_regs = *l4_utcb_exc();
|
||||
*l4_utcb_exc() = _regs;
|
||||
l4_cap_idx_t dst = Foc::Capability::valid(_last.kcap)
|
||||
? _last.kcap : (l4_cap_idx_t)L4_SYSF_REPLY;
|
||||
Foc::l4_msgtag_t const msg_tag =
|
||||
|
||||
@@ -493,7 +493,11 @@ Platform::Platform()
|
||||
pages << get_page_size_log2(),
|
||||
"platform_info", [&] ()
|
||||
{
|
||||
xml.node("kernel", [&] () { xml.attribute("name", "foc"); });
|
||||
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()); });
|
||||
|
||||
|
||||
@@ -1 +1 @@
|
||||
2021-03-11 5f70d9ee12b71eeda56fed778219365271c78934
|
||||
2021-05-27 602a4250ab4812d355255f87600ae5b2d058ff6c
|
||||
|
||||
@@ -1 +1 @@
|
||||
2021-03-11 d370add0c416bc0f2e7ae83de6d2f10f9ea59823
|
||||
2021-05-27 5a92bddc377068791d0eb704411e8f64f408b7a3
|
||||
|
||||
@@ -1 +1 @@
|
||||
2021-03-11 be82a7e08f0a16f93f689b8d3d747ea90fab396f
|
||||
2021-05-27 03207ecbb46d304aecf94b491dd7f5f18434a3ba
|
||||
|
||||
@@ -1 +1 @@
|
||||
2021-03-11 0f3db9a963d53504843478924551bc619667d8d4
|
||||
2021-05-27 e561b3c3024c5e66fc47a14741ad51f94772023d
|
||||
|
||||
@@ -1 +1 @@
|
||||
2021-03-28 d4983186c11a48fecfc87fbc15f16f6bb45d91e5
|
||||
2021-05-27 a45306f7af1fbe6b5414fc79d6d7df72d90cc051
|
||||
|
||||
@@ -1 +1 @@
|
||||
2021-03-11 8176ee1808ba28e0e84ad00154d88ecf8d0cbfff
|
||||
2021-05-27 0e52b14f12fb8387836c1d282c5b3bdd43308a33
|
||||
|
||||
@@ -1 +1 @@
|
||||
2021-03-11 76290d876f3ca43436d7cfd0558b264be0aac69a
|
||||
2021-05-27 04b1d602e9705d398191f25bd5650df55e02d15e
|
||||
|
||||
@@ -1 +1 @@
|
||||
2021-03-11 b399a660467f8107c0297cb502f80f64432d6ef6
|
||||
2021-05-27 6a261650e7781a3fe05b2884c3222c4a684989b9
|
||||
|
||||
@@ -1 +1 @@
|
||||
2021-03-11 6bc53d97397ed97bd275b81a4af771e59f0a29db
|
||||
2021-05-27 6a7d93057760db316c708ed862f57552e1d30076
|
||||
|
||||
@@ -1 +1 @@
|
||||
2021-03-11 37a51e7eeed1c8902b6a12a7e6f9ba0c4857fb45
|
||||
2021-05-27 f297a9e79ff7645be095431c9b4d8a6caeea84e3
|
||||
|
||||
@@ -1 +1 @@
|
||||
2021-03-11 d722eae5ebbafea313995f3443f903c0c965be9f
|
||||
2021-05-27 a461ab6e948dd5d96a908bec57a9eecbf7088f3b
|
||||
|
||||
@@ -1 +1 @@
|
||||
2021-03-11 06c48030f17bcd7ba888145b208e27146c6ea687
|
||||
2021-05-27 f2aa981b5a6eee8a4f246b2f03c785558e001f09
|
||||
|
||||
@@ -1 +1 @@
|
||||
2021-03-11 7eed185acd78e556e5cc69ecd1db6ce43a724238
|
||||
2021-05-27 c2d6204ae3de07ef6bca3aceacb7cc0df6b8939a
|
||||
|
||||
@@ -175,7 +175,7 @@ Platform::Platform()
|
||||
using namespace Genode;
|
||||
|
||||
/* prepare the ram allocator */
|
||||
board.early_ram_regions.for_each([this] (Memory_region const & region) {
|
||||
board.early_ram_regions.for_each([this] (unsigned, Memory_region const & region) {
|
||||
ram_alloc.add(region); });
|
||||
ram_alloc.remove(bootstrap_region);
|
||||
|
||||
@@ -207,6 +207,6 @@ Platform::Platform()
|
||||
/* add all left RAM to bootinfo */
|
||||
ram_alloc.for_each_free_region([&] (Memory_region const & r) {
|
||||
bootinfo.ram_regions.add(r); });
|
||||
board.late_ram_regions.for_each([&] (Memory_region const & r) {
|
||||
board.late_ram_regions.for_each([&] (unsigned, Memory_region const & r) {
|
||||
bootinfo.ram_regions.add(r); });
|
||||
}
|
||||
|
||||
@@ -27,6 +27,7 @@
|
||||
/* core-local includes */
|
||||
#include <kernel/signal_receiver.h>
|
||||
#include <hw/mapping.h>
|
||||
#include <mapping.h>
|
||||
#include <object.h>
|
||||
#include <rpc_cap_factory.h>
|
||||
|
||||
@@ -56,28 +57,6 @@ namespace Genode {
|
||||
}
|
||||
|
||||
|
||||
struct Genode::Mapping : Hw::Mapping
|
||||
{
|
||||
Mapping() {}
|
||||
|
||||
Mapping(addr_t virt,
|
||||
addr_t phys,
|
||||
Cache_attribute cacheable,
|
||||
bool io,
|
||||
unsigned size_log2,
|
||||
bool writeable,
|
||||
bool executable)
|
||||
:
|
||||
Hw::Mapping(phys, virt, 1 << size_log2,
|
||||
{ writeable ? Hw::RW : Hw::RO,
|
||||
executable ? Hw::EXEC : Hw::NO_EXEC, Hw::USER,
|
||||
Hw::NO_GLOBAL, io ? Hw::DEVICE : Hw::RAM, cacheable })
|
||||
{ }
|
||||
|
||||
void prepare_map_operation() const {}
|
||||
};
|
||||
|
||||
|
||||
class Genode::Ipc_pager
|
||||
{
|
||||
protected:
|
||||
|
||||
@@ -67,7 +67,7 @@ void Platform::_init_io_mem_alloc()
|
||||
{
|
||||
/* add entire adress space minus the RAM memory regions */
|
||||
_io_mem_alloc.add_range(0, ~0x0UL);
|
||||
_boot_info().ram_regions.for_each([this] (Hw::Memory_region const &r) {
|
||||
_boot_info().ram_regions.for_each([this] (unsigned, Hw::Memory_region const &r) {
|
||||
_io_mem_alloc.remove_range(r.base, r.size); });
|
||||
};
|
||||
|
||||
@@ -82,7 +82,7 @@ Hw::Memory_region_array const & Platform::_core_virt_regions()
|
||||
addr_t Platform::core_phys_addr(addr_t virt)
|
||||
{
|
||||
addr_t ret = 0;
|
||||
_boot_info().elf_mappings.for_each([&] (Hw::Mapping const & m)
|
||||
_boot_info().elf_mappings.for_each([&] (unsigned, Hw::Mapping const & m)
|
||||
{
|
||||
if (virt >= m.virt() && virt < (m.virt() + m.size()))
|
||||
ret = (virt - m.virt()) + m.phys();
|
||||
@@ -132,7 +132,10 @@ void Platform::_init_platform_info()
|
||||
Genode::Xml_generator xml(reinterpret_cast<char *>(virt_addr),
|
||||
rom_size, rom_name, [&] ()
|
||||
{
|
||||
xml.node("kernel", [&] () { xml.attribute("name", "hw"); });
|
||||
xml.node("kernel", [&] () {
|
||||
xml.attribute("name", "hw");
|
||||
xml.attribute("acpi", true);
|
||||
});
|
||||
_init_additional_platform_info(xml);
|
||||
xml.node("affinity-space", [&] () {
|
||||
xml.attribute("width", affinity_space().width());
|
||||
@@ -162,11 +165,11 @@ Platform::Platform()
|
||||
|
||||
_core_mem_alloc.virt_alloc().add_range(Hw::Mm::core_heap().base,
|
||||
Hw::Mm::core_heap().size);
|
||||
_core_virt_regions().for_each([this] (Hw::Memory_region const & r) {
|
||||
_core_virt_regions().for_each([this] (unsigned, Hw::Memory_region const & r) {
|
||||
_core_mem_alloc.virt_alloc().remove_range(r.base, r.size); });
|
||||
_boot_info().elf_mappings.for_each([this] (Hw::Mapping const & m) {
|
||||
_boot_info().elf_mappings.for_each([this] (unsigned, Hw::Mapping const & m) {
|
||||
_core_mem_alloc.virt_alloc().remove_range(m.virt(), m.size()); });
|
||||
_boot_info().ram_regions.for_each([this] (Hw::Memory_region const & region) {
|
||||
_boot_info().ram_regions.for_each([this] (unsigned, Hw::Memory_region const & region) {
|
||||
_core_mem_alloc.phys_alloc().add_range(region.base, region.size); });
|
||||
|
||||
_init_io_port_alloc();
|
||||
|
||||
@@ -61,11 +61,24 @@ void Pager_entrypoint::entry()
|
||||
if (!locked_ptr.valid()) continue;
|
||||
|
||||
Hw::Address_space * as = static_cast<Hw::Address_space*>(&*locked_ptr);
|
||||
as->insert_translation(_mapping.virt(), _mapping.phys(),
|
||||
_mapping.size(), _mapping.flags());
|
||||
|
||||
Hw::Page_flags const flags {
|
||||
.writeable = _mapping.writeable ? Hw::RW : Hw::RO,
|
||||
.executable = _mapping.executable ? Hw::EXEC : Hw::NO_EXEC,
|
||||
.privileged = Hw::USER,
|
||||
.global = Hw::NO_GLOBAL,
|
||||
.type = _mapping.io_mem ? Hw::DEVICE : Hw::RAM,
|
||||
.cacheable = _mapping.cached ? Genode::CACHED : Genode::UNCACHED
|
||||
};
|
||||
|
||||
as->insert_translation(_mapping.dst_addr, _mapping.src_addr,
|
||||
1UL << _mapping.size_log2, flags);
|
||||
}
|
||||
|
||||
/* let pager object go back to no-fault state */
|
||||
po->wake_up();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void Mapping::prepare_map_operation() const { }
|
||||
|
||||
@@ -39,7 +39,7 @@ Kernel::Vm::Vm(unsigned,
|
||||
void Vm::exception(Cpu & cpu)
|
||||
{
|
||||
switch(_state.cpu_exception) {
|
||||
case Genode::Cpu_state::INTERRUPT_REQUEST: [[fallthrough]]
|
||||
case Genode::Cpu_state::INTERRUPT_REQUEST: [[fallthrough]];
|
||||
case Genode::Cpu_state::FAST_INTERRUPT_REQUEST:
|
||||
_interrupt(cpu.id());
|
||||
return;
|
||||
|
||||
@@ -65,8 +65,7 @@ Capability<Vm_session::Native_vcpu> Vm_session_component::create_vcpu(Thread_cap
|
||||
Vcpu & vcpu = *_vcpus[_vcpu_id_alloc];
|
||||
|
||||
try {
|
||||
vcpu.ds_cap = _constrained_md_ram_alloc.alloc(_ds_size(),
|
||||
Cache_attribute::UNCACHED);
|
||||
vcpu.ds_cap = _constrained_md_ram_alloc.alloc(_ds_size(), Cache::UNCACHED);
|
||||
vcpu.ds_addr = _region_map.attach(vcpu.ds_cap);
|
||||
} catch (...) {
|
||||
if (vcpu.ds_cap.valid())
|
||||
|
||||
@@ -1,63 +0,0 @@
|
||||
/*
|
||||
* \brief Array class with static size
|
||||
* \author Stefan Kalkowski
|
||||
* \date 2016-09-30
|
||||
*/
|
||||
|
||||
/*
|
||||
* Copyright (C) 2016-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 _SRC__LIB__HW__ARRAY_H_
|
||||
#define _SRC__LIB__HW__ARRAY_H_
|
||||
|
||||
#include <base/log.h>
|
||||
|
||||
namespace Hw { template <typename, unsigned> class Array; }
|
||||
|
||||
|
||||
template <typename T, unsigned MAX>
|
||||
class Hw::Array
|
||||
{
|
||||
private:
|
||||
|
||||
unsigned _count = 0;
|
||||
T _objs[MAX];
|
||||
|
||||
void _init(unsigned i, T obj) { _objs[i] = obj; }
|
||||
|
||||
template <typename ... TAIL>
|
||||
void _init(unsigned i, T obj, TAIL ... tail)
|
||||
{
|
||||
_objs[i] = obj;
|
||||
_init(i+1, tail...);
|
||||
}
|
||||
|
||||
public:
|
||||
|
||||
Array() {}
|
||||
|
||||
template<typename ... ARGS>
|
||||
Array(ARGS ... args) : _count(sizeof...(ARGS))
|
||||
{
|
||||
static_assert(sizeof...(ARGS) <= MAX, "Array too small!");
|
||||
_init(0, args...);
|
||||
}
|
||||
|
||||
void add(T const & obj)
|
||||
{
|
||||
if (_count == MAX) Genode::error("Array too small!");
|
||||
else _objs[_count++] = obj;
|
||||
}
|
||||
|
||||
template <typename FUNC>
|
||||
void for_each(FUNC f) const {
|
||||
for (unsigned i = 0; i < _count; i++) f(_objs[i]); }
|
||||
|
||||
unsigned count() const { return _count; }
|
||||
};
|
||||
|
||||
#endif /* _SRC__LIB__HW__ARRAY_H_ */
|
||||
@@ -22,7 +22,7 @@ namespace Hw { template <typename> struct Boot_info; }
|
||||
template <typename PLAT_INFO>
|
||||
struct Hw::Boot_info
|
||||
{
|
||||
using Mapping_pool = Array<Mapping, 32>;
|
||||
using Mapping_pool = Genode::Array<Mapping, 32>;
|
||||
|
||||
addr_t const table;
|
||||
addr_t const table_allocator;
|
||||
|
||||
@@ -45,7 +45,7 @@ struct Hw::Mmio_space : Hw::Memory_region_array
|
||||
void for_each_mapping(FUNC f) const
|
||||
{
|
||||
addr_t virt_base = Mm::core_mmio().base;
|
||||
auto lambda = [&] (Memory_region const & r) {
|
||||
auto lambda = [&] (unsigned, Memory_region const & r) {
|
||||
f(Mapping { r.base, virt_base, r.size, PAGE_FLAGS_KERN_IO });
|
||||
virt_base += r.size + get_page_size();
|
||||
};
|
||||
|
||||
@@ -15,13 +15,13 @@
|
||||
#define _SRC__LIB__HW__MEMORY_REGION_H_
|
||||
|
||||
#include <base/output.h>
|
||||
#include <hw/array.h>
|
||||
#include <util/array.h>
|
||||
#include <hw/util.h>
|
||||
|
||||
namespace Hw {
|
||||
|
||||
struct Memory_region;
|
||||
using Memory_region_array = Array<Memory_region, 16>;
|
||||
using Memory_region_array = Genode::Array<Memory_region, 16>;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -31,12 +31,12 @@ namespace Hw {
|
||||
|
||||
struct Hw::Page_flags
|
||||
{
|
||||
Writeable writeable;
|
||||
Executeable executable;
|
||||
Privileged privileged;
|
||||
Global global;
|
||||
Type type;
|
||||
Genode::Cache_attribute cacheable;
|
||||
Writeable writeable;
|
||||
Executeable executable;
|
||||
Privileged privileged;
|
||||
Global global;
|
||||
Type type;
|
||||
Genode::Cache cacheable;
|
||||
|
||||
void print(Genode::Output & out) const
|
||||
{
|
||||
|
||||
@@ -199,8 +199,8 @@ class Hw::Long_translation_table
|
||||
struct Attribute_index : Base::template Bitfield<2, 3>
|
||||
{
|
||||
enum {
|
||||
UNCACHED = Genode::Cache_attribute::UNCACHED,
|
||||
CACHED = Genode::Cache_attribute::CACHED,
|
||||
UNCACHED = Genode::Cache::UNCACHED,
|
||||
CACHED = Genode::Cache::CACHED,
|
||||
DEVICE
|
||||
};
|
||||
|
||||
|
||||
@@ -122,7 +122,7 @@ class Hw::Level_4_translation_table
|
||||
|
||||
static access_t create(Page_flags const &flags, addr_t const pa)
|
||||
{
|
||||
bool const wc = flags.cacheable == Genode::Cache_attribute::WRITE_COMBINED;
|
||||
bool const wc = flags.cacheable == Genode::Cache::WRITE_COMBINED;
|
||||
|
||||
return Common::create(flags)
|
||||
| G::bits(flags.global)
|
||||
@@ -303,7 +303,7 @@ class Hw::Page_directory
|
||||
static typename Base::access_t create(Page_flags const &flags,
|
||||
addr_t const pa)
|
||||
{
|
||||
bool const wc = flags.cacheable == Genode::Cache_attribute::WRITE_COMBINED;
|
||||
bool const wc = flags.cacheable == Genode::Cache::WRITE_COMBINED;
|
||||
|
||||
return Base::create(flags)
|
||||
| Base::Ps::bits(1)
|
||||
|
||||
34
repos/base-linux/include/spec/arm_64/trace/timestamp.h
Normal file
34
repos/base-linux/include/spec/arm_64/trace/timestamp.h
Normal file
@@ -0,0 +1,34 @@
|
||||
/*
|
||||
* \brief Trace timestamp
|
||||
* \author Norman Feske
|
||||
* \date 2021-05-01
|
||||
*/
|
||||
|
||||
/*
|
||||
* Copyright (C) 2021 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__TRACE__TIMESTAMP_H_
|
||||
#define _INCLUDE__SPEC__ARM_64__TRACE__TIMESTAMP_H_
|
||||
|
||||
#include <base/fixed_stdint.h>
|
||||
|
||||
namespace Genode { namespace Trace {
|
||||
|
||||
typedef uint64_t Timestamp;
|
||||
|
||||
/*
|
||||
* In Linux/AARCH64, the 'mrs' instruction cannot be executed in user land.
|
||||
* It triggers the abort of the program with an illegal-instruction
|
||||
* exception.
|
||||
*
|
||||
* By returning 0, we discharge the timestamp-based interpolation of
|
||||
* 'Timer::Connection::curr_time', falling back to a precision of 1 ms.
|
||||
*/
|
||||
inline Timestamp timestamp() { return 0; }
|
||||
} }
|
||||
|
||||
#endif /* _INCLUDE__SPEC__ARM_64__TRACE__TIMESTAMP_H_ */
|
||||
@@ -74,7 +74,7 @@ EXT_OBJECTS += $(shell $(CUSTOM_CC) $(CC_MARCH) -print-file-name=crtbegin.o)
|
||||
EXT_OBJECTS += $(shell $(CUSTOM_CC) $(CC_MARCH) -print-file-name=crtend.o)
|
||||
EXT_OBJECTS += $(shell $(CUSTOM_HOST_CC) $(CC_MARCH) -print-file-name=crtn.o)
|
||||
|
||||
LX_LIBS_OPT += -lgcc -lgcc_s -lsupc++ -lc -lpthread
|
||||
LX_LIBS_OPT += -lgcc_s -lsupc++ -lc -lpthread -lgcc
|
||||
|
||||
USE_HOST_LD_SCRIPT = yes
|
||||
|
||||
@@ -98,6 +98,11 @@ CXX_LINK_OPT += -Wl,--dynamic-linker=/lib/ld-linux.so.3
|
||||
LD_SCRIPT_STATIC = ldscripts/armelf_linux_eabi.xc
|
||||
endif
|
||||
|
||||
ifeq (arm_64,$(findstring arm_64,$(SPECS)))
|
||||
CXX_LINK_OPT += -Wl,--dynamic-linker=/lib/ld-linux-aarch64.so.1
|
||||
LD_SCRIPT_STATIC = /usr/lib/aarch64-linux-gnu/ldscripts/aarch64elf.xc
|
||||
endif
|
||||
|
||||
#
|
||||
# Because we use the host compiler's libgcc, omit the Genode toolchain's
|
||||
# version and put all libraries here we depend on.
|
||||
|
||||
@@ -11,6 +11,7 @@ HOST_INC_DIR += /usr/include/$(shell $(CUSTOM_HOST_CC) -dumpmachine)
|
||||
#
|
||||
HOST_INC_DIR += /usr/include/i386-linux-gnu
|
||||
HOST_INC_DIR += /usr/include/x86_64-linux-gnu
|
||||
HOST_INC_DIR += /usr/include/aarch64-linux-gnu
|
||||
|
||||
#
|
||||
# Some header files installed on GNU/Linux test for the GNU compiler. For
|
||||
|
||||
69
repos/base-linux/lib/mk/core-linux.inc
Normal file
69
repos/base-linux/lib/mk/core-linux.inc
Normal file
@@ -0,0 +1,69 @@
|
||||
GEN_CORE_DIR := $(BASE_DIR)/src/core
|
||||
LIBS := syscall-linux
|
||||
BOARD ?= unknown
|
||||
|
||||
SRC_CC := main.cc \
|
||||
platform.cc \
|
||||
platform_thread.cc \
|
||||
platform_services.cc \
|
||||
pd_session_component.cc \
|
||||
ram_dataspace_support.cc \
|
||||
rom_session_component.cc \
|
||||
cpu_session_component.cc \
|
||||
cpu_session_support.cc \
|
||||
cpu_thread_component.cc \
|
||||
pd_session_support.cc \
|
||||
dataspace_component.cc \
|
||||
native_pd_component.cc \
|
||||
native_cpu_component.cc \
|
||||
capability_space.cc \
|
||||
rpc_cap_factory_linux.cc \
|
||||
ram_dataspace_factory.cc \
|
||||
core_rpc_cap_alloc.cc \
|
||||
io_mem_session_component.cc \
|
||||
irq_session_component.cc \
|
||||
signal_source_component.cc \
|
||||
signal_transmitter_proxy.cc \
|
||||
signal_receiver.cc \
|
||||
trace_session_component.cc \
|
||||
thread_linux.cc \
|
||||
stack_area.cc \
|
||||
core_log.cc \
|
||||
core_log_out.cc \
|
||||
default_log.cc \
|
||||
env_reinit.cc \
|
||||
heartbeat.cc \
|
||||
thread.cc \
|
||||
thread_myself.cc
|
||||
|
||||
INC_DIR += $(REP_DIR)/src/core/include \
|
||||
$(GEN_CORE_DIR)/include \
|
||||
$(REP_DIR)/src/platform \
|
||||
$(REP_DIR)/src/include \
|
||||
$(BASE_DIR)/src/include
|
||||
|
||||
vpath main.cc $(GEN_CORE_DIR)
|
||||
vpath pd_session_component.cc $(GEN_CORE_DIR)
|
||||
vpath core_log.cc $(GEN_CORE_DIR)
|
||||
vpath cpu_session_component.cc $(GEN_CORE_DIR)
|
||||
vpath cpu_session_support.cc $(GEN_CORE_DIR)
|
||||
vpath cpu_thread_component.cc $(GEN_CORE_DIR)
|
||||
vpath pd_upgrade_ram_quota.cc $(GEN_CORE_DIR)
|
||||
vpath pd_session_support.cc $(GEN_CORE_DIR)
|
||||
vpath capability_space.cc $(GEN_CORE_DIR)
|
||||
vpath ram_dataspace_factory.cc $(GEN_CORE_DIR)
|
||||
vpath signal_source_component.cc $(GEN_CORE_DIR)
|
||||
vpath signal_transmitter_proxy.cc $(GEN_CORE_DIR)
|
||||
vpath signal_receiver.cc $(GEN_CORE_DIR)
|
||||
vpath trace_session_component.cc $(GEN_CORE_DIR)
|
||||
vpath default_log.cc $(GEN_CORE_DIR)
|
||||
vpath heartbeat.cc $(GEN_CORE_DIR)
|
||||
vpath thread.cc $(BASE_DIR)/src/lib/base
|
||||
vpath thread_myself.cc $(BASE_DIR)/src/lib/base
|
||||
vpath trace.cc $(BASE_DIR)/src/lib/base
|
||||
vpath env_reinit.cc $(REP_DIR)/src/lib/base
|
||||
vpath dataspace_component.cc $(REP_DIR)/src/core/spec/$(BOARD)
|
||||
vpath io_mem_session_component.cc $(REP_DIR)/src/core/spec/$(BOARD)
|
||||
vpath irq_session_component.cc $(REP_DIR)/src/core/spec/$(BOARD)
|
||||
vpath platform_services.cc $(REP_DIR)/src/core/spec/$(BOARD)
|
||||
vpath %.cc $(REP_DIR)/src/core
|
||||
1
repos/base-linux/lib/mk/core-linux.mk
Normal file
1
repos/base-linux/lib/mk/core-linux.mk
Normal file
@@ -0,0 +1 @@
|
||||
include $(REP_DIR)/lib/mk/core-linux.inc
|
||||
3
repos/base-linux/lib/mk/spec/arm_64/base-linux.mk
Normal file
3
repos/base-linux/lib/mk/spec/arm_64/base-linux.mk
Normal file
@@ -0,0 +1,3 @@
|
||||
LIBS += timeout-arm
|
||||
|
||||
include $(REP_DIR)/lib/mk/base-linux.mk
|
||||
3
repos/base-linux/lib/mk/spec/arm_64/ld-linux.mk
Normal file
3
repos/base-linux/lib/mk/spec/arm_64/ld-linux.mk
Normal file
@@ -0,0 +1,3 @@
|
||||
BASE_LIBS += base-linux-common base-linux
|
||||
|
||||
include $(BASE_DIR)/lib/mk/spec/arm_64/ld-platform.inc
|
||||
3
repos/base-linux/lib/mk/spec/arm_64/seccomp.mk
Normal file
3
repos/base-linux/lib/mk/spec/arm_64/seccomp.mk
Normal file
@@ -0,0 +1,3 @@
|
||||
SRC_BIN += seccomp_bpf_policy.bin
|
||||
|
||||
vpath seccomp_bpf_policy.bin $(REP_DIR)/src/lib/seccomp/spec/arm_64
|
||||
1
repos/base-linux/lib/mk/spec/arm_64/startup-linux.mk
Normal file
1
repos/base-linux/lib/mk/spec/arm_64/startup-linux.mk
Normal file
@@ -0,0 +1 @@
|
||||
include $(BASE_DIR)/lib/mk/spec/arm_64/startup.inc
|
||||
5
repos/base-linux/lib/mk/spec/arm_64/syscall-linux.mk
Normal file
5
repos/base-linux/lib/mk/spec/arm_64/syscall-linux.mk
Normal file
@@ -0,0 +1,5 @@
|
||||
SRC_S += lx_clone.S
|
||||
SRC_S += lx_syscall.S
|
||||
|
||||
vpath lx_clone.S $(REP_DIR)/src/lib/syscall/spec/arm_64
|
||||
vpath lx_syscall.S $(REP_DIR)/src/lib/syscall/spec/arm_64
|
||||
7
repos/base-linux/lib/mk/spec/x86/core-linux.mk
Normal file
7
repos/base-linux/lib/mk/spec/x86/core-linux.mk
Normal file
@@ -0,0 +1,7 @@
|
||||
include $(REP_DIR)/lib/mk/core-linux.inc
|
||||
|
||||
SRC_CC += io_port_session_support.cc \
|
||||
io_port_session_component.cc
|
||||
|
||||
vpath io_port_session_support.cc $(GEN_CORE_DIR)/spec/x86
|
||||
vpath io_port_session_component.cc $(REP_DIR)/src/core/spec/$(BOARD)
|
||||
@@ -1,4 +1,4 @@
|
||||
FROM_BASE_LINUX := etc src/lib/syscall src/lib/lx_hybrid lib/import
|
||||
FROM_BASE_LINUX := etc src/lib/syscall src/lib/lx_hybrid lib/import include
|
||||
FROM_BASE_LINUX_AND_BASE := lib/mk src/lib/base src/include
|
||||
FROM_BASE := src/lib/timeout
|
||||
|
||||
|
||||
@@ -1 +1 @@
|
||||
2021-03-11 4ab4ab408aa38109d6f12f402f477667c90229da
|
||||
2021-05-09 e5ecbb3c8bdace835f144f0084c9aa91649e0bab
|
||||
|
||||
@@ -6,10 +6,10 @@ lib/import src/ld:
|
||||
$(mirror_from_rep_dir)
|
||||
|
||||
content:
|
||||
for spec in x86_32 x86_64 arm; do \
|
||||
for spec in x86_32 x86_64 arm arm_64; do \
|
||||
mv lib/mk/spec/$$spec/ld-linux.mk lib/mk/spec/$$spec/ld.mk; done;
|
||||
sed -i "s/core-linux/core/" src/core/linux/target.mk
|
||||
sed -i "s/BOARD.*unknown/BOARD := linux/" src/core/linux/target.mk
|
||||
sed -i "/TARGET/s/core-linux/core/" src/core/linux/target.mk
|
||||
sed -i "s/BOARD.*unknown/BOARD := linux/" lib/mk/core-linux.inc
|
||||
sed -i "s/ld-linux/ld/" src/lib/ld/linux/target.mk
|
||||
sed -i "s/linux_timer_drv/timer/" src/timer/linux/target.mk
|
||||
rm -rf src/lib/initramfs
|
||||
|
||||
@@ -1 +1 @@
|
||||
2021-03-11 2847f916b65cee82243e88b9ac37550148f46dc5
|
||||
2021-05-27 9534bb2a4c39f66505bdbbad8ccb9da9506617c5
|
||||
|
||||
@@ -32,7 +32,7 @@
|
||||
|
||||
inline int lx_mkdir(char const *pathname, mode_t mode)
|
||||
{
|
||||
return lx_syscall(SYS_mkdir, pathname, mode);
|
||||
return lx_syscall(SYS_mkdirat, AT_FDCWD, pathname, mode);
|
||||
}
|
||||
|
||||
|
||||
@@ -44,7 +44,7 @@ inline int lx_ftruncate(int fd, unsigned long length)
|
||||
|
||||
inline int lx_unlink(const char *fname)
|
||||
{
|
||||
return lx_syscall(SYS_unlink, fname);
|
||||
return lx_syscall(SYS_unlinkat, AT_FDCWD, fname, 0);
|
||||
}
|
||||
|
||||
|
||||
@@ -52,19 +52,30 @@ inline int lx_unlink(const char *fname)
|
||||
** Functions used by core's rom-session support code **
|
||||
*******************************************************/
|
||||
|
||||
inline int lx_open(const char *pathname, int flags, mode_t mode = 0)
|
||||
inline int lx_open(char const *pathname, int flags, mode_t mode = 0)
|
||||
{
|
||||
return lx_syscall(SYS_open, pathname, flags, mode);
|
||||
return lx_syscall(SYS_openat, AT_FDCWD, pathname, flags, mode);
|
||||
}
|
||||
|
||||
|
||||
inline int lx_stat(const char *path, struct stat64 *buf)
|
||||
inline int lx_stat_size(char const *path, Genode::uint64_t &out_size)
|
||||
{
|
||||
#ifdef _LP64
|
||||
return lx_syscall(SYS_stat, path, buf);
|
||||
#ifdef __aarch64__
|
||||
struct statx buf { };
|
||||
int result = lx_syscall(SYS_statx, AT_FDCWD, path, 0, STATX_SIZE, &buf);
|
||||
out_size = buf.stx_size;
|
||||
#else
|
||||
return lx_syscall(SYS_stat64, path, buf);
|
||||
#ifdef _LP64
|
||||
struct stat buf { };
|
||||
int result = lx_syscall(SYS_stat, path, &buf);
|
||||
out_size = buf.st_size;
|
||||
#else
|
||||
struct stat64 buf { };
|
||||
int result = lx_syscall(SYS_stat64, path, &buf);
|
||||
out_size = buf.st_size;
|
||||
#endif
|
||||
#endif
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
@@ -119,7 +130,7 @@ inline int lx_kill(int pid, int signal)
|
||||
}
|
||||
|
||||
|
||||
inline int lx_create_process(int (*entry)(void *), void *stack, void *arg)
|
||||
inline int lx_create_process(int (*entry)(), void *stack)
|
||||
{
|
||||
/*
|
||||
* The low byte of the flags denotes the signal to be sent to the parent
|
||||
@@ -127,7 +138,7 @@ inline int lx_create_process(int (*entry)(void *), void *stack, void *arg)
|
||||
* this condition.
|
||||
*/
|
||||
int const flags = CLONE_VFORK | LX_SIGCHLD;
|
||||
return lx_clone((int (*)(void *))entry, stack, flags, arg);
|
||||
return lx_clone((int (*)())entry, stack, flags);
|
||||
}
|
||||
|
||||
|
||||
@@ -253,7 +264,7 @@ inline int lx_connect(int sockfd, const struct sockaddr *serv_addr,
|
||||
|
||||
inline int lx_pipe(int pipefd[2])
|
||||
{
|
||||
return lx_syscall(SYS_pipe, pipefd);
|
||||
return lx_syscall(SYS_pipe2, pipefd, 0);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -74,8 +74,7 @@ class Genode::Dataspace_component : public Rpc_object<Linux_dataspace>
|
||||
/**
|
||||
* Constructor
|
||||
*/
|
||||
Dataspace_component(size_t size, addr_t addr,
|
||||
Cache_attribute, bool writable,
|
||||
Dataspace_component(size_t size, addr_t addr, Cache, bool writable,
|
||||
Dataspace_owner * owner)
|
||||
:
|
||||
_size(size), _addr(addr), _cap(), _writable(writable), _owner(owner)
|
||||
@@ -94,7 +93,7 @@ class Genode::Dataspace_component : public Rpc_object<Linux_dataspace>
|
||||
* reasons and should not be used.
|
||||
*/
|
||||
Dataspace_component(size_t size, addr_t, addr_t phys_addr,
|
||||
Cache_attribute, bool writable, Dataspace_owner *_owner);
|
||||
Cache, bool writable, Dataspace_owner *_owner);
|
||||
|
||||
/**
|
||||
* This constructor is especially used for ROM dataspaces
|
||||
|
||||
@@ -34,9 +34,9 @@ class Genode::Io_mem_session_component : public Rpc_object<Io_mem_session>
|
||||
Rpc_entrypoint &_ds_ep;
|
||||
Io_mem_dataspace_capability _ds_cap;
|
||||
|
||||
size_t get_arg_size(const char *);
|
||||
addr_t get_arg_phys(const char *);
|
||||
Cache_attribute get_arg_wc(const char *);
|
||||
size_t get_arg_size(char const *);
|
||||
addr_t get_arg_phys(char const *);
|
||||
Cache get_arg_wc (char const *);
|
||||
|
||||
public:
|
||||
|
||||
|
||||
@@ -75,7 +75,7 @@ class Genode::Platform : public Platform_generic
|
||||
bool valid_addr(addr_t ) const override { ASSERT_NEVER_CALLED; }
|
||||
bool alloc(size_t, void **) override { ASSERT_NEVER_CALLED; }
|
||||
|
||||
Alloc_return alloc_aligned(size_t, void **, int, addr_t, addr_t) override
|
||||
Alloc_return alloc_aligned(size_t, void **, unsigned, Range) override
|
||||
{ ASSERT_NEVER_CALLED; }
|
||||
|
||||
Alloc_return alloc_addr(size_t, addr_t) override
|
||||
@@ -94,10 +94,9 @@ class Genode::Platform : public Platform_generic
|
||||
return true;
|
||||
}
|
||||
|
||||
Alloc_return alloc_aligned(size_t, void **out_addr, int,
|
||||
addr_t, addr_t) override
|
||||
Alloc_return alloc_aligned(size_t, void **out, unsigned, Range) override
|
||||
{
|
||||
*out_addr = 0;
|
||||
*out = 0;
|
||||
return Alloc_return::OK;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,83 +1,10 @@
|
||||
TARGET = core-linux
|
||||
REQUIRES = linux
|
||||
LIBS = cxx base-linux-common syscall-linux startup-linux
|
||||
TARGET := core-linux
|
||||
REQUIRES := linux
|
||||
LIBS := cxx base-linux-common startup-linux core-linux
|
||||
BOARD ?= unknown
|
||||
|
||||
BOARD ?= unknown
|
||||
include $(BASE_DIR)/src/core/version.inc
|
||||
|
||||
GEN_CORE_DIR = $(BASE_DIR)/src/core
|
||||
|
||||
SRC_CC = main.cc \
|
||||
platform.cc \
|
||||
platform_thread.cc \
|
||||
platform_services.cc \
|
||||
pd_session_component.cc \
|
||||
ram_dataspace_support.cc \
|
||||
rom_session_component.cc \
|
||||
cpu_session_component.cc \
|
||||
cpu_session_support.cc \
|
||||
cpu_thread_component.cc \
|
||||
pd_session_support.cc \
|
||||
dataspace_component.cc \
|
||||
native_pd_component.cc \
|
||||
native_cpu_component.cc \
|
||||
capability_space.cc \
|
||||
rpc_cap_factory_linux.cc \
|
||||
ram_dataspace_factory.cc \
|
||||
core_rpc_cap_alloc.cc \
|
||||
io_mem_session_component.cc \
|
||||
io_port_session_component.cc \
|
||||
io_port_session_support.cc \
|
||||
irq_session_component.cc \
|
||||
signal_source_component.cc \
|
||||
signal_transmitter_proxy.cc \
|
||||
signal_receiver.cc \
|
||||
trace_session_component.cc \
|
||||
thread_linux.cc \
|
||||
stack_area.cc \
|
||||
core_log.cc \
|
||||
core_log_out.cc \
|
||||
default_log.cc \
|
||||
env_reinit.cc \
|
||||
heartbeat.cc \
|
||||
thread.cc \
|
||||
thread_myself.cc
|
||||
|
||||
INC_DIR += $(REP_DIR)/src/core/include \
|
||||
$(GEN_CORE_DIR)/include \
|
||||
$(REP_DIR)/src/platform \
|
||||
$(REP_DIR)/src/include \
|
||||
$(BASE_DIR)/src/include
|
||||
|
||||
LD_TEXT_ADDR ?= 0x01000000
|
||||
LD_SCRIPT_STATIC = $(BASE_DIR)/src/ld/genode.ld \
|
||||
$(call select_from_repositories,src/ld/stack_area.ld)
|
||||
|
||||
include $(GEN_CORE_DIR)/version.inc
|
||||
|
||||
vpath main.cc $(GEN_CORE_DIR)
|
||||
vpath pd_session_component.cc $(GEN_CORE_DIR)
|
||||
vpath core_log.cc $(GEN_CORE_DIR)
|
||||
vpath cpu_session_component.cc $(GEN_CORE_DIR)
|
||||
vpath cpu_session_support.cc $(GEN_CORE_DIR)
|
||||
vpath cpu_thread_component.cc $(GEN_CORE_DIR)
|
||||
vpath pd_upgrade_ram_quota.cc $(GEN_CORE_DIR)
|
||||
vpath pd_session_support.cc $(GEN_CORE_DIR)
|
||||
vpath capability_space.cc $(GEN_CORE_DIR)
|
||||
vpath ram_dataspace_factory.cc $(GEN_CORE_DIR)
|
||||
vpath signal_source_component.cc $(GEN_CORE_DIR)
|
||||
vpath signal_transmitter_proxy.cc $(GEN_CORE_DIR)
|
||||
vpath signal_receiver.cc $(GEN_CORE_DIR)
|
||||
vpath trace_session_component.cc $(GEN_CORE_DIR)
|
||||
vpath default_log.cc $(GEN_CORE_DIR)
|
||||
vpath heartbeat.cc $(GEN_CORE_DIR)
|
||||
vpath io_port_session_support.cc $(GEN_CORE_DIR)/spec/x86
|
||||
vpath thread.cc $(BASE_DIR)/src/lib/base
|
||||
vpath thread_myself.cc $(BASE_DIR)/src/lib/base
|
||||
vpath trace.cc $(BASE_DIR)/src/lib/base
|
||||
vpath env_reinit.cc $(REP_DIR)/src/lib/base
|
||||
vpath dataspace_component.cc $(REP_DIR)/src/core/spec/$(BOARD)
|
||||
vpath io_mem_session_component.cc $(REP_DIR)/src/core/spec/$(BOARD)
|
||||
vpath irq_session_component.cc $(REP_DIR)/src/core/spec/$(BOARD)
|
||||
vpath io_port_session_component.cc $(REP_DIR)/src/core/spec/$(BOARD)
|
||||
vpath platform_services.cc $(REP_DIR)/src/core/spec/$(BOARD)
|
||||
vpath %.cc $(REP_DIR)/src/core
|
||||
LD_TEXT_ADDR ?= 0x01000000
|
||||
LD_SCRIPT_STATIC = $(BASE_DIR)/src/ld/genode.ld \
|
||||
$(call select_from_repositories,src/ld/stack_area.ld)
|
||||
|
||||
@@ -15,6 +15,7 @@
|
||||
#include <util/arg_string.h>
|
||||
#include <base/log.h>
|
||||
#include <base/snprintf.h>
|
||||
#include <cpu/consts.h>
|
||||
|
||||
/* core-local includes */
|
||||
#include <pd_session_component.h>
|
||||
@@ -35,33 +36,48 @@ using namespace Genode;
|
||||
***************/
|
||||
|
||||
/**
|
||||
* Argument frame for passing 'execve' paremeters through 'clone'
|
||||
* Argument frame and initial stack for passing 'execve' parameters through 'clone'
|
||||
*/
|
||||
struct Execve_args
|
||||
struct Execve_args_and_stack
|
||||
{
|
||||
char const *filename;
|
||||
char * const *argv;
|
||||
char * const *envp;
|
||||
Lx_sd const parent_sd;
|
||||
struct Args
|
||||
{
|
||||
char const *filename;
|
||||
char **argv;
|
||||
char **envp;
|
||||
Lx_sd parent_sd;
|
||||
};
|
||||
|
||||
Execve_args(char const *filename,
|
||||
char * const *argv,
|
||||
char * const *envp,
|
||||
Lx_sd parent_sd)
|
||||
:
|
||||
filename(filename), argv(argv), envp(envp), parent_sd(parent_sd)
|
||||
{ }
|
||||
Args args;
|
||||
|
||||
/* initial stack used by the child until calling 'execve' */
|
||||
enum { STACK_SIZE = 4096 };
|
||||
char stack[STACK_SIZE];
|
||||
|
||||
void *initial_sp()
|
||||
{
|
||||
return (void *)Abi::stack_align((addr_t)(stack + STACK_SIZE));
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
static Execve_args_and_stack &_execve_args_and_stack()
|
||||
{
|
||||
static Execve_args_and_stack inst { };
|
||||
return inst;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Startup code of the new child process
|
||||
*/
|
||||
static int _exec_child(Execve_args *arg)
|
||||
static int _exec_child()
|
||||
{
|
||||
lx_dup2(arg->parent_sd.value, PARENT_SOCKET_HANDLE);
|
||||
auto const &args = _execve_args_and_stack().args;
|
||||
|
||||
return lx_execve(arg->filename, arg->argv, arg->envp);
|
||||
lx_dup2(args.parent_sd.value, PARENT_SOCKET_HANDLE);
|
||||
|
||||
return lx_execve(args.filename, args.argv, args.envp);
|
||||
}
|
||||
|
||||
|
||||
@@ -148,31 +164,15 @@ void Native_pd_component::_start(Dataspace_component &ds)
|
||||
argv_buf[0] = pname_buf;
|
||||
argv_buf[1] = 0;
|
||||
|
||||
/*
|
||||
* We cannot create the new process via 'fork()' because all our used
|
||||
* memory including stack memory is backed by dataspaces, which had been
|
||||
* mapped with the 'MAP_SHARED' flag. Therefore, after being created, the
|
||||
* new process starts using the stack with the same physical memory pages
|
||||
* as used by parent process. This would ultimately lead to stack
|
||||
* corruption. To prevent both processes from concurrently accessing the
|
||||
* same stack, we pause the execution of the parent until the child calls
|
||||
* 'execve'. From then on, the child has its private memory layout. The
|
||||
* desired behaviour is normally provided by 'vfork' but we use the more
|
||||
* modern 'clone' call for this purpose.
|
||||
*/
|
||||
enum { STACK_SIZE = 4096 };
|
||||
static char stack[STACK_SIZE]; /* initial stack used by the child until
|
||||
calling 'execve' */
|
||||
_execve_args_and_stack().args = Execve_args_and_stack::Args {
|
||||
.filename = filename,
|
||||
.argv = argv_buf,
|
||||
.envp = env,
|
||||
.parent_sd = Capability_space::ipc_cap_data(_pd_session._parent).dst.socket
|
||||
};
|
||||
|
||||
/*
|
||||
* Argument frame as passed to 'clone'. Because, we can only pass a single
|
||||
* pointer, all arguments are embedded within the 'execve_args' struct.
|
||||
*/
|
||||
Execve_args arg(filename, argv_buf, env,
|
||||
Capability_space::ipc_cap_data(_pd_session._parent).dst.socket);
|
||||
|
||||
_pid = lx_create_process((int (*)(void *))_exec_child,
|
||||
stack + STACK_SIZE - sizeof(umword_t), &arg);
|
||||
_pid = lx_create_process((int (*)())_exec_child,
|
||||
_execve_args_and_stack().initial_sp());
|
||||
|
||||
if (strcmp(filename, tmp_filename) == 0)
|
||||
lx_unlink(filename);
|
||||
|
||||
@@ -54,10 +54,11 @@ Linux_dataspace::Filename Dataspace_component::_file_name(const char *args)
|
||||
|
||||
size_t Dataspace_component::_file_size()
|
||||
{
|
||||
struct stat64 s;
|
||||
if (lx_stat(_fname.buf, &s) < 0) throw Service_denied();
|
||||
uint64_t size = 0;
|
||||
if (lx_stat_size(_fname.buf, size) < 0)
|
||||
throw Service_denied();
|
||||
|
||||
return align_addr(s.st_size, 12);
|
||||
return align_addr(size, 12);
|
||||
}
|
||||
|
||||
|
||||
@@ -73,7 +74,7 @@ Dataspace_component::Dataspace_component(const char *args)
|
||||
|
||||
|
||||
Dataspace_component::Dataspace_component(size_t size, addr_t, addr_t phys_addr,
|
||||
Cache_attribute, bool, Dataspace_owner *_owner)
|
||||
Cache, bool, Dataspace_owner *_owner)
|
||||
:
|
||||
_size(size), _addr(phys_addr), _cap(), _writable(false), _owner(_owner)
|
||||
{
|
||||
|
||||
@@ -53,7 +53,7 @@ Io_mem_session_component::Io_mem_session_component(Range_allocator &io_mem_alloc
|
||||
}
|
||||
|
||||
|
||||
Cache_attribute Io_mem_session_component::get_arg_wc(const char *)
|
||||
Cache Io_mem_session_component::get_arg_wc(const char *)
|
||||
{
|
||||
warning(__func__, " not implemented");
|
||||
return UNCACHED;
|
||||
|
||||
@@ -53,10 +53,11 @@ Linux_dataspace::Filename Dataspace_component::_file_name(const char *args)
|
||||
|
||||
Genode::size_t Dataspace_component::_file_size()
|
||||
{
|
||||
struct stat64 s;
|
||||
if (lx_stat(_fname.buf, &s) < 0) throw Service_denied();
|
||||
uint64_t size = 0;
|
||||
if (lx_stat_size(_fname.buf, &size) < 0)
|
||||
throw Service_denied();
|
||||
|
||||
return s.st_size;
|
||||
return size;
|
||||
}
|
||||
|
||||
|
||||
@@ -72,7 +73,7 @@ Dataspace_component::Dataspace_component(const char *args)
|
||||
|
||||
|
||||
Dataspace_component::Dataspace_component(size_t size, addr_t, addr_t phys_addr,
|
||||
Cache_attribute, bool writable, Dataspace_owner *_owner)
|
||||
Cache, bool writable, Dataspace_owner *_owner)
|
||||
:
|
||||
_size(size), _addr(phys_addr), _cap(), _writable(writable), _owner(_owner)
|
||||
{
|
||||
|
||||
@@ -40,7 +40,7 @@ addr_t Io_mem_session_component::get_arg_phys(const char *args)
|
||||
}
|
||||
|
||||
|
||||
Cache_attribute Io_mem_session_component::get_arg_wc(const char *args)
|
||||
Cache Io_mem_session_component::get_arg_wc(const char *args)
|
||||
{
|
||||
Arg const a = Arg_string::find_arg("wc", args);
|
||||
if (a.valid() && a.bool_value(0)) {
|
||||
|
||||
@@ -79,8 +79,7 @@ class Stack_area_region_map : public Genode::Region_map
|
||||
|
||||
struct Stack_area_ram_allocator : Genode::Ram_allocator
|
||||
{
|
||||
Genode::Ram_dataspace_capability alloc(Genode::size_t,
|
||||
Genode::Cache_attribute) override {
|
||||
Genode::Ram_dataspace_capability alloc(Genode::size_t, Genode::Cache) override {
|
||||
return Genode::Ram_dataspace_capability(); }
|
||||
|
||||
void free(Genode::Ram_dataspace_capability) override { }
|
||||
|
||||
@@ -66,6 +66,6 @@ void Thread::_deinit_platform_thread() { }
|
||||
|
||||
void Thread::start()
|
||||
{
|
||||
native_thread().tid = lx_create_thread(Thread::_thread_start, stack_top(), this);
|
||||
native_thread().tid = lx_create_thread(Thread::_thread_start, stack_top());
|
||||
native_thread().pid = lx_getpid();
|
||||
}
|
||||
|
||||
@@ -160,7 +160,7 @@ void Thread::start()
|
||||
threadlib_initialized = true;
|
||||
}
|
||||
|
||||
native_thread().tid = lx_create_thread(Thread::_thread_start, stack_top(), this);
|
||||
native_thread().tid = lx_create_thread(Thread::_thread_start, stack_top());
|
||||
native_thread().pid = lx_getpid();
|
||||
|
||||
/* wait until the 'thread_start' function got entered */
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -84,8 +84,7 @@ extern "C" void wait_for_continue(void);
|
||||
*********************************************************/
|
||||
|
||||
extern "C" long lx_syscall(int number, ...);
|
||||
extern "C" int lx_clone(int (*fn)(void *), void *child_stack,
|
||||
int flags, void *arg);
|
||||
extern "C" int lx_clone(int (*fn)(), void *child_stack, int flags);
|
||||
|
||||
|
||||
/*****************************************
|
||||
@@ -118,7 +117,7 @@ inline int lx_dup(int fd)
|
||||
|
||||
inline int lx_dup2(int fd, int to)
|
||||
{
|
||||
return lx_syscall(SYS_dup2, fd, to);
|
||||
return lx_syscall(SYS_dup3, fd, to, 0);
|
||||
}
|
||||
|
||||
|
||||
@@ -237,7 +236,7 @@ struct Lx_socketpair
|
||||
|
||||
inline Lx_epoll_sd lx_epoll_create()
|
||||
{
|
||||
int const ret = lx_syscall(SYS_epoll_create, 1);
|
||||
int const ret = lx_syscall(SYS_epoll_create1, 0);
|
||||
if (ret < 0) {
|
||||
/*
|
||||
* No recovery possible, just leave a diagnostic message and block
|
||||
@@ -259,7 +258,7 @@ inline int lx_epoll_ctl(Lx_epoll_sd epoll, int op, Lx_sd fd, epoll_event *event)
|
||||
inline int lx_epoll_wait(Lx_epoll_sd epoll, struct epoll_event *events,
|
||||
int maxevents, int timeout)
|
||||
{
|
||||
return lx_syscall(SYS_epoll_wait, epoll.value, events, maxevents, timeout);
|
||||
return lx_syscall(SYS_epoll_pwait, epoll.value, events, maxevents, timeout, 0);
|
||||
}
|
||||
|
||||
|
||||
@@ -357,7 +356,7 @@ inline int lx_sigaction(int signum, void (*handler)(int), bool altstack)
|
||||
* with EINTR. We therefore set the SA_RESTART flag in signal handlers.
|
||||
*/
|
||||
|
||||
#ifdef _LP64
|
||||
#ifdef __x86_64__
|
||||
/*
|
||||
* The SA_RESTORER flag is not officially documented, but used internally
|
||||
* by the glibc implementation of sigaction(). Without specifying this flag
|
||||
@@ -404,18 +403,12 @@ inline int lx_sigaltstack(void *signal_stack, Genode::size_t stack_size)
|
||||
}
|
||||
|
||||
|
||||
inline int lx_create_thread(void (*entry)(), void *stack, void *arg)
|
||||
inline int lx_create_thread(void (*entry)(), void *stack)
|
||||
{
|
||||
int flags = CLONE_VM | CLONE_FS | CLONE_FILES | CLONE_SIGHAND
|
||||
| CLONE_THREAD | CLONE_SYSVSEM;
|
||||
|
||||
/*
|
||||
* The syscall binding for clone does not exist in the FreeBSD libc, which
|
||||
* we are using as libc for Genode. In glibc, clone is implemented as a
|
||||
* assembler binding without external libc references. Hence, we are safe
|
||||
* to rely on the glibc version of 'clone' here.
|
||||
*/
|
||||
return lx_clone((int (*)(void *))entry, stack, flags, arg);
|
||||
return lx_clone((int (*)())entry, stack, flags);
|
||||
}
|
||||
|
||||
|
||||
|
||||
19
repos/base-linux/src/lib/syscall/spec/arm_64/lx_clone.S
Normal file
19
repos/base-linux/src/lib/syscall/spec/arm_64/lx_clone.S
Normal file
@@ -0,0 +1,19 @@
|
||||
/*
|
||||
* \brief Linux clone() binding
|
||||
* \author Norman Feske
|
||||
* \date 2021-04-12
|
||||
*/
|
||||
|
||||
#define SYS_clone 220
|
||||
|
||||
.text
|
||||
.globl lx_clone
|
||||
.type lx_clone, #function
|
||||
lx_clone:
|
||||
stp x29, x30, [sp, #-16]! /* save sp and link register */
|
||||
stp x3, x0, [x1, #-16]! /* supply fn and argp at new thread's stack */
|
||||
mov x0, x2 /* flags */
|
||||
mov w8, #SYS_clone
|
||||
svc #0 /* syscall, return value in x0 */
|
||||
ldp x29, x30, [sp], #16 /* restore sp and link register */
|
||||
ret
|
||||
21
repos/base-linux/src/lib/syscall/spec/arm_64/lx_syscall.S
Normal file
21
repos/base-linux/src/lib/syscall/spec/arm_64/lx_syscall.S
Normal file
@@ -0,0 +1,21 @@
|
||||
/*
|
||||
* \brief Linux syscall() binding
|
||||
* \author Norman Feske
|
||||
* \date 2021-04-07
|
||||
*/
|
||||
|
||||
.text
|
||||
.globl lx_syscall
|
||||
.type lx_syscall, #function
|
||||
lx_syscall:
|
||||
stp x29, x30, [sp, #-16]! /* save sp and link register */
|
||||
mov x8, x0 /* system call number */
|
||||
mov x0, x1 /* arguments ... */
|
||||
mov x1, x2
|
||||
mov x2, x3
|
||||
mov x3, x4
|
||||
mov x4, x5
|
||||
mov x5, x6
|
||||
svc #0 /* syscall, return value in x0 */
|
||||
ldp x29, x30, [sp], #16 /* restore sp and link register */
|
||||
ret
|
||||
@@ -592,10 +592,11 @@ namespace Nova {
|
||||
} gdtr, idtr;
|
||||
unsigned long long tsc_val, tsc_off;
|
||||
} __attribute__((packed));
|
||||
mword_t mr[(4096 - 4 * sizeof(mword_t)) / sizeof(mword_t)];
|
||||
};
|
||||
|
||||
/* message payload */
|
||||
mword_t * msg() { return reinterpret_cast<mword_t *>(&mtd); }
|
||||
mword_t * msg() { return mr; }
|
||||
|
||||
struct Item {
|
||||
mword_t crd;
|
||||
@@ -747,7 +748,9 @@ namespace Nova {
|
||||
}
|
||||
|
||||
mword_t mtd_value() const { return static_cast<Mtd>(mtd).value(); }
|
||||
} __attribute__((packed));
|
||||
};
|
||||
|
||||
static_assert(sizeof(Utcb) == 4096, "Unexpected size of UTCB");
|
||||
|
||||
/**
|
||||
* Size of event-specific portal window mapped at PD creation time
|
||||
|
||||
@@ -1 +1 @@
|
||||
0316f8810c665d115fb860399d824a6531aa5aad
|
||||
2ff8c9abf7389a2bdb7e0aa8aa4d2fec688c51af
|
||||
|
||||
@@ -4,7 +4,7 @@ DOWNLOADS := nova.git
|
||||
|
||||
# r10 branch
|
||||
URL(nova) := https://github.com/alex-ab/NOVA.git
|
||||
REV(nova) := 98b501b243bcd7aa1be36454cf58a63aae362c2e
|
||||
REV(nova) := 5c64bba1ee59902eb2a4ce4abe4b867eaf085dac
|
||||
DIR(nova) := src/kernel/nova
|
||||
|
||||
PATCHES := $(sort $(wildcard $(REP_DIR)/patches/*.patch))
|
||||
|
||||
@@ -1 +1 @@
|
||||
2021-02-22 b6091dc3f0529cf78b05eb2f648fe2a89c3982af
|
||||
2021-05-09 7e538243f9886048199e49cec7643674585b164c
|
||||
|
||||
@@ -1 +1 @@
|
||||
2021-03-11 17d4c88f9d9a66aaa4a12881c052368c750934fc
|
||||
2021-05-27 8ae888b469b89a1a4ca3e4f8334967e2144f2f7d
|
||||
|
||||
@@ -19,50 +19,38 @@
|
||||
#include <base/ipc.h>
|
||||
#include <base/stdint.h>
|
||||
|
||||
/* core-local includes */
|
||||
#include <mapping.h>
|
||||
|
||||
/* NOVA includes */
|
||||
#include <nova/syscalls.h>
|
||||
|
||||
namespace Genode {
|
||||
class Mapping;
|
||||
class Ipc_pager;
|
||||
namespace Genode { class Ipc_pager; }
|
||||
|
||||
|
||||
namespace Genode { enum { PAGE_SIZE_LOG2 = 12 }; }
|
||||
|
||||
|
||||
static inline Nova::Rights nova_map_rights(Genode::Mapping const &mapping)
|
||||
{
|
||||
return Nova::Rights(true, mapping.writeable, mapping.executable);
|
||||
}
|
||||
|
||||
class Genode::Mapping
|
||||
|
||||
static inline Nova::Mem_crd nova_src_crd(Genode::Mapping const &mapping)
|
||||
{
|
||||
private:
|
||||
return Nova::Mem_crd(mapping.src_addr >> Genode::PAGE_SIZE_LOG2,
|
||||
mapping.size_log2 - Genode::PAGE_SIZE_LOG2,
|
||||
nova_map_rights(mapping));
|
||||
}
|
||||
|
||||
addr_t const _dst_addr;
|
||||
Cache_attribute const _attr;
|
||||
Nova::Mem_crd const _mem_crd;
|
||||
|
||||
enum { PAGE_SIZE_LOG2 = 12 };
|
||||
|
||||
public:
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*/
|
||||
Mapping(addr_t dst_addr, addr_t source_addr,
|
||||
Cache_attribute c, bool /* io_mem */,
|
||||
unsigned size_log2,
|
||||
bool writeable, bool executable)
|
||||
:
|
||||
_dst_addr(dst_addr),
|
||||
_attr(c),
|
||||
_mem_crd(source_addr >> PAGE_SIZE_LOG2,
|
||||
size_log2 - PAGE_SIZE_LOG2,
|
||||
Nova::Rights(true, writeable, executable))
|
||||
{ }
|
||||
|
||||
void prepare_map_operation() { }
|
||||
|
||||
Nova::Mem_crd mem_crd() const { return _mem_crd; }
|
||||
|
||||
bool dma() { return _attr != CACHED; };
|
||||
bool write_combined() { return _attr == WRITE_COMBINED; };
|
||||
|
||||
addr_t dst_addr() { return _dst_addr; }
|
||||
};
|
||||
static inline Nova::Mem_crd nova_dst_crd(Genode::Mapping const &mapping)
|
||||
{
|
||||
return Nova::Mem_crd(mapping.dst_addr >> Genode::PAGE_SIZE_LOG2,
|
||||
mapping.size_log2 - Genode::PAGE_SIZE_LOG2,
|
||||
nova_map_rights(mapping));
|
||||
}
|
||||
|
||||
|
||||
class Genode::Ipc_pager
|
||||
|
||||
@@ -23,6 +23,10 @@
|
||||
|
||||
using namespace Genode;
|
||||
|
||||
|
||||
void Mapping::prepare_map_operation() const { }
|
||||
|
||||
|
||||
Ipc_pager::Ipc_pager(Nova::Utcb &utcb, addr_t pd_dst, addr_t pd_core)
|
||||
:
|
||||
_pd_dst(pd_dst),
|
||||
@@ -44,23 +48,20 @@ Ipc_pager::Ipc_pager(Nova::Utcb &utcb, addr_t pd_dst, addr_t pd_core)
|
||||
}
|
||||
|
||||
|
||||
void Ipc_pager::set_reply_mapping(Mapping m)
|
||||
void Ipc_pager::set_reply_mapping(Mapping const mapping)
|
||||
{
|
||||
Nova::Utcb &utcb = *(Nova::Utcb *)Thread::myself()->utcb();
|
||||
|
||||
utcb.set_msg_word(0);
|
||||
bool res = utcb.append_item(m.mem_crd(), 0, true, false,
|
||||
false, m.dma(), m.write_combined());
|
||||
/* one item ever fits on the UTCB */
|
||||
|
||||
bool res = utcb.append_item(nova_src_crd(mapping), 0, true, false, false,
|
||||
mapping.dma_buffer, mapping.write_combined);
|
||||
|
||||
/* one item always fits in the UTCB */
|
||||
(void)res;
|
||||
|
||||
/* receive window in destination pd */
|
||||
Nova::Mem_crd crd_mem(m.dst_addr() >> 12, m.mem_crd().order(),
|
||||
Nova::Rights(m.mem_crd().rights().readable(),
|
||||
m.mem_crd().rights().writeable(),
|
||||
m.mem_crd().rights().executable()));
|
||||
/* asynchronously map memory */
|
||||
_syscall_res = Nova::delegate(_pd_core, _pd_dst, crd_mem);
|
||||
_syscall_res = Nova::delegate(_pd_core, _pd_dst, nova_dst_crd(mapping));
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -66,34 +66,31 @@ void Pd_session_component::map(addr_t virt, addr_t size)
|
||||
uint8_t err = Nova::NOVA_PD_OOM;
|
||||
do {
|
||||
utcb.set_msg_word(0);
|
||||
bool res = utcb.append_item(mapping.mem_crd(), 0, true, false,
|
||||
false, mapping.dma(),
|
||||
mapping.write_combined());
|
||||
|
||||
bool res = utcb.append_item(nova_src_crd(mapping), 0, true, false,
|
||||
false,
|
||||
mapping.dma_buffer,
|
||||
mapping.write_combined);
|
||||
|
||||
/* one item ever fits on the UTCB */
|
||||
(void)res;
|
||||
|
||||
Nova::Rights const map_rights (true,
|
||||
region->write() && dsc->writable(),
|
||||
region->executable());
|
||||
err = Nova::delegate(pd_core, pd_dst, nova_dst_crd(mapping));
|
||||
|
||||
/* receive window in destination pd */
|
||||
Nova::Mem_crd crd_mem(mapping.dst_addr() >> 12,
|
||||
mapping.mem_crd().order(), map_rights);
|
||||
|
||||
err = Nova::delegate(pd_core, pd_dst, crd_mem);
|
||||
} while (err == Nova::NOVA_PD_OOM &&
|
||||
Nova::NOVA_OK == Pager_object::handle_oom(Pager_object::SRC_CORE_PD,
|
||||
_pd->pd_sel(),
|
||||
"core", "ep",
|
||||
Pager_object::Policy::UPGRADE_CORE_TO_DST));
|
||||
|
||||
addr_t const map_crd_size = 1UL << (mapping.mem_crd().order() + 12);
|
||||
addr_t const mapped = mapping.dst_addr() + map_crd_size - virt;
|
||||
addr_t const map_size = 1UL << mapping.size_log2;
|
||||
addr_t const mapped = mapping.dst_addr + map_size - virt;
|
||||
|
||||
if (err != Nova::NOVA_OK)
|
||||
if (err != Nova::NOVA_OK) {
|
||||
error("could not map memory ",
|
||||
Hex_range<addr_t>(mapping.dst_addr(), map_crd_size) , " "
|
||||
Hex_range<addr_t>(mapping.dst_addr, map_size) , " "
|
||||
"eagerly error=", err);
|
||||
}
|
||||
|
||||
return mapped;
|
||||
};
|
||||
|
||||
@@ -680,7 +680,11 @@ Platform::Platform()
|
||||
pages << get_page_size_log2(),
|
||||
"platform_info", [&] ()
|
||||
{
|
||||
xml.node("kernel", [&] () { xml.attribute("name", "nova"); });
|
||||
xml.node("kernel", [&] () {
|
||||
xml.attribute("name", "nova");
|
||||
xml.attribute("acpi", true);
|
||||
xml.attribute("msi" , true);
|
||||
});
|
||||
if (efi_sys_tab_phy) {
|
||||
xml.node("efi-system-table", [&] () {
|
||||
xml.attribute("address", String<32>(Hex(efi_sys_tab_phy)));
|
||||
|
||||
@@ -1 +1 @@
|
||||
2021-03-11 36594a3e445254981972ee7344007c39d01343c7
|
||||
2021-05-27 4394ee99a7779bcaf5f1ca8fe9e7f2f82ade9fdb
|
||||
|
||||
@@ -14,61 +14,16 @@
|
||||
#ifndef _CORE__INCLUDE__IPC_PAGER_H_
|
||||
#define _CORE__INCLUDE__IPC_PAGER_H_
|
||||
|
||||
#include <base/cache.h>
|
||||
/* Genode includes */
|
||||
#include <base/ipc.h>
|
||||
#include <base/stdint.h>
|
||||
|
||||
/* base-internal includes */
|
||||
#include <base/internal/okl4.h>
|
||||
|
||||
namespace Genode {
|
||||
/* core-local includes */
|
||||
#include <mapping.h>
|
||||
|
||||
class Mapping;
|
||||
class Ipc_pager;
|
||||
}
|
||||
|
||||
|
||||
class Genode::Mapping
|
||||
{
|
||||
private:
|
||||
|
||||
addr_t _phys_addr { 0 };
|
||||
Okl4::L4_Fpage_t _fpage { };
|
||||
Okl4::L4_PhysDesc_t _phys_desc { };
|
||||
|
||||
public:
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*/
|
||||
Mapping(addr_t dst_addr, addr_t src_addr,
|
||||
Cache_attribute cacheability, bool io_mem,
|
||||
unsigned l2size, bool rw, bool executable);
|
||||
|
||||
/**
|
||||
* Construct invalid mapping
|
||||
*/
|
||||
Mapping();
|
||||
|
||||
/**
|
||||
* Return flexpage describing the virtual destination address
|
||||
*/
|
||||
Okl4::L4_Fpage_t fpage() const { return _fpage; }
|
||||
|
||||
/**
|
||||
* Return physical-memory descriptor describing the source location
|
||||
*/
|
||||
Okl4::L4_PhysDesc_t phys_desc() const { return _phys_desc; }
|
||||
|
||||
/**
|
||||
* Prepare map operation
|
||||
*
|
||||
* On OKL4, we do not need to map a page core-locally to be able to
|
||||
* map it into another address space. Therefore, we can leave this
|
||||
* function blank.
|
||||
*/
|
||||
void prepare_map_operation() { }
|
||||
};
|
||||
namespace Genode { class Ipc_pager; }
|
||||
|
||||
|
||||
class Genode::Ipc_pager
|
||||
|
||||
@@ -61,24 +61,11 @@ static inline L4_ThreadId_t thread_get_my_global_id()
|
||||
}
|
||||
|
||||
|
||||
/*************
|
||||
** Mapping **
|
||||
*************/
|
||||
|
||||
Mapping::Mapping(addr_t dst_addr, addr_t src_addr, Cache_attribute, bool,
|
||||
unsigned l2size, bool rw, bool)
|
||||
:
|
||||
_fpage(L4_FpageLog2(dst_addr, l2size)),
|
||||
/*
|
||||
* OKL4 does not support write-combining as mapping attribute.
|
||||
*/
|
||||
_phys_desc(L4_PhysDesc(src_addr, 0))
|
||||
{
|
||||
L4_Set_Rights(&_fpage, rw ? L4_ReadWriteOnly : L4_ReadeXecOnly);
|
||||
}
|
||||
|
||||
|
||||
Mapping::Mapping() { }
|
||||
/*
|
||||
* On OKL4, we do not need to map a page core-locally to be able to map it into
|
||||
* another address space. Therefore, we can leave this method blank.
|
||||
*/
|
||||
void Mapping::prepare_map_operation() const { }
|
||||
|
||||
|
||||
/***************
|
||||
@@ -121,10 +108,21 @@ void Ipc_pager::reply_and_wait_for_fault()
|
||||
L4_SpaceId_t to_space;
|
||||
to_space.raw = L4_ThreadNo(_last) >> Thread_id_bits::THREAD;
|
||||
|
||||
/* map page to faulting space */
|
||||
int ret = L4_MapFpage(to_space, _reply_mapping.fpage(),
|
||||
_reply_mapping.phys_desc());
|
||||
/* flexpage describing the virtual destination address */
|
||||
Okl4::L4_Fpage_t fpage { L4_FpageLog2(_reply_mapping.dst_addr,
|
||||
_reply_mapping.size_log2) };
|
||||
|
||||
L4_Set_Rights(&fpage, _reply_mapping.writeable ? L4_ReadWriteOnly
|
||||
: L4_ReadeXecOnly);
|
||||
/*
|
||||
* Note that OKL4 does not support write-combining as mapping attribute.
|
||||
*/
|
||||
|
||||
/* physical-memory descriptor describing the source location */
|
||||
Okl4::L4_PhysDesc_t phys_desc { L4_PhysDesc(_reply_mapping.src_addr, 0) };
|
||||
|
||||
/* map page to faulting space */
|
||||
int ret = L4_MapFpage(to_space, fpage, phys_desc);
|
||||
if (ret != 1)
|
||||
error("L4_MapFpage returned ", ret, ", error=", L4_ErrorCode());
|
||||
|
||||
|
||||
@@ -16,6 +16,7 @@
|
||||
#include <base/allocator_avl.h>
|
||||
#include <base/sleep.h>
|
||||
#include <util/misc_math.h>
|
||||
#include <util/xml_generator.h>
|
||||
|
||||
/* base-internal includes */
|
||||
#include <base/internal/crt0.h>
|
||||
@@ -208,6 +209,33 @@ Platform::Platform()
|
||||
|
||||
init_core_log(Core_log_range { core_local_addr, log_size } );
|
||||
}
|
||||
|
||||
/* export platform specific infos */
|
||||
{
|
||||
void * core_local_ptr = nullptr;
|
||||
void * phys_ptr = nullptr;
|
||||
unsigned const pages = 1;
|
||||
size_t const size = pages << 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);
|
||||
|
||||
/* let one page free after the log buffer */
|
||||
region_alloc().alloc_aligned(size, &core_local_ptr, get_page_size_log2());
|
||||
addr_t const core_local_addr = reinterpret_cast<addr_t>(core_local_ptr);
|
||||
|
||||
if (map_local(phys_addr, core_local_addr, pages)) {
|
||||
|
||||
Genode::Xml_generator xml(reinterpret_cast<char *>(core_local_addr),
|
||||
size, "platform_info", [&] () {
|
||||
xml.node("kernel", [&] () { xml.attribute("name", "okl4"); });
|
||||
});
|
||||
|
||||
_rom_fs.insert(new (core_mem_alloc()) Rom_module(phys_addr, size,
|
||||
"platform_info"));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user