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
lib/uksp: Change default canary to terminator canary
The terminator canary contains different terminator characters
for inputs (e.g., newline) and is thus more effective than an
arbitrary constant value in protecting against, for example,
str*-function-based buffer overflows.
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
Simon Kuenzer [Mon, 15 Feb 2021 11:19:02 +0000 (12:19 +0100)]
Correct license headers introduced by UPB
This commit removes the additional clause
"THIS HEADER MAY NOT BE EXTRACTED OR MODIFIED IN ANY WAY"
from BSD license headers that got introduced by mistake
Roxana Nicolescu with the following commit: cd1873671 - lib/ukblkdev: Request interface 9065c15ef - plat/xen/drivers/blk: Register blkfront with libukblkdev 30f42955f - plat/xen/drivers: Introduce blkfront driver skeleton 620425c02 - lib/ukblkdev: Blkdev registration bff097cd2 - plat/xen/drivers/blk: Init Xenbus Device
On the one hand, this additional clause is redundant because
the BSD license already states that it must remain and the
copyright notice must be kept.
On the other hand, the clause freezes the file header
and prohibits future contributors from extending the
copyright notice for their contributions. This additional
clause is not part of the official BSD 3-clause.
The original author consents to the change with a `Signed-off-by`
or `Reviewed-by` tag to this commit.
Signed-off-by: Simon Kuenzer <simon.kuenzer@neclab.eu> Signed-off-by: Roxana Nicolescu <nicolescu.roxana1996@gmail.com>
Simon Kuenzer [Mon, 15 Feb 2021 11:19:01 +0000 (12:19 +0100)]
Correct license headers introduced by UPB
This commit removes the additional clause
"THIS HEADER MAY NOT BE EXTRACTED OR MODIFIED IN ANY WAY"
from BSD license headers that got introduced by mistake
by Bogdan Lascu with the following commit: 32ad87545 - lib/vfscore: Add anonymous pipe
On the one hand, this additional clause is redundant because
the BSD license already states that it must remain and the
copyright notice must be kept.
On the other hand, the clause freezes the file header
and prohibits future contributors from extending the
copyright notice for their contributions. This additional
clause is not part of the official BSD 3-clause.
The original author consents to the change with a `Signed-off-by`
or `Reviewed-by` tag to this commit.
Signed-off-by: Simon Kuenzer <simon.kuenzer@neclab.eu> Reviewed-by: Razvan Deaconescu <razvan.deaconescu@cs.pub.ro> on behalf of Bogdan Lascu
Simon Kuenzer [Mon, 15 Feb 2021 11:19:00 +0000 (12:19 +0100)]
Correct license headers introduced by UPB
This commit removes the additional clause
"THIS HEADER MAY NOT BE EXTRACTED OR MODIFIED IN ANY WAY"
from BSD license headers that got introduced by mistake
by Razvan Cojocaru with the following commit: 63fac86c7 - lib/uknetdev: Netdev registration
On the one hand, this additional clause is redundant because
the BSD license already states that it must remain and the
copyright notice must be kept.
On the other hand, the clause freezes the file header
and prohibits future contributors from extending the
copyright notice for their contributions. This additional
clause is not part of the official BSD 3-clause.
The original author consents to the change with a `Signed-off-by`
or `Reviewed-by` tag to this commit.
Signed-off-by: Simon Kuenzer <simon.kuenzer@neclab.eu> Reviewed-by: Razvan Deaconescu <razvan.deaconescu@cs.pub.ro> on behalf of Razvan Cojocaru
Simon Kuenzer [Mon, 15 Feb 2021 11:18:59 +0000 (12:18 +0100)]
Correct license headers introduced by UPB
This commit removes the additional clause
"THIS HEADER MAY NOT BE EXTRACTED OR MODIFIED IN ANY WAY"
from BSD license headers that got introduced by mistake
by Vlad-Andrei BĂDOIU with the following commits: d2967b3b1 - lib/ukswrand: Adapt the library to work with multiple algorithms 9bb9a617d - lib/ukswrand: Add ChaCha algorithm 8c5e2b4bb - lib/ukswrand: Add /dev/random and /dev/urandom 2784ae201 - lib/nolibc: Add pwd.h 19ebca61d - include/uk: Add page.h 8c9cd0ec9 - lib/uksysinfo: Introduce uksysinfo library 3a39d50dd - plat/*: Introduce unikraft internal constructors 200037918 - lib/nolibc: Add utsname.h
On the one hand, this additional clause is redundant because
the BSD license already states that it must remain and the
copyright notice must be kept.
On the other hand, the clause freezes the file header
and prohibits future contributors from extending the
copyright notice for their contributions. This additional
clause is not part of the official BSD 3-clause.
The original author consents to the change with a `Signed-off-by`
or `Reviewed-by` tag to this commit.
Signed-off-by: Simon Kuenzer <simon.kuenzer@neclab.eu> Reviewed-by: Razvan Deaconescu <razvan.deaconescu@cs.pub.ro> on behalf of Vlad-Andrei BĂDOIU
Simon Kuenzer [Mon, 15 Feb 2021 11:18:58 +0000 (12:18 +0100)]
Correct license headers introduced by UPB
This commit removes the additional clause
"THIS HEADER MAY NOT BE EXTRACTED OR MODIFIED IN ANY WAY"
from BSD license headers that got introduced by mistake
by Cristian Banu with the following commits: ca9616f9a - lib/uk9p: Add 9P fid abstraction b2ce99adc - lib/uk9p: Add 9P transport registration 5c24de843 - lib/uk9p: Add 9P device implementation 440259b39 - plat/xen/drivers/9p: Initialize xenbus device 5282598ae - plat/drivers: Virtio 9P driver skeleton 7ee9a512d - plat/xen/drivers: Add 9pfront driver skeleton f2c29a657 - lib/uk9p: Add 9P requests abstraction f74733d49 - lib/9pfs: Implement mount and unmount cd65e50e4 - lib/uk9p: Add 9P protocol core definitions ef1021378 - lib/9pfs: Add 9pfs header e77b99c78 - lib/uk9p: Add 9P helper API
On the one hand, this additional clause is redundant because
the BSD license already states that it must remain and the
copyright notice must be kept.
On the other hand, the clause freezes the file header
and prohibits future contributors from extending the
copyright notice for their contributions. This additional
clause is not part of the official BSD 3-clause.
The original author consents to the change with a `Signed-off-by`
or `Reviewed-by` tag to this commit.
Signed-off-by: Simon Kuenzer <simon.kuenzer@neclab.eu> Reviewed-by: Razvan Deaconescu <razvan.deaconescu@cs.pub.ro> on behalf of Cristian Banu
Simon Kuenzer [Mon, 15 Feb 2021 11:18:57 +0000 (12:18 +0100)]
Correct license headers introduced by UPB
This commit removes the additional clause
"THIS HEADER MAY NOT BE EXTRACTED OR MODIFIED IN ANY WAY"
from BSD license headers that got introduced by mistake
by Costin Lupu with the following commits: e09db222a - lib/posix-process: Introduce library 790787e1a - plat/kvm: Add KVM (x86_64) timer support 495221f5a - plat/common: Common x86 tracing functions 6ea24ce5f - plat/common: Common x86 segment descriptors definitions 3174af1a1 - plat/common: Common x86 traps definitions and functions f2478ed85 - plat/kvm: Add KVM (x86_64) interrupts support 9f0389adf - plat/xen: Add Xenbus driver registration support ff0c0bf65 - plat/kvm: Fix current thread retrieval in interrupt context on x86_64 fbbc468c9 - lib/uktime: Introduce time_types.h for type defintions a79078c96 - plat/xen: Add API for Xenstore messages 300c8309c - plat: Introduce API for setting platform default allocator 45d7afdb5 - lib/uksched: Introduce thread attributes 9464bdc06 - plat/xen: Introduce client API for Xenbus drivers cf2e10677 - plat/common: Common x86 CPU definitions 3bf7ba15a - plat/xen: Add IRQ subsystem initialization function 26a59e3d2 - plat/xen: Add support for communication with Xenstore daemon cc797499a - plat/common: Common x86 CPU functions dde942de7 - lib/ukunistd: Add user.h for user related functions declarations 1162bca18 - lib/posix-libdl: Add stubs 0101002ee - plat/common: Halting functions 5e73e025f - plat/xen: Add Xenstore watch support 62917eb15 - plat/linuxu: Add linuxu (x86_64) interrupts support 2c29345cd - lib/ukswrand: Add getrandom() function 925b04e24 - plat/linuxu: Add linuxu (x86_64) timer support df484abae - lib/nolibc: Add time.c
On the one hand, this additional clause is redundant because
the BSD license already states that it must remain and the
copyright notice must be kept.
On the other hand, the clause freezes the file header
and prohibits future contributors from extending the
copyright notice for their contributions. This additional
clause is not part of the official BSD 3-clause.
The original author consents to the change with a `Signed-off-by`
or `Reviewed-by` tag to this commit.
Signed-off-by: Simon Kuenzer <simon.kuenzer@neclab.eu> Reviewed-by: Razvan Deaconescu <razvan.deaconescu@cs.pub.ro> on behalf of Costin Lupu
Simon Kuenzer [Mon, 15 Feb 2021 11:18:56 +0000 (12:18 +0100)]
Correct license headers introduced by Arm Ltd.
This commit removes the additional clause
"THIS HEADER MAY NOT BE EXTRACTED OR MODIFIED IN ANY WAY"
from BSD license headers that got introduced by mistake
with the following commits: c06ff6e61 - plat/common: Implement assembly helper for Arm64 thread context switch ac8ebd49e - plat/common: Add cache maintenance support for arm64 d411a62f8 - plat/common: Implement PSCI despatch functions for arm64 b329b5143 - plat/common: Move global variables defined in link scripts to a header c1827efc4 - plat/kvm: Add Arm64 virtual timer library to provide ticks 7a65cf0e3 - plat/common: Common arm64 CPU interrupt flag handling 25ff8503b - plat/kvm: Add interrupt handle APIs for arm64 70fc87133 - plat/common: Implement CPU halt function for arm64 74ef78c41 - plat/include: Define macros for Arm64 to access registers 65b6280b6 - plat/kvm: Add linker script for Arm64 9c7b1e93b - uk/arch: Add necessary header files for Arm64 24297ac1a - plat/kvm: Add Arm64 basic entry code 37e9d07f4 - plat/include: Define address offsets of boot stack and pagetable 1a16e1046 - plat: Implement tls stub for arm64 b41faf876 - plat/drivers/ofw: Move gic_get_irq_from_dtb to gic_fdt.c 8ed802d62 - plat/kvm: Implement stub of ukplat_stack_set_current_thread for arm64 1f5ea382e - plat/common: Split arch specific codes from time.c to arm{, 64}/time.h 2def01809 - lib/fdt: Introduce fdt_getprop_u32_by_offset helper 278ad9eda - plat/common: Add a platform API to get IRQ from device tree 5183a0a64 - plat/common: Implement gic-v2 library for Arm 1fc6481a1 - plat/common: Introduce fdt_interrupt_cells helper to parse irq
On the one hand, this additional clause is redundant because
the BSD license already states that it must remain and the
copyright notice must be kept.
On the other hand, the clause freezes the file header
and prohibits future contributors from extending the
copyright notice for their contributions. This additional
clause is not part of the official BSD 3-clause.
The original author or affiliation consents to the change
with a `Signed-off-by` or `Reviewed-by` tag to this
commit.
Signed-off-by: Simon Kuenzer <simon.kuenzer@neclab.eu> Signed-off-by: Jia He <justin.he@arm.com>
Simon Kuenzer [Mon, 15 Feb 2021 11:18:55 +0000 (12:18 +0100)]
Correct license headers introduced by NEC Laboratories Europe GmbH
This commit removes the additional clause
"THIS HEADER MAY NOT BE EXTRACTED OR MODIFIED IN ANY WAY"
from BSD license headers that got introduced by mistake
with the following commits: d7ab6740e - lib/ukunistd: Introduce ukunistd library 154a9b466 - lib/ukallocbbuddy: Add binary buddy allocator implementation cfa2c08ae - lib/ukboot: Add Unikraft bootstrapping 17327dfe6 - lib/ukargparse: Add argument parser 1e1a8f5b5 - lib/ukschedcoop: Add cooperative round-robin scheduler c327e9713 - lib/uknetdev: Introduce Netbufs 3c3dc48b5 - plat/xen: Add Xen (x86_64, ARM) platform code 1fa094ed7 - plat/kvm: Introduce platform configuration struct a8cb90f65 - lib/ukalloc: Add abstraction library for memory allocators feb280521 - plat/xen: Split emergency and hypervisor console c722184e9 - include: Introduce <uk/prio.h> 0bc9633a0 - plat/xen: Add console support for x86_64 3b94c37a5 - plat/*: Add binary system call feature and API 06cb4527f - plat/common: Add cpu.h for Arm32 463baa06a - lib/vfscore: Automount option 27af93b6d - lib/ukalloc: Move internal functions to new header 1760d9ef4 - lib/nolibc: Add nolibc, a minimal subset of libc functions 2c9108854 - plat/kvm: Add KVM (x86_64) platform code eacdeffea - arch: Add architecture interface 8dba9141b - lib/nolibc: Provide assertions (assert.h) e6d46e521 - plat/kvm: System call trap handler (x86_64) 8277edb38 - build: Add build and configuration framework 3afda62dd - lib/ukdebug: Do not rely on libc for uk_pr_*() 7c7518d28 - plat/linuxu: Add linux userspace (x86_64, ARM) platform code 347cb7db4 - lib/ukdebug: Add printing and debug helpers 1353814b3 - lib/uksched: Add abstraction library for schedulers 828efb76e - plat: Add platform interface bd4825025 - lib/ukmmap: mmap trick for Go ef5245754 - plat/common: Split ARM generic timer implementation 1717ee104 - lib/ukbus: Introduce abstraction for device buses 71ee3e521 - plat/common: Introduce virtio standard header 2d39b41ca - lib/ukmpi: Introduce mailboxes with libukmpi 67e70a93b - plat/drivers: Introduce virtio PCI device 00292f747 - include/uk: Introduce init table b49cc5403 - plat/drivers: Introduce the virtio bus ae22ad94c - plat/kvm: Add initial PCI bus driver for x86_64 415e1ed05 - lib/ukswrand: Introduce libukswrand 87880cde9 - plat/drivers: Reintroduce the virtio ring 15bea914c - lib/uklibparam: Introduce the library parameter 80928b929 - lib/uklock: Introduce semaphores and mutexes with libuklock 340cd8ef6 - plat/common: virt to phys addr conversion bb7d1651e - arch: provide thread-local storage helper functions fcc07a3cd - lib/nolibc: move shared definitions to special include file 4c2afee22 - plat: Add global struct to keep x86 CPU information 11ac352a7 - plat: switch thread-local storage area on context switch 00b652b41 - lib/vfscore: update license header for imported files 740fc6014 - lib/ukdebug: save actual data into tracebuffer 2bc4d9df7 - lib/ukdebug: trace.h - introduce UK_FOREACH and UK_NARGS macros 917d23a75 - support/scripts: fetch trace data from running Unikraft b3fbde2b3 - lib/vfscore: implement fops for std(out|err) ccb39b566 - lib/syscall_shim: introduce syscalls macro layer 146c13e04 - lib/vfscore: introduce vfscore
On the one hand, this additional clause is redundant because
the BSD license already states that it must remain and the
copyright notice must be kept.
On the other hand, the clause freezes the file header
and prohibits future contributors from extending the
copyright notice for their contributions. This additional
clause is not part of the official BSD 3-clause.
The original author or affiliation consents to the change
with a `Signed-off-by` or `Reviewed-by` tag to this
commit.
Signed-off-by: Simon Kuenzer <simon.kuenzer@neclab.eu> Signed-off-by: Sharan Santhanam<sharan.santhanam@neclab.eu> Signed-off-by: Felipe Huici <felipe.huici@neclab.eu>
Sharan Santhanam [Wed, 10 Feb 2021 12:28:52 +0000 (13:28 +0100)]
lib/vfscore: Perform readv and writev operations
The actual read and write operations are split from the error
checks so, different flavors of read and write can call the
respective implementation without additional error checks.
Signed-off-by: Sharan Santhanam <sharan.santhanam@neclab.eu> Reviewed-by: Alexander Jung <a.jung@lancs.ac.uk> Tested-by: Unikraft CI <monkey@unikraft.io>
GitHub-Pull-Request: #109
Sharan Santhanam [Wed, 10 Feb 2021 11:31:25 +0000 (12:31 +0100)]
lib/vfscore: UK_VFSCORE_NOPOS flag to check seek
When `UK_VFSCORE_NOPOS` is set, seek operation
is not allowed on a file descriptor. ESPIPE is returned
when seek operation is performed on these descriptors.
Signed-off-by: Sharan Santhanam <sharan.santhanam@neclab.eu> Reviewed-by: Alexander Jung <a.jung@lancs.ac.uk> Tested-by: Unikraft CI <monkey@unikraft.io>
GitHub-Pull-Request: #109
When compiling Unikraft with gcc-10, the compiler replace the memset
function with a recursive builtin memset call, which result in a
infinite recursive call to the memset causing exhaustion of the stack
memory eventually leading to crash. To fix this the gcc provides
compiler flags -ffreestanding and -fhosted.
Bernard Rizzo [Sat, 16 Jan 2021 01:12:07 +0000 (02:12 +0100)]
lib/uksignal: initial code
uksignal provides a basic implementation of signals over Unikraft. It
supports signals between threads and process wide signals. It provides
all the definitions needed for signals so we must disable the
definitions provided in libc to run it.
It does not support signal codes, rt signals and executes the signal
handlers on the thread stack. It is also not yet integrated with our
irqs to deliver signals like SIGSEGV.
This implementation is not complete; it is meant as a temporory
solution until we have a proper events delivering system.
This patch is an update of the original.
Signed-off-by: Mihai Pogonaru <pogonarumihai@gmail.com> Signed-off-by: Teodora Serbanescu <teo.serbanescu16@gmail.com> Signed-off-by: Felipe Huici <felipe.huici@neclab.eu> Signed-off-by: Bernard Rizzo <b.rizzo@student.uliege.be> Reviewed-by: ARGINT DRAGOS IULIAN <dragosargint21@gmail.com>
Provide a ukalloc compatible interface. This enables the usage of pools
with common allocator interfaces, like `uk_malloc()`, `uk_free()`,
and `uk_memalign()`.
Signed-off-by: Simon Kuenzer <simon.kuenzer@neclab.eu> Reviewed-by: Razvan Deaconescu <razvan.deaconescu@cs.pub.ro>
Simon Kuenzer [Tue, 22 Dec 2020 12:52:34 +0000 (13:52 +0100)]
lib/ukallocpool: LIFO pool implementation
Initial implementation of a memory pool (same-sized and fixed-sized object
allocator) following LIFO principle by using a single list to keep track of
free objects. LIFO is chosen to potentially better utilize hardware caches.
Signed-off-by: Simon Kuenzer <simon.kuenzer@neclab.eu> Reviewed-by: Razvan Deaconescu <razvan.deaconescu@cs.pub.ro>
lib/vfscore: Add missing goto statement in pwritev
The label out_errno in pwritev() is not used, though it should be, as it
is the case with preadv(). This updates pwritev() and add a missing goto
statement to the out_errno label. It makes the implementation of
pwritev() consistent with preadv().
Signed-off-by: Razvan Deaconescu <razvan.deaconescu@cs.pub.ro> Reviewed-by: Alexander Jung <a.jung@lancs.ac.uk> Tested-by: Unikraft CI <monkey@unikraft.io>
GitHub-Pull-Request: #96
The out_error jump label used by goto in lib/vfscore/main.c is not
properly named. It results in an error when using vfscore. This fix
renames it to out_errno.
Signed-off-by: Razvan Deaconescu <razvan.deaconescu@cs.pub.ro> Reviewed-by: Alexander Jung <a.jung@lancs.ac.uk> Tested-by: Unikraft CI <monkey@unikraft.io>
GitHub-Pull-Request: #96
Alexander Jung [Mon, 18 Jan 2021 15:45:32 +0000 (16:45 +0100)]
build: Upgrade missing platform to error
This commit turns the missing platform selection into an error.
This is useful when build step is pipelined to prevent further
steps to be completed as the build will not start without a target
platform.
Signed-off-by: Alexander Jung <a.jung@lancs.ac.uk> Reviewed-by: Sharan Santhanam <sharan.santhanam@neclab.eu> Tested-by: Unikraft CI <monkey@unikraft.io>
GitHub-Pull-Request: #88
dragosargint [Fri, 27 Nov 2020 13:55:42 +0000 (15:55 +0200)]
solve ukswrand does not generate random numbers
If you configure ukswrand with the platform timestamp
as initial seed, and you'll try to use getrandom function
or try to read from /dev/urandom you won't get random
numbers. This is because the initialization of the random
number generator, which is located in the swrand.c file,
is done earlier than the initialization of TSC clock.