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

#1233 - Add unlikely() to error checking conditions #1408

Open
wants to merge 4 commits into
base: staging
Choose a base branch
from

Conversation

ggracechoi
Copy link

@ggracechoi ggracechoi commented May 4, 2024

Prerequisite checklist

  • [ X ] Read the contribution guidelines regarding submitting new changes to the project;
  • Tested your changes against relevant architectures and platforms;
  • [ X ] Ran the checkpatch.uk on your commit series before opening this PR;
  • [ X ] Updated relevant documentation.

Base target

  • Architecture(s): [e.g. x86_64 or N/A]
  • Platform(s): [e.g. kvm, xen or N/A]
  • Application(s): [e.g. app-python3 or N/A]

Additional configuration

N/A

Description of changes

We wrapped all error conditions that end the current function / flow with the unlikely() macro. Our only concern is we were not able to test our changes because our terminals could not recognize "sh" while following these guidelines.

@ggracechoi ggracechoi requested review from a team as code owners May 4, 2024 04:24
@github-actions github-actions bot added arch/arm arch/arm64 arch/x86_64 area/arch Unikraft Architecture area/docs Documentation area/lib Internal Unikraft Microlibrary area/plat Unikraft Patform area/support Support scripts, tools, services. lang/c Issues or PRs to do with C/C++ lib/9pfs 9p client lib/posix-process Information about system parameters lib/posix-sysinfo lib/uk9p lib/ukallocbbuddy lib/ukblkdev lib/ukcpio ukcpio: CPIO archive extraction lib/uklibparam lib/ukmpi labels May 4, 2024
@github-actions github-actions bot added lib/vfscore VFS Core Interface plat/common Common to all platforms plat/driver plat/driver/tap plat/kvm Unikraft for KVM plat/xen Unikraft for Xen labels May 4, 2024
ggracechoi and others added 3 commits May 4, 2024 00:19
Add LIBVFSCORE_INITRD_OPT_MKMP for "mkmp" mount option in
lib/vfscore/automount.c, instead of just the string "mkmp."

Signed-off-by: Grace Choi <gracechoi@utexas.edu>

Signed-off-by: Pranjal Rai <pranjalrai@utexas.edu>
Commit 4d97341 ("lib/ukvmem/arch: Do not print error message if demand paging disabled")
introduced a build error and a warning by copy-pasting the change from
x86 to Arm. This is incorrect as the trap context from Arm does not have
the `error_code` but the `esr` field instead. Fix this by using using the
corect field and correct string format.

Signed-off-by: Sergiu Moga <sergiu@unikraft.io>
Reviewed-by: Stefan Jumarea <stefanjumarea02@gmail.com>
Approved-by: Razvan Deaconescu <razvand@unikraft.io>
GitHub-Closes: unikraft#1388
Add the unlikely() macro to consistently check for unlikely error situations.

Signed-off-by: Grace Choi <gracechoi@utexas.edu>

Signed-off-by: Pranjal Rai <pranjalrai@utexas.edu>
@razvand razvand requested review from Mihnea27, StefanJum and mariasfiraiala and removed request for a team May 21, 2024 20:28
@razvand razvand self-assigned this May 21, 2024
@razvand razvand added this to the v0.17.0 (Calypso) milestone May 21, 2024
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.

@ggracechoi please rebase the pr and only leave the relevant commit in (the one adding error checking)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
arch/arm arch/arm64 arch/x86_64 area/arch Unikraft Architecture area/docs Documentation area/lib Internal Unikraft Microlibrary area/plat Unikraft Patform area/support Support scripts, tools, services. lang/c Issues or PRs to do with C/C++ lib/posix-process Information about system parameters lib/posix-sysinfo lib/uk9p lib/ukallocbbuddy lib/ukblkdev lib/ukcpio ukcpio: CPIO archive extraction lib/uklibparam lib/ukmpi lib/uknetdev lib/ukring lib/uksglist lib/vfscore VFS Core Interface lib/9pfs 9p client plat/common Common to all platforms plat/driver/tap plat/driver plat/kvm Unikraft for KVM plat/xen Unikraft for Xen
Projects
Status: 🏗 In Progress
Development

Successfully merging this pull request may close these issues.

None yet

4 participants