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

General improvements and cleanup to page tables handling #309

Merged
merged 11 commits into from
Oct 27, 2023

Conversation

wipawel
Copy link
Contributor

@wipawel wipawel commented Oct 23, 2023

This is needed to implement #308 properly.

@wipawel wipawel added improvement A small enhancement, that makes already implemented features better devel Development effort cleanup labels Oct 23, 2023
@wipawel wipawel requested a review from a team as a code owner October 23, 2023 12:08
Copy link
Contributor

@minipli-oss minipli-oss left a comment

Choose a reason for hiding this comment

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

I don't think we need invlpg_safe() as it's simply trying to handle a case that's no longer relevant (no i386 or even IA-32 support in KTF anyways).

arch/x86/pagetables.c Outdated Show resolved Hide resolved
lib/lib.c Outdated Show resolved Hide resolved
They have to be mapped in the new kernel page tables anyway.
This is needed to get rid of initial map_used_memory().

Signed-off-by: Pawel Wieczorkiewicz <[email protected]>
The multiboot areas are used to determine invalid physical addresses
and MFNs.

Signed-off-by: Pawel Wieczorkiewicz <[email protected]>
This is mainly refactoring cleanup.

Signed-off-by: Pawel Wieczorkiewicz <[email protected]>
This is mainly refactoring cleanup.
Boot stack is part of .bss.init section and as such is mapped.

Signed-off-by: Pawel Wieczorkiewicz <[email protected]>
Since all necessary pages have been mapped, no need to map anything
else.

Signed-off-by: Pawel Wieczorkiewicz <[email protected]>
Rename it to more correct tmp_map_mfn() and make it an inline function.

Signed-off-by: Pawel Wieczorkiewicz <[email protected]>
Instead of doing full page table walk to obtain PTE of the temp.
mapping location, cache it in _tmp_mapping_entry variable.
The variable needs to be set once before construction of the page
tables begins and updated once before the switch to new page tables
(the virtual address of the PTE changes).

Also, there is no need to map in all levels of the page tables for the
_tmp_mappings, since the entry address is cached. Map only the last
level page table.

Signed-off-by: Pawel Wieczorkiewicz <[email protected]>
Signed-off-by: Pawel Wieczorkiewicz <[email protected]>
Use INVLPG instead.

Signed-off-by: Pawel Wieczorkiewicz <[email protected]>
Copy link
Contributor

@minipli-oss minipli-oss left a comment

Choose a reason for hiding this comment

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

Still a few more nits...

common/setup.c Show resolved Hide resolved
mm/pmm.c Show resolved Hide resolved
include/arch/x86/pagetable.h Show resolved Hide resolved
@wipawel wipawel merged commit 7291169 into KernelTestFramework:mainline Oct 27, 2023
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cleanup devel Development effort improvement A small enhancement, that makes already implemented features better
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants