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

zap identity mappings after init #64

Merged
merged 5 commits into from
Aug 24, 2020

Conversation

wipawel
Copy link
Contributor

@wipawel wipawel commented Aug 22, 2020

*Issue #5 *

Description of changes:

pmm: zap boot mappings after initialization

* PMM:
  - Add reclaim_frame() non-static wrapper over add_frame();
    it adds a frame being reclaimed to the list of free frames.
* Compiler:
  - Add IS_INIT_SECTION() macro; it decides, if section is an init
    section, based on its name.
* Setup:
  - Modify zap_boot_mappings() to iterate over all defined memory
    regions and unmap plus reclaim all frames belonging to identity
    mapped init sections. Additionally, zero-out non-text sections.

smp: minor cleanup

* Rename smp_init() to init_smp() to follow naming convention
* Put boot_cpu() and init_smp() into the .text.init section

smp: use dedicated variable for CR3

Do not keep final, global cr3 variable in .data.init section.  When
init sections are being reclaimed, this breaks pagetables interface.

Instead, for SMP AP booting, use dedicated ap_cr3 variable, which can
be reclaimed after SMP initialization.

pmm: export display_frames_count()

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

Signed-off-by: Pawel Wieczorkiewicz <[email protected]>
Do not keep final, global cr3 variable in .data.init section.  When
init sections are being reclaimed, this breaks pagetables interface.

Instead, for SMP AP booting, use dedicated ap_cr3 variable, which can
be reclaimed after SMP initialization.

Signed-off-by: Pawel Wieczorkiewicz <[email protected]>
* Rename smp_init() to init_smp() to follow naming convention
* Put boot_cpu() and init_smp() into the .text.init section

Signed-off-by: Pawel Wieczorkiewicz <[email protected]>
* PMM:
  - Add reclaim_frame() non-static wrapper over add_frame();
    it adds a frame being reclaimed to the list of free frames.
* Compiler:
  - Add IS_INIT_SECTION() macro; it decides, if section is an init
    section, based on its name.
* Setup:
  - Modify zap_boot_mappings() to iterate over all defined memory
    regions and unmap plus reclaim all frames belonging to identity
    mapped init sections. Additionally, zero-out non-text sections.

Signed-off-by: Pawel Wieczorkiewicz <[email protected]>
@wipawel wipawel added the improvement A small enhancement, that makes already implemented features better label Aug 22, 2020
@bjoernd bjoernd merged commit 320f68b into KernelTestFramework:mainline Aug 24, 2020
@wipawel wipawel linked an issue Aug 25, 2020 that may be closed by this pull request
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.

pagetables: zap identity mappings after init
2 participants