-
Notifications
You must be signed in to change notification settings - Fork 25
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
update userfaultfd handling. #228
Conversation
feda1da
to
4ededc0
Compare
src/iso_alloc_sanity.c
Outdated
|
||
if(_uf_fd == ERR) { | ||
LOG_AND_ABORT("This kernel does not support userfaultfd"); | ||
LOG_AND_ABORT("This kernel does not support userfaultfd or disallowed in the user-space"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LOG_AND_ABORT("This kernel does not support userfaultfd or disallowed in the user-space"); | |
LOG_AND_ABORT("This kernel does not support userfaultfd or is disallowed in the user-space"); |
4ededc0
to
c73c307
Compare
src/iso_alloc_sanity.c
Outdated
int flags = O_CLOEXEC | O_NONBLOCK; | ||
|
||
#ifdef UFFD_USER_MODE_ONLY | ||
// Below, the syscall fails not necessarily because lack of kernel support. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use C style comments
in multithread setting, reporting the thread id when appropriate. Also, allowing to work from the user-space perspective from Linux 5.11 so reports can me made from its own addresses ranges.
c73c307
to
d631286
Compare
if(ioctl(_uf_fd, UFFDIO_API, &_uffd_api) == ERR) { | ||
LOG_AND_ABORT("Failed to setup userfaultfd with ioctl"); | ||
} | ||
|
||
#if THREAD_SUPPORT | ||
if(!(_uffd_api.features & UFFD_FEATURE_THREAD_ID)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does the ioctl
call reset this if it cannot be used?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we also check errno
for -EFAULT
here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not sure we really need to, return value is checked for ioctl already.
in multithread setting, reporting the thread id when appropriate. Also, allowing to work from the user-space perspective from Linux 5.11
so reports can me made from its own addresses ranges.