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

[BACKPORT] Pull addrenv/kmm_map related fixes from upstream #171

Merged
merged 10 commits into from
Oct 11, 2023

Conversation

pussuw
Copy link

@pussuw pussuw commented Oct 10, 2023

Merge patches from upstream, + fix for TLS stack allocation (which is not upstreamed)

The TLS alignment requires more room in the stack, which means more
_initial_ heap is required to accomodate the stack.

Why 2x TLS_MAXSTACK ? No idea. This is a temporary fix, like the +1 page
extra above.
@pussuw pussuw requested a review from jlaitine October 10, 2023 06:12
Use kernel page table flags if the mapped virtual address is in kernel
space.
All kernel memory is mapped paddr=vaddr, so it is trivial to give mapping
for kernel memory. Only interesting region should be kernel RAM, so omit
kernel ROM and don't allow re-mapping it.
In addition to printing out the thread name (task name in flat mode),
print the parent process's name as well.

It is quite useful to know which process is the parent of a faulting
thread, although this information can be read from the assert dump, in
some cases the dump might be incomplete (due to e.g. stack corruption,
which causes another exception and PANIC().)
Provide the handle to gran_alloc, not pointer to handle.
User pages are mapped from the currently active address environment. If
the process is running on a borrowed address environment, then the
mapping should be created from there.

This happens during (new) process creation only.
is_kmap_vaddr is added and used to test that a given (v)addr is actually
inside the kernel map area. This gives a speed optimization for kmm_unmap,
as it is no longer necessary to take the mm_map_lock to check if such a
mapping exists; obviously if the address is not within the kmap area, it
won't be in the list either.
The temp variable was freed only in error cases, but it needs to be freed
in the happy case as well.
Mapping a physical page to a kernel virtual page is very simple and does
not need the kernel vma list, just get the kernel addressable virtual
address for the page.
@pussuw pussuw merged commit 24b31cc into master Oct 11, 2023
8 checks passed
@pussuw pussuw deleted the upstream_fixes_3 branch October 11, 2023 05:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants