-
-
Notifications
You must be signed in to change notification settings - Fork 173
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
Frame allocator will allocate two copies of a frame #451
Comments
Thanks for filing the issue, I'll look into this immediately. |
For clarity, the solution was to take the range of requested frames from the general-purpose list of free frames and then treat those frames as reserved from then on. |
You can still allocate duplicate frames at any given physical address that have been allocated before from the FREE_FRAMES_LIST. That's because the check inserted just ensures that the frames are currently not in the free list.
mp and mp2 will be allocated with duplicate frames. mp3 will fail because by then we've added that frame to the list of reserved regions. |
Thanks for correctly identifying this problem! I'll fix it hopefully by tomorrow. |
This is the portion of code where the problem occurs. The resulting physical address values are:
rq_pa = 0x586b000
sq_pa = 0x587b000
db_pa = 0x587b000
I've traced the issue to the
allocate_frames_deferred()
function in the frame_allocator crate. It seems that when a physical address is provided to the function, it'll add the required frames to the FREE_RESERVED_FRAMES_LIST without checking if that frame is present in the FREE_FRAMES_LIST.I'm not sure if the solution is to return an Error if a user requests a physical address that is not in the reserved portions, or to return AllocatedFrames from the FREE_FRAMES_LIST.
The text was updated successfully, but these errors were encountered: