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

add VIRT_KERNEL_MAP memory area #240

Merged
merged 3 commits into from
Jan 20, 2022

Conversation

wipawel
Copy link
Contributor

@wipawel wipawel commented Jan 19, 2022

The VIRT_KERNEL_MAP is currently located at the address 0xffff800000000000.
The memory area should be used for high-address or large memory allocations.
The VIRT_KERNEL_BASE area, while reachable from within the VIRT_IDENT_BASE
area, does not have enough addressing space for high address allocations
(base address overflow). All such allocations should go to the new area.

Add mmap() helper (or its order size variants) to automatically use the
VIRT_KERNEL_MAP area.

The get_free_pages() gets a new flag GPF_KERNEL_MAP to use the area.

@wipawel wipawel added the improvement A small enhancement, that makes already implemented features better label Jan 19, 2022
@@ -196,6 +212,19 @@ static inline void *kmap(mfn_t mfn, unsigned int order,
l3_flags, l2_flags, l1_flags);
}

static inline void *mmap(mfn_t mfn, unsigned int order,
Copy link
Contributor

Choose a reason for hiding this comment

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

Same here
name mmap is misleading.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ok. Suggestions welcome.

Copy link
Contributor Author

@wipawel wipawel Jan 20, 2022

Choose a reason for hiding this comment

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

With VIRT_KERNEL_MAP I hope it's now ok.

The VIRT_KERNEL_MAP is currently located at the address 0xffff800000000000.
The memory area should be used for high-address or large memory allocations.
The VIRT_KERNEL_BASE area, while reachable from within the VIRT_IDENT_BASE
area, does not have enough addressing space for high address allocations
(base address overflow). All such allocations should go to the new area.

Add mmap() helper (or its order size variants) to automatically use the
VIRT_KERNEL_MAP area.

The get_free_pages() gets a new flag GPF_KERNEL_MAP to use the area.

Signed-off-by: Pawel Wieczorkiewicz <[email protected]>
82marbag
82marbag previously approved these changes Jan 20, 2022
@wipawel wipawel changed the title add VIRT_KERNEL_HIGH memory area add VIRT_KERNEL_MAP memory area Jan 20, 2022
@wipawel wipawel merged commit ee1f654 into KernelTestFramework:mainline Jan 20, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
improvement A small enhancement, that makes already implemented features better
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants