regions_mm: New memory mapping functions#9114
Merged
kv2019i merged 2 commits intothesofproject:mainfrom May 24, 2024
Merged
Conversation
A macro was used to statically initialize the vmh_list list head. This allowed to resign from calling a function whose only task was to initialize the list header. This function was removed as no needed anymore. Signed-off-by: Adrian Warecki <adrian.warecki@intel.com>
addb4dc to
a5e2397
Compare
lyakh
reviewed
May 13, 2024
dabekjakub
reviewed
May 13, 2024
Member
dabekjakub
left a comment
There was a problem hiding this comment.
Changes look good I would like more commentary since this is complex code.
lgirdwood
reviewed
May 14, 2024
Member
lgirdwood
left a comment
There was a problem hiding this comment.
LGTM, @softwarecki do you think we will need to update the vmh ztests or are the existing ztests providing coverage for this update ?
Collaborator
Author
|
@lgirdwood There is no need to extend vmh ztests. This PR does not add any new functionality, it only fixes bugs. Before merge let my apply @lyakh comments. |
The previous memory mapping function did not work properly if the buffer size exceeded the memory page size. In this case the size of the region to be checked passed to the sys_bitarray_is_region_cleared function was zero, causing the function to always return false. As a result, the allocator stated that a page was already mapped for a given address and did not map it. This led to a cpu exception when trying to access the allocated buffer. The function responsible for unmapping memory had a similar problem. Additionally, the size of the freed area was incorrectly determined and an incorrect offset was passed to the sys_bitarray_is_region_cleared function. New functions have been created to map and unmap memory pages for allocated buffers. It don't need allocation of temporary array and manipulation of memblocks bitarray. Signed-off-by: Adrian Warecki <adrian.warecki@intel.com>
lyakh
reviewed
May 17, 2024
pjdobrowolski
approved these changes
May 21, 2024
Collaborator
Author
|
SOFCI TEST |
lgirdwood
approved these changes
May 22, 2024
2 tasks
Collaborator
|
@dabekjakub good to go? This seems to be ready for merge now. |
dabekjakub
approved these changes
May 24, 2024
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The previous memory mapping function did not work properly if the buffer size exceeded the memory page size. In this case the size of the region to be checked passed to the
sys_bitarray_is_region_clearedfunction was zero, causing the function to always return false. As a result, the allocator stated that a page was already mapped for a given address and did not map it. This led to a cpu exception when trying to access the allocated buffer.The function responsible for unmapping memory had a similar problem. Additionally, the size of the freed area was incorrectly determined and an incorrect offset was passed to the
sys_bitarray_is_region_clearedfunction.New functions have been created to map and unmap memory pages for allocated buffers. It don't need allocation of temporary array and manipulation of memblocks bitarray.
Used static initialization of the vmh_list list head using macro.