Open
Conversation
… to pass a 64bit val from set() to bind(); initialized more of the invocation buf, this is likely at the wrong place
…k for the state frame to stay below 4KiB
…ew thread state address if the frame was changed while the EC was loaded
… to pass a 64bit val from set() to bind(); initialized more of the invocation buf, this is likely at the wrong place
…k for the state frame to stay below 4KiB
…ew thread state address if the frame was changed while the EC was loaded
This was
linked to
issues
Feb 29, 2020
Collaborator
Author
|
Creating pthreads works again. However, not all of the allocated kernel objects are deleted after the thread has finished. |
…n in EC::setFlagsSuspend
kubanrob
approved these changes
Mar 5, 2020
Collaborator
kubanrob
left a comment
There was a problem hiding this comment.
Looks good, compiles, haven't tested it ... I added some comments for nitpicking.
| { | ||
| MLOG_INFO(mlog::ec, "EC setEntryPoint", DVARhex(rip)); | ||
| threadState.rip = rip; | ||
| if (!state) return; |
Collaborator
There was a problem hiding this comment.
This might need a return value if it can fail.
Comment on lines
+345
to
+348
| if (state) { | ||
| state->threadState.fs_base = fs; | ||
| state->threadState.gs_base = gs; | ||
| } |
Collaborator
There was a problem hiding this comment.
We might want to return an error code to our unsuspecting user.
| void ExecutionContext::handleTrap() | ||
| { | ||
| auto ctx = &threadState; | ||
| auto ctx = &state->threadState; |
Collaborator
There was a problem hiding this comment.
Are we sure that state != nullptr?
| getLocalPlace().setCR3(info.table); // without reload if not changed | ||
| } | ||
| // Reload the address space and thread state address if they have changed | ||
| getLocalPlace().setCR3(page_table); // without reload if not changed |
Collaborator
There was a problem hiding this comment.
We should be very careful never to set CR3 to nullptr. Maybe assert page_table != nullptr or at least use the default/fallback system PML4 as a "null" value.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Store state of execution contexts in user accessible memory frames. This includes the CPU and FPU registers. The objective is to enable easier access to suspended threads for user-mode trap handlers and thread management.
Integration into the musl pthreads support code is still pending.