Andrei Tatar [Tue, 21 Nov 2023 20:11:46 +0000 (21:11 +0100)]
vfscore: Move fd handling into posix-fdtab
This change moves the file descriptor table out of vfscore, along with
the fd-specific syscalls close and dup*.
Implementations of vfscore files are also patched to use posix-fdtab.
Checkpatch-Ignore: USE_NEGATIVE_ERRNO
Checkpatch-Ignore: LINE_SPACING Signed-off-by: Andrei Tatar <andrei@unikraft.io> Reviewed-by: Simon Kuenzer <simon@unikraft.io> Approved-by: Simon Kuenzer <simon@unikraft.io>
GitHub-Closes: #1168
Andrei Tatar [Tue, 21 Nov 2023 19:34:43 +0000 (20:34 +0100)]
lib/posix-fdtab: Add legacy interface for vfscore
This change adds support for legacy vfscore files to posix-fdtab,
allowing both new uk_ofiles and vfscore files to be used simultaneously.
This includes legacy as well as type-agnostic ("shim") API additions.
Checkpatch-Ignore: UNNECESSARY_ELSE Signed-off-by: Andrei Tatar <andrei@unikraft.io> Reviewed-by: Simon Kuenzer <simon@unikraft.io> Approved-by: Simon Kuenzer <simon@unikraft.io>
GitHub-Closes: #1168
Andrei Tatar [Tue, 21 Nov 2023 19:22:23 +0000 (20:22 +0100)]
lib/posix-fdtab: Introduce fdtab library
This change introduces the posix-fdtab library, tasked with managing the
file descriptor table, mapping integers to open file descriptions.
posix-fdtab exposes functionality through Unikraft-internal APIs and is
independent from the file descriptor table implementation in vfscore,
which it aims to replace.
Checkpatch-Ignore: VOLATILE
Checkpatch-Ignore: LINE_SPACING Signed-off-by: Andrei Tatar <andrei@unikraft.io> Reviewed-by: Simon Kuenzer <simon@unikraft.io> Approved-by: Simon Kuenzer <simon@unikraft.io>
GitHub-Closes: #1168
Andrei Tatar [Mon, 20 Nov 2023 15:20:25 +0000 (16:20 +0100)]
lib/ukfile: Introduce the ukfile library
This change introduces the ukfile library to provide a new fundamental
abstraction for "files" in Unikraft. This forms the base for a larger
rearchitecting of vfscore.
Checkpatch-Ignore: ENOSYS
Checkpatch-Ignore: VOLATILE Signed-off-by: Andrei Tatar <andrei@unikraft.io> Reviewed-by: Simon Kuenzer <simon@unikraft.io> Approved-by: Simon Kuenzer <simon@unikraft.io>
GitHub-Closes: #1165
Andrei Tatar [Mon, 2 Oct 2023 18:58:34 +0000 (20:58 +0200)]
include/arch: Add atomic fetch & AND operation
This change adds a Unikraft macro for an architecture's atomic fetch &
AND operation, similar to the fetch & OR we already have.
It also fixes the order of the fetch & OR operations to be truthful to
the docstring.
Signed-off-by: Andrei Tatar <andrei@unikraft.io> Reviewed-by: Simon Kuenzer <simon@unikraft.io> Approved-by: Simon Kuenzer <simon@unikraft.io>
GitHub-Closes: #1125
Andrei Tatar [Mon, 2 Oct 2023 19:07:40 +0000 (21:07 +0200)]
lib/uklock: Add static initializer for uk_rwlock
Signed-off-by: Andrei Tatar <andrei@unikraft.io> Reviewed-by: Simon Kuenzer <simon@unikraft.io> Approved-by: Simon Kuenzer <simon@unikraft.io>
GitHub-Closes: #1126
Andrei Tatar [Mon, 2 Oct 2023 19:04:47 +0000 (21:04 +0200)]
lib/uksched: Export static wait queue initializer
This change adds the convenience macro `UK_WAIT_QUEUE_INITIALIZER` to
the public API of uksched, enabling external code to use initializers
for embedded wait queues.
Signed-off-by: Andrei Tatar <andrei@unikraft.io> Reviewed-by: Simon Kuenzer <simon@unikraft.io> Approved-by: Simon Kuenzer <simon@unikraft.io>
GitHub-Closes: #1126
Andrei Tatar [Thu, 16 Nov 2023 18:04:30 +0000 (19:04 +0100)]
include: Add strong/weak reference counting
This change adds a utility header implementing a reference counting
scheme that supports regular (strong) as well as weak references.
Signed-off-by: Andrei Tatar <andrei@unikraft.io> Reviewed-by: Simon Kuenzer <simon@unikraft.io> Approved-by: Simon Kuenzer <simon@unikraft.io>
GitHub-Closes: #1160
Andrei Tatar [Wed, 16 Aug 2023 22:45:39 +0000 (00:45 +0200)]
lib/ukcpio: Optimize path handling
This change removes redundant string copies of the destination
extraction path, dropping about half of the total string copy ops.
In addition, some minor code style changes included.
Signed-off-by: Andrei Tatar <andrei@unikraft.io> Reviewed-by: Simon Kuenzer <simon@unikraft.io> Approved-by: Simon Kuenzer <simon@unikraft.io>
GitHub-Closes: #1181
Andrei Tatar [Wed, 16 Aug 2023 22:00:31 +0000 (00:00 +0200)]
lib/ukcpio: Refactor CPIO extraction
This change reorganizes the CPIO extraction code, making the parsing of
header fields more explicit, as well as splitting functionality into
dedicated handling functions.
Checkpatch-Ignore: CODE_INDENT
Checkpatch-Ignore: LEADING_SPACE
Checkpatch-Ignore: LINE_SPACING
Checkpatch-Ignore: UNNECESSARY_ELSE Signed-off-by: Andrei Tatar <andrei@unikraft.io> Reviewed-by: Simon Kuenzer <simon@unikraft.io> Approved-by: Simon Kuenzer <simon@unikraft.io>
GitHub-Closes: #1181
Andrei Tatar [Wed, 16 Aug 2023 17:58:24 +0000 (19:58 +0200)]
lib/ukcpio: Clean up & organize code
This change is a minor code cleanup with no significant logic changes,
in preparation for a larger refactoring; it includes:
- improved macros with more logical ordering
- code deduplication
- cleaner structured `read_section` function
Checkpatch-Ignore: COMPLEX_MACRO Signed-off-by: Andrei Tatar <andrei@unikraft.io> Reviewed-by: Simon Kuenzer <simon@unikraft.io> Approved-by: Simon Kuenzer <simon@unikraft.io>
GitHub-Closes: #1181
Andrei Tatar [Thu, 16 Nov 2023 18:22:22 +0000 (19:22 +0100)]
lib/uktimeconv: Add conversion functions
This change adds a header with utility functions related to various time
formats defined by standard C or POSIX.
This header depends on time headers provided by (no)libc.
Signed-off-by: Andrei Tatar <andrei@unikraft.io> Reviewed-by: Simon Kuenzer <simon@unikraft.io> Approved-by: Simon Kuenzer <simon@unikraft.io>
GitHub-Closes: #1162
Andrei Tatar [Mon, 2 Oct 2023 19:04:47 +0000 (21:04 +0200)]
lib/uksched: Export static wait queue initializer
This change adds the convenience macro `UK_WAIT_QUEUE_INITIALIZER` to
the public API of uksched, enabling external code to use initializers
for embedded wait queues.
Andrei Tatar [Tue, 7 Nov 2023 13:59:41 +0000 (14:59 +0100)]
include/arch: Make time constants signed
This change removes the unsigned marker on integer literals that define
time-related constants, as there is no logical reason for time to always
be positive. This also alleviates mixed-signedness warnings when doing
arithmetic on time values, as well as assigning to __snsec.
Signed-off-by: Andrei Tatar <andrei@unikraft.io> Reviewed-by: Simon Kuenzer <simon@unikraft.io> Approved-by: Simon Kuenzer <simon@unikraft.io>
GitHub-Closes: #1157
Andrei Tatar [Tue, 7 Nov 2023 13:53:45 +0000 (14:53 +0100)]
include/arch: Add raw compare-exchange operation
This change adds a Unikraft macro for the raw compare-exchange
operation, which in contrast to the existing macro may modify its
arguments.
Signed-off-by: Andrei Tatar <andrei@unikraft.io> Reviewed-by: Simon Kuenzer <simon@unikraft.io> Approved-by: Simon Kuenzer <simon@unikraft.io>
GitHub-Closes: #1156
Andrei Tatar [Tue, 7 Nov 2023 14:12:30 +0000 (15:12 +0100)]
lib/vfscore: Fix crash in fstatat on NULL args
This change makes fstatat gracefully handle NULL arguments by returning
-EFAULT, preventing a hard crash.
Signed-off-by: Andrei Tatar <andrei@unikraft.io> Reviewed-by: Simon Kuenzer <simon@unikraft.io> Approved-by: Simon Kuenzer <simon@unikraft.io>
GitHub-Closes: #1155
Andrei Tatar [Tue, 7 Nov 2023 14:06:48 +0000 (15:06 +0100)]
lib/posix-time: Allow NULL arg in clock_getres
This change fixes the behavior of clock_getres to not return an error
when receiving a NULL as its output argument, in accordance with docs.
Signed-off-by: Andrei Tatar <andrei@unikraft.io> Reviewed-by: Simon Kuenzer <simon@unikraft.io> Approved-by: Simon Kuenzer <simon@unikraft.io>
GitHub-Closes: #1154
Sergiu Moga [Mon, 23 Oct 2023 16:19:05 +0000 (19:19 +0300)]
lib/devfs: Remove dependency on `LIBVFSCORE_AUTOMOUNT_ROOTFS`
Now that we have `fstab`, we no longer depend on something mounting
a rootfs being preconfigured within the kernel. A user may simply
choose to specify rootfs through the `vfs.fstab` command-line
argument.
Signed-off-by: Sergiu Moga <sergiu@unikraft.io> Reviewed-by: Alexander Jung <alex@unikraft.io> Approved-by: Simon Kuenzer <simon@unikraft.io>
GitHub-Closes: #1146
Alexander Jung [Wed, 22 Nov 2023 13:46:33 +0000 (14:46 +0100)]
build: Introduce `UK_IMAGE_NAME_OVERWRITE` make var
This commit introduces a new make variable,
`UK_IMAGE_NAME_OVERWRITE`, which is used to customize the
output binary name of the kernel image. This is a special,
and experimental, variable which can be helpful in certain
use cases, for example where targets with the same architecture
and platform are present. This variable should be used in
conjunction with a different build directory, `O=`, as the
resulting binary will always have the name from this option.
Signed-off-by: Alexander Jung <alex@unikraft.io> Reviewed-by: Simon Kuenzer <simon@unikraft.io> Approved-by: Simon Kuenzer <simon@unikraft.io>
GitHub-Closes: #1169
Marco Schlumpp [Mon, 27 Feb 2023 14:15:58 +0000 (15:15 +0100)]
lib/uknetdev: Add ipv4_dns0_addr configuration
Previously, we were only able to statically configure the ip address,
netmask, and gateway, but not the DNS server. This commit adds the
configuration option for a DNS server.
Signed-off-by: Marc Rittinghaus <marc.rittinghaus@kit.edu> Signed-off-by: Marco Schlumpp <marco@unikraft.io> Reviewed-by: Simon Kuenzer <simon@unikraft.io> Approved-by: Simon Kuenzer <simon@unikraft.io>
GitHub-Closes: #1167
cocodery [Mon, 20 Nov 2023 04:33:41 +0000 (12:33 +0800)]
lib/ukrust: Fix compilation fialure when enable libukrust
This commit aims to fix issue#1147 which compile apps with enabled
libukrust
1. ukrust/Makefile.uk: fix command line argument with high-version
bindgen, from 'size_t-is-usize' to 'no-size_t-is-usize'.
2. ukrust/src/allocator.rs: fix previous defined symbol by comment
them, becasue rustc will help to resolve, and add new symbol
'__rust_no_alloc_shim_is_unstable' for locate.
cocodery [Fri, 17 Nov 2023 16:17:03 +0000 (00:17 +0800)]
build: guarantee files generated by awk-file before others rely on them
Fix sub-problem of issue#1147 when enable libukrust, which will throw an error that
`fatal error: 'uk/bits/libid.h' file not found` because of wrong commands order.
this header file is needed by `bindings_helper.h` but command generates
'uk/bits/libid/h' is ahead from the bindgen command.
Eduard Vintilă [Sun, 12 Nov 2023 13:54:34 +0000 (15:54 +0200)]
plat/common/arm: Zero out `x29` and `x30` before stack switch
In order to properly mark the end of a stacktrace and avoid
undefined behaviour during unwinding, both the frame pointer
(`x29`) and the link register (`x30`) should be
zeroed out before switching to a new stack.
Signed-off-by: Eduard Vintilă <eduard.vintila47@gmail.com>
Andrei Tatar [Mon, 2 Oct 2023 18:58:34 +0000 (20:58 +0200)]
include/arch: Add atomic fetch & AND operation
This change adds a Unikraft macro for an architecture's atomic fetch &
AND operation, similar to the fetch & OR we already have.
It also fixes the order of the fetch & OR operations to be truthful to
the docstring.
Robert Kuban [Fri, 8 Sep 2023 08:52:12 +0000 (10:52 +0200)]
ukboot: Remove explicit PLAT_KVM dependency
Remove an explicit PLAT_KVM dependency in LIBUKBOOT_HEAP_BASE
to allow plattforms other then plat/kvm to let ukboot to
initialize the heap with paging enabled.
Robert Kuban [Fri, 27 Oct 2023 13:51:29 +0000 (15:51 +0200)]
arch/arm64: Fix `ukarch_tlb_flush_entry`
Fix a bug in `ukarch_tlb_flush_entry` that leads to the TLB entry
not being invalidated on arm64.
The argument `X` of `tlbi vaae1is, X` is not the virtual address,
but a field that contains the bits 55:12 of the virtual address in
the bits 43:0. The remaining bits of this field (RES0,TTL) are valid
being set to 0.
Store the virtual address at the proper location in the argument.
Signed-off-by: Robert Kuban <robert.kuban@opensynergy.com>
Sergiu Moga [Mon, 23 Oct 2023 13:41:54 +0000 (16:41 +0300)]
lib/vfscore: Re-enable the mounting of `initrd`'s through `fstab`
After commit 9946c9329346 ("lib/vfscore: Embedded initrd"), the
mounting of `initrd`'s became dependent on having the option
`CONFIG_LIBVFSCORE_AUTOMOUNT_ROOTFS` enabled. Thus, if someone
wanted to mount an `initrd` through `fstab` only and with that
configuration option disabled, their build would fail.
Solve this dependency misconfiguration by making
`vfscore_mount_initrd_volume` only depend on the
`CONFIG_LIBUKCPIO && CONFIG_LIBRAMFS` options instead.
Kha Dinh [Wed, 18 Oct 2023 07:32:42 +0000 (07:32 +0000)]
plat/kvm/x86: ExitBootService after GetMemoryMap and retry if fail
We exit Boot Service after obtaining MemoryMap, since it is no
longer needed. The function `uk_efi_exit_bs` is not reused and
is rather simple so it is merged with `uk_efi_get_mmap`.
Kha Dinh [Wed, 18 Oct 2023 07:29:21 +0000 (07:29 +0000)]
plat/kvm/x86: Add formatted printing utility using during EFI boot
The current crash printing is somewhat limited as it cannot print
variables.
This commit refactor EFI debug printing. It adds a printf-like
utility for easier time debugging, rename some functions to be
more consistent with the rest of the code base.
Also, debug printing in EFI now depends on `libukdebug`, instead of
a dedicated option.
If `vfscore` is enabled, then add a small set of minimally implemented
file handling functions like `fopen`, `fclose`, `fwrite`.
These are useful at link time for `gcc` objects such
as the ones from `gcov`.
Simon Kuenzer [Mon, 18 Sep 2023 12:17:40 +0000 (14:17 +0200)]
build: Introduce `E=` parameter for excluding libraries
This commit introduces the build system parameter `E=` which expects a
colon separated list of paths that are matched against any library path
that the build system is including. This mechanism is intended to be used
for replacing internal libraries.
For example, to replace `uksched`, the replacing library (that has to match
configuration name(s) and APIs) needs to be included with `L=` while at the
same time, the Unikraft-internal library has to be excluded with `E=`:
```
make L=/path/to/external-uksched E=/path/to/unikraft/lib/uksched
```
Signed-off-by: Simon Kuenzer <simon@unikraft.io> Reviewed-by: Cezar Craciunoiu <cezar.craciunoiu@unikraft.io> Reviewed-by: Michalis Pappas <michalis@unikraft.io> Reviewed-by: Maria Sfiraiala <maria.sfiraiala@gmail.com> Approved-by: Razvan Deaconescu <razvand@unikraft.io>
GitHub-Closes: #1104
Simon Kuenzer [Mon, 18 Sep 2023 12:15:42 +0000 (14:15 +0200)]
build: Ability to skip imports with `import_lib`
This commits adds the ability to skip including `Makefile.uk` files by
`import_lib` if the target path matches with one of the paths that can
be found in the `$(IMPORT_EXCLUDEDIRS)` variable.
Signed-off-by: Simon Kuenzer <simon@unikraft.io> Reviewed-by: Cezar Craciunoiu <cezar.craciunoiu@unikraft.io> Reviewed-by: Michalis Pappas <michalis@unikraft.io> Reviewed-by: Maria Sfiraiala <maria.sfiraiala@gmail.com> Approved-by: Razvan Deaconescu <razvand@unikraft.io>
GitHub-Closes: #1104
Simon Kuenzer [Thu, 12 Oct 2023 13:18:21 +0000 (15:18 +0200)]
build: Remove obsolete relative paths handling for external libs
This commit removes obsolete build system code that checked if external
libraries and external platforms were handed over from `$(UK_BASE)`
(Application directory or Unikraft root). Relative paths were never
supported and in the meantime, arguments are even checked to be absolute.
Signed-off-by: Simon Kuenzer <simon@unikraft.io> Reviewed-by: Cezar Craciunoiu <cezar.craciunoiu@unikraft.io> Reviewed-by: Michalis Pappas <michalis@unikraft.io> Reviewed-by: Maria Sfiraiala <maria.sfiraiala@gmail.com> Approved-by: Razvan Deaconescu <razvand@unikraft.io>
GitHub-Closes: #1104
Simon Kuenzer [Thu, 14 Sep 2023 19:08:02 +0000 (21:08 +0200)]
build: config-submenu: Introduce parameter to exclude libraries
This commit introduces the `-e` parameter which accepts a colon-separated
list of library paths. Such a path is compared to any library path that
would be included. If a match occurs, the affected library path is skipped.
Signed-off-by: Simon Kuenzer <simon@unikraft.io> Reviewed-by: Cezar Craciunoiu <cezar.craciunoiu@unikraft.io> Reviewed-by: Michalis Pappas <michalis@unikraft.io> Reviewed-by: Maria Sfiraiala <maria.sfiraiala@gmail.com> Approved-by: Razvan Deaconescu <razvand@unikraft.io>
GitHub-Closes: #1104
Simon Kuenzer [Thu, 14 Sep 2023 19:07:15 +0000 (21:07 +0200)]
build: config-submenu: Correctly quote file path for readlink
Whenever an output file is requested, `support/build/config-submenu`
writes the name of the target file to the console. This commit passes
this file name with quotes to `readlink` that converts it to a fully
qualified path.
Signed-off-by: Simon Kuenzer <simon@unikraft.io> Reviewed-by: Cezar Craciunoiu <cezar.craciunoiu@unikraft.io> Reviewed-by: Michalis Pappas <michalis@unikraft.io> Reviewed-by: Maria Sfiraiala <maria.sfiraiala@gmail.com> Approved-by: Razvan Deaconescu <razvand@unikraft.io>
GitHub-Closes: #1104
Simon Kuenzer [Fri, 8 Sep 2023 23:43:48 +0000 (01:43 +0200)]
build: Move arm64 clang target to architecture's Makefile.uk
This commit moves setting of special ARCHFLAGS and ISR_ARCHFLAGS for arm64
with clang compilers from the main Makefile to the architecture's
`Makefile.uk` at `arch/arm/arm64/Makefile.uk`. The original feature was
introduced with:
Commit 55255f470592d ("Makfile: Add target flags for `clang` with `AArch64`")
Signed-off-by: Simon Kuenzer <simon@unikraft.io> Reviewed-by: Cezar Craciunoiu <cezar.craciunoiu@unikraft.io> Reviewed-by: Michalis Pappas <michalis@unikraft.io> Reviewed-by: Maria Sfiraiala <maria.sfiraiala@gmail.com> Approved-by: Razvan Deaconescu <razvand@unikraft.io>
GitHub-Closes: #1104
Simon Kuenzer [Fri, 8 Sep 2023 23:32:07 +0000 (01:32 +0200)]
build: Rename `_import_linker` to `import_linker`
This commit renames the Makefile function `_import_linker` to `import_linker`.
The original intent was for this function to be purely internal and only
used in the core `Makefile`. It turns out that it might be used in other
places in the future, like potentilly external architectures, so this
commit removes the inappropriate `_` prefix.
Signed-off-by: Simon Kuenzer <simon@unikraft.io> Reviewed-by: Cezar Craciunoiu <cezar.craciunoiu@unikraft.io> Reviewed-by: Michalis Pappas <michalis@unikraft.io> Reviewed-by: Maria Sfiraiala <maria.sfiraiala@gmail.com> Approved-by: Razvan Deaconescu <razvand@unikraft.io>
GitHub-Closes: #1104
Simon Kuenzer [Fri, 8 Sep 2023 23:31:19 +0000 (01:31 +0200)]
build: Rename `_import_lib` to `import_lib`
This commit renames the Makefile function `_import_lib` to `import_lib`.
The original intent was for this function to be purely internal and only
used in the core `Makefile`. It turns out that it needs to be used in many
other places, like `drivers/`, so this commit removes the inappropriate
`_` prefix.
Signed-off-by: Simon Kuenzer <simon@unikraft.io> Reviewed-by: Cezar Craciunoiu <cezar.craciunoiu@unikraft.io> Reviewed-by: Michalis Pappas <michalis@unikraft.io> Reviewed-by: Maria Sfiraiala <maria.sfiraiala@gmail.com> Approved-by: Razvan Deaconescu <razvand@unikraft.io>
GitHub-Closes: #1104
Simon Kuenzer [Thu, 19 Oct 2023 15:17:54 +0000 (17:17 +0200)]
build: Forcefully re-create link to main Makefile
This commit makes sure that the symbolic link within the build directory
always points to the unikraft Makefile version that is used for a
build. This avoids issues when a project is build with multiple Unikraft
versions but using the same build path. The reason is that the build system
is invoking a sub-make call within the build directory using this symbolic
link.
Signed-off-by: Simon Kuenzer <simon@unikraft.io> Reviewed-by: Cezar Craciunoiu <cezar.craciunoiu@unikraft.io> Reviewed-by: Michalis Pappas <michalis@unikraft.io> Reviewed-by: Maria Sfiraiala <maria.sfiraiala@gmail.com> Approved-by: Razvan Deaconescu <razvand@unikraft.io>
GitHub-Closes: #1104
plat/kvm: Enable linux-compatible virtio-mmio cmdline on Firecracker
Firecracker injects virtio-mmio device descriptors to the command line
using the Linux format. Enable VIRTIO_MMIO_LINUX_COMPAT_CMDLINE for
Firecracker.
Michalis Pappas [Thu, 31 Aug 2023 14:04:20 +0000 (16:04 +0200)]
drivers/virtio/mmio: Support passing devices via the cmdline
This commit adds support for passing virtio-mmio devices via the
command-line.
The probing function is invoked by ukbus at a priority lower than
the the platform bus, to ensure that the virtio devices have been
probed, to safely register with the parent device.
Add a config parameter to control compatibility with Linux.
Specifically, when VIRTIO_MMIO_LINUX_COMPAT_CMDLINE is selected
the MMIO driver is configured to accept devices in the Linux format,
ie:
virtio_mmio.device = <size>@<base>:<irq>[:<id>]
If this option is not enabled, use the default libukparam
format for this library, ie:
Add `uk_bus_pf_devmap()` for mapping device regions. Because of the
current boot flow that initializes the vmmap API after the probing
the interrupt controller - which is required for bringing up secondary
cores - it is not possible to use uk_vma_map_dma() here, so we need to
resort to the low level paging API and map devices 1:1.
drivers/ukbus/pci: Make PCI ECAM conditional to fdt
The PCI ECAM implementation is tightly coupled to fdt. Given that
the platform bus can now be used on x86_64, make PCI ECAM conditional
to the fdt libraries.
Michalis Pappas [Tue, 3 Oct 2023 15:49:35 +0000 (17:49 +0200)]
include/essentials: Provide __fallthrough macro
Add a macro for `__attribute__(fallthrough)` to hint the compiler
about fallthrough cases in switch statements. The fallthough
attributed is supported by the minimum compiler version of both GCC
and clang.
After commit f57ca0bbc402 ("plat/kvm/x86: Make zero page inaccessible"),
early accesses to uninitialized VGA framebuffer would issue an unhandled
page fault and thus crashing the application. Solve this by
preinitializing the `terminal_buffer` variable.
Sergiu Moga [Sat, 14 Oct 2023 09:15:02 +0000 (12:15 +0300)]
plat/kvm/x86: Use `ur_pte` for the first page table
After commit f57ca0bbc402 ("plat/kvm/x86: Make zero page inaccessible"),
UEFI builds would fail to run due to the first page table becoming
unrelocatable.
Therefore, fix this by using the `ur_pte` variant of the `pte` macro.
Clang's preprocessor seems to behave differently when computing an integer
based on undefined macros. For example, the following expression:
```
(!(!__LIBUKLIBID_COMPILEOPT_PIE__) * (0x01 << 0))
```
resolves to 0x0 on GCC's GAS if __LIBUKLIBID_COMPILEOPT_PIE__ is not
defined. Clang is throwing an compile error because of the missing
definition. This commit adopts `libinfo.S` to define an intermediate
value macro that is set to `0` when the requested feature is not enabled.
Signed-off-by: Simon Kuenzer <simon@unikraft.io> Reviewed-by: Stefan Jumarea <stefanjumarea02@gmail.com> Reviewed-by: Robert Kuban <robert.kuban@opensynergy.com> Approved-by: Razvan Deaconescu <razvand@unikraft.io>
GitHub-Closes: #1131
sys/prctl.h in nolibc is using UK_LIBC_SYSCALLS as guard.
This is not required, since the guard only makes sense outside nolibc.
Remove UK_LIBC_SYSCALLS guard.
Signed-off-by: Tiago Andre Goncalves Oliveira <t.g.oliveira@ua.pt> Reviewed-by: Stefan Jumarea <stefanjumarea02@gmail.com> Approved-by: Razvan Deaconescu <razvand@unikraft.io>
GitHub-Closes: #1102