Skip to content

Conversation

@wipawel
Copy link
Contributor

@wipawel wipawel commented Nov 24, 2023

No description provided.

Using public API (get_free_frame() and get_free_page()) in the very
internal new_frames_array() is a bad idea.
The new frames array allocation can be triggered from within the
public API functions, while the PMM lock is already taken.
This obviously leads to a deadlock.

Signed-off-by: Pawel Wieczorkiewicz <[email protected]>
If there is not enough early frames (or for whatever reason the frame
physical address is big enough), it might be the case that such frame
mapping does not fit into the relatively small KERNEL_BASE area.
It is better to always map in the large enough KERNEL_MAP area.

The early frames arrays (before the final page tables are created)
have to be mapped into the KERNEL_BASE area as this is the only space
covered by boot time page tables (see EARLY_VIRT_MEM settings).

Signed-off-by: Pawel Wieczorkiewicz <[email protected]>
@wipawel wipawel added bugfix This fixes a bug Severity: high Very important bug - fix ASAP labels Nov 24, 2023
@wipawel wipawel requested a review from a team as a code owner November 24, 2023 15:56
If we run out of 4k frames it becomes impossible to perform a higher
order frames splitting, since new frames creation may need new frames
array, which is 4k as well.
To prevent these kind of situations, always keep at least two free 4k
frames available.
@wipawel wipawel enabled auto-merge (rebase) November 24, 2023 17:13
@wipawel wipawel merged commit e79b129 into KernelTestFramework:mainline Nov 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bugfix This fixes a bug Severity: high Very important bug - fix ASAP

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants