vmop: add VMOP_KILL_THREAD and VMOP_KILL_CHILD#65
Draft
Erich Plondke (eplondke) wants to merge 1 commit into
Draft
vmop: add VMOP_KILL_THREAD and VMOP_KILL_CHILD#65Erich Plondke (eplondke) wants to merge 1 commit into
Erich Plondke (eplondke) wants to merge 1 commit into
Conversation
Wires up the dormant H2K_VMSTATUS_KILL bit into a cross-thread kill API. KILL_THREAD sets KILL+VMWORK on the target and forces it out of any state (VMWAIT / RUNNING / INTBLOCKED / BLOCKED / READY), ignoring guest IE so a target with interrupts disabled still terminates. KILL_CHILD iterates a child VM's contexts[] under a single BKL critical section. Permission mirrors vmop_status (self or child) for kill_thread and vmop_free (parent-only) for kill_child; the natural H2K_thread_stop teardown signals the parent and frees the vmblock when the last vcpu drains. The state-switch is duplicated from H2K_vm_int_deliver_locked rather than factored out, since unifying the two paths would require touching vmint.v4opt.S. A FIXME marks that refactor as future work. Test exercises every state, the kill-ignores-IE invariant, self-kill through KILL_THREAD, both permission denials for KILL_CHILD, and a mixed RUNNING+DEAD vcpu set. Coverage for the three new functions is 100%. Signed-off-by: Erich Plondke <erich@qti.qualcomm.com>
Contributor
|
Erich, could you take the tests from my PR and try with your change ? |
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.
Wires up the dormant H2K_VMSTATUS_KILL bit into a cross-thread kill API. KILL_THREAD sets KILL+VMWORK on the target and forces it out of any state (VMWAIT / RUNNING / INTBLOCKED / BLOCKED / READY), ignoring guest IE so a target with interrupts disabled still terminates. KILL_CHILD iterates a child VM's contexts[] under a single BKL critical section. Permission mirrors vmop_status (self or child) for kill_thread and vmop_free (parent-only) for kill_child; the natural H2K_thread_stop teardown signals the parent and frees the vmblock when the last vcpu drains.
The state-switch is duplicated from H2K_vm_int_deliver_locked rather than factored out, since unifying the two paths would require touching vmint.v4opt.S. A FIXME marks that refactor as future work.
Test exercises every state, the kill-ignores-IE invariant, self-kill through KILL_THREAD, both permission denials for KILL_CHILD, and a mixed RUNNING+DEAD vcpu set. Coverage for the three new functions is 100%.
This is very similar to andreykarpenko-qc PR ... I thought I'd push this WIP so we can compare.