Alexander Jung [Mon, 12 Apr 2021 10:39:59 +0000 (12:39 +0200)]
plat/linuxu: Add fstat, open and close host system calls
* Add system call number for arm_32 and x86_64 for the `fstat`
system call;
* Implement system call wrapper function for `open`, `close` and
`fstat`;
* Add `MAP_PRIVATE` constant for use with `mmap`.
Signed-off-by: Robert Hrusecky <roberth@cs.utexas.edu> Signed-off-by: Omar Jamil <omarj2898@gmail.com> Signed-off-by: Sachin Beldona <sachinbeldona@utexas.edu> Signed-off-by: Gabriel Mocanu <gabi.mocanu98@gmail.com> Signed-off-by: Alexander Jung <a.jung@lancs.ac.uk> Reviewed-by: Simon Kuenzer <simon.kuenzer@neclab.eu> Tested-by: Unikraft CI <monkey@unikraft.io>
GitHub-Pull-Request: #179
Jia He [Fri, 14 May 2021 01:21:12 +0000 (09:21 +0800)]
plat/arm64: Fix extregs allocation on Arm
Implement the extregs (currently only fpsimd registers) allocation
related helpers. Otherwise, Unikraft can't be built on Arm kvm plat
due to the missing of several helpers.
Signed-off-by: Jia He <justin.he@arm.com> Reviewed-by: Răzvan Vîrtan <virtanrazvan@gmail.com> Tested-by: Unikraft CI <monkey@unikraft.io>
GitHub-Pull-Request: #206
Michalis Pappas [Wed, 17 Feb 2021 10:52:04 +0000 (11:52 +0100)]
plat/common: Add invalidate_dcache_range for arm64
Introduces an additional cache maintenance function that invalidates
cache without cleaning. This is useful when reading memory updated
from a different core, after turning on the caches.
cristian-vijelie [Wed, 30 Jun 2021 16:22:30 +0000 (19:22 +0300)]
plat/kvm: Provide udelay and mdelay implementations
The delay functions are required by the SMP module and can be used in
places where setting up a timer in not worth the effort or cannot be
safely done (e.g., early boot code, drivers).
Signed-off-by: cristian-vijelie <cristianvijelie@gmail.com> Reviewed-by: Marc Rittinghaus <marc.rittinghaus@kit.edu> Tested-by: Unikraft CI <monkey@unikraft.io>
GitHub-Pull-Request: #184
Hugo Lefeuvre [Fri, 25 Jun 2021 11:17:23 +0000 (13:17 +0200)]
lib/ukboot: add bindings for tinyalloc allocator
This commits allows users to select tinyalloc as default system
allocator. Previously users had to patch the main tree to achieve this.
This is the tinyalloc counter part of 4b31168 (Mimalloc).
Signed-off-by: Hugo Lefeuvre <hugo.lefeuvre@manchester.ac.uk> Reviewed-by: Simon Kuenzer <simon.kuenzer@neclab.eu> Tested-by: Unikraft CI <monkey@unikraft.io>
GitHub-Pull-Request: #238
Hugo Lefeuvre [Fri, 25 Jun 2021 08:28:28 +0000 (10:28 +0200)]
lib/ukboot: add bindings for Mimalloc allocator
This commits allows users to select Mimalloc as default system
allocator. Previously users had to patch the main tree to achieve this.
While adding more an more "hardcoded" allocators like this is certainly
not a long term solution, this is the only one we have for now.
Signed-off-by: Hugo Lefeuvre <hugo.lefeuvre@manchester.ac.uk> Reviewed-by: Simon Kuenzer <simon.kuenzer@neclab.eu> Tested-by: Unikraft CI <monkey@unikraft.io>
GitHub-Pull-Request: #237
Simon Kuenzer [Mon, 23 Nov 2020 12:10:58 +0000 (13:10 +0100)]
lib/ukalloc: per-library stats: Return ENOMEM
THe per-library wrapper returns ENOMEM instead of failing in an assertions
when the default allocator is not yet initialized.
Signed-off-by: Simon Kuenzer <simon.kuenzer@neclab.eu> Reviewed-by: Cezar Craciunoiu <cezar.craciunoiu@gmail.com> Tested-by: Unikraft CI <monkey@unikraft.io>
GitHub-Pull-Request: #229
Instruments <stdlib.h> so that per-library allocator statistics are
possible. We make sure that libraries using `malloc()`, `free()`, and
company will resolve `uk_alloc_get_default()` within their scope so that
the individual wrapper allocators can be used.
Signed-off-by: Simon Kuenzer <simon.kuenzer@neclab.eu> Reviewed-by: Cezar Craciunoiu <cezar.craciunoiu@gmail.com> Tested-by: Unikraft CI <monkey@unikraft.io>
GitHub-Pull-Request: #229
Simon Kuenzer [Tue, 17 Nov 2020 16:27:19 +0000 (17:27 +0100)]
lib/ukalloc: Use Unikraft internal types
Use Unikraft-internal types for the API headers in order to have minimal
dependency to libc definitions. This is done so that libcs can integrate
`<uk/alloc.h> directly with their header files without breaking the
declaration set of libc headers.
This is done towards receiving per-library statistics
(see the following commit).
Signed-off-by: Simon Kuenzer <simon.kuenzer@neclab.eu> Reviewed-by: Cezar Craciunoiu <cezar.craciunoiu@gmail.com> Tested-by: Unikraft CI <monkey@unikraft.io>
GitHub-Pull-Request: #229
Simon Kuenzer [Tue, 17 Nov 2020 15:48:24 +0000 (16:48 +0100)]
lib/ukalloc: Iterator for per-library statistics
Provides the `uk_alloc_foreach_libstats()` helper macro that can be used
to iterate over the available library allocator statistics.
Signed-off-by: Simon Kuenzer <simon.kuenzer@neclab.eu> Reviewed-by: Cezar Craciunoiu <cezar.craciunoiu@gmail.com> Tested-by: Unikraft CI <monkey@unikraft.io>
GitHub-Pull-Request: #229
Simon Kuenzer [Thu, 12 Nov 2020 23:20:12 +0000 (00:20 +0100)]
lib/ukalloc: Per-library allocation statistics
Per-library allocation statistics is achieved by replacing the default
allocator for each library with a wrapper. This wrapper forwards operations
to the actual default allocator while recording changes of the statistics
caused by the operations.
Some statistic counters are updated to support signed values (e.g.,
current memory usage or current number of allocations). This is
needed to cover cases where, for instance, a library A is allocating while
a library B is freeing.
Signed-off-by: Simon Kuenzer <simon.kuenzer@neclab.eu> Reviewed-by: Cezar Craciunoiu <cezar.craciunoiu@gmail.com> Tested-by: Unikraft CI <monkey@unikraft.io>
GitHub-Pull-Request: #229
Simon Kuenzer [Tue, 22 Dec 2020 12:56:32 +0000 (13:56 +0100)]
lib/ukallocpool: Instrumentation for statistics
Instruments the allocator to record allocation statistics.
Signed-off-by: Simon Kuenzer <simon.kuenzer@neclab.eu> Reviewed-by: Cezar Craciunoiu <cezar.craciunoiu@gmail.com> Tested-by: Unikraft CI <monkey@unikraft.io>
GitHub-Pull-Request: #229
Simon Kuenzer [Thu, 12 Nov 2020 23:17:37 +0000 (00:17 +0100)]
lib/ukallocregion: Instrumentation for statistics
Instruments the allocator to record allocation statistics.
Signed-off-by: Simon Kuenzer <simon.kuenzer@neclab.eu> Reviewed-by: Cezar Craciunoiu <cezar.craciunoiu@gmail.com> Tested-by: Unikraft CI <monkey@unikraft.io>
GitHub-Pull-Request: #229
Simon Kuenzer [Thu, 12 Nov 2020 15:54:50 +0000 (16:54 +0100)]
lib/ukallocregion: Internal functions as `static`
Declares internal functions as static in order to enable potentially
more aggressive optimizations by the compiler.
Signed-off-by: Simon Kuenzer <simon.kuenzer@neclab.eu> Reviewed-by: Cezar Craciunoiu <cezar.craciunoiu@gmail.com> Tested-by: Unikraft CI <monkey@unikraft.io>
GitHub-Pull-Request: #229
Simon Kuenzer [Thu, 12 Nov 2020 23:16:37 +0000 (00:16 +0100)]
lib/ukallocbbuddy: Instrumentation for statistics
Instruments the allocator to record allocation statistics.
Signed-off-by: Simon Kuenzer <simon.kuenzer@neclab.eu> Reviewed-by: Cezar Craciunoiu <cezar.craciunoiu@gmail.com> Tested-by: Unikraft CI <monkey@unikraft.io>
GitHub-Pull-Request: #229
Simon Kuenzer [Thu, 12 Nov 2020 23:12:15 +0000 (00:12 +0100)]
lib/ukalloc: Global statistics
Provides a configuration option that collects a consolidated global
statistic over all allocators.
Signed-off-by: Simon Kuenzer <simon.kuenzer@neclab.eu> Reviewed-by: Cezar Craciunoiu <cezar.craciunoiu@gmail.com> Tested-by: Unikraft CI <monkey@unikraft.io>
GitHub-Pull-Request: #229
Simon Kuenzer [Thu, 12 Nov 2020 16:24:30 +0000 (17:24 +0100)]
lib/ukalloc: Allocator statistics
This commit introduces an implementation for the configuration option
`LIBUKALLOC_IFSTATS`. When enabled, allocators keep allocation statistics,
like number of current allocations, maximum memory usage due to
allocations, or how often ENOMEM was returned.
The statistics are kept on the `uk_alloc` struct while the instrumentation
of an allocator is minimal: An allocator has only to be modified with
the following macros:
- `uk_alloc_stats_count_alloc()`, `uk_alloc_stats_count_palloc()`
- `uk_alloc_stats_count_free()`, `uk_alloc_stats_count_pfree()`
- `uk_alloc_stats_count_enomem()`, `uk_alloc_stats_count_penomem()`
Current statistics can be queried with `uk_alloc_stats()`.
Signed-off-by: Simon Kuenzer <simon.kuenzer@neclab.eu> Reviewed-by: Cezar Craciunoiu <cezar.craciunoiu@gmail.com> Tested-by: Unikraft CI <monkey@unikraft.io>
GitHub-Pull-Request: #229
This commit introduces helper functions to retrieve the total available
memory of all registered allocators. In case an allocator does not support
querying the amount of free memory, it is considered as 0 bytes free for
this particular allocator.
Signed-off-by: Simon Kuenzer <simon.kuenzer@neclab.eu> Reviewed-by: Cezar Craciunoiu <cezar.craciunoiu@gmail.com> Tested-by: Unikraft CI <monkey@unikraft.io>
GitHub-Pull-Request: #229
Simon Kuenzer [Thu, 12 Nov 2020 16:11:00 +0000 (17:11 +0100)]
lib/ukalloc: Iterator helper for allocators
This commit provides `uk_alloc_foreach()`, a helper macro for
iterating over all registered allocators.
Signed-off-by: Simon Kuenzer <simon.kuenzer@neclab.eu> Reviewed-by: Cezar Craciunoiu <cezar.craciunoiu@gmail.com> Tested-by: Unikraft CI <monkey@unikraft.io>
GitHub-Pull-Request: #229
Simon Kuenzer [Thu, 12 Nov 2020 16:10:03 +0000 (17:10 +0100)]
lib/ukalloc: Cross-compatibility wrappers for "free memory" APIs
This commit provides cross compatibility wrappers between page and non-page
allocators: `uk_alloc_availmem()`, `uk_alloc_maxalloc()`,
`uk_alloc_pavailmem()`, and `uk_alloc_pmaxalloc()`.
Signed-off-by: Simon Kuenzer <simon.kuenzer@neclab.eu> Reviewed-by: Cezar Craciunoiu <cezar.craciunoiu@gmail.com> Tested-by: Unikraft CI <monkey@unikraft.io>
GitHub-Pull-Request: #229
This commit introduces
- `uk_alloc_pavailmem()` as an equivalent for `uk_alloc_availmem()`
for page allocators.
- `uk_alloc_pmaxalloc()` as an equivalent for `uk_alloc_maxalloc()`
for page allocators.
Signed-off-by: Simon Kuenzer <simon.kuenzer@neclab.eu> Reviewed-by: Cezar Craciunoiu <cezar.craciunoiu@gmail.com> Tested-by: Unikraft CI <monkey@unikraft.io>
GitHub-Pull-Request: #229
Simon Kuenzer [Thu, 12 Nov 2020 15:52:53 +0000 (16:52 +0100)]
lib/ukalloc: Introduce `uk_alloc_maxalloc()` and make `uk_alloc_availmem()` available
The purpose of this commit is to make `uk_alloc_availmem()` always
available because it is currently the only way to figure out how much heap
memory is still available. We also introduce `uk_alloc_maxalloc()` that
returns the biggest possible allocation that an allocator can currently
satisfy. The configuration option `CONFIG_IFSTAT` is removed because it
raises the expectation of an interface that returns detailed allocator
statistics.
Signed-off-by: Simon Kuenzer <simon.kuenzer@neclab.eu> Reviewed-by: Cezar Craciunoiu <cezar.craciunoiu@gmail.com> Tested-by: Unikraft CI <monkey@unikraft.io>
GitHub-Pull-Request: #229
Simon Kuenzer [Thu, 12 Nov 2020 15:27:03 +0000 (16:27 +0100)]
lib/ukalloc: Move `uk_zalloc()` after `uk_calloc()`
Moves `uk_zalloc()` to a more appropriate location within the
`<uk/alloc.h> header.
Signed-off-by: Simon Kuenzer <simon.kuenzer@neclab.eu> Reviewed-by: Cezar Craciunoiu <cezar.craciunoiu@gmail.com> Tested-by: Unikraft CI <monkey@unikraft.io>
GitHub-Pull-Request: #229
Simon Kuenzer [Thu, 12 Nov 2020 15:26:04 +0000 (16:26 +0100)]
lib/ukalloc: `extern C {}` at the beginning of <uk/alloc.h>
`<uk/alloc.h>`: Move the type `struct uk_alloc` declaration into the
C code block.
Signed-off-by: Simon Kuenzer <simon.kuenzer@neclab.eu> Reviewed-by: Cezar Craciunoiu <cezar.craciunoiu@gmail.com> Tested-by: Unikraft CI <monkey@unikraft.io>
GitHub-Pull-Request: #229
Simon Kuenzer [Thu, 12 Nov 2020 15:24:41 +0000 (16:24 +0100)]
lib/ukalloc: Move ifpages comment
Moves the comment about the ifpages implementation within `alloc.c`
to the correct place.
Signed-off-by: Simon Kuenzer <simon.kuenzer@neclab.eu> Reviewed-by: Cezar Craciunoiu <cezar.craciunoiu@gmail.com> Tested-by: Unikraft CI <monkey@unikraft.io>
GitHub-Pull-Request: #229
Marc Rittinghaus [Mon, 14 Jun 2021 09:47:16 +0000 (11:47 +0200)]
plat/common/x86: Fix control protection trap
The current trap number for the control protection exception (in
Unikraft called security trap) is wrong and the asm trap is missing. This
patch fixes these issues.
Signed-off-by: Marc Rittinghaus <marc.rittinghaus@kit.edu> Reviewed-by: Simon Kuenzer <simon.kuenzer@neclab.eu> Tested-by: Unikraft CI <monkey@unikraft.io>
GitHub-Pull-Request: #228
Simon Kuenzer [Thu, 20 May 2021 22:34:16 +0000 (00:34 +0200)]
docs: Update version to 0.5.0
Bump the version number within the documentation to 0.5.0:
`docs/` and `README.md`
Signed-off-by: Simon Kuenzer <simon.kuenzer@neclab.eu> Reviewed-by: Alexander Jung <a.jung@lancs.ac.uk> Tested-by: Unikraft CI <monkey@unikraft.io>
GitHub-Pull-Request: #214
Simon Kuenzer [Thu, 6 May 2021 13:03:11 +0000 (15:03 +0200)]
lib/uksched: Enable multiple `UK_THREAD_INIT()` in one source
In order to enable multiple UK_THREAD_INIT(_PRIO) definitions within
one source file, we generate file-unique symbol names for each entry
by using the priority level, init function name, and fini function name.
Signed-off-by: Simon Kuenzer <simon.kuenzer@neclab.eu> Reviewed-by: Razvan Deaconescu <razvan.deaconescu@cs.pub.ro> Tested-by: Unikraft CI <monkey@unikraft.io>
GitHub-Pull-Request: #201
Simon Kuenzer [Thu, 6 May 2021 13:02:35 +0000 (15:02 +0200)]
lib/uksched: Remove unnecessary alignment for thread inittab
The align parameter within `extra.ld` for the `uk_thread_inttab` was
causing some alignment issues for the `text` section. Some builds
were not able to be executed. It turns out that this extra alignment
statement is not needed for the table.
Signed-off-by: Simon Kuenzer <simon.kuenzer@neclab.eu> Reviewed-by: Razvan Deaconescu <razvan.deaconescu@cs.pub.ro> Tested-by: Unikraft CI <monkey@unikraft.io>
GitHub-Pull-Request: #201
Costin Lupu [Tue, 17 Nov 2020 08:38:48 +0000 (10:38 +0200)]
plat/xen/drivers/net: Add receive operation
Incoming packets are written in pages allocated by the netfront. Such pages are
allocated and registered to the shared ring after completion of receiving
operations.
Costin Lupu [Tue, 17 Nov 2020 08:38:47 +0000 (10:38 +0200)]
plat/xen/drivers/net: Add transmit operation
Whenever a packet is transmitted, the request describing it is written in the
shared ring. The packet itself is written in a page referenced by the request
and shared, as well, with the backend. At the end of each transmit operation, a
cleanup operation is performed free'ing the resources allocated for the
previously transmitted packets.
Costin Lupu [Tue, 17 Nov 2020 08:38:46 +0000 (10:38 +0200)]
plat/xen/drivers/net: Start netfront device
Starting the device implies establishing the connection between netfront and
netback. The connection is set up after a negociation between the two end
points. After configuring the device queues, the netfront publishes via
Xenstore the information associated with the queues which will be used by the
backend to connect.
Costin Lupu [Tue, 17 Nov 2020 08:38:45 +0000 (10:38 +0200)]
plat/xen/drivers/net: Enable/disable interrupts for rx queues
The user can enable/disable interrupts for devices according with the operation
mode he or she chooses for the device. This patch follows closely the logic
implemented in the virtio net driver.
Costin Lupu [Tue, 17 Nov 2020 08:38:44 +0000 (10:38 +0200)]
plat/xen/drivers/net: Configure netfront rx queue
Incoming packets are saved in buffers allocated with user-provided callbacks.
Whenever such packet is available, the driver is notified via event channels.
This patch introduces the configuration logic for rx queues and the handler
used in dealing with the notifications.
Costin Lupu [Tue, 17 Nov 2020 08:38:43 +0000 (10:38 +0200)]
plat/xen/drivers/net: Configure netfront tx queue
For each queue, either rx or tx, the packets references are kept in a Xen
shared ring. This patch introduces the initialization of tx shared ring. Each
time the driver will send a packet it will add a request on the tx shared ring
which will be serviced by the backend. Therefore we need to keep track of the
requests by keeping track of their IDs. Because our resources are limited, we
will maintain a pool of IDs (see `freelist` array) for this purpose.
Costin Lupu [Tue, 17 Nov 2020 08:38:42 +0000 (10:38 +0200)]
plat/xen/drivers/net: Create netfront queues
We continue with the device configuration by retrieving the Xenstore
information regarding the number of queues and their associated event channels.
Netfront devices operate pairs of Rx/Tx queues and for notifications we can
either use a single event channel per pair or split event channels.
Costin Lupu [Tue, 17 Nov 2020 08:38:41 +0000 (10:38 +0200)]
plat/xen/drivers/net: Configure netfront device
The information needed for configuring netfront devices is in the Xenstore. For
now, we only retrieve the MAC and IP addresses from there in order to
initialize the device.
This patch introduces the `netfront_dev` structure which integrates both netdev
and Xenbus device information and also keeps the configuration parameters.
Jia He [Thu, 13 May 2021 08:28:33 +0000 (16:28 +0800)]
lib/vfscore: Correct the macro name of UK_LIBC_SYSCALLS
Correct the name from UK_LIBC_SYSCALL to UK_LIBC_SYSCALLS
Otherwise the linking will report:
libs/newlib/musl-imported/src/termios/tcsetattr.c:35:
undefined reference to `ioctl'
/bin/ld:
apps/sqlite/build/sqlite_kvm-x86_64.o: in
function `tcgetattr':
libs/newlib/musl-imported/src/termios/tcgetattr.c:30:
undefined reference to `ioctl'
Reported-by: Alexander Jung <a.jung@lancs.ac.uk> Signed-off-by: Jia He <justin.he@arm.com> Reviewed-by: Alexander Jung <a.jung@lancs.ac.uk> Tested-by: Unikraft CI <monkey@unikraft.io>
GitHub-Pull-Request: #204
Simon Kuenzer [Mon, 26 Apr 2021 14:28:29 +0000 (16:28 +0200)]
build: Introduce `mk_sub_libbuild_dir`
Inline with `mk_sub_build_dir`, this commit introduces
`mk_sub_libbuild_dir` that enables creating a sub build
directory for a library. This new Makefile command has
two parameters: (1) library name, (2) sub directory
structure.
Signed-off-by: Simon Kuenzer <simon.kuenzer@neclab.eu> Reviewed-by: Cezar Craciunoiu <cezar.craciunoiu@gmail.com> Tested-by: Unikraft CI <monkey@unikraft.io>
GitHub-Pull-Request: #194
Simon Kuenzer [Mon, 25 May 2020 01:44:01 +0000 (03:44 +0200)]
lib/ukdebug: Provide `uk_printd_once()`, `uk_printk_once()`
This commit introduces debug and kernel print helpers that print a
message just once. Any successive call of the same location of a
message will produce no output: `uk_printd_once()` and
`uk_printk_once()`, as well as `uk_pr_crit_once()`, `uk_pr_err_once()`,
`uk_pr_warn_once()`, and `uk_pr_info_once()`.
This can be used to limit the amount of shown messages.
This commit updates the macro `WARN_STUBBED()`. Since the
functionality of printing once is made generally available, the macro
is based on `uk_pr_warn_once()`. In order to be inline with the
Unikraft naming scheme and reducing the risk of naming conflicts,
the macro is also introduced under the name `UK_WARN_STUBBED()`.
`WARN_STUBBED()` should be considered as deprecated.
Signed-off-by: Simon Kuenzer <simon.kuenzer@neclab.eu> Reviewed-by: Razvan Deaconescu <razvan.deaconescu@cs.pub.ro> Tested-by: Unikraft CI <monkey@unikraft.io>
GitHub-Pull-Request: #172
Alexander Jung [Fri, 15 Jan 2021 22:44:56 +0000 (23:44 +0100)]
devfs: Introduce stdout device
This commit introduces a new device, `/dev/stdout` which pipes
output to the platform console.
Signed-off-by: Alexander Jung <a.jung@lancs.ac.uk> Reviewed-by: Cezar Craciunoiu <cezar.craciunoiu@gmail.com> Tested-by: Unikraft CI <monkey@unikraft.io>
GitHub-Pull-Request: #104
Simon Kuenzer [Thu, 22 Apr 2021 21:29:15 +0000 (23:29 +0200)]
plat/common: Fix struct name in `sw_ctx_size()`
By mistake, a wrong struct name (`ukplat_ctx`) was used instead
of `sw_ctx` in `sw_ctx_size()`. The issue was introduced with
commit 9ca0659f6 and caused a Unikraft build to fail.
Signed-off-by: Simon Kuenzer <simon.kuenzer@neclab.eu> Reviewed-by: Alexander Jung <a.jung@lancs.ac.uk> Tested-by: Unikraft CI <monkey@unikraft.io>
GitHub-Pull-Request: #188
Simon Kuenzer [Mon, 15 Mar 2021 09:44:35 +0000 (10:44 +0100)]
build: Warn about empty libraries and platforms
Print a warning on the console when libraries and/or platforms are dropped
from the build because they are empty. The message is shown when verbose
mode is active (`V=1`).
Signed-off-by: Simon Kuenzer <simon.kuenzer@neclab.eu> Reviewed-by: Laurentiu Barbulescu <lrbarbulescu@gmail.com> Tested-by: Unikraft CI <monkey@unikraft.io>
GitHub-Pull-Request: #152
Simon Kuenzer [Mon, 22 Feb 2021 16:13:41 +0000 (17:13 +0100)]
lib/uksignal: Use thread creation callbacks for initialization
Make use of thread creation callbacks to initializing `signals_container`
of a thread. This is making `lib/uksched` more independent from
`lib/uksignal`. In order to achieve complete independence,
`signals_container` should actually be moved to the thread local storage
of each thread and defined within `uksignal`. So far, we do not have a
helper function to access a variable of a foreign TLS during thread
initialization. Because of this we need to finish this restructuring
later.
Signed-off-by: Simon Kuenzer <simon.kuenzer@neclab.eu> Reviewed-by: Daniel Dinca <dincadaniel97@gmail.com> Tested-by: Unikraft CI <monkey@unikraft.io>
GitHub-Pull-Request: #138
Simon Kuenzer [Mon, 14 Dec 2020 20:23:58 +0000 (21:23 +0100)]
lib/ukbus: Increase initialization class to `platform`
Since buses can have dependencies to other basic libraries and require
their early initialization to be called before (e.g, in order create
threads (XenStore), a potentially used threading API library needs to
be initialized before), we make sure that `UK_INIT_CLASS_EARLY` is
reserved for early library initialization. We scan for devices at the
intended stage `UK_INIT_CLASS_PLAT`.
Signed-off-by: Simon Kuenzer <simon.kuenzer@neclab.eu> Reviewed-by: Daniel Dinca <dincadaniel97@gmail.com> Tested-by: Unikraft CI <monkey@unikraft.io>
GitHub-Pull-Request: #138
Simon Kuenzer [Mon, 14 Dec 2020 20:23:57 +0000 (21:23 +0100)]
lib/uksched: Thread creation callbacks
Introduces the ability for libraries to hook into thread creation and
deletion process at `lib/uksched`. Main intended usage are libc's
(like newlibc, musl) that can initialize TLS for each thread, even
when a thread is created/deleted through the uksched API.
Signed-off-by: Simon Kuenzer <simon.kuenzer@neclab.eu> Reviewed-by: Daniel Dinca <dincadaniel97@gmail.com> Tested-by: Unikraft CI <monkey@unikraft.io>
GitHub-Pull-Request: #138
Simon Kuenzer [Mon, 14 Dec 2020 20:23:56 +0000 (21:23 +0100)]
include/: No dependency to `lib/ukalloc` for thread contexts
Changes the platform API in a way so that there is no dependency to
`ukalloc` for context creation. An API function is added to query the
allocation size for a thread context. Another API function is added to
call the platform-specific thread context initialization.
Signed-off-by: Simon Kuenzer <simon.kuenzer@neclab.eu> Reviewed-by: Daniel Dinca <dincadaniel97@gmail.com> Tested-by: Unikraft CI <monkey@unikraft.io>
GitHub-Pull-Request: #138
Simon Kuenzer [Mon, 14 Dec 2020 20:23:55 +0000 (21:23 +0100)]
include/: Remove libc dependency in `<uk/plat/thread.h>`
Removes the dependency to a libc with the platform header
`<uk/plat/thread.h>`. This is done in order to avoid unexpected
import orders and conflicts caused by generic Unikraft headers.
Signed-off-by: Simon Kuenzer <simon.kuenzer@neclab.eu> Reviewed-by: Daniel Dinca <dincadaniel97@gmail.com> Tested-by: Unikraft CI <monkey@unikraft.io>
GitHub-Pull-Request: #138
Simon Kuenzer [Fri, 18 Dec 2020 18:09:23 +0000 (19:09 +0100)]
build: `*.in` files as pure pre-processed files
Registers `*.in` files as purely pre-processed files. The idea is
that such generated files can be used/included by other source
files during pre-processing or compiling.