Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

lib/ukboot: Fix configuration of no "no scheduler" #1413

Merged
merged 2 commits into from
May 17, 2024

Conversation

skuenzer
Copy link
Member

Description of changes

This PR fixes the KConfig configuration of "no scheduler" with lib/ukboot. Previously, scheduler initialization code was still compiled in even if no scheduling was selected. This happened if at the same time no allocator was configured as well.

Please note that this PR fixes only the configuration handling in lib/ukboot. I noticed a crash within one of the registered inittab functions if no scheduler was initialized. There is also an assertion failure if lib/ukboot is configured without allocator initialization (system does not boot without an allocator assigned to the platform libraries). Both need fixing with corresponding subsystem PRs and taking re-arch into account.

This commit introduces the hidden configuration option
`CONFIG_LIBUKBOOT_INITSCHED` that indicates that scheduler initialization
is configured with `lib/ukboot`.
The previous check for `!CONFIG_LIBUKBOOT_NOSCHED` was not sufficient,
as the option is not available if `CONFIG_LIBUKBOOT_NOALLOC` is set. The
reason is the dependency expressed for the corresponding `choice` in
the libraries' `Config.uk`. This would incorrectly mean that a scheduler is
being initialized.

Signed-off-by: Simon Kuenzer <simon@unikraft.io>
This commit introduces the hidden configuration option
`CONFIG_LIBUKBOOT_INITALLOC` that indicates that allocator initialization
is configured with `lib/ukboot`.
We do this in order to be inline with the scheduler configuration
(`Config.uk`) and to have the possibility to add dependencies to the
corresponding `choice` of the allocator initialization configuration in
the future.

Signed-off-by: Simon Kuenzer <simon@unikraft.io>
@skuenzer skuenzer requested a review from a team as a code owner May 14, 2024 23:00
@github-actions github-actions bot added area/lib Internal Unikraft Microlibrary lang/c Issues or PRs to do with C/C++ lib/ukboot labels May 14, 2024
Copy link
Member

@michpappas michpappas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. In the future we need to be a bit careful not to use LIBUKBOOT_NOALLOC /LIBUKBOOT_NOSCHED, also during reviews. I will wait for one more RB before approving for merge.

Reviewed-by: Michalis Pappas michalis@unikraft.io

Copy link
Member

@StefanJum StefanJum left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Works fine, thank you.
Reviewed-by: Stefan Jumarea stefanjumarea02@gmail.com

@razvand razvand self-assigned this May 17, 2024
@razvand razvand added this to the v0.17.0 (Calypso) milestone May 17, 2024
Copy link
Contributor

@razvand razvand left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved-by: Razvan Deaconescu razvand@unikraft.io

@razvand razvand changed the base branch from staging to staging-1413 May 17, 2024 07:33
@razvand razvand merged commit 0a7bc7a into unikraft:staging-1413 May 17, 2024
14 checks passed
razvand pushed a commit that referenced this pull request May 17, 2024
This commit introduces the hidden configuration option
`CONFIG_LIBUKBOOT_INITSCHED` that indicates that scheduler initialization
is configured with `lib/ukboot`.
The previous check for `!CONFIG_LIBUKBOOT_NOSCHED` was not sufficient,
as the option is not available if `CONFIG_LIBUKBOOT_NOALLOC` is set. The
reason is the dependency expressed for the corresponding `choice` in
the libraries' `Config.uk`. This would incorrectly mean that a scheduler is
being initialized.

Signed-off-by: Simon Kuenzer <simon@unikraft.io>
Reviewed-by: Michalis Pappas <michalis@unikraft.io>
Reviewed-by: Stefan Jumarea <stefanjumarea02@gmail.com>
Approved-by: Razvan Deaconescu <razvand@unikraft.io>
GitHub-Closes: #1413
razvand pushed a commit that referenced this pull request May 17, 2024
This commit introduces the hidden configuration option
`CONFIG_LIBUKBOOT_INITALLOC` that indicates that allocator initialization
is configured with `lib/ukboot`.
We do this in order to be inline with the scheduler configuration
(`Config.uk`) and to have the possibility to add dependencies to the
corresponding `choice` of the allocator initialization configuration in
the future.

Signed-off-by: Simon Kuenzer <simon@unikraft.io>
Reviewed-by: Michalis Pappas <michalis@unikraft.io>
Reviewed-by: Stefan Jumarea <stefanjumarea02@gmail.com>
Approved-by: Razvan Deaconescu <razvand@unikraft.io>
GitHub-Closes: #1413
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/lib Internal Unikraft Microlibrary lang/c Issues or PRs to do with C/C++ lib/ukboot
Projects
Status: Done!
Development

Successfully merging this pull request may close these issues.

4 participants