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

feat: Provide VDSO image and __kernel_vsyscall interface #23

Closed
wants to merge 1 commit into from

Conversation

i-Pear
Copy link
Member

@i-Pear i-Pear commented Jul 28, 2023

This patch provides the capability to automatically generate a VDSO (Virtual Dynamic Shared Object) image and pass it to the application. The VDSO contains only symbols, while its actual implementation is retained in the kernel, with their mapping relationship recorded in vdso_mapping.conf.

Additionally, this introduces the __kernel_vsyscall interface, which allows libc to access system calls without relying on slow binary syscalls. The difference between __kernel_vsyscall and uk_syscall6_r lies in considering TLS (Thread Local Storage) switching, enabling both the kernel and user applications to use thread-local storage seamlessly. To utilize this feature, the libc needs to be modified accordingly, please refer to fork-musl [1] and fork-glibc [2] for further information.

To use the VDSO, please select Application Options -> Provide VDSO Image.

[1] https://github.com/unikraft/fork-musl
[2] https://github.com/unikraft/fork-glibc

This patch provides the capability to automatically generate a VDSO
(Virtual Dynamic Shared Object) image and pass it to the application.
The VDSO contains only symbols, while its actual implementation is
retained in the kernel, with their mapping relationship recorded in
`vdso_mapping.conf`.

Additionally, this introduces the `__kernel_vsyscall` interface,
which allows libc to access system calls without relying on slow
binary syscalls. The difference between `__kernel_vsyscall` and
`uk_syscall6_r` lies in considering TLS (Thread Local Storage)
switching, enabling both the kernel and user applications to use
thread-local storage seamlessly. To utilize this feature, the libc
needs to be modified accordingly, please refer to `fork-musl` [1]
and `fork-glibc` [2] for further information.

To use the VDSO, please select
`Application Options -> Provide VDSO Image`.

[1] https://github.com/unikraft/fork-musl
[2] https://github.com/unikraft/fork-glibc

Signed-off-by: Tianyi Liu <i.pear@outlook.com>
@razvand razvand requested a review from John-Ted August 9, 2023 10:10
@razvand razvand self-assigned this Aug 9, 2023
@razvand razvand added the enhancement New feature or request label Aug 9, 2023
Copy link

@John-Ted John-Ted left a comment

Choose a reason for hiding this comment

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

Everything seems to work, did not encounter issues.

Reviewed-by: Ioan-Teodor Teugea ioan_teodor.teugea@stud.acs.upb.ro

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 pushed a commit that referenced this pull request Aug 16, 2023
This patch provides the capability to automatically generate a VDSO
(Virtual Dynamic Shared Object) image and pass it to the application.
The VDSO contains only symbols, while its actual implementation is
retained in the kernel, with their mapping relationship recorded in
`vdso_mapping.conf`.

Additionally, this introduces the `__kernel_vsyscall` interface,
which allows libc to access system calls without relying on slow
binary syscalls. The difference between `__kernel_vsyscall` and
`uk_syscall6_r` lies in considering TLS (Thread Local Storage)
switching, enabling both the kernel and user applications to use
thread-local storage seamlessly. To utilize this feature, the libc
needs to be modified accordingly, please refer to `fork-musl` [1]
and `fork-glibc` [2] for further information.

To use the VDSO, please select
`Application Options -> Provide VDSO Image`.

[1] https://github.com/unikraft/fork-musl
[2] https://github.com/unikraft/fork-glibc

Signed-off-by: Tianyi Liu <i.pear@outlook.com>
Co-authored-by: Simon Kuenzer <simon@unikraft.io>
Signed-off-by: Simon Kuenzer <simon@unikraft.io>
Reviewed-by: Ioan-Teodor Teugea <ioan_teodor.teugea@stud.acs.upb.ro>
Approved-by: Razvan Deaconescu <razvand@unikraft.io>
Tested-by: Unikraft CI <monkey@unikraft.io>
GitHub-Closes: #23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ci/merged enhancement New feature or request
Projects
Status: Done
Status: Done!
Development

Successfully merging this pull request may close these issues.

None yet

4 participants