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.
Introduces the pre-process build stage which is executed after
`prepare` and before compiling object files. This is done in
order to let header files be generated later.
Signed-off-by: Simon Kuenzer <simon.kuenzer@neclab.eu> Reviewed-by: Vlad-Andrei Badoiu <vlad_andrei.badoiu@upb.ro>
Simon Kuenzer [Fri, 18 Dec 2020 18:09:21 +0000 (19:09 +0100)]
build: Pre-processing rule for AWK progfiles
Introduces an AWK pre-processing rule as another way for generating source
files based on AWK progfiles. One intention of this is to simplify
`Makefile.uk` of `lib/syscall_shim`.
The source file is treated as the AWK progfile which will be executed over
given includes (`AWKINCLUDES[-y]`). Because global flags and includes
would not be meaningful for AWK rules, we support only library-local and
file-local scopes.
Example of compiling `uk_syscall6.o` from `uk_syscall6.awk`
in `lib/syscall_shim`:
LIBSYSCALL_SHIM_SRCS += $(LIBSYSCALL_SHIM_BASE)/gen_uk_syscall6.awk>.c
LIBSYSCALL_SHIM_GEN_UK_SYSCALL6_AWKFLAGS += -F '-'
LIBSYSCALL_SHIM_GEN_UK_SYSCALL6_AWKINCLUDES += $(LIBSYSCALL_SHIM_BUILD)/provided_syscalls.h.in
Signed-off-by: Simon Kuenzer <simon.kuenzer@neclab.eu> Reviewed-by: Vlad-Andrei Badoiu <vlad_andrei.badoiu@upb.ro>
Simon Kuenzer [Fri, 18 Dec 2020 18:09:20 +0000 (19:09 +0100)]
build: Per-file flags and includes for M4 pre-processing
Similar to build rules, we add support for specifying file-local
flags and includes to M4 pre-processing rules. This can be done
through the following variables:
<LIBNAME>_<SOURCE NAME>_M4FLAGS
<LIBNAME>_<SOURCE NAME>_M4INCLUDES
Example: Setting `-myflag` to the M4 pre-processing of `code.m4`:
LIBMYLIB_SRCS += $(LIBMYLIB_BASE)/code.m4>.c
LIBMYLIB_CODE_M4FLAGS += -myflag
Signed-off-by: Simon Kuenzer <simon.kuenzer@neclab.eu> Reviewed-by: Vlad-Andrei Badoiu <vlad_andrei.badoiu@upb.ro>
Simon Kuenzer [Fri, 18 Dec 2020 18:09:18 +0000 (19:09 +0100)]
build: Enable extending pre-processing rules
Similar to build rules, we enable extending the supported pre-process
rules. This can be achieved by specifying a pre-process rule definition
within a libraries' `Makefule.rules` with the following name scheme:
preprule_<source file extension>
Examples:
preprule_m4 for *.m4 source files
preprule_awk for *.awk source files
Signed-off-by: Simon Kuenzer <simon.kuenzer@neclab.eu> Reviewed-by: Vlad-Andrei Badoiu <vlad_andrei.badoiu@upb.ro>
Gabriel Mocanu [Thu, 15 Apr 2021 07:57:14 +0000 (10:57 +0300)]
lib: Clean up library names and put them in the same format
Signed-off-by: Gabriel Mocanu <gabi.mocanu98@gmail.com> Reviewed-by: Alexander Jung <a.jung@lancs.ac.uk> Tested-by: Unikraft CI <monkey@unikraft.io>
GitHub-Pull-Request: #180
Simon Kuenzer [Mon, 29 Mar 2021 12:35:48 +0000 (14:35 +0200)]
support: checkpatch: Unikraft subject format
Checks and fails with an error when the subject line format is not
following the Unikraft scheme.
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: #169
Simon Kuenzer [Mon, 15 Feb 2021 15:52:15 +0000 (16:52 +0100)]
support: checkpatch: Prefer raw system call definitions
Introduces a warning for system call definitions when
`UK_SYSCALL_DEFINE` and `UK_LLSYSCALL_DEFINE` was used:
Raw system call definitions are preferred because `errno`
is not used.
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: #166
cristian-vijelie [Thu, 28 Jan 2021 11:34:46 +0000 (13:34 +0200)]
lib/isrlib: "Interrupt-service-routine"-safe standard functions
Introduces libisr, a library for providing "interrupt-service-routine"-
safe variants of standard functions so that they can be used in
interrupt handlers and early boot code. This commit provides an initial
set of standard functions normally found with `<string.h>`. The
implementation is derived from nolibc and compiled with the `|isr`
variant which disables the use of extended CPU features, like
vector units (e.g., SSE, AVX) and floating point units.
Signed-off-by: cristian-vijelie <cristianvijelie@gmail.com> Signed-off-by: Simon Kuenzer <simon.kuenzer@neclab.eu> Reviewed-by: Sharan Santhanam <sharan.santhanam@neclab.eu> Tested-by: Unikraft CI <monkey@unikraft.io>
GitHub-Pull-Request: #151
The existing setup macro sets only the lower 32 bits, even on
64-bit platforms. This commit creates a canary in full native word
length. It also incorporates a null terminator to mitigate classic
byte-by-byte attacks with str*-functions.
Signed-off-by: Marc Rittinghaus <marc.rittinghaus@kit.edu> Reviewed-by: Vlad-Andrei Badoiu <vlad_andrei.badoiu@upb.ro> Tested-by: Unikraft CI <monkey@unikraft.io>
GitHub-Pull-Request: #141
Initializing the random stack canary in ukplat_entry() is too
early because at this point lib/ukswrand is not initialized and
uk_swrand_randr() returns fixed known values. We do the
canary initialization after the init table run instead. Although
a bit late, the canary will at least be set before any
application-specific code runs.
Signed-off-by: Marc Rittinghaus <marc.rittinghaus@kit.edu> Reviewed-by: Vlad-Andrei Badoiu <vlad_andrei.badoiu@upb.ro> Tested-by: Unikraft CI <monkey@unikraft.io>
GitHub-Pull-Request: #141