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

fix compatibility in registering regions #120

Merged
merged 2 commits into from
Jan 19, 2022
Merged

fix compatibility in registering regions #120

merged 2 commits into from
Jan 19, 2022

Conversation

IBPeng
Copy link
Collaborator

@IBPeng IBPeng commented Dec 15, 2021

No description provided.

@IBPeng IBPeng requested a review from egreen77 December 15, 2021 22:43
Copy link
Collaborator

@egreen77 egreen77 left a comment

Choose a reason for hiding this comment

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

I think this may not work as intended, since the original issue of the value of UFFD_API_RANGE_IOCTLS varying between compile time and the value returned by the kernel at run time remains.

It's probably best to individually check only the flags we use:

if (
  !(uffdio_register.ioctls & UFFDIO_COPY)
#ifdef UFFDIO_WRITEPROTECT
  || !(uffdio_register.ioctls & UFFDIO_WRITEPROTECT)
#endif
  ) ...

Copy link
Collaborator

@egreen77 egreen77 left a comment

Choose a reason for hiding this comment

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

Thanks, looks good to me.

@IBPeng IBPeng merged commit cb294ef into develop Jan 19, 2022
@IBPeng IBPeng deleted the fix_compatibility branch January 19, 2022 22:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants