-
Notifications
You must be signed in to change notification settings - Fork 69
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
Only map with executable permissions when using code space #1176
Conversation
I pushed some changes. It refactors |
Thank you for the refactoring. It looks much better now. Jikes is broken for some reason. Does it depend on exec permissions on non-codespaces perhaps...? |
I am not sure. MMTK in JikesRVM does mmap all the spaces with exec. Our Julia binding currently allocates code into normal spaces. I added a feature |
binding-refs |
It seems Julia does not need exec permission for normal spaces, but V8 (NoGC has no code space) and JikesRVM need. |
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.
Mostly OK. Only a small suggestion.
src/util/memory.rs
Outdated
@@ -98,27 +144,27 @@ pub fn dzmmap_noreplace(start: Address, size: usize, strategy: MmapStrategy) -> | |||
/// This function does not reserve swap space for this mapping, which means there is no guarantee that writes to the | |||
/// mapping can always be successful. In case of out of physical memory, one may get a segfault for writing to the mapping. | |||
/// We can use this to reserve the address range, and then later overwrites the mapping with dzmmap(). | |||
pub fn mmap_noreserve(start: Address, size: usize, strategy: MmapStrategy) -> Result<()> { | |||
let prot = PROT_NONE; | |||
pub fn mmap_noreserve(start: Address, size: usize, mut options: MmapStrategy) -> Result<()> { |
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.
We have been using the variable name strategy
in other functions for MmapStrategy
. I think it's OK to use strategy
here, too.
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.
Done. That was a mistake.
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.
LGTM.
This PR closes #7. This PR
MmapStrategy
to include protection flags, and allows each space to passMmapstrategy
to the mmapper.exec_permission_on_all_spaces
for bindings that may allocate code into normal spaces.